Skip to content
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

Bug: Failed to build windows-sys v0.28 for UWP targets #1411

Closed
bdbai opened this issue Jan 3, 2022 · 4 comments · Fixed by #1416
Closed

Bug: Failed to build windows-sys v0.28 for UWP targets #1411

bdbai opened this issue Jan 3, 2022 · 4 comments · Fixed by #1416
Labels
bug Something isn't working

Comments

@bdbai
Copy link
Contributor

bdbai commented Jan 3, 2022

Which crate is this about?

windows-sys

Crate version

0.28.0

Summary

[package]
name = "testlib"
version = "0.1.0"
authors = ["bdbai <bdbaiapp@163.com>"]
edition = "2021"

[dependencies]
windows-sys = { version = "0.28", features = ["Foundation_Collections"] }
fn main() {
    #[allow(unused_imports)]
    use windows_sys;
}
cargo build -Z build-std=std,panic_abort --target x86_64-uwp-windows-msvc

Expected behavior

The program compiles successfully.

Actual behavior

Compiling testlib v0.1.0 (D:\proj\testrs\testlib)
error: linking with link.exe failed: exit code: 1181
|
= note: "D:\soft\vs2022\VC\Tools\MSVC\14.30.30705\bin\HostX64\x64\link.exe" "/LIBPATH:D:\soft\vs2022\VC\Tools\MSVC\14.30.30705\lib\x64\store" "/NOLOGO" "/APPCONTAINER" "mincore.lib" "D:\proj\testrs\testlib\target\x86_64-uwp-windows-msvc\debug\deps\testlib.12vmw4gj9nfwec88.rcgu.o" "D:\proj\testrs\testlib\target\x86_64-uwp-windows-msvc\debug\deps\testlib.1j1n6no1c99akr0j.rcgu.o" "D:\proj\testrs\testlib\target\x86_64-uwp-windows-msvc\debug\deps\testlib.1jk4kivmwworo4w.rcgu.o" "D:\proj\testrs\testlib\target\x86_64-uwp-windows-msvc\debug\deps\testlib.27gpty3m03fap44q.rcgu.o" "D:\proj\testrs\testlib\target\x86_64-uwp-windows-msvc\debug\deps\testlib.4232um37ftko5bak.rcgu.o" "D:\proj\testrs\testlib\target\x86_64-uwp-windows-msvc\debug\deps\testlib.52aknw0u11xqg9o0.rcgu.o" "D:\proj\testrs\testlib\target\x86_64-uwp-windows-msvc\debug\deps\testlib.3y3ebs8hltnhz6at.rcgu.o" "/LIBPATH:D:\proj\testrs\testlib\target\x86_64-uwp-windows-msvc\debug\deps" "/LIBPATH:D:\proj\testrs\testlib\target\debug\deps" "/LIBPATH:C:\Users\bdbai\.rustup\toolchains\nightly-2022-01-01-x86_64-pc-windows-msvc\lib\rustlib\x86_64-uwp-windows-msvc\lib" "D:\proj\testrs\testlib\target\x86_64-uwp-windows-msvc\debug\deps\libwindows_sys-83302516282eaf16.rlib" "D:\proj\testrs\testlib\target\x86_64-uwp-windows-msvc\debug\deps\libstd-887136ed81f7457d.rlib" "D:\proj\testrs\testlib\target\x86_64-uwp-windows-msvc\debug\deps\libpanic_unwind-0c7692820fe96ff7.rlib" "D:\proj\testrs\testlib\target\x86_64-uwp-windows-msvc\debug\deps\libstd_detect-121b5eaf2b92134f.rlib" "D:\proj\testrs\testlib\target\x86_64-uwp-windows-msvc\debug\deps\librustc_demangle-64710a2d26a0f79a.rlib" "D:\proj\testrs\testlib\target\x86_64-uwp-windows-msvc\debug\deps\libhashbrown-d723a7a0db3770a4.rlib" "D:\proj\testrs\testlib\target\x86_64-uwp-windows-msvc\debug\deps\librustc_std_workspace_alloc-c1810ac5ca88d78b.rlib" "D:\proj\testrs\testlib\target\x86_64-uwp-windows-msvc\debug\deps\libunwind-012d9bb6d5e8961d.rlib" "D:\proj\testrs\testlib\target\x86_64-uwp-windows-msvc\debug\deps\libcfg_if-9d3295dd49b34d62.rlib" "D:\proj\testrs\testlib\target\x86_64-uwp-windows-msvc\debug\deps\liblibc-3e453c293f500f34.rlib" "D:\proj\testrs\testlib\target\x86_64-uwp-windows-msvc\debug\deps\liballoc-7100162ff8163776.rlib" "D:\proj\testrs\testlib\target\x86_64-uwp-windows-msvc\debug\deps\librustc_std_workspace_core-ca4d8718395fe3fa.rlib" "D:\proj\testrs\testlib\target\x86_64-uwp-windows-msvc\debug\deps\libcore-f5e35ad5f4b3cb6d.rlib" "D:\proj\testrs\testlib\target\x86_64-uwp-windows-msvc\debug\deps\libcompiler_builtins-358995a960b47c60.rlib" "windows.lib" "kernel32.lib" "ws2_32.lib" "bcrypt.lib" "kernel32.lib" "msvcrt.lib" "/NXCOMPAT" "/LIBPATH:C:\Users\bdbai\.rustup\toolchains\nightly-2022-01-01-x86_64-pc-windows-msvc\lib\rustlib\x86_64-uwp-windows-msvc\lib" "/OUT:D:\proj\testrs\testlib\target\x86_64-uwp-windows-msvc\debug\deps\testlib.exe" "/OPT:REF,NOICF" "/DEBUG" "/NATVIS:C:\Users\bdbai\.rustup\toolchains\nightly-2022-01-01-x86_64-pc-windows-msvc\lib\rustlib\etc\intrinsic.natvis" "/NATVIS:C:\Users\bdbai\.rustup\toolchains\nightly-2022-01-01-x86_64-pc-windows-msvc\lib\rustlib\etc\liballoc.natvis" "/NATVIS:C:\Users\bdbai\.rustup\toolchains\nightly-2022-01-01-x86_64-pc-windows-msvc\lib\rustlib\etc\libcore.natvis" "/NATVIS:C:\Users\bdbai\.rustup\toolchains\nightly-2022-01-01-x86_64-pc-windows-msvc\lib\rustlib\etc\libstd.natvis"
= note: LINK : fatal error LNK1181: cannot open input file 'windows.lib'

error: could not compile testlib due to previous error

Additional comments

Seems like windows_x86_64_msvc was not picked for x86_64-uwp-windows-msvc target, and the build script for the targets did not recognize x86_64-uwp-windows-msvc as well.

if std::env::var("TARGET").unwrap() != "x86_64-pc-windows-msvc" {

@bdbai bdbai added the bug Something isn't working label Jan 3, 2022
@bdbai bdbai changed the title Bug: Failed to build windows-sys v28 for UWP targets Bug: Failed to build windows-sys v0.28 for UWP targets Jan 3, 2022
@kennykerr
Copy link
Collaborator

We should be able to use the same lib for uwp targets.

@riverar
Copy link
Collaborator

riverar commented Jan 3, 2022

One note, x86_64-uwp-windows-msvc is a tier 3 target (read: could be broken at any time). And with UWP investment gone, I wonder if it'll see any further work / is worth worrying about.

@kennykerr
Copy link
Collaborator

Yes, I don't expect to add much/any support beyond simply unblocking the x86_64_msvc target to work with UWP (not introducing any new targets).

@kennykerr
Copy link
Collaborator

Feel free to jump in and update this. It's mostly just about updating the toml files for windows and windows-sys to add the appropriate target dependencies and ensuring the msvc targets include uwp targets in their build.rs checks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants