-
Notifications
You must be signed in to change notification settings - Fork 211
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
Attempt to fix CI #582
Attempt to fix CI #582
Conversation
Does this still error with the latest nightly? It seems like if the new test from rust-lang/rust#122580 passes on windows CI runners, then the build should also succeed here, shouldn't it? |
Seems to be failing only on x86_64-apple-darwin. |
Is Apple's linker just particularly bad at removing dead code? |
The point of (and design of) rust-lang/rust#122580 is to not rely on linkers to remove dead code which would fail to link. For whatever reason, Linux linkers seem to be quite good at that, so even if you are incautious things tend to work great on Linux and break on other platforms 🙃 |
The undefined symbol references must be only in the LLVM bitcode. How can I disassemble(?) the bitcode to figure out where they are referenced? |
Does |
🤷 The panic-related functions from My only guess based on the available data is that the undefined symbol reported by I think it would be fair to call the CI failure here a false positive. |
The issue on x86_64-apple-darwin here happens with |
You don't need an Apple system; we have a cross-compiling toolchain.
Then you can use your llvm-nm on that rlib:
|
Oh 🤦 you said it happens even without embedding bitcode. |
Actually... can you explain why you think this happens with |
Actually I just realized you are right. The build with It seems that the panic symbol is appearing in the symbol table, but there is no relocation which actually uses it. |
|
That's fair. I'll just change this test to use |
8aae9f8
to
ce105a4
Compare
@@ -36,17 +42,11 @@ case $1 in | |||
;; | |||
esac | |||
|
|||
NM=$(find $(rustc --print sysroot) -name llvm-nm) | |||
NM=$(find $(rustc --print sysroot) \( -name llvm-nm -o -name llvm-nm.exe \) ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like this is causing the issue: comparing a working job to the failing one using llvm-nm
instead of nm
on i686-pc-windows-gnu is causing the tests to fail.
When I try to run llvm-nm
locally in MinGW32, I get error while loading shared libraries: ?: cannot open shared object file: No such file or directory
and an exit code of 127. Perhaps we're missing also missing some shared libraries required to run this on the CI machines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be libLLVM.dll itself. Try prefixing the command with rustup run +nightly
. That will set the dynamic linker path as necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test passes on windows, it's only macOS where it fails. See the CI results.
Never mind. I didn't realize the macOS thing was resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be libLLVM.dll itself. Try prefixing the command with
rustup run +nightly
. That will set the dynamic linker path as necessary.
Good call - that fixed the issue. I don't think it was libLLVM.dll (since that's not in the toolchain), but rather libgcc_s_dw2-1.dll and libwinpthread-1.dll.
I had to do a bit extra since not every build has rustup
on the path, and the toolchain isn't always called nightly
, but I now have this working: 4242372 @Amanieu feel free to steal that commit, or I can publish the draft PR if you prefer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for looking into this! I implemented a similar workaround based on yours but without the need for a second argument to run.sh.
Upstream issue: rust-lang/rust#121552
Now that rust-lang/rust#121421 is merged, we are no longer emitting calls to functions in
core
from compiler builtins. However rustc may still codegen such functions, which will make them appear in the.rlib
. This shouldn't cause issues since the linker will discard these functions as unreachable.