-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
UWP target (e.g. x86_64-uwp-windows-msvc) is broken #138257
Comments
cc @bdbai for FYI |
It looks like rust/library/std/src/sys/pal/windows/c.rs Line 224 in a96fa31
Before a patch is available to fix this, a workaround will be to turn on |
I just filed #138276 and verified locally in Visual Studio that a new UWP app was able to link against a |
Rollup merge of rust-lang#138276 - bdbai:fix-uwp-ntopenfile, r=ChrisDenton Lazy load NtOpenFile for UWP Lazily load `NtOpenFile` to allow libraries targeting UWP to build and link. Fixes rust-lang#138257 . r? `@ChrisDenton`
…enton Lazy load NtOpenFile for UWP Lazily load `NtOpenFile` to allow libraries targeting UWP to build and link. Fixes rust-lang#138257 . r? `@ChrisDenton`
I tried to compile x86_64-uwp-windows-msvc on nightly rust using
-Z build-std
. I usedstaticlib
as target type. Then I tried to link the successfully created .lib file into my exe - outside of rust ecosystem. The linker failed with this error:error LNK2019: unresolved external symbol __imp_NtOpenFile referenced in function _ZN3std3sys3pal7windows2fs14remove_dir_all12nt_open_file17h43bb929b19188a87E
My successful cargo command which created my staticlib which is unusable in UWP is:
The issue is due to rust's std lib using NtOpenFile function which is not available for UWP applications. This regression was introduced in bb9d5c4
The usage of the function is not guarded by the
#[cfg(target_vendor = "uwp")]
feature here:rust/library/std/src/sys/pal/windows/fs/remove_dir_all.rs
Line 55 in 446649d
The way I understand it, all uwp targets are unusable since the above mentioned commit around September 2024 because the rust's std library uses function not allowed for uwp applications.
The text was updated successfully, but these errors were encountered: