Skip to content

Commit 8e731ad

Browse files
committed
Including the case of building from tarball source.
When building from the tarball source, we ignore the automatic download of submodules since they don't include Git and submodules are already included.
1 parent 79274a9 commit 8e731ad

File tree

3 files changed

+20
-9
lines changed

3 files changed

+20
-9
lines changed

config.example.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ change-id = 116881
4848
# We also currently only support this when building LLVM for the build triple.
4949
#
5050
# Set this to `"if-unchanged"` to only download if the llvm-project have not
51-
# been modified. (if no changes, the logic is the same as `"if-available"`)
51+
# been modified. (If there are no changes or if built from tarball source,
52+
# the logic is the same as "if-available")
5253
#
5354
# Note that many of the LLVM options are not currently supported for
5455
# downloading. Currently only the "assertions" option can be toggled.

src/bootstrap/src/core/build_steps/setup.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,14 @@ impl Step for Profile {
147147
}
148148

149149
fn run(self, builder: &Builder<'_>) {
150-
if self == Profile::Codegen {
151-
builder.update_submodule(&Path::new("src/llvm-project"));
150+
// During ./x.py setup once you select the codegen profile.
151+
// The submodule will be downloaded. It does not work in the
152+
// tarball case since they don't include Git and submodules
153+
// are already included.
154+
if !builder.rust_info().is_from_tarball() {
155+
if self == Profile::Codegen {
156+
builder.update_submodule(&Path::new("src/llvm-project"));
157+
}
152158
}
153159
setup(&builder.build.config, self)
154160
}

src/bootstrap/src/core/config/config.rs

+10-6
Original file line numberDiff line numberDiff line change
@@ -2108,12 +2108,16 @@ impl Config {
21082108
llvm::is_ci_llvm_available(&self, asserts)
21092109
}
21102110
Some(StringOrBool::String(s)) if s == "if-unchanged" => {
2111-
if self
2112-
.last_modified_commit(&["src/llvm-project"], "download-ci-llvm", true)
2113-
.is_none()
2114-
{
2115-
// there are some untracked changes in the the given paths.
2116-
false
2111+
if !self.rust_info.is_from_tarball() {
2112+
if self
2113+
.last_modified_commit(&["src/llvm-project"], "download-ci-llvm", true)
2114+
.is_none()
2115+
{
2116+
// there are some untracked changes in the the given paths.
2117+
false
2118+
} else {
2119+
llvm::is_ci_llvm_available(&self, asserts)
2120+
}
21172121
} else {
21182122
llvm::is_ci_llvm_available(&self, asserts)
21192123
}

0 commit comments

Comments
 (0)