Skip to content

rustc is distributed with unnecessary? procedural macros ~60 MB #80294

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

Closed
tmiasko opened this issue Dec 22, 2020 · 3 comments · Fixed by #80315
Closed

rustc is distributed with unnecessary? procedural macros ~60 MB #80294

tmiasko opened this issue Dec 22, 2020 · 3 comments · Fixed by #80315
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. I-heavy Issue: Problems and improvements with respect to binary size of generated code. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.

Comments

@tmiasko
Copy link
Contributor

tmiasko commented Dec 22, 2020

$ cd ~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib
$ ls -s -S --si 
total 282M
121M librustc_driver-54c3daf069bcd3f6.so
 94M libLLVM-11-rust-1.50.0-nightly.so
 15M libserde_derive-026483cb77a7c305.so
 15M librustc_macros-5f0ec4a119c6ac86.so
 15M libchalk_derive-0685d79833dc9b2b.so
 14M libtracing_attributes-e4be92c35ab2a33b.so
8,3M libstd-25c6acf8063a3802.so
2,6M libtest-57470d2aa8f7aa83.so
4,1k rustlib/

$ rm libserde_derive-*.so librustc_macros-*.so libchalk_derive-*.so libtracing_attributes-*.so
$ ls -s -S --si
total 224M
...
@jonas-schievink jonas-schievink added C-enhancement Category: An issue proposing an enhancement or a PR with one. I-heavy Issue: Problems and improvements with respect to binary size of generated code. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Dec 22, 2020
@jyn514
Copy link
Member

jyn514 commented Dec 22, 2020

@tmiasko do you have the rustc-dev component installed? That adds a bunch more crates to the sysroot.

@jyn514 jyn514 added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Dec 22, 2020
@ehuss
Copy link
Contributor

ehuss commented Dec 22, 2020

I believe these are required in rustc-dev as part of the need for -Z dual-proc-macros (#64671). I'll admit, I still don't fully understand the need for that, as it is quite mind-bending.

@tmiasko
Copy link
Contributor Author

tmiasko commented Dec 22, 2020

They are included in both rustc component and rustc-dev component. The latter are definitely used for example to build clippy, but I don't see reason for inclusion in rustc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. I-heavy Issue: Problems and improvements with respect to binary size of generated code. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants