-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Create tar balls of save-analysis-api metadata for the standard libra… #38102
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
Conversation
@@ -731,6 +731,8 @@ case "$CFG_RELEASE_CHANNEL" in | |||
nightly ) | |||
msg "overriding settings for $CFG_RELEASE_CHANNEL" | |||
CFG_ENABLE_LLVM_ASSERTIONS=1 | |||
CFG_STAGE2_SAVE_ANALYSIS=true |
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 like tabs/spaces leaked in here by accident...
pub fn analysis(build: &Build, compiler: &Compiler, target: &str) { | ||
println!("Dist analysis"); | ||
|
||
if env::var("CFG_STAGE2_SAVE_ANALYSIS") != Ok("true".to_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.
Have you confirmed this works? I don't think these environment variables are set by the configure script for the invocation of rustbuild. (this'd want to get parsed in src/bootstrap/config.rs
and then you can check it here via build.config.xxx
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.
You may also want to add a check here for:
if compiler.stage != 2 {
return
}
cc @brson, first time I think we've added new distribution packages? |
updated... |
let image_src = src.join("save-analysis"); | ||
let dst = image.join("lib/rustlib").join(target).join("save-analysis"); | ||
t!(fs::create_dir_all(&dst)); | ||
cp_r(&image_src, &dst); |
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.
In theory we want the rust-analysis
package to just have the csv files for save-analysis, right? Isn't this copying in the whole set of target libraries?
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.
No, on line 304 we append save-analysis
to the path, which means on this line we only copy the contents of that directory, which is the json files (btw, we stopped using csv a while back).
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.
Since this doesn't include changes to the makefiles I take it the plan is to wait out their removal and the conversion of the release process to use only rustbuild.
// Emit save-analysis info. | ||
if env::var("RUSTC_SAVE_ANALYSIS") == Ok("api".to_string()) { | ||
cmd.arg("-Zsave-analysis-api"); | ||
} |
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.
Why is this conditionalized on an env var?
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.
Huh, this env var is also set by bootstrap. What all does this env var do?
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.
Oh nvm I see what's going on. bootstrap is using this to communicate with the shim.
if build.config.channel != "nightly" { | ||
println!("Skipping dist-analysis - not on nightly channel"); | ||
return; | ||
} |
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.
Doing this on nightlies I guess is just a conservative precaution?
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.
yes
let src = build.stage_out(compiler, Mode::Libstd).join(target).join("release").join("deps"); | ||
|
||
let image_src = src.join("save-analysis"); | ||
let dst = image.join("lib/rustlib").join(target).join("save-analysis"); |
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.
I'm not crazy about the name "save-analysis" here. The verb "save" sounds a bit wrong as the name of the folder containing the analysis.
What is the directory structure under "save-analysis"? I would expect that under this directory there are a series of directories named after target triples, since the analysis is per-target. Based on that assumption I would prefer if the analysis were stored under lib/rustlib/$target/analysis
since we already have the organizational structure to distinguish targets under the rustlib dir. I'd also slightly prefer to put the analysis files side-by-side with the libraries they contain analysis for, directly under lib/rustlib/$target/lib
, but can't articulate why, so maybe it doesn't matter.
@brson - changed r? @brson or @alexcrichton |
@bors r+ |
📌 Commit 9adaff0 has been approved by |
⌛ Testing commit 9adaff0 with merge 5e750fa... |
@bors: retry force clean |
🔒 Merge conflict |
☔ The latest upstream changes (presumably #38256) made this pull request unmergeable. Please resolve the merge conflicts. |
…ries as part of `make dist`.
@bors: r=brson |
📌 Commit c49ba05 has been approved by |
Create tar balls of save-analysis-api metadata for the standard libra… …ries as part of `make dist`. r? @alexcrichton
@nrc hm it looks like this is one reason nightlies are broken, failing logs end with:
I'm currently investigating, but out of curiosity did this succeed locally for you? |
@alexcrichton it did, but I changed a directory name and I think it only worked then because an artefact was left around from a previous run. I have, I think a fix, but waiting on a full build run... |
…ries as part of
make dist
.r? @alexcrichton