-
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
Shrink the rust-src component #41546
Conversation
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
@malbarbo To paraphrase, you're asking about the fact that rust-std may or may not include rustc crates? I'm not actually referring to rust-std for the chosen crates here, but only the proper If we want to include rustc crates in rust-src, we could, but I don't think that's necessary. All of those crates are unstable, and folks who really want that can still checkout rust.git for use by racer et al. |
Thanks for the PR @cuviper! This seems like the kind of list that's highly susceptible to breakage over time, I wonder if we could enhance distcheck to verify that the rust-src component is valid? Maybe something like executing Also cc @jonathandturner and @nrc, I believe the rls uses the rust-src component |
I need to check if this breaks intellisense for people developing rustc itself using editors with plugins depending on |
Ok, everything still seems to work normally. |
@alexcrichton I agree that the list is a bit fragile. Using I think rls primarily uses this through racer, but I'm not certain. I don't usually use rls or vscode, but it seems like it works, and I did make sure racer directly works too. |
Well at first glance, it's not that easy, because Just having the distcheck as your suggested is probably an 80% solution, and it's not like this list changes frequently. |
So far this list has changed at least once a cycle for I think the past 3 or 4 cycles? Which means it'd otherwise have broken once per release so far for the past few months :( |
OK, there's a distcheck. I double-checked that if the source list has something bogus then rust-src doesn't build successfully, and if it's missing something (say libcore) then the distcheck catches that. |
📌 Commit b9bdb17 has been approved by |
…chton Shrink the rust-src component Before this change, the installable rust-src component had essentially the same contents as the rustc-src dist tarball, just additionally wrapped in a rust-installer. As discussed on [internals], rust-src is only meant to support uses for the standard library, so it doesn't really need the rest of the compiler sources. Now rust-src only contains libstd and its path dependencies, which roughly matches the set of crates that have rust-analysis data. The result is **significantly** smaller, from 36MB to 1.3MB compressed, and from 247MB to 8.5MB uncompressed. [internals]: https://internals.rust-lang.org/t/minimizing-the-rust-src-component/5117
…chton Shrink the rust-src component Before this change, the installable rust-src component had essentially the same contents as the rustc-src dist tarball, just additionally wrapped in a rust-installer. As discussed on [internals], rust-src is only meant to support uses for the standard library, so it doesn't really need the rest of the compiler sources. Now rust-src only contains libstd and its path dependencies, which roughly matches the set of crates that have rust-analysis data. The result is **significantly** smaller, from 36MB to 1.3MB compressed, and from 247MB to 8.5MB uncompressed. [internals]: https://internals.rust-lang.org/t/minimizing-the-rust-src-component/5117
I did not do any manual adjustments to the rollup. Everything that's committed in there is through the bors queue interface. I feel like we've had this happen before; it's kind of a scary bug. |
I just noticed, that's not the tail commit -- it should be c5cd4cb. @alexcrichton maybe r+ it explicitly? |
💡 This pull request was already approved, no need to approve it again. |
🙀 |
Hm sure enough homu is now wedged with this, closing to test out. |
Hm @cuviper mind sending up a follow-up PR? Sorry for the automation hiccup :( |
No problem, I was already getting that ready. :) #41608 |
…richton Add a distcheck for rust-src completeness This is for the last commit of rust-lang#41546. For some reason, @bors only saw the first two commits, and wouldn't approve the last even when explicitly directed so. r? @alexcrichton
…richton Add a distcheck for rust-src completeness This is for the last commit of rust-lang#41546. For some reason, @bors only saw the first two commits, and wouldn't approve the last even when explicitly directed so. r? @alexcrichton
…richton Add a distcheck for rust-src completeness This is for the last commit of rust-lang#41546. For some reason, @bors only saw the first two commits, and wouldn't approve the last even when explicitly directed so. r? @alexcrichton
rust-src: include everything needed to compile libstd with jemalloc I am not very happy about all this `Path::new`, but did not find a nice way to avoid it. Also, this shouldn't be very performance-critical. With this patch, rust-src-1.19.0-dev.tar.gz grows from 1.4 to 3.1 MiB (new uncompressed size: 15.5 MiB). Not great, but shipping incomplete sources is also not great, and this is still much smaller than pre-rust-lang#41546. Excluding the entire `src/jemalloc/test` does not work, unfortunately; there is a file in there that is needed to build libstd. (And anyway there's just 190 KiB uncompressed left in that folder.) In principle, we could try excluding the Rust test suite directories (that would be `libcore/tests` and `libcollection/tests`). I don't know enough about how this component is used to judge whether that would cause any problems. Anyway this is just 600 KiB uncompressed. Fixes rust-lang#41952
rust-src: include everything needed to compile libstd with jemalloc I am not very happy about all this `Path::new`, but did not find a nice way to avoid it. Also, this shouldn't be very performance-critical. With this patch, rust-src-1.19.0-dev.tar.gz grows from 1.4 to 3.1 MiB (new uncompressed size: 15.5 MiB). Not great, but shipping incomplete sources is also not great, and this is still much smaller than pre-rust-lang#41546. Excluding the entire `src/jemalloc/test` does not work, unfortunately; there is a file in there that is needed to build libstd. (And anyway there's just 190 KiB uncompressed left in that folder.) In principle, we could try excluding the Rust test suite directories (that would be `libcore/tests` and `libcollection/tests`). I don't know enough about how this component is used to judge whether that would cause any problems. Anyway this is just 600 KiB uncompressed. Fixes rust-lang#41952
rust-src: include everything needed to compile libstd with jemalloc I am not very happy about all this `Path::new`, but did not find a nice way to avoid it. Also, this shouldn't be very performance-critical. With this patch, rust-src-1.19.0-dev.tar.gz grows from 1.4 to 3.1 MiB (new uncompressed size: 15.5 MiB). Not great, but shipping incomplete sources is also not great, and this is still much smaller than pre-#41546. Excluding the entire `src/jemalloc/test` does not work, unfortunately; there is a file in there that is needed to build libstd. (And anyway there's just 190 KiB uncompressed left in that folder.) In principle, we could try excluding the Rust test suite directories (that would be `libcore/tests` and `libcollection/tests`). I don't know enough about how this component is used to judge whether that would cause any problems. Anyway this is just 600 KiB uncompressed. Fixes #41952
Before this change, the installable rust-src component had essentially the same contents as the rustc-src dist tarball, just additionally wrapped in a rust-installer. As discussed on internals, rust-src is only meant to support uses for the standard library, so it doesn't really need the rest of the compiler sources.
Now rust-src only contains libstd and its path dependencies, which roughly matches the set of crates that have rust-analysis data. The result is significantly smaller, from 36MB to 1.3MB compressed, and from 247MB to 8.5MB uncompressed.