about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>2024-09-12 18:48:08 +0000
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>2024-11-21 17:51:14 +0000
commit5763c09be110e080e690f28bd1ce5200b054bea0 (patch)
treef3a351c42eb95bbec33ef5a08f47d54f93b4f92e
parent4f213adf09fb52e7c95a7b6d36bc1ca4f09ac9e8 (diff)
downloadrust-5763c09be110e080e690f28bd1ce5200b054bea0.tar.gz
rust-5763c09be110e080e690f28bd1ce5200b054bea0.zip
Remove RelPath::DOWNLOAD
-rw-r--r--build_system/abi_cafe.rs4
-rw-r--r--build_system/path.rs3
-rw-r--r--build_system/prepare.rs4
3 files changed, 4 insertions, 7 deletions
diff --git a/build_system/abi_cafe.rs b/build_system/abi_cafe.rs
index 9292778806a..674acfbd309 100644
--- a/build_system/abi_cafe.rs
+++ b/build_system/abi_cafe.rs
@@ -1,4 +1,4 @@
-use crate::path::{Dirs, RelPath};
+use crate::path::Dirs;
 use crate::prepare::GitRepo;
 use crate::utils::{CargoProject, Compiler, spawn_and_wait};
 use crate::{CodegenBackend, SysrootKind, build_sysroot};
@@ -20,7 +20,7 @@ pub(crate) fn run(
     rustup_toolchain_name: Option<&str>,
     bootstrap_host_compiler: &Compiler,
 ) {
-    RelPath::DOWNLOAD.ensure_exists(dirs);
+    std::fs::create_dir_all(&dirs.download_dir).unwrap();
     ABI_CAFE_REPO.fetch(dirs);
     ABI_CAFE_REPO.patch(dirs);
 
diff --git a/build_system/path.rs b/build_system/path.rs
index a81902d8470..3fa246cbe35 100644
--- a/build_system/path.rs
+++ b/build_system/path.rs
@@ -14,7 +14,6 @@ pub(crate) struct Dirs {
 #[derive(Debug, Copy, Clone)]
 pub(crate) enum PathBase {
     Source,
-    Download,
     Build,
     Dist,
 }
@@ -23,7 +22,6 @@ impl PathBase {
     fn to_path(self, dirs: &Dirs) -> PathBuf {
         match self {
             PathBase::Source => dirs.source_dir.clone(),
-            PathBase::Download => dirs.download_dir.clone(),
             PathBase::Build => dirs.build_dir.clone(),
             PathBase::Dist => dirs.dist_dir.clone(),
         }
@@ -38,7 +36,6 @@ pub(crate) enum RelPath {
 
 impl RelPath {
     pub(crate) const SOURCE: RelPath = RelPath::Base(PathBase::Source);
-    pub(crate) const DOWNLOAD: RelPath = RelPath::Base(PathBase::Download);
     pub(crate) const BUILD: RelPath = RelPath::Base(PathBase::Build);
     pub(crate) const DIST: RelPath = RelPath::Base(PathBase::Dist);
 
diff --git a/build_system/prepare.rs b/build_system/prepare.rs
index c6f979f0278..60363c27936 100644
--- a/build_system/prepare.rs
+++ b/build_system/prepare.rs
@@ -8,7 +8,7 @@ use crate::path::{Dirs, RelPath};
 use crate::utils::{copy_dir_recursively, ensure_empty_dir, spawn_and_wait};
 
 pub(crate) fn prepare(dirs: &Dirs) {
-    RelPath::DOWNLOAD.ensure_exists(dirs);
+    std::fs::create_dir_all(&dirs.download_dir).unwrap();
     crate::tests::RAND_REPO.fetch(dirs);
     crate::tests::REGEX_REPO.fetch(dirs);
 }
@@ -79,7 +79,7 @@ impl GitRepo {
 
     fn download_dir(&self, dirs: &Dirs) -> PathBuf {
         match self.url {
-            GitRepoUrl::Github { user: _, repo } => RelPath::DOWNLOAD.join(repo).to_path(dirs),
+            GitRepoUrl::Github { user: _, repo } => dirs.download_dir.join(repo),
         }
     }