-
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
Move the target libLLVM to llvm-tools-preview #72000
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
Thanks, this looks good to me. Can you check that the llvm tools (e.g. rust-lld) which I believe are dynamically linked to LLVM on Linux also continue to work with this? Not sure what the best way to do that is though. r=me presuming that works |
I've giving that a conditional "yes". I tried compiling a wasm project, which implicitly uses rust-lld, and that works fine -- rustup already sets The conditional part is that I'm not sure how the other
I'll wait for your opinion on |
Hm, so I think that we should try to make them work - would it be feasible to set things up such that their RPATH works? I don't recall the details myself. I think if we can, we should fix them up, but if it's a big hassle I wouldn't be opposed to this mild breakage so long as we don't break the most heavily used case of rustc running rust-lld, which is relied upon on stable I think. |
Ok, I'll explore cmake options to see if we can get a useful RPATH for our layout. |
I can't find a clean way to set RPATH just for the tools. There is What if I just add |
That's fine by me. We should make sure that installing both doesn't lead to errors though (we can run a try build and check rustup-toolchain-install-master and I can publish a nightly based on the try build to dev-static to test that). |
Ok, added. I'm surprised to see that llvm-tools-preview is included in the combined installer, so now that's back to the original size. At least rustup downloads separate installers, so that case will still benefit from the reduced @bors try |
⌛ Trying commit 86c29d6 with merge cf4df42b0cc4692d3601ba548c32d0018da14007... |
💔 Test failed - checks-actions |
OK, that looks like a real failure -- I'll investigate. |
@bors try |
Move the target libLLVM to rustc-dev For running the compiler, we usually only need LLVM from `$sysroot/lib`, which rustup will make available with `LD_LIBRARY_PATH`. We've also been shipping LLVM in the `$target/lib` directory, which bloats the download and installed size. The one time we do need the latter is for linking `rustc-dev` libraries, so let's move it to that component directly. Here are the dist sizes that I got before and after this change: rust-1.45.0-dev-x86_64-unknown-linux-gnu.tar.gz 182M 159M rust-1.45.0-dev-x86_64-unknown-linux-gnu.tar.xz 107M 91M rustc-1.45.0-dev-x86_64-unknown-linux-gnu.tar.gz 100M 78M rustc-1.45.0-dev-x86_64-unknown-linux-gnu.tar.xz 68M 53M rustc-dev-1.45.0-dev-x86_64-unknown-linux-gnu.tar.gz 146M 168M rustc-dev-1.45.0-dev-x86_64-unknown-linux-gnu.tar.xz 92M 108M The installed size should reduce by exactly one `libLLVM.so` (~70-80M), unless you also install `rustc-dev`, and then it should be identical. Resolves rust-lang#70838.
☀️ Try build successful - checks-actions, checks-azure |
@Mark-Simulacrum so we have a try build -- what did you want to test with this? |
I've triggered a nightly build from this to be published to dev-static, which should do so in the next hour or so. Once that's done I'll likely r+ after checking that rustup install continues to work, both normally and with the added component. |
Tested out the built nightly (
@kinnison -- I'm thinking that the right thing here would be for rustup to detect that both LLVM's are identical and not report an error, but I guess that's probably hard? @cuviper I'm not sure what the best way to solve this is. We could temporarily say that the llvm-tools component must be installed together with the rustc-dev component to be usable without LD_LIBRARY_PATH changes, I guess... but that seems not nice. |
With the current model in rustup, trying to deduplicate files like that would be very uncomfortable to do, because we'd need to add reference counting to files etc to deal with component uninstall when files ended up shared. Sorry. |
Would it be possible for rustup to express dependencies? If so, I might put the library in llvm-tools alone and have rustc-dev depend on that. |
Ah, yes, I wasn't considering removal. I can see that being quite hard. I would be fine with a dependency; if necessary we can also just make it a documented one. I wouldn't personally care too much about breaking rustc-dev consumers given an easy fix (but we shouldn't break llvm-tools-preview consumers if we can avoid it). |
To my knowledge there's no real dependency stuff in the channel manifests right now. I'm not sure if that'd be easier or harder to do in the current model than the other options :( For all that it's useful and clever, rustup is a very simple model under the hood :( |
@cuviper -- sounds like there's not nice support for the things we want in manifests / rustup, so we'll go with the manually installed "just documented" dependency. rustc-dev is nightly-only anyway these days, so I'm not too concerned with breakage -- its users are predominantly miri/clippy devs I imagine. Can you update this PR to move the libLLVM over to just the llvm-tools-preview component? If I'm remembering/understanding right that basically means:
|
For running the compiler, we usually only need LLVM from `$sysroot/lib`, which rustup will make available with `LD_LIBRARY_PATH`. We've also been shipping LLVM in the `$target/lib` directory, which bloats the download and installed size. The only times we do need the latter are for the RPATH of `llvm-tools-preview` binaries, and for linking `rustc-dev` libraries. We'll move it to the `llvm-tools-preview` component directly, and `rustc-dev` will have an implicit dependency on it. Here are the dist sizes that I got before and after this change: llvm-tools-1.45.0-dev-x86_64-unknown-linux-gnu.tar.gz 1.3M 24M llvm-tools-1.45.0-dev-x86_64-unknown-linux-gnu.tar.xz 748K 17M rustc-1.45.0-dev-x86_64-unknown-linux-gnu.tar.gz 83M 61M rustc-1.45.0-dev-x86_64-unknown-linux-gnu.tar.xz 56M 41M The installed size should reduce by exactly one `libLLVM.so` (~70-80M), unless you also install `llvm-tools`, and then it should be identical.
OK, |
cc @rust-lang/release as a heads up that we're making rustc-dev incomplete and llvm-tools complete with this patch, as it moves some components around. If people complain about missing libLLVM (probably a linker error) then please ask them to install llvm-tools-preview and see if that resolves their problem. @bors r+ |
📌 Commit 9c97b3c has been approved by |
Indeed so let's ping them so they are aware. :) |
Ah, good call, thanks! To be clear I suspect that neither clippy nor miri may actually depend on the libLLVM linked rustc parts, so you may get away with not installing. But should be easy to install so hopefully not a problem. |
Miri behaves like normal rustc to compile dependencies in |
To be clear, developers of clippy and miri will probably care about this change, because when you link to compiler libraries, you'll inherit a |
I just realized that we don't ship |
I'm personally fine with that for now, we can revert (or expand the set of platforms) if people complain. But I'd not expect too much rustc-dev-using development outside the main targets anyway. |
☀️ Test successful - checks-azure |
rustup, and now we also need to install llvm-tools Fixes fallout from rust-lang/rust#72000
Indeed looks like getting Miri to work again is easy: rust-lang/miri#1427 |
This is no longer packaged with Rust due to rust-lang/rust#72000.
Fix nightly tests with llvm-tools. rust-lang/rust#72000 removed `libLLVM-10-rust-1.45.0-nightly.so` from the default install. Several of the plugins tests fail without this, so make sure it gets installed.
This PR made |
For running the compiler, we usually only need LLVM from
$sysroot/lib
,which rustup will make available with
LD_LIBRARY_PATH
. We've also beenshipping LLVM in the
$target/lib
directory, which bloats the downloadand installed size. The only times we do need the latter are for the
RPATH of
llvm-tools-preview
binaries, and for linkingrustc-dev
libraries. We'll move it to the
llvm-tools-preview
component directly,and
rustc-dev
will have an implicit dependency on it.Here are the dist sizes that I got before and after this change:
The installed size should reduce by exactly one
libLLVM.so
(~70-80M),unless you also install
llvm-tools
, and then it should be identical.Resolves #70838.