1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Update Rust

This commit is contained in:
Ycarus (Yannick Chabanois) 2024-06-09 19:10:37 +02:00
parent 6e158986e4
commit 7a88fd36e2
4 changed files with 26 additions and 118 deletions

View file

@ -11,25 +11,28 @@
os.makedirs(rustc_cache)
--- a/src/bootstrap/src/core/download.rs
+++ b/src/bootstrap/src/core/download.rs
@@ -208,7 +208,13 @@ impl Config {
@@ -208,10 +208,13 @@ impl Config {
Some(other) => panic!("unsupported protocol {other} in {url}"),
None => panic!("no protocol in {url}"),
}
- t!(std::fs::rename(&tempfile, dest_path));
- t!(
- std::fs::rename(&tempfile, dest_path),
- format!("failed to rename {tempfile:?} to {dest_path:?}")
- );
+ match std::fs::rename(&tempfile, dest_path) {
+ Ok(v) => v,
+ Err(_) => {
+ t!(std::fs::copy(&tempfile, dest_path));
+ t!(std::fs::remove_file(&tempfile));
+ }
+ }
+ };
}
fn download_http_with_retries(&self, tempfile: &Path, url: &str, help_on_error: &str) {
@@ -544,7 +550,10 @@ impl Config {
key: &str,
destination: &str,
) {
@@ -577,7 +580,10 @@ impl Config {
return;
}
- let cache_dst = self.out.join("cache");
+ let cache_dst = match env::var_os("OPENWRT_RUSTC_BOOTSTRAP_CACHE") {
+ Some(v) => PathBuf::from(v),
@ -38,7 +41,7 @@
let cache_dir = cache_dst.join(key);
if !cache_dir.exists() {
t!(fs::create_dir_all(&cache_dir));
@@ -671,7 +680,10 @@ download-rustc = false
@@ -704,7 +710,10 @@ download-rustc = false
let llvm_assertions = self.llvm_assertions;
let cache_prefix = format!("llvm-{llvm_sha}-{llvm_assertions}");