-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Add option to include submodules from vendoring #137583
base: master
Are you sure you want to change the base?
Conversation
rustbot has assigned @albertlarsan68. Use |
This PR modifies If appropriate, please update This PR modifies If appropriate, please update |
b507517
to
3064c02
Compare
3064c02
to
c53d067
Compare
Actually this patch doesn't work, I'm working on a revision that should though. |
This adds a config option `exclude-submodules-from-vendoring` that explicitly filters out listed submodules from vendoring. This allows us to exclude submodules like `rustc-perf`, which vendors a number of libraries for benchmarking, and has a complicated licensing story. Closes rust-lang#137272
c53d067
to
21f240e
Compare
Confirmed the latest works for us. |
("src/tools/rustc-perf/Cargo.toml", vec!["src/tools/rustc-perf"]), | ||
("src/tools/opt-dist/Cargo.toml", vec![]), | ||
("src/doc/book/packages/trpl/Cargo.toml", vec![]), | ||
("src/tools/cargo/Cargo.toml", &["src/tools/cargo"][..]), |
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.
("src/tools/cargo/Cargo.toml", &["src/tools/cargo"][..]), | |
("src/tools/cargo/Cargo.toml", &["src/tools/cargo"]), |
Just a small nit.
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.
Looks good! r=me with my and Kobzol's nits fixed.
pub fn default_paths_to_vendor(builder: &Builder<'_>) -> Vec<(PathBuf, Vec<&'static str>)> { | ||
pub fn default_paths_to_vendor( | ||
builder: &Builder<'_>, | ||
excluded_submodules: &BTreeSet<String>, |
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.
It seems to me that all callers of exclude_submodules
pass the same argument to it. Can we remove the argument and access builder.config.dist_exclude_submodules_from_vendoring
directly inside of the function?
… vendoring Building rust broke it now requires all submodules to be present when vendoring, but we don't check it out because it has a complicated licensing story. This patch excludes it from the check to allow rust to work. We should be able to remove once: 1. rust-lang/rust#137583 has landed 2. our stage0 has advanced passed this checkout version. Original-Bug: b/399417231 Original-Reviewed-on: https://fuchsia-review.googlesource.com/c/infra/recipes/+/1215144 Original-Revision: a3421adf94a9221a2038108da4566da6089aae02 GitOrigin-RevId: bb529ac503d02b941202e3be6bfcd542c8a90d60 Change-Id: Ie0f8d5aa5c31e2b22e7c7b3253095fb7acb216cb
} = dist; | ||
config.dist_sign_folder = sign_folder.map(PathBuf::from); | ||
config.dist_upload_addr = upload_addr; | ||
config.dist_compression_formats = compression_formats; | ||
config.dist_exclude_submodules_from_vendoring = | ||
exclude_submodules_from_vendoring.unwrap_or_else(BTreeSet::new); |
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.
nit:
exclude_submodules_from_vendoring.unwrap_or_else(BTreeSet::new); | |
exclude_submodules_from_vendoring.unwrap_or_default(); |
Ping @erickt, do you still want to move forward with this? :) |
This adds a config option
exclude-submodules-from-vendoring
that explicitly filters out listed submodules from vendoring. This allows us to exclude submodules likerustc-perf
, which vendors a number of libraries for benchmarking, and has a complicated licensing story.Closes #137272
cc @Kobzol @pietroalbini @jieyouxu