-
Notifications
You must be signed in to change notification settings - Fork 148
Unexpected failures on windows runners #1201
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
Comments
cc @hlopko for visibility |
Hi, yes, I did an upgrade of our VMs and containers over the weekend - for Windows I summarize the changes here: bazelbuild/bazel#13816 We‘ve seen a couple of issues with the new image and are currently fixing broken tests etc. across CI. |
That failure is strange. We didn’t change anything about Visual Studio except the version of the Windows SDK in the new images. :/ |
Oh… maybe the failing test is accidentally using a „link“ executable from MSYS while you’re expecting a link.exe from VStudio? |
@meteorcloudy Could we remove the mingw32 compiler, gcc, etc. from MSYS2? Why do we need / install them when we want to build with Visual Studio on Windows? (Not sure that that’s where the /usr/bin/link is coming from, but it’s my guess) |
Oh no, link.exe actually comes from https://packages.msys2.org/package/coreutils?repo=msys&variant=x86_64 … :/ |
Yeah, the |
This is how rust finds the link.exe binary: |
I'm not very familiar with rust, cannot figure out what went wrong, @UebelAndre can you help take a look? |
I may have some time toward the end of the day today to take a closer look but otherwise don't have too much free time this week so can't commit to too much support 😞 |
Basically this API doesn't work correctly: https://docs.rs/cc/1.0.29/cc/windows_registry/fn.find_tool.html I wonder if the registry is somehow messed up? |
rules_rust take the linker from the C++ toolchain, we don't use the rustc defaults. This is where this happens: https://github.com/bazelbuild/rules_rust/blob/main/rust/private/rustc.bzl#L229. I'm hopeless when it comes to Windows, but to me it seems the error is not directly Rust related. @meteorcloudy, does the invocation look reasonable to you?
We also take linker flags from the C++ toolchain, but we construct flags for libraries to link ourselves here: https://github.com/bazelbuild/rules_rust/blob/main/rust/private/rustc.bzl#L879. Is that logic correct? How would the error look like if there were undefined symbols or cyclic dependencies between libraries? Can it be that we're hitting that problem? Can this be related to bazelbuild/rules_rust#637? One way to debug this further would be to replace rust_binary with a cc_binary and:
|
If ^ works when C++ constructs the linking action, we can diff the command line and see further where things went wrong. |
Interesting, thanks Marcel! We can see in the logs that the "outer" Bazel can successfully build Rust files (at least there are a few messages that suggest that, like "(01:17:50) INFO: From Compiling Rust rlib libc (59 files): [...]" and "Compiling Rust bin cargo_build_script_runner (1 files); 1s local, remote-cache". But then the "inner" Bazel in the (shell) tests fails when building Rust. My guess what happens is that inside the shell tests, the PATH is wrong and puts MSYS2's /usr/bin before the other directories and as the command-line does not call |
Oh wow I've never looked into the implementation of rust_doc_test, I didn't know about the shell script inside. Still, there doesn't seem to be outer/inner Bazel, just potentially slightly different compilation actions. @UebelAndre can you maybe take a look if regular rustc actions and rust_doc compilation actions differ in their env or in paths used? That could be an explanation. |
The difference is that |
Initially noticed on bazelbuild/rules_rust#879 (comment)
Did something change about the windows runners recently? As you can see in that comment, build 4029 succeeded but build 4046 failed when no changes had been made to that branch.
The text was updated successfully, but these errors were encountered: