From d0ea8bbc5e8dcb2018a248ee9d88a02ce2319b3c Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Mon, 29 May 2023 13:41:55 +0000 Subject: [PATCH] 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. --- build_system/prepare.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/build_system/prepare.rs b/build_system/prepare.rs index 350c3ad8fdcb..748d92614b67 100644 --- a/build_system/prepare.rs +++ b/build_system/prepare.rs @@ -268,7 +268,12 @@ pub(crate) fn apply_patches(dirs: &Dirs, crate_name: &str, source_dir: &Path, ta remove_dir_if_exists(target_dir); fs::create_dir_all(target_dir).unwrap(); - copy_dir_recursively(source_dir, target_dir); + if crate_name == "stdlib" { + fs::create_dir(target_dir.join("library")).unwrap(); + copy_dir_recursively(&source_dir.join("library"), &target_dir.join("library")); + } else { + copy_dir_recursively(source_dir, target_dir); + } init_git_repo(target_dir);