Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/bootstrap/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,14 @@ pub fn analysis(build: &Build, compiler: &Compiler, target: &str) {
}

/// Creates the `rust-src` installer component and the plain source tarball
pub fn rust_src(build: &Build) {
pub fn rust_src(build: &Build, host: &str) {
println!("Dist src");

if host != build.config.build {
println!("\tskipping, not a build host");
return
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be added to step.rs instead actually?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just copying what the other dist functions did. How do I squeeze this into step.rs, by putting into the run closure without the println?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah right yeah there's some other filters in here by this point. In that case let's leave this here for a future refactoring to take care of.


let plain_name = format!("rustc-{}-src", package_vers(build));
let name = format!("rust-src-{}", package_vers(build));
let image = tmpdir(build).join(format!("{}-image", name));
Expand Down
13 changes: 11 additions & 2 deletions src/bootstrap/step.rs
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ pub fn build_rules(build: &Build) -> Rules {
rules.dist("dist-src", "src")
.default(true)
.host(true)
.run(move |_| dist::rust_src(build));
.run(move |s| dist::rust_src(build, s.target));
rules.dist("dist-docs", "src/doc")
.default(true)
.dep(|s| s.name("default:doc"))
Expand Down Expand Up @@ -822,7 +822,16 @@ invalid rule dependency graph detected, was a rule added and maybe typo'd?
let hosts = if self.build.flags.host.len() > 0 {
&self.build.flags.host
} else {
&self.build.config.host
if kind == Kind::Dist {
// For 'dist' steps we only distribute artifacts built from
// the build platform, so only consider that in the hosts
// array.
// NOTE: This relies on the fact that the build triple is
// always placed first, as done in `config.rs`.
&self.build.config.host[..1]
} else {
&self.build.config.host
}
};
let targets = if self.build.flags.target.len() > 0 {
&self.build.flags.target
Expand Down