Skip to content

Commit df51036

Browse files
committed
Rollup merge of rust-lang#44076 - RalfJung:src, r=alexcrichton
include Cargo.{toml,lock} in rust-src tarball The lock file is interesting because e.g. xargo could use it to build libstd against the same dependencies that were used for the main build. More generally speaking, just documenting in this form which exact dependencies should be used IMHO makes lots of sense. I added the Cargo.toml mostly because having the lock without the toml feels odd. Of course, the toml contains references to paths that don't actually exist in the rust-src tarball. Not sure if that is considered a problem.
2 parents 9e5c679 + 8cd4cac commit df51036

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/bootstrap/dist.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,10 @@ impl Step for Src {
724724
let dst_src = dst.join("rust");
725725
t!(fs::create_dir_all(&dst_src));
726726

727+
let src_files = [
728+
"src/Cargo.toml",
729+
"src/Cargo.lock",
730+
];
727731
// This is the reduced set of paths which will become the rust-src component
728732
// (essentially libstd and all of its path dependencies)
729733
let std_src_dirs = [
@@ -759,6 +763,9 @@ impl Step for Src {
759763
];
760764

761765
copy_src_dirs(build, &std_src_dirs[..], &std_src_dirs_exclude[..], &dst_src);
766+
for file in src_files.iter() {
767+
copy(&build.src.join(file), &dst_src.join(file));
768+
}
762769

763770
// Create source tarball in rust-installer format
764771
let mut cmd = rust_installer(builder);

0 commit comments

Comments
 (0)