-
Notifications
You must be signed in to change notification settings - Fork 107
Implement vendoring #1342
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
Implement vendoring #1342
Conversation
d6677c4
to
248a67a
Compare
@jyn514 will this work for integration with rust's CI? The vendored directory will be separate from the main one. It is 395MB compared to rust's 602MB. Gzip compressed it is 54MB compared to rust's 81MB. Vendoring just cg_clif takes 208MB or 135MB when removing the jit feature. The total package is 355MB when removing the jit feature. Part of this size difference between jit and no jit comes from region and libloading still depending on winapi rather than windows-sys. |
|
Hmm, I'm confused how vendoring is related to
What's the reason for that? Will it shrink the size at all if we combine them? |
My plan was to enable the testing by default, which means it would also run for source tarballs. If you think I should rather only run it on rust's CI, but not by default when using |
Because a second cargo vendor call seems to remove crates vendored by the previous call, thus requiring a single cargo vendor call for both the main rust workspace and cg_clif. Merging both should save at least 208MB, although that can likely also be saved by removing the vendor call of cg_clif itself from x.py and instead using the version vendored here when building the cranelift backend from x.py as opposed to cg_clif's y.rs. |
Got it - that seems like a good goal 👍
Ahhh right, I've run into that bug too :( It sounds like cg_clif itself doesn't need vendoring and it's just for the benefit of the rust source tarballs, right? In that case, could we move the vendoring to x.py, around https://github.com/rust-lang/rust/blob/af669c26846f85fd15e34a6f03d5d2f237444c17/src/bootstrap/dist.rs#L976-L985 ? That should combine both into a single vendor/ directory, hopefully without breaking anything for your repository. |
Indeed
The part of |
If that's not too much extra work, I think that would be my preference, seems nice to save the space since we store release artifacts indefinitely. That said, we can always fix it later, I don't mind merging this for now if the new code is a hassle. |
I think it wouldn't be too much of a hassle. I will cherry-pick the TOCTOU commit directly to the master branch (there were a couple of other occurences) and close this PR. |
c3fa16e
to
e1e70e9
Compare
Part of https://github.com/bjorn3/rustc_codegen_cranelift/issues/1290
./y.rs vendor
will vendor everything that needs to be fetched from the internet intodownload/
. After vendoring you shouldn't use./y.rs prepare
.