about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2021-06-16 18:28:34 +0200
committerbjorn3 <bjorn3@users.noreply.github.com>2021-06-19 13:58:32 +0200
commitd71b12535e84a7c242cf217af49a0366b06c8691 (patch)
treedf0fc3276edbb0288e7a44ae2d27b099dbe5d526
parent066d5f952cfb0c5d22d4ee31d6ac716b2d16668d (diff)
downloadrust-d71b12535e84a7c242cf217af49a0366b06c8691.tar.gz
rust-d71b12535e84a7c242cf217af49a0366b06c8691.zip
Merge the crate_patches dir into the patches dir
-rw-r--r--build_system/prepare.rs21
-rw-r--r--patches/0001-compiler-builtins-Disable-128bit-atomic-operations.patch (renamed from crate_patches/0001-compiler-builtins-Disable-128bit-atomic-operations.patch)0
-rw-r--r--patches/0001-rand-Enable-c2-chacha-simd-feature.patch (renamed from crate_patches/0001-rand-Enable-c2-chacha-simd-feature.patch)0
-rw-r--r--patches/0002-rand-Disable-failing-test.patch (renamed from crate_patches/0002-rand-Disable-failing-test.patch)0
4 files changed, 8 insertions, 13 deletions
diff --git a/build_system/prepare.rs b/build_system/prepare.rs
index b6d6457163d..b5011ceb159 100644
--- a/build_system/prepare.rs
+++ b/build_system/prepare.rs
@@ -20,7 +20,7 @@ pub(crate) fn prepare() {
         "https://github.com/rust-random/rand.git",
         "0f933f9c7176e53b2a3c7952ded484e1783f0bf1",
     );
-    apply_patches("crate_patches", "rand", Path::new("rand"));
+    apply_patches("rand", Path::new("rand"));
 
     clone_repo(
         "regex",
@@ -73,19 +73,14 @@ fn prepare_sysroot() {
         .current_dir(&sysroot_src);
     spawn_and_wait(git_commit_cmd);
 
-    apply_patches("patches", "sysroot", &sysroot_src);
+    apply_patches("sysroot", &sysroot_src);
 
     clone_repo(
         "build_sysroot/compiler-builtins",
         "https://github.com/rust-lang/compiler-builtins.git",
         "0.1.45",
     );
-
-    apply_patches(
-        "crate_patches",
-        "compiler-builtins",
-        Path::new("build_sysroot/compiler-builtins"),
-    );
+    apply_patches("compiler-builtins", Path::new("build_sysroot/compiler-builtins"));
 }
 
 fn clone_repo(target_dir: &str, repo: &str, rev: &str) {
@@ -102,8 +97,8 @@ fn clone_repo(target_dir: &str, repo: &str, rev: &str) {
     spawn_and_wait(checkout_cmd);
 }
 
-fn get_patches(patch_dir: &str, crate_name: &str) -> Vec<OsString> {
-    let mut patches: Vec<_> = fs::read_dir(patch_dir)
+fn get_patches(crate_name: &str) -> Vec<OsString> {
+    let mut patches: Vec<_> = fs::read_dir("patches")
         .unwrap()
         .map(|entry| entry.unwrap().path())
         .filter(|path| path.extension() == Some(OsStr::new("patch")))
@@ -116,10 +111,10 @@ fn get_patches(patch_dir: &str, crate_name: &str) -> Vec<OsString> {
     patches
 }
 
-fn apply_patches(patch_dir: &str, crate_name: &str, target_dir: &Path) {
-    for patch in get_patches(patch_dir, crate_name) {
+fn apply_patches(crate_name: &str, target_dir: &Path) {
+    for patch in get_patches(crate_name) {
         eprintln!("[PATCH] {:?} <- {:?}", target_dir.file_name().unwrap(), patch);
-        let patch_arg = Path::new(patch_dir).join(patch).canonicalize().unwrap();
+        let patch_arg = Path::new("patches").join(patch).canonicalize().unwrap();
         let mut apply_patch_cmd = Command::new("git");
         apply_patch_cmd.arg("am").arg(patch_arg).arg("-q").current_dir(target_dir);
         spawn_and_wait(apply_patch_cmd);
diff --git a/crate_patches/0001-compiler-builtins-Disable-128bit-atomic-operations.patch b/patches/0001-compiler-builtins-Disable-128bit-atomic-operations.patch
index 7daea99f579..7daea99f579 100644
--- a/crate_patches/0001-compiler-builtins-Disable-128bit-atomic-operations.patch
+++ b/patches/0001-compiler-builtins-Disable-128bit-atomic-operations.patch
diff --git a/crate_patches/0001-rand-Enable-c2-chacha-simd-feature.patch b/patches/0001-rand-Enable-c2-chacha-simd-feature.patch
index 01dc0fcc537..01dc0fcc537 100644
--- a/crate_patches/0001-rand-Enable-c2-chacha-simd-feature.patch
+++ b/patches/0001-rand-Enable-c2-chacha-simd-feature.patch
diff --git a/crate_patches/0002-rand-Disable-failing-test.patch b/patches/0002-rand-Disable-failing-test.patch
index 19fd20d7269..19fd20d7269 100644
--- a/crate_patches/0002-rand-Disable-failing-test.patch
+++ b/patches/0002-rand-Disable-failing-test.patch