Skip to content

Bootstrap tests fail when git_merge_commit_email in src/stage0 contains square brackets #140669

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
japaric opened this issue May 5, 2025 · 0 comments · May be fixed by #140675
Open

Bootstrap tests fail when git_merge_commit_email in src/stage0 contains square brackets #140669

japaric opened this issue May 5, 2025 · 0 comments · May be fixed by #140675
Labels
C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@japaric
Copy link
Member

japaric commented May 5, 2025

Summary

What the title says. This was found when integrating recent Rust changes into Ferrocene.

Command used

Change the git_merge_commit_email entry in src/stage0. For example

diff --git a/src/stage0 b/src/stage0
index 06080e3a8c1..70282328d22 100644
--- a/src/stage0
+++ b/src/stage0
@@ -1,7 +1,7 @@
 dist_server=https://static.rust-lang.org
 artifacts_server=https://ci-artifacts.rust-lang.org/rustc-builds
 artifacts_with_llvm_assertions_server=https://ci-artifacts.rust-lang.org/rustc-builds-alt
-[email protected]
+git_merge_commit_email=bors[bot]@rust-lang.org
 nightly_branch=master

 # The configuration above this comment is editable, and can be changed
$ ./x test bootstrap -- ci_rustc
failures:
    core::builder::tests::ci_rustc_if_unchanged_do_not_invalidate_on_library_changes_outside_ci
    core::builder::tests::ci_rustc_if_unchanged_do_not_invalidate_on_tool_changes

Expected behaviour

The tests should pass.

Actual behaviour

The tests fail.

The root of the problem seems to be these two shell invocations of git rev-list. The argument of the --author flag is not a plaintext substring but a regular expression, when square bracket characters are passed unescaped then git fails to find the matching commit.

Bootstrap configuration (bootstrap.toml)

profile = "compiler"

[llvm]
download-ci-llvm = false

Note that the repro command will not build LLVM but llvm.download-ci-llvm = true makes bootstrap fail for a different reason that's not a bug.

Operating system

Ubuntu 22.04

HEAD

efcbb94

Additional context

Build Log

Testing stage0 bootstrap (x86_64-unknown-linux-gnu)
configure: build.configure-args := ['--set', 'build.cargo=/home/jorge/git/github/ ...
configure: build.cargo          := /home/jorge/git/github/rust-lang/rust/build/x8 ...
configure: build.rustc          := /home/jorge/git/github/rust-lang/rust/build/x8 ...
configure: profile              := dist
WARNING: skipping TOML validation, need at least python 3.11
.configure: build.configure-args := ['--set', 'rust.deny-warnings=false', '--set', ...
configure: rust.deny-warnings   := False
configure: build.cargo          := /home/jorge/git/github/rust-lang/rust/build/x8 ...
configure: build.rustc          := /home/jorge/git/github/rust-lang/rust/build/x8 ...
configure: profile              := dist
WARNING: skipping TOML validation, need at least python 3.11
configure: build.configure-args := ['--set', 'rust.deny-warnings=false', '--set', ...
configure: rust.deny-warnings   := False
configure: build.cargo          := /home/jorge/git/github/rust-lang/rust/build/x8 ...
configure: build.rustc          := /home/jorge/git/github/rust-lang/rust/build/x8 ...
configure: build.cargo          := /home/jorge/git/github/rust-lang/rust/build/x8 ...
configure: build.rustc          := /home/jorge/git/github/rust-lang/rust/build/x8 ...
configure: profile              := dist
WARNING: skipping TOML validation, need at least python 3.11
configure: build.configure-args := ['--set', 'rust.deny-warnings=true', '--set',  ...
configure: rust.deny-warnings   := True
configure: build.cargo          := /home/jorge/git/github/rust-lang/rust/build/x8 ...
configure: build.rustc          := /home/jorge/git/github/rust-lang/rust/build/x8 ...
configure: profile              := dist
WARNING: skipping TOML validation, need at least python 3.11
configure: build.configure-args := ['--set', 'rust.deny-warnings=true', '--set',  ...
configure: rust.deny-warnings   := True
configure: build.cargo          := /home/jorge/git/github/rust-lang/rust/build/x8 ...
configure: build.rustc          := /home/jorge/git/github/rust-lang/rust/build/x8 ...
configure: build.cargo          := /home/jorge/git/github/rust-lang/rust/build/x8 ...
configure: build.rustc          := /home/jorge/git/github/rust-lang/rust/build/x8 ...
configure: profile              := dist
WARNING: skipping TOML validation, need at least python 3.11
configure: build.configure-args := ['--set', 'build.cargo=/home/jorge/git/github/ ...
configure: build.cargo          := /home/jorge/git/github/rust-lang/rust/build/x8 ...
configure: build.rustc          := /home/jorge/git/github/rust-lang/rust/build/x8 ...
configure: profile              := dist
WARNING: skipping TOML validation, need at least python 3.11
configure: build.configure-args := ['--set', 'build.cargo=/home/jorge/git/github/ ...
configure: build.cargo          := /home/jorge/git/github/rust-lang/rust/build/x8 ...
configure: build.rustc          := /home/jorge/git/github/rust-lang/rust/build/x8 ...
configure: build.cargo          := /home/jorge/git/github/rust-lang/rust/build/x8 ...
configure: build.rustc          := /home/jorge/git/github/rust-lang/rust/build/x8 ...
configure: profile              := dist
WARNING: skipping TOML validation, need at least python 3.11
.configure: build.configure-args := []
configure: profile              := dist
WARNING: skipping TOML validation, need at least python 3.11
.configure: build.configure-args := ['--set', 'rust.codegen-backends=cranelift']
configure: rust.codegen-backends := cranelift
configure: profile              := dist
WARNING: skipping TOML validation, need at least python 3.11
configure: build.configure-args := ['--set', 'rust.codegen-backends=cranelift,llv ...
configure: rust.codegen-backends := cranelift,llvm
configure: profile              := dist
WARNING: skipping TOML validation, need at least python 3.11
configure: build.configure-args := ['--enable-full-tools']
configure: rust.codegen-backends := ['llvm']
configure: rust.lld             := True
configure: rust.llvm-tools      := True
configure: rust.llvm-bitcode-linker := True
configure: build.extended       := True
configure: profile              := dist
WARNING: skipping TOML validation, need at least python 3.11
.configure: build.configure-args := ['--set', 'llvm.download-ci-llvm']
configure: llvm.download-ci-llvm := True
configure: profile              := dist
WARNING: skipping TOML validation, need at least python 3.11
.configure: build.configure-args := ['--set', 'target.x86_64-unknown-linux-gnu.cc= ...
configure: target.x86_64-unknown-linux-gnu.cc := gcc
configure: profile              := dist
WARNING: skipping TOML validation, need at least python 3.11
.configure: build.configure-args := ['--set', 'profile=compiler']
configure: profile              := compiler
WARNING: skipping TOML validation, need at least python 3.11
.configure: build.configure-args := ['--enable-full-tools']
configure: rust.codegen-backends := ['llvm']
configure: rust.lld             := True
configure: rust.llvm-tools      := True
configure: rust.llvm-bitcode-linker := True
configure: build.extended       := True
configure: build.configure-args := ['--disable-full-tools']
configure: rust.codegen-backends := ['llvm']
configure: rust.lld             := True
configure: rust.llvm-tools      := True
configure: rust.llvm-bitcode-linker := True
configure: build.extended       := True
configure: build.configure-args := ['--target=x86_64-unknown-linux-gnu']
configure: build.target         := ['x86_64-unknown-linux-gnu']
configure: build.configure-args := ['--target', 'x86_64-unknown-linux-gnu']
configure: build.target         := ['x86_64-unknown-linux-gnu']
.configure: build.configure-args := ['--target']
configure: profile              := dist
.configure: build.configure-args := ['--target']
configure: profile              := dist
configure: build.configure-args := ['--enable-option-checking', '--target']
configure: profile              := dist
configure: build.configure-args := ['--disable-option-checking', '--target']
configure: profile              := dist
.configure: build.configure-args := ['enable-full-tools']
configure: profile              := dist
configure: build.configure-args := ['--some-random-flag']
configure: profile              := dist
....invalid checksum:
    found:    334d016f755cd6dc58c53a86e183882f8ec14f52fb05345887c8a5edd42c87b7
    expected: 64ec88ca00b268e5ba1a35678a1b5316d212f4f366b2477232534a8aeca37f3c
..
----------------------------------------------------------------------
Ran 16 tests in 0.209s

OK
    Finished `test` profile [unoptimized] target(s) in 0.12s
     Running unittests src/lib.rs (build/bootstrap/x86_64-unknown-linux-gnu/debug/deps/bootstrap-e87f0dc0e173abcc)

running 4 tests

core::builder::tests::ci_rustc_if_unchanged_do_not_invalidate_on_library_changes_outside_ci ... F

core::builder::tests::ci_rustc_if_unchanged_do_not_invalidate_on_tool_changes ... F
..

failures:

---- core::builder::tests::ci_rustc_if_unchanged_do_not_invalidate_on_library_changes_outside_ci stdout ----
Running cd "/tmp/.tmpLtHISf" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "init"
Running cd "/tmp/.tmpLtHISf" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "config" "user.name" "Tester"
Running cd "/tmp/.tmpLtHISf" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "config" "user.email" "[email protected]"
Running cd "/tmp/.tmpLtHISf" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "add" "."
Running cd "/tmp/.tmpLtHISf" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "commit" "-m" "commit message"
Running cd "/tmp/.tmpLtHISf" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "rev-parse" "HEAD"
Running cd "/tmp/.tmpLtHISf" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "branch" "-m" "main"
Running cd "/tmp/.tmpLtHISf" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "add" "."
Running cd "/tmp/.tmpLtHISf" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "commit" "-m" "commit message"
Running cd "/tmp/.tmpLtHISf" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "rev-parse" "HEAD"
Running cd "/tmp/.tmpLtHISf" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "rev-parse" "--abbrev-ref" "HEAD"
Running cd "/tmp/.tmpLtHISf" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "checkout" "-b" "previous-pr"
Running cd "/tmp/.tmpLtHISf" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "add" "."
Running cd "/tmp/.tmpLtHISf" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "commit" "-m" "commit message"
Running cd "/tmp/.tmpLtHISf" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "rev-parse" "HEAD"
Running cd "/tmp/.tmpLtHISf" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "switch" "main"
Running cd "/tmp/.tmpLtHISf" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "merge" "--no-commit" "--no-ff" "previous-pr"
Running cd "/tmp/.tmpLtHISf" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "rev-parse" "--abbrev-ref" "HEAD"
Running cd "/tmp/.tmpLtHISf" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "commit" "-m" "Merge of previous-pr into main" "--author" "Merge bot <bors[bot]@rust-lang.org>"
Running cd "/tmp/.tmpLtHISf" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "branch" "-d" "previous-pr"
Running cd "/tmp/.tmpLtHISf" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "rev-parse" "HEAD"
Running cd "/tmp/.tmpLtHISf" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "rev-parse" "--abbrev-ref" "HEAD"
Running cd "/tmp/.tmpLtHISf" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "checkout" "-b" "pr"
Running cd "/tmp/.tmpLtHISf" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "add" "."
Running cd "/tmp/.tmpLtHISf" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "commit" "-m" "commit message"
Running cd "/tmp/.tmpLtHISf" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "rev-parse" "HEAD"
Running cd "/tmp/.tmpLtHISf" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "switch" "main"
Running cd "/tmp/.tmpLtHISf" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "merge" "--no-commit" "--no-ff" "pr"
Running cd "/tmp/.tmpLtHISf" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "rev-parse" "--abbrev-ref" "HEAD"
Running cd "/tmp/.tmpLtHISf" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "commit" "-m" "Merge of pr into main" "--author" "Tester <[email protected]>"
Running cd "/tmp/.tmpLtHISf" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "branch" "-d" "pr"
Running cd "/tmp/.tmpLtHISf" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "rev-parse" "HEAD"
No upstream commit found

thread 'core::builder::tests::ci_rustc_if_unchanged_do_not_invalidate_on_library_changes_outside_ci' panicked at src/bootstrap/src/core/builder/tests.rs:279:9:
assertion `left == right` failed
  left: None
 right: Some("0649f955c3852e14f487f7452e718b2a979ef8a0")
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- core::builder::tests::ci_rustc_if_unchanged_do_not_invalidate_on_tool_changes stdout ----
Running cd "/tmp/.tmpwIiX51" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "init"
Running cd "/tmp/.tmpwIiX51" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "config" "user.name" "Tester"
Running cd "/tmp/.tmpwIiX51" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "config" "user.email" "[email protected]"
Running cd "/tmp/.tmpwIiX51" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "add" "."
Running cd "/tmp/.tmpwIiX51" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "commit" "-m" "commit message"
Running cd "/tmp/.tmpwIiX51" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "rev-parse" "HEAD"
Running cd "/tmp/.tmpwIiX51" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "branch" "-m" "main"
Running cd "/tmp/.tmpwIiX51" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "add" "."
Running cd "/tmp/.tmpwIiX51" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "commit" "-m" "commit message"
Running cd "/tmp/.tmpwIiX51" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "rev-parse" "HEAD"
Running cd "/tmp/.tmpwIiX51" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "rev-parse" "--abbrev-ref" "HEAD"
Running cd "/tmp/.tmpwIiX51" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "checkout" "-b" "previous-pr"
Running cd "/tmp/.tmpwIiX51" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "add" "."
Running cd "/tmp/.tmpwIiX51" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "commit" "-m" "commit message"
Running cd "/tmp/.tmpwIiX51" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "rev-parse" "HEAD"
Running cd "/tmp/.tmpwIiX51" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "switch" "main"
Running cd "/tmp/.tmpwIiX51" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "merge" "--no-commit" "--no-ff" "previous-pr"
Running cd "/tmp/.tmpwIiX51" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "rev-parse" "--abbrev-ref" "HEAD"
Running cd "/tmp/.tmpwIiX51" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "commit" "-m" "Merge of previous-pr into main" "--author" "Merge bot <bors[bot]@rust-lang.org>"
Running cd "/tmp/.tmpwIiX51" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "branch" "-d" "previous-pr"
Running cd "/tmp/.tmpwIiX51" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "rev-parse" "HEAD"
Running cd "/tmp/.tmpwIiX51" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "rev-parse" "--abbrev-ref" "HEAD"
Running cd "/tmp/.tmpwIiX51" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "checkout" "-b" "pr"
Running cd "/tmp/.tmpwIiX51" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "add" "."
Running cd "/tmp/.tmpwIiX51" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "commit" "-m" "commit message"
Running cd "/tmp/.tmpwIiX51" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "rev-parse" "HEAD"
Running cd "/tmp/.tmpwIiX51" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "switch" "main"
Running cd "/tmp/.tmpwIiX51" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "merge" "--no-commit" "--no-ff" "pr"
Running cd "/tmp/.tmpwIiX51" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "rev-parse" "--abbrev-ref" "HEAD"
Running cd "/tmp/.tmpwIiX51" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "commit" "-m" "Merge of pr into main" "--author" "Tester <[email protected]>"
Running cd "/tmp/.tmpwIiX51" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "branch" "-d" "pr"
Running cd "/tmp/.tmpwIiX51" && GIT_CONFIG_GLOBAL="/tmp/nonexistent" GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/nonexistent" "git" "rev-parse" "HEAD"
No upstream commit found

thread 'core::builder::tests::ci_rustc_if_unchanged_do_not_invalidate_on_tool_changes' panicked at src/bootstrap/src/core/builder/tests.rs:292:9:
assertion `left == right` failed
  left: None
 right: Some("0efdd41e85badec757d0f19550cb42e4df6152b1")


failures:
    core::builder::tests::ci_rustc_if_unchanged_do_not_invalidate_on_library_changes_outside_ci
    core::builder::tests::ci_rustc_if_unchanged_do_not_invalidate_on_tool_changes

test result: FAILED. 2 passed; 2 failed; 0 ignored; 0 measured; 116 filtered out; finished in 1.10s

error: test failed, to rerun pass `--lib`

I'm preparing a PR fixing the issue.

@japaric japaric added C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels May 5, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label May 5, 2025
@japaric japaric changed the title Tests fail when git_merge_commit_email contains square brackets Bootstrap tests fail when git_merge_commit_email in src/stage0 contains square brackets May 5, 2025
japaric added a commit to ferrocene/ferrocene that referenced this issue May 5, 2025
The `git` API shells out to `git rev-list` and was directly passing an
email string to the command's `--author` flag. That flag interprets its
arguments as a regular expression, meaning that characters like square
brackets (`[]`) in the email string made the command fail to find a
commit matching the author e-mail

This commit escapes the email string prior to passing it to `git
rev-list`.

The change is tested in the `bootstrap` crate because it contains the
testing infrastructure to create temporary git repositories.

fixes rust-lang/rust#140669
japaric added a commit to ferrocene/rust that referenced this issue May 5, 2025
The `git` API shells out to `git rev-list` and was directly passing an
email string to the command's `--author` flag. That flag interprets its
arguments as a regular expression, meaning that characters like square
brackets (`[]`) in the email string made the command fail to find a
commit matching the author e-mail

This commit escapes the email string prior to passing it to `git
rev-list`.

The change is tested in the `bootstrap` crate because it contains the
testing infrastructure to create temporary git repositories.

fixes rust-lang#140669
@jieyouxu jieyouxu removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label May 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants