-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Replace libLLVM symlink with linker script #121967
Conversation
@bors try |
Replace libLLVM symlink with linker script It turns out that the libLLVM-N.so -> libLLVM.so.N.1 symlink is also needed when projects like miri link against librustc_driver.so. As such, we have to distribute it in real rustup components like rustc-dev, rather than only for download-ci-llvm. To avoid actually distributing symlinks (which are not supported or not fully supported by the rustup infrastructure) replace it with a linker script that does the same thing instead. Fixes rust-lang#121889. r? `@cuviper`
☀️ Try build successful - checks-actions |
Breaks download-ci-llvm, because that doesn't have the symlink now either, so the new logic doesn't apply to it anymore. I'll restore the symlink for the download-ci-llvm case. |
It turns out that the libLLVM-N.so -> libLLVM.so.N.1 symlink is also needed when projects like miri link against librustc_driver.so. As such, we have to distribute it in real rustup components like rustc-dev, rather than only for download-ci-llvm. To avoid actually distributing symlinks (which are not supported or not fully supported by the rustup infrastructure) replace it with a linker script that does the same thing instead.
3501f4a
to
5d1d408
Compare
@bors try |
Replace libLLVM symlink with linker script It turns out that the libLLVM-N.so -> libLLVM.so.N.1 symlink is also needed when projects like miri link against librustc_driver.so. As such, we have to distribute it in real rustup components like rustc-dev, rather than only for download-ci-llvm. To avoid actually distributing symlinks (which are not supported or not fully supported by the rustup infrastructure) replace it with a linker script that does the same thing instead. Fixes rust-lang#121889. r? `@cuviper`
☀️ Try build successful - checks-actions |
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.
Code looks good, although it's a bit sad that w have separate code path for download-ci-llvm and everything else.
I've confirmed that download-ci-llvm works again now, and also confirmed that miri can be built against this toolchain (I had to edit miri-script to disable rustfmt and clippy, which are not part of the try toolchain). |
Why does the linker script not work for download-ci-llvm? |
It does work for the purposes of linking, but it breaks the code being modified here that handles libLLVM installation. The logic is based around having the symlink. If we don't ship the symlink for download-ci-llvm, then the logic would additionally also have to support reading the linker script to determine which shared object it needs to install in the libdir. |
Oh, this function later works on its own output as input? Wow that's recursive.^^ Might be worth having a comment in the code explaining that. |
This is partly because the OS infrastructure we run all this stuff on doesn't always support this very well. It is a royal pain in the ass to create symlinks on Windows/NTFS. Windows 10 has made it significantly easier, and with the deprecation of Windows 7 support, that's closer to an option, but I don't know if it's easy enough to be able to assume symlinks are viable on Windows yet, because I don't remember which patch it was. When Windows 11 is our minimum, maybe. |
On Windows 10 it still requires developer mode to be enabled, right? |
Both Windows 10 and 11 require either developer mode or modification of group policies. |
@cuviper this is blocking all tools linking against rustc_driver, would be nice to get it landed soon. :) |
@bors r+ The risk here seems fairly low (I expect to hit some problems but that's almost always true with changes like this). In the meantime, it should unblock miri etc. |
@bors p=1
|
☀️ Test successful - checks-actions |
Finished benchmarking commit (bfe762e): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 646.923s -> 644.65s (-0.35%) |
…rk-Simulacrum Include all library files in artifact summary on CI It's not worth it to maintain any custom logic here. Just print all files in the `lib` directory, this should be forward compatible. This fixes rust-lang#121866, based on rust-lang#121967. r? `@Mark-Simulacrum`
Record mtime in bootstrap's LLVM linker script As discovered in https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/.60ui.60.20tests.20re-running.3F the linker script added in rust-lang#121967 can trigger rebuilds or new test executions, as it's more recent than some of the existing files themselves. This PR copies the mtime to the linker script to prevent a second invocation of `./x test tests/ui` from rerunning all of the tests.
Rollup merge of rust-lang#122138 - lqd:llvm-mtime, r=clubby789 Record mtime in bootstrap's LLVM linker script As discovered in https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/.60ui.60.20tests.20re-running.3F the linker script added in rust-lang#121967 can trigger rebuilds or new test executions, as it's more recent than some of the existing files themselves. This PR copies the mtime to the linker script to prevent a second invocation of `./x test tests/ui` from rerunning all of the tests.
Rollup merge of rust-lang#122136 - Kobzol:opt-dist-lookup-logic, r=Mark-Simulacrum Include all library files in artifact summary on CI It's not worth it to maintain any custom logic here. Just print all files in the `lib` directory, this should be forward compatible. This fixes rust-lang#121866, based on rust-lang#121967. r? `@Mark-Simulacrum`
It turns out that the libLLVM-N.so -> libLLVM.so.N.1 symlink is also needed when projects like miri link against librustc_driver.so. As such, we have to distribute it in real rustup components like rustc-dev, rather than only for download-ci-llvm.
To avoid actually distributing symlinks (which are not supported or not fully supported by the rustup infrastructure) replace it with a linker script that does the same thing instead.
Fixes #121889.
r? @cuviper