-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Distribute libntdll.a with windows-gnu toolchains #108262
Conversation
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
f15aea0
to
be3a276
Compare
This allows loading some essential functions (e.g. read/write file) at load time instead of lazily.
be3a276
to
77de724
Compare
The Miri subtree was changed cc @rust-lang/miri |
853c7f8
to
8123eb4
Compare
I'm not sure how to evaluate whether this is a good idea or not -- maybe we can reassign to someone else? It seems like a comment in the dist.rs code where we list the dll list that says something about what we should think about when extending or shrinking the list would be good. |
In #68519 a similar change was rejected because libstd didn't use ntdll at the time. That has changed. Issue #47359 aims to audit the list but it doesn't look like it's actively maintained or been followed up on. We should probably try to clean up the list at some point, although it is possible some people are relying on specific libraries being distributed. Judging from past history, it seems we tend to accidentally break windows-gnu builds first then fix them by adding to this list when people report the errors. Which isn't great. Feel free to reassign this PR if you'd prefer. |
OK. That seems like reasonable rationale for me to sign off here, we can figure out how to do auditing/better CI in the future. Seems like a hard problem. @bors r+ rollup=iffy |
⌛ Testing commit b44b50a with merge 6fa6a5f76bc57e1495fb975024495f5e5488188f... |
💔 Test failed - checks-actions |
@bors retry |
☀️ Test successful - checks-actions |
Finished benchmarking commit (3ff4d56): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
|
Following changes introduced by rust-lang/rust#108262
Following changes introduced by rust-lang/rust#108262
Link also to ntdll.lib which became required since Rust 1.70.0 or nightly-2023-03-21 [1] (which was sadly not clearly documented as such) when linking the resulting rsvg DLL. So, we extend the batch script that is used to formerly query the default Rust toolchain to also check whether it requires linking to ntdll.lib by checking against the Rust version. [1]: rust-lang/rust#108262 Fixes issue #968.
Link also to ntdll.lib which became required since Rust 1.70.0 or nightly-2023-03-21 [1] (which was sadly not clearly documented as such) when linking the resulting rsvg DLL. So, we extend the batch script that is used to formerly query the default Rust toolchain to also check whether it requires linking to ntdll.lib by checking against the Rust version. [1]: rust-lang/rust#108262 Fixes issue #968.
Link also to ntdll.lib which became required since Rust 1.70.0 or nightly-2023-03-21 [1] (which was sadly not clearly documented as such) when linking the resulting rsvg DLL. So, we extend the batch script that is used to formerly query the default Rust toolchain to also check whether it requires linking to ntdll.lib by checking against the Rust version. [1]: rust-lang/rust#108262 Fixes issue #968.
Link also to ntdll.lib which became required since Rust 1.70.0 or nightly-2023-03-21 [1] (which was sadly not clearly documented as such) when linking the resulting rsvg DLL. So, we extend the batch script that is used to formerly query the default Rust toolchain to also check whether it requires linking to ntdll.lib by checking against the Rust version. [1]: rust-lang/rust#108262 Fixes issue #968.
Link also to ntdll.lib which became required since Rust 1.70.0 or nightly-2023-03-21 [1] (which was sadly not clearly documented as such) when linking the resulting rsvg DLL. So, we extend the batch script that is used to formerly query the default Rust toolchain to also check whether it requires linking to ntdll.lib by checking against the Rust version. [1]: rust-lang/rust#108262 Fixes issue #968.
Link also to ntdll.lib which became required since Rust 1.70.0 or nightly-2023-03-21 [1] (which was sadly not clearly documented as such) when linking the resulting rsvg DLL. So, we extend the batch script that is used to formerly query the default Rust toolchain to also check whether it requires linking to ntdll.lib by checking against the Rust version. [1]: rust-lang/rust#108262 Fixes issue #968.
Extend the helper batch file that we use to query the default Rust toolchain so that we can use the rustc that corresponds to the Rust toolchain that we are using to query the system libraries (i.e. from the Windows SDK), in order to ensure that the final librvg DLL links, as Rust might involve changes that require more system libraries to be required for the build, such as in issue [1]: rust-lang/rust#108262 Fixes issue #968.
Extend the helper batch file that we use to query the default Rust toolchain so that we can use the rustc that corresponds to the Rust toolchain that we are using to query the system libraries (i.e. from the Windows SDK), in order to ensure that the final librvg DLL links, as Rust might involve changes that require more system libraries to be required for the build, such as in issue [1]: rust-lang/rust#108262 Fixes issue #968.
Extend the helper batch file that we use to query the default Rust toolchain so that we can use the rustc that corresponds to the Rust toolchain that we are using to query the system libraries (i.e. from the Windows SDK), in order to ensure that the final librvg DLL links, as Rust might involve changes that require more system libraries to be required for the build, such as in issue [1]: rust-lang/rust#108262 Fixes issue #968.
Fix ntdll linkage issues on Windows UWP platforms See discussion: rust-lang#112265 (comment) Static loading `ntdll` functions does not work for UWP programs, which will end up link errors complaining about missing symbols, or failure to pass the WACK tests. The breakage was introduced in rust-lang#108262. This PR basically reverts part of the changes in rust-lang#108262 for UWP only, and fixes some lint suggestions.
Extend the helper batch file that we use to query the default Rust toolchain so that we can use the rustc that corresponds to the Rust toolchain that we are using to query the system libraries (i.e. from the Windows SDK), in order to ensure that the final librvg DLL links, as Rust might involve changes that require more system libraries to be required for the build, such as in issue [1]: rust-lang/rust#108262 Fixes issue #968. Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/842>
Extend the helper batch file that we use to query the default Rust toolchain so that we can use the rustc that corresponds to the Rust toolchain that we are using to query the system libraries (i.e. from the Windows SDK), in order to ensure that the final librvg DLL links, as Rust might involve changes that require more system libraries to be required for the build, such as in issue [1]: rust-lang/rust#108262 Fixes issue #968.
Extend the helper batch file that we use to query the default Rust toolchain so that we can use the rustc that corresponds to the Rust toolchain that we are using to query the system libraries (i.e. from the Windows SDK), in order to ensure that the final librvg DLL links, as Rust might involve changes that require more system libraries to be required for the build, such as in the issue below: rust-lang/rust#108262 Fixes issue #968 for the librsvg-2.56 branch.
Previously, building the tip of `main` in CI for Windows, Windows CMake (Debug), and Windows CMake (Release) was failing with link-time errors of the form: ``` rustls_ffi.lib(std-391022a4250a8b9a.std.feb3b897-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol __imp_NtWriteFile referenced in function _ZN3std3sys7windows6handle6Handle17synchronous_write17h5e143db420a86fa8E [D:\a\rustls-ffi\rustls-ffi\build\tests\server.vcxproj] ``` The fix is to explicitly include `ntdll.lib` in the native static libs that we link on Windows. Doing this fixes the builds once we also update the `verify-static-libraries.py` script to expect this additional lib. This may be related to an upstream `rust-lang/rust` change[0] but I'm not 100% sure. [0]: rust-lang/rust#108262
Previously, building the tip of `main` in CI for Windows, Windows CMake (Debug), and Windows CMake (Release) was failing with link-time errors of the form: ``` rustls_ffi.lib(std-391022a4250a8b9a.std.feb3b897-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol __imp_NtWriteFile referenced in function _ZN3std3sys7windows6handle6Handle17synchronous_write17h5e143db420a86fa8E [D:\a\rustls-ffi\rustls-ffi\build\tests\server.vcxproj] ``` The fix is to explicitly include `ntdll.lib` in the native static libs that we link on Windows. Doing this fixes the builds once we also update the `verify-static-libraries.py` script to expect this additional lib. This may be related to an upstream `rust-lang/rust` change[0] but I'm not 100% sure. [0]: rust-lang/rust#108262
This allows the OS loader to load essential functions (e.g. read/write file) at load time instead of lazily doing so at runtime.
r? libs