-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Switch back to .gz tarball - Replace local bootstrap cache hack with upstreamed option Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
- Loading branch information
1 parent
3cac19e
commit c1b3e04
Showing
3 changed files
with
51 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
lang/rust/patches/0002-correct-the-handling-of-bootstrap-cache-path-option.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
From bd479113d38aa453cbad9d9f5ca9c5fc8903b0cf Mon Sep 17 00:00:00 2001 | ||
From: onur-ozkan <work@onurozkan.dev> | ||
Date: Thu, 11 Apr 2024 14:57:10 +0300 | ||
Subject: [PATCH] correct the handling of `bootstrap-cache-path` option | ||
|
||
This change makes `build.bootstrap-cache-path` option to be configurable with | ||
`./configure` script, so it can be used like `./configure --bootstrap-cache-path=demo`. | ||
|
||
Signed-off-by: onur-ozkan <work@onurozkan.dev> | ||
--- | ||
config.example.toml | 2 +- | ||
src/bootstrap/configure.py | 4 +++- | ||
2 files changed, 4 insertions(+), 2 deletions(-) | ||
|
||
--- a/config.example.toml | ||
+++ b/config.example.toml | ||
@@ -302,7 +302,7 @@ | ||
|
||
# Set the bootstrap/download cache path. It is useful when building rust | ||
# repeatedly in a CI invironment. | ||
-# bootstrap-cache-path = /shared/cache | ||
+#bootstrap-cache-path = /path/to/shared/cache | ||
|
||
# Enable a build of the extended Rust tool set which is not only the compiler | ||
# but also tools such as Cargo. This will also produce "combined installers" | ||
--- a/src/bootstrap/configure.py | ||
+++ b/src/bootstrap/configure.py | ||
@@ -152,9 +152,9 @@ v("default-linker", "rust.default-linker | ||
# (others are conditionally saved). | ||
o("manage-submodules", "build.submodules", "let the build manage the git submodules") | ||
o("full-bootstrap", "build.full-bootstrap", "build three compilers instead of two (not recommended except for testing reproducible builds)") | ||
-o("bootstrap-cache-path", "build.bootstrap-cache-path", "use provided path for the bootstrap cache") | ||
o("extended", "build.extended", "build an extended rust tool set") | ||
|
||
+v("bootstrap-cache-path", None, "use provided path for the bootstrap cache") | ||
v("tools", None, "List of extended tools will be installed") | ||
v("codegen-backends", None, "List of codegen backends to build") | ||
v("build", "build.build", "GNUs ./configure syntax LLVM build triple") | ||
@@ -359,6 +359,8 @@ def apply_args(known_args, option_checki | ||
set('target.{}.llvm-filecheck'.format(build_triple), value, config) | ||
elif option.name == 'tools': | ||
set('build.tools', value.split(','), config) | ||
+ elif option.name == 'bootstrap-cache-path': | ||
+ set('build.bootstrap-cache-path', value, config) | ||
elif option.name == 'codegen-backends': | ||
set('rust.codegen-backends', value.split(','), config) | ||
elif option.name == 'host': |
This file was deleted.
Oops, something went wrong.
c1b3e04
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this last change, I can no longer build rust!
I suspect that the reason is that my dl folder is mounted via NFS?
See: https://doc.rust-lang.org/std/fs/fn.rename.html
@1715173329 Can you make a statement about this? I am not a rustc specialist.
c1b3e04
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the inconvenience. By checking history commits, I found I missed the change in f9f1e02.
Ping @lu-zero our rust expert here ;)
Is it possible to upstream this change?
c1b3e04
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could change the pattern from
rename
tocopy
/delete
.https://github.com/rust-lang/rust/blob/master/src/bootstrap/src/core/download.rs#L212-L213
The disadvantage would be that it may take longer, because the file system entry is not simply changed as with rename.
c1b3e04
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have to doublecheck if there isn't already a
fn rename
doing that we can leverage.c1b3e04
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently didn't so I made rust-lang/rust#124975
c1b3e04
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!