-
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ use std::io::Write; | |
use std::path::{PathBuf, Path}; | ||
use std::process::Command; | ||
|
||
use {Build, Compiler}; | ||
use {Build, Compiler, Mode}; | ||
use util::{cp_r, libdir, is_dylib, cp_filtered, copy}; | ||
|
||
pub fn package_vers(build: &Build) -> &str { | ||
|
@@ -289,6 +289,50 @@ pub fn rust_src_location(build: &Build) -> PathBuf { | |
distdir(build).join(&format!("{}.tar.gz", plain_name)) | ||
} | ||
|
||
/// Creates a tarball of save-analysis metadata, if available. | ||
pub fn analysis(build: &Build, compiler: &Compiler, target: &str) { | ||
println!("Dist analysis"); | ||
|
||
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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
if compiler.stage != 2 { | ||
return | ||
} | ||
|
||
let name = format!("rust-analysis-{}", package_vers(build)); | ||
let image = tmpdir(build).join(format!("{}-{}-image", name, target)); | ||
|
||
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("analysis"); | ||
t!(fs::create_dir_all(&dst)); | ||
cp_r(&image_src, &dst); | ||
|
||
let mut cmd = Command::new("sh"); | ||
cmd.arg(sanitize_sh(&build.src.join("src/rust-installer/gen-installer.sh"))) | ||
.arg("--product-name=Rust") | ||
.arg("--rel-manifest-dir=rustlib") | ||
.arg("--success-message=save-analysis-saved.") | ||
.arg(format!("--image-dir={}", sanitize_sh(&image))) | ||
.arg(format!("--work-dir={}", sanitize_sh(&tmpdir(build)))) | ||
.arg(format!("--output-dir={}", sanitize_sh(&distdir(build)))) | ||
.arg(format!("--package-name={}-{}", name, target)) | ||
.arg(format!("--component-name=rust-analysis-{}", target)) | ||
.arg("--legacy-manifest-dirs=rustlib,cargo"); | ||
build.run(&mut cmd); | ||
t!(fs::remove_dir_all(&image)); | ||
|
||
// Create plain source tarball | ||
let mut cmd = Command::new("tar"); | ||
cmd.arg("-czf").arg(sanitize_sh(&distdir(build).join(&format!("{}.tar.gz", name)))) | ||
.arg("analysis") | ||
.current_dir(&src); | ||
build.run(&mut cmd); | ||
} | ||
|
||
/// Creates the `rust-src` installer component and the plain source tarball | ||
pub fn rust_src(build: &Build) { | ||
println!("Dist src"); | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.