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

Switch std to using raw-dylib by default on Windows #129821

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ChrisDenton
Copy link
Member

@ChrisDenton ChrisDenton commented Aug 31, 2024

The raw-dylib feature allows rust to compile code even without have the Windows SDK installed (or mingw equivalent). We were already using it to work around a couple of import library issues, this just makes it the default for everything. The windows_use_import_libs std feature can be used to disable this.

try-job: dist-aarch64-msvc

@rustbot
Copy link
Collaborator

rustbot commented Aug 31, 2024

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added O-windows Operating system: Windows S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Aug 31, 2024
@Mark-Simulacrum
Copy link
Member

Do we have a reviewer with more context perhaps? The changes look "fine" but I'm not sure about any wider implications this might (or might not!) have.

@ChrisDenton
Copy link
Member Author

I'm not sure but @bjorn3 may be able to provide some wider context?

@bjorn3
Copy link
Member

bjorn3 commented Aug 31, 2024

I'm not very familiar with Windows linker things. I don't use Windows myself. @dpaoliello did the raw-dylib implementation in cg_clif. Maybe they have some useful input on this PR?

@dpaoliello
Copy link
Contributor

I'm in favor of switching to raw-dylib - it makes it easier to use Rust in places where the Windows SDK may not be available (non-Windows platforms, folks don't want to install it or when building Windows itself).

My concern with switching to raw-dylib is that we lose what little verification we got from the import libraries, turning linker failures into crashes at startup

  1. Verification that a name exists.
  2. Verification that the API is available in a given Windows version (assuming we were building with an old enough Windows SDK).
  3. For x86 stdcall, the name mangling added some checking of parameters (the total size of the parameters was part of the decoration).

For 1 and 3, this is easily mitigated by avoiding hand-written bindings and using windows-bindgen instead (which the standard library mostly already does).

For 2, @kennykerr do you know if there's enough detail in the metadata to be able to expose Windows SDK versions as crate features (e.g., forcing windows-rs to only expose APIs available in a given Windows version?)

@kennykerr
Copy link
Contributor

Assuming all Windows exports are called through bindings generated by windows-bindgen - I think that is the case - the concerns here should be mitigated in practice.

We do have metadata for API versions and could conceivably make that available through windows-bindgen as well.

The windows-rs project has been providing optional raw-dylib support and been testing this quite heavily for a long time. I think it would be great to turn this on more broadly.

@dpaoliello
Copy link
Contributor

We do have metadata for API versions and could conceivably make that available through windows-bindgen as well.

Excellent, I filed microsoft/windows-rs#3247 to expose that as feature flags.

@ChrisDenton
Copy link
Member Author

I'll add that any version check should only be applied to functions for our use case. Occasionally we do want to use some newer attribute or options by default, but with a fallback for older OS versions if it isn't supported. This works so long as the function itself is supported.

Note that we don't currently test this in CI. IIRC we just use whatever SDK CI provides, which is newer than our minimum support. Accidental use of newer functions are mitigated by the fact that any new API has to be manually added to bindings.txt before it can be used.

@bors
Copy link
Contributor

bors commented Sep 8, 2024

☔ The latest upstream changes (presumably #130091) made this pull request unmergeable. Please resolve the merge conflicts.

We were already using it to work around various import library issues, this just makes it the default for everything.

The `windows_use_import_libs` std feature can be used to disable this.
@Mark-Simulacrum
Copy link
Member

OK, given comments above I think it makes sense to proceed with this. Thanks!

@bors r+

@bors
Copy link
Contributor

bors commented Sep 14, 2024

📌 Commit e528d5d has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 14, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 15, 2024
…mulacrum

Switch std to using raw-dylib by default on Windows

The `raw-dylib` feature allows rust to compile code even without have the Windows SDK installed (or mingw equivalent). We were already using it to work around a couple of import library issues, this just makes it the default for everything. The `windows_use_import_libs` std feature can be used to disable this.
@bors
Copy link
Contributor

bors commented Sep 15, 2024

⌛ Testing commit e528d5d with merge f359eb4...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Sep 15, 2024

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 15, 2024
@ChrisDenton
Copy link
Member Author

unresolved external symbol __imp_RtlGetLastNtStatus referenced in function "class std::error_code __cdecl llvm::mapLastWindowsError(void)"

Error is coming from an LLVM lib. It seems like rustc_driver were implicitly relying on std to link ntdll.lib. That seems... suboptimal. Hm, I have no idea how we handle LLVM dependencies. Do we just always assume that Windows import libs will be provided somehow and don't explicitly link any? cc @nikic maybe?

@nikic
Copy link
Contributor

nikic commented Sep 15, 2024

Sorry, I don't know anything about how we link LLVM on Windows. The relevant code should be in https://github.com/rust-lang/rust/blob/master/compiler/rustc_llvm/build.rs though.

@ChrisDenton
Copy link
Member Author

Thanks! It looks like LLVM lists the necessary libs in https://github.com/rust-lang/llvm-project/blob/4b8d29c585687084bbcf21471e04f279d1eddc0a/llvm/lib/Support/CMakeLists.txt#L44 but we don't use cmake and I can't find that list copied into our build anywhere. So I might need to add it.

@nikic
Copy link
Contributor

nikic commented Sep 15, 2024

We're asking llvm-config for the system libs here:

if !is_crossed {
cmd.arg("--system-libs");
}
Whether they get correctly returned and we then correctly add them is a different question :)

@nikic
Copy link
Contributor

nikic commented Sep 15, 2024

Oh, I just saw that the failure is in dist-aarch64-msvc, so I assume that's a cross-compiled configuration and we fall under !is_crossed?

@bors
Copy link
Contributor

bors commented Sep 15, 2024

☀️ Try build successful - checks-actions
Build commit: 8652fbc (8652fbc6e272e003fa618fdf45fc969ed08fa9b9)

@ChrisDenton
Copy link
Member Author

That worked! But I think I'll split out the commit into a new PR because it needs both a compiler reviewer and maybe a bit of explanation.

@ChrisDenton
Copy link
Member Author

#130398 has been merged so I've reverted to the originally approved commit, Let's try this again:

@bors r=Mark-Simulacrum

@bors
Copy link
Contributor

bors commented Sep 16, 2024

📌 Commit e528d5d has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 16, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 16, 2024
…mulacrum

Switch std to using raw-dylib by default on Windows

The `raw-dylib` feature allows rust to compile code even without have the Windows SDK installed (or mingw equivalent). We were already using it to work around a couple of import library issues, this just makes it the default for everything. The `windows_use_import_libs` std feature can be used to disable this.

try-job: dist-aarch64-msvc
@bors
Copy link
Contributor

bors commented Sep 16, 2024

⌛ Testing commit e528d5d with merge 444d8ab...

@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@bors
Copy link
Contributor

bors commented Sep 16, 2024

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 16, 2024
@ChrisDenton
Copy link
Member Author

ChrisDenton commented Sep 16, 2024

I've not seen that before. It looks like a spurious error in the dist-x86_64-linux builder:

  error: dial unix /run/buildkit/buildkitd.sock: connect: no such file or directory
  ERROR: listing workers for Build: failed to list workers: Unavailable: connection error: desc = "error reading server preface: EOF"

In any case, this PR only affects Windows so let's retry.

@bors retry

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 16, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 16, 2024
…mulacrum

Switch std to using raw-dylib by default on Windows

The `raw-dylib` feature allows rust to compile code even without have the Windows SDK installed (or mingw equivalent). We were already using it to work around a couple of import library issues, this just makes it the default for everything. The `windows_use_import_libs` std feature can be used to disable this.

try-job: dist-aarch64-msvc
@bors
Copy link
Contributor

bors commented Sep 16, 2024

⌛ Testing commit e528d5d with merge 3a238f0...

@rust-log-analyzer
Copy link
Collaborator

The job i686-msvc failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
[RUSTC-TIMING] rustc_lint_defs test:false 3.107
   Compiling rustc_errors v0.0.0 (C:\a\rust\rust\compiler\rustc_errors)
error: linking with `link.exe` failed: exit code: 1120
  |
  = note: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\MSVC\\14.41.34120\\bin\\HostX64\\x86\\link.exe" "/NOLOGO" "/LARGEADDRESSAWARE" "/SAFESEH" "C:\\a\\_temp\\msys64\\tmp\\rustccGxZI6\\symbols.o" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\rustc_span-6c286204ce9509ec.rustc_span.e32ada4f800f0731-cgu.00.rcgu.o" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\rustc_span-6c286204ce9509ec.rustc_span.e32ada4f800f0731-cgu.01.rcgu.o" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\rustc_span-6c286204ce9509ec.rustc_span.e32ada4f800f0731-cgu.02.rcgu.o" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\rustc_span-6c286204ce9509ec.rustc_span.e32ada4f800f0731-cgu.03.rcgu.o" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\rustc_span-6c286204ce9509ec.rustc_span.e32ada4f800f0731-cgu.04.rcgu.o" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\rustc_span-6c286204ce9509ec.rustc_span.e32ada4f800f0731-cgu.05.rcgu.o" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\rustc_span-6c286204ce9509ec.rustc_span.e32ada4f800f0731-cgu.06.rcgu.o" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\rustc_span-6c286204ce9509ec.rustc_span.e32ada4f800f0731-cgu.07.rcgu.o" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\rustc_span-6c286204ce9509ec.rustc_span.e32ada4f800f0731-cgu.08.rcgu.o" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\rustc_span-6c286204ce9509ec.rustc_span.e32ada4f800f0731-cgu.09.rcgu.o" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\rustc_span-6c286204ce9509ec.rustc_span.e32ada4f800f0731-cgu.10.rcgu.o" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\rustc_span-6c286204ce9509ec.rustc_span.e32ada4f800f0731-cgu.11.rcgu.o" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\rustc_span-6c286204ce9509ec.rustc_span.e32ada4f800f0731-cgu.12.rcgu.o" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\rustc_span-6c286204ce9509ec.rustc_span.e32ada4f800f0731-cgu.13.rcgu.o" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\rustc_span-6c286204ce9509ec.rustc_span.e32ada4f800f0731-cgu.14.rcgu.o" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\rustc_span-6c286204ce9509ec.rustc_span.e32ada4f800f0731-cgu.15.rcgu.o" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\rustc_span-6c286204ce9509ec.1ey6i1ke0hf84tb9jytdwmq06.rcgu.o" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libunicode_width-ec0578594fc93c56.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libitoa-0cfeb98e30101fe9.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libscoped_tls-0e1ecf3ec7285456.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1\\lib\\rustlib\\i686-pc-windows-msvc\\lib\\libtest-cf9fe81bc16340bb.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1\\lib\\rustlib\\i686-pc-windows-msvc\\lib\\libgetopts-f02c2303782c1e41.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1\\lib\\rustlib\\i686-pc-windows-msvc\\lib\\libunicode_width-bfe855ebe545e348.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1\\lib\\rustlib\\i686-pc-windows-msvc\\lib\\librustc_std_workspace_std-31e563d27cec9923.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libsha2-8a9815740b225df9.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libsha1-82d1db2d999e60d6.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libcpufeatures-a3b128428e630fff.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libmd5-17646ee3e3fcf070.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libdigest-51bcae2fe511bc84.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libblock_buffer-4425a41249f36a1f.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libcrypto_common-337d39091f017be0.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libgeneric_array-543a45e4766e7256.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libtypenum-b9fd9717a31a9472.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\librustc_data_structures-f1ecc73365a8d7c9.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libelsa-dee123ee9861416d.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libstable_deref_trait-3144c8700608b200.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libstacker-6f439b4e82fbd0e8.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libpsm-fea34ad6d57d1e04.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\liblibc-23f774b3ed4b9bed.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libmemmap2-6a6cd91643b8c172.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\librustc_arena-ef2dd8daa153dab9.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libwindows-f7430c0bd4b103fe.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libwindows_core-c95cf710a2ed69a5.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libbitflags-7242cec8dae900e6.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libtempfile-fb6351e77468cef6.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libfastrand-73cb65d05433cd2f.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libwindows_sys-8949bc351e96ec7a.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\librustc_stable_hash-1078a13ae9a05fe6.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libmeasureme-fba43a0b31cf36c0.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libparking_lot-dac02f0a4bc89606.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libparking_lot_core-a25b7f1065721944.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libwindows_targets-761d1cf0420b9537.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\liblock_api-b0e2b1469919c445.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libscopeguard-68eeec6feb18046d.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\librustc_graphviz-4c09823f2b789df2.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libjobserver-7aca5da393dc1998.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libtracing-d5ee12771d6a72d5.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libpin_project_lite-b6f6376881469afa.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libtracing_core-ae0a6b152066f893.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\librustc_hash-ec08b8ae5225e6c9.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\librustc_index-b69e546ba021d795.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\librustc_serialize-55d1617d3ba139fe.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libindexmap-87160ac32832fae9.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libequivalent-b6ad1c3993e6b37e.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\librayon-6bb5bf2e8456da1d.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\librayon_core-165b4d00e03459e1.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libnum_cpus-2c06d4c47561bfa8.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libcrossbeam_deque-a694c4646e693e22.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libcrossbeam_epoch-84ee648643afb118.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libcrossbeam_channel-77286214258d70be.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libcrossbeam_utils-de2fce643f79d27f.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libeither-45998f5b0a65675d.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libhashbrown-56d6558a3a8bec46.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libahash-2f0e897bf16a7679.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libonce_cell-cc260e1d0eedb2e8.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libcfg_if-f0608800fa583496.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libzerocopy-941bca4655b73b74.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libbyteorder-b8bd97df41eab458.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\liballocator_api2-3f6aee9b98bbedae.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libthin_vec-dc79f88420218db4.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libsmallvec-7346bb2e6b6d15aa.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libarrayvec-d7fb9821a7d3fac2.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\libena-117aa4bba083a8c2.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\liblog-a91e153aadab0c3e.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1\\lib\\rustlib\\i686-pc-windows-msvc\\lib\\libstd-0f7a54c773e7bace.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1\\lib\\rustlib\\i686-pc-windows-msvc\\lib\\libpanic_unwind-83f74310d40f925c.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1\\lib\\rustlib\\i686-pc-windows-msvc\\lib\\libwindows_targets-4291a0c00630f550.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1\\lib\\rustlib\\i686-pc-windows-msvc\\lib\\librustc_demangle-cca8b287a56fdde9.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1\\lib\\rustlib\\i686-pc-windows-msvc\\lib\\libstd_detect-095316773372b955.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1\\lib\\rustlib\\i686-pc-windows-msvc\\lib\\libhashbrown-72b8b56207cf7339.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1\\lib\\rustlib\\i686-pc-windows-msvc\\lib\\librustc_std_workspace_alloc-c3a081bdb87cc9a8.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1\\lib\\rustlib\\i686-pc-windows-msvc\\lib\\libunwind-2b9810a9b3fba4dc.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1\\lib\\rustlib\\i686-pc-windows-msvc\\lib\\libcfg_if-a0bdf45bc09716e2.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1\\lib\\rustlib\\i686-pc-windows-msvc\\lib\\liballoc-b20316c00f8ef3ec.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1\\lib\\rustlib\\i686-pc-windows-msvc\\lib\\librustc_std_workspace_core-a67c29f4a9c7a99d.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1\\lib\\rustlib\\i686-pc-windows-msvc\\lib\\libcore-76c424679b11e231.rlib" "C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1\\lib\\rustlib\\i686-pc-windows-msvc\\lib\\libcompiler_builtins-24982af87d4df7d4.rlib" "kernel32.lib" "legacy_stdio_definitions.lib" "kernel32.lib" "/defaultlib:libcmt" "/NXCOMPAT" "/LIBPATH:C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\MSVC\\14.41.34120\\atlmfc\\lib\\x86" "/LIBPATH:C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\build\\stacker-47e46d6e54fbd7e2\\out" "/LIBPATH:C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\MSVC\\14.41.34120\\atlmfc\\lib\\x86" "/LIBPATH:C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\build\\psm-78bb28666655b41b\\out" "/OUT:C:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage1-rustc\\i686-pc-windows-msvc\\release\\deps\\rustc_span-6c286204ce9509ec.exe" "/OPT:REF,ICF" "/DEBUG" "/PDBALTPATH:%_PDB%"
  = note: libjobserver-7aca5da393dc1998.rlib(jobserver-7aca5da393dc1998.jobserver.f6cdb89c3d15ed89-cgu.1.rcgu.o) : error LNK2019: unresolved external symbol _SystemFunction036@8 referenced in function __RNvMNtCslbJfcGtNF5B_9jobserver3impNtB2_6Client3new␍
          

[RUSTC-TIMING] rustc_span test:true 23.482
error: could not compile `rustc_span` (lib test) due to 1 previous error
---
[RUSTC-TIMING] rustc_hir test:false 15.482
[RUSTC-TIMING] rustc_target test:false 46.808
[RUSTC-TIMING] rustc_errors test:false 25.057
Build completed unsuccessfully in 1:05:15
make: *** [Makefile:106: ci-msvc-ps1] Error 1
  network time: Mon, 16 Sep 2024 14:48:23 GMT
##[error]Process completed with exit code 2.
Post job cleanup.
[command]"C:\Program Files\Git\bin\git.exe" version

@bors
Copy link
Contributor

bors commented Sep 16, 2024

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 16, 2024
@kennykerr
Copy link
Contributor

Don't know if its relevant but SystemFunction036 is the export name for RtlGenRandom. The windows_targets link macro supports this scenario (with raw-dylib) as follows:

windows_targets::link!("advapi32.dll" "system" "SystemFunction036" fn RtlGenRandom(randombuffer : *mut core::ffi::c_void, randombufferlength : u32) -> super::super::super::Foundation:: BOOLEAN);

@ChrisDenton
Copy link
Member Author

In this case the problem is in the rustc dependency jobserver. They declare external functions but don't define where they come from. I'll open a PR.

@Mark-Simulacrum Mark-Simulacrum added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 22, 2024
@bors
Copy link
Contributor

bors commented Oct 14, 2024

☔ The latest upstream changes (presumably #131662) made this pull request unmergeable. Please resolve the merge conflicts.

@jieyouxu
Copy link
Member

@bors r- (bors sync)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-windows Operating system: Windows S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants