Skip to content

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

Merged
merged 1 commit into from
Dec 10, 2016

Conversation

nrc
Copy link
Member

@nrc nrc commented Dec 1, 2016

…ries as part of make dist.

r? @alexcrichton

@@ -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
Copy link
Member

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()) {
Copy link
Member

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

Copy link
Member

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
}

@alexcrichton
Copy link
Member

cc @brson, first time I think we've added new distribution packages?

@nrc
Copy link
Member Author

nrc commented Dec 2, 2016

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);
Copy link
Member

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?

Copy link
Member Author

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-analysisto 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).

Copy link
Contributor

@brson brson left a 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");
}
Copy link
Contributor

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?

Copy link
Contributor

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?

Copy link
Contributor

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;
}
Copy link
Contributor

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?

Copy link
Member Author

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");
Copy link
Contributor

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.

@nrc
Copy link
Member Author

nrc commented Dec 8, 2016

@brson - changed save-analysis to analysis in the output names, I think this addresses everything we talked about yesterday.

r? @brson or @alexcrichton

@rust-highfive rust-highfive assigned brson and unassigned alexcrichton Dec 8, 2016
@brson
Copy link
Contributor

brson commented Dec 9, 2016

@bors r+

@bors
Copy link
Collaborator

bors commented Dec 9, 2016

📌 Commit 9adaff0 has been approved by brson

@bors
Copy link
Collaborator

bors commented Dec 9, 2016

⌛ Testing commit 9adaff0 with merge 5e750fa...

@alexcrichton
Copy link
Member

@bors: retry force clean

@bors
Copy link
Collaborator

bors commented Dec 9, 2016

🔒 Merge conflict

@bors
Copy link
Collaborator

bors commented Dec 9, 2016

☔ The latest upstream changes (presumably #38256) made this pull request unmergeable. Please resolve the merge conflicts.

@nrc
Copy link
Member Author

nrc commented Dec 9, 2016

@bors: r=brson

@bors
Copy link
Collaborator

bors commented Dec 9, 2016

📌 Commit c49ba05 has been approved by brson

@bors
Copy link
Collaborator

bors commented Dec 9, 2016

⌛ Testing commit c49ba05 with merge fa45d0b...

bors added a commit that referenced this pull request Dec 9, 2016
Create tar balls of save-analysis-api metadata for the standard libra…

…ries as part of `make dist`.

r? @alexcrichton
@bors bors merged commit c49ba05 into rust-lang:master Dec 10, 2016
@alexcrichton
Copy link
Member

@nrc hm it looks like this is one reason nightlies are broken, failing logs end with:

Dist analysis
gen-installer: looking for programs
gen-installer: 
gen-installer: found tar
gen-installer: found cp
gen-installer: found rm
gen-installer: found mkdir
gen-installer: found echo
gen-installer: found tr
gen-installer: found awk
gen-installer: 
gen-installer: processing arguments
gen-installer: 
gen-installer: CFG_PRODUCT_NAME     := Rust 
gen-installer: CFG_COMPONENT_NAME   := rust-analysis-i686-pc-windows-msvc 
gen-installer: CFG_PACKAGE_NAME     := rust-analysis-nightly-i686-pc-windo ...
gen-installer: CFG_REL_MANIFEST_DIR := rustlib 
gen-installer: CFG_SUCCESS_MESSAGE  := save-analysis-saved. 
gen-installer: CFG_LEGACY_MANIFEST_DIRS := rustlib,cargo 
gen-installer: CFG_NON_INSTALLED_OVERLAY :=  
gen-installer: CFG_BULK_DIRS        :=  
gen-installer: CFG_IMAGE_DIR        := /C/bot/slave/nightly-dist-rustc-win ...
gen-installer: CFG_WORK_DIR         := /C/bot/slave/nightly-dist-rustc-win ...
gen-installer: CFG_OUTPUT_DIR       := /C/bot/slave/nightly-dist-rustc-win ...
gen-installer: 
gen-installer: validating arguments
gen-installer: 
gen-install-script: looking for install programs
gen-install-script: 
gen-install-script: found sed
gen-install-script: found chmod
gen-install-script: found cat
gen-install-script: 
gen-install-script: processing arguments
gen-install-script: 
gen-install-script: CFG_PRODUCT_NAME     := Rust 
gen-install-script: CFG_REL_MANIFEST_DIR := rustlib 
gen-install-script: CFG_SUCCESS_MESSAGE  := save-analysis-saved. 
gen-install-script: CFG_OUTPUT_SCRIPT    := /C/bot/slave/nightly-dist-rustc-win ...
gen-install-script: CFG_LEGACY_MANIFEST_DIRS := rustlib,cargo 
gen-install-script: 
gen-install-script: validating arguments
gen-install-script: 
tar: analysis: Cannot stat: No such file or directory


command did not execute successfully: "tar" "-czf" "/C/bot/slave/nightly-dist-rustc-win-msvc-32-cross/build/obj/build/dist/rust-analysis-nightly.tar.gz" "analysis"
expected success, got: exit code: 2

I'm currently investigating, but out of curiosity did this succeed locally for you?

@nrc
Copy link
Member Author

nrc commented Dec 13, 2016

@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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants