-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
50 additions
and
1 deletion.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
gvsbuild/patches/librsvg/001-fix-failed-to-rename-query-rust.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
diff --git a/meson/query-rustc.py b/meson/query-rustc.py | ||
index 2b169b1fc5ad7dff2dfec1d62214ee4cb1fce0de..f97cb692d1a080a730be8953c60e52ffc9a71b91 100755 | ||
--- a/meson/query-rustc.py | ||
+++ b/meson/query-rustc.py | ||
@@ -64,7 +64,6 @@ def retrive_version_info(output, query): | ||
|
||
if __name__ == "__main__": | ||
args = parser.parse_args() | ||
- dummy_out = tempfile.NamedTemporaryFile() | ||
query = args.query | ||
query_arg = None | ||
rustc_cmd = [Path(args.RUSTC).as_posix()] | ||
@@ -85,17 +84,23 @@ if __name__ == "__main__": | ||
if args.target: | ||
rustc_cmd.extend(['--target', args.target]) | ||
|
||
- # We need these for '--print=native-static-libs' on Windows | ||
- if query == 'native-static-libs': | ||
- rustc_cmd.extend(['--crate-type', 'staticlib']) | ||
- rustc_cmd.append(os.devnull) | ||
- rustc_cmd.extend(['-o', dummy_out.name]) | ||
+ fd, dummy_out = tempfile.mkstemp() | ||
+ os.close(fd) | ||
+ try: | ||
+ # We need these for '--print=native-static-libs' on Windows | ||
+ if query == 'native-static-libs': | ||
+ rustc_cmd.extend(['--crate-type', 'staticlib']) | ||
+ rustc_cmd.append(os.devnull) | ||
+ rustc_cmd.extend(['-o', dummy_out]) | ||
+ | ||
+ query_results = subprocess.run( | ||
+ rustc_cmd, | ||
+ capture_output=True, | ||
+ text=True, | ||
+ ) | ||
+ finally: | ||
+ os.unlink(dummy_out) | ||
|
||
- query_results = subprocess.run( | ||
- rustc_cmd, | ||
- capture_output=True, | ||
- text=True, | ||
- ) | ||
if query == 'native-static-libs': | ||
retrieve_native_static_libs_from_output(query_results.stderr) | ||
elif query == 'default-host-toolchain' or query == 'stable-actual-version': |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters