Skip to content

Commit 1850b36

Browse files
committed
Only copy library dir for stdlib
When building as part of rust, the sysroot source dir is symlinked to the main source dir, which contains the build dir to which we are likely copying.
1 parent 99e5239 commit 1850b36

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

build_system/prepare.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,12 @@ pub(crate) fn apply_patches(dirs: &Dirs, crate_name: &str, source_dir: &Path, ta
268268

269269
remove_dir_if_exists(target_dir);
270270
fs::create_dir_all(target_dir).unwrap();
271-
copy_dir_recursively(source_dir, target_dir);
271+
if crate_name == "stdlib" {
272+
fs::create_dir(target_dir.join("library")).unwrap();
273+
copy_dir_recursively(&source_dir.join("library"), &target_dir.join("library"));
274+
} else {
275+
copy_dir_recursively(source_dir, target_dir);
276+
}
272277

273278
init_git_repo(target_dir);
274279

0 commit comments

Comments
 (0)