Skip to content

bootstrap config tests failing locally #140387

New issue

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

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

Already on GitHub? # to your account

Closed
jieyouxu opened this issue Apr 28, 2025 · 6 comments · Fixed by #140394
Closed

bootstrap config tests failing locally #140387

jieyouxu opened this issue Apr 28, 2025 · 6 comments · Fixed by #140394
Labels
A-bootstrap-config Area: bootstrap `config.toml` and the config system A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@jieyouxu
Copy link
Member

jieyouxu commented Apr 28, 2025

When I run the bootstrap tests locally I get the failure new failures. Could this PR be responsible?

running 119 tests
........................................................................
core::config::tests::test_local_changes_subtree_that_used_bors ... F

core::config::tests::test_local_committed_modifications ... F
..............  88/119
...............................

failures:

---- core::config::tests::test_local_changes_subtree_that_used_bors stdout ----
Running cd "/tmp/.tmpQ834nG" && "git" "init"
Running cd "/tmp/.tmpQ834nG" && "git" "config" "user.name" "Tester"
Running cd "/tmp/.tmpQ834nG" && "git" "config" "user.email" "tester@rust-lang.org"
Running cd "/tmp/.tmpQ834nG" && "git" "add" "."
Running cd "/tmp/.tmpQ834nG" && "git" "commit" "-m" "commit message"
Running cd "/tmp/.tmpQ834nG" && "git" "rev-parse" "HEAD"
Running cd "/tmp/.tmpQ834nG" && "git" "branch" "-m" "main"
Running cd "/tmp/.tmpQ834nG" && "git" "rev-parse" "--abbrev-ref" "HEAD"
Running cd "/tmp/.tmpQ834nG" && "git" "checkout" "-b" "previous-pr"
Running cd "/tmp/.tmpQ834nG" && "git" "add" "."
Running cd "/tmp/.tmpQ834nG" && "git" "commit" "-m" "commit message"
Running cd "/tmp/.tmpQ834nG" && "git" "rev-parse" "HEAD"
Running cd "/tmp/.tmpQ834nG" && "git" "switch" "main"
Running cd "/tmp/.tmpQ834nG" && "git" "merge" "--no-commit" "--no-ff" "previous-pr"
Running cd "/tmp/.tmpQ834nG" && "git" "rev-parse" "--abbrev-ref" "HEAD"
Running cd "/tmp/.tmpQ834nG" && "git" "commit" "-m" "Merge of previous-pr into main" "--author" "Merge bot <merge-bot@rust-lang.org>"
Running cd "/tmp/.tmpQ834nG" && "git" "branch" "-d" "previous-pr"
Running cd "/tmp/.tmpQ834nG" && "git" "rev-parse" "HEAD"
Running cd "/tmp/.tmpQ834nG" && "git" "switch" "--orphan" "subtree"
Running cd "/tmp/.tmpQ834nG" && "git" "add" "."
Running cd "/tmp/.tmpQ834nG" && "git" "commit" "-m" "commit message"
Running cd "/tmp/.tmpQ834nG" && "git" "rev-parse" "HEAD"
Running cd "/tmp/.tmpQ834nG" && "git" "rev-parse" "--abbrev-ref" "HEAD"
Running cd "/tmp/.tmpQ834nG" && "git" "checkout" "-b" "previous-pr"
Running cd "/tmp/.tmpQ834nG" && "git" "add" "."
Running cd "/tmp/.tmpQ834nG" && "git" "commit" "-m" "commit message"
Running cd "/tmp/.tmpQ834nG" && "git" "rev-parse" "HEAD"
Running cd "/tmp/.tmpQ834nG" && "git" "switch" "subtree"
Running cd "/tmp/.tmpQ834nG" && "git" "merge" "--no-commit" "--no-ff" "previous-pr"
Running cd "/tmp/.tmpQ834nG" && "git" "rev-parse" "--abbrev-ref" "HEAD"
Running cd "/tmp/.tmpQ834nG" && "git" "commit" "-m" "Merge of previous-pr into subtree" "--author" "Merge bot <merge-bot@rust-lang.org>"
Running cd "/tmp/.tmpQ834nG" && "git" "branch" "-d" "previous-pr"
Running cd "/tmp/.tmpQ834nG" && "git" "rev-parse" "HEAD"
Running cd "/tmp/.tmpQ834nG" && "git" "commit" "--amend" "--date" "Wed Feb 16 14:00 2011 +0100" "--no-edit"
Running cd "/tmp/.tmpQ834nG" && "git" "switch" "main"
Running cd "/tmp/.tmpQ834nG" && "git" "merge" "subtree" "--allow-unrelated"
Running cd "/tmp/.tmpQ834nG" && "git" "rev-parse" "--abbrev-ref" "HEAD"
Running cd "/tmp/.tmpQ834nG" && "git" "checkout" "-b" "previous-pr"
Running cd "/tmp/.tmpQ834nG" && "git" "add" "."
Running cd "/tmp/.tmpQ834nG" && "git" "commit" "-m" "commit message"

thread 'core::config::tests::test_local_changes_subtree_that_used_bors' panicked at src/bootstrap/src/utils/tests/git.rs:125:13:
Git command `cd "/tmp/.tmpQ834nG" && "git" "commit" "-m" "commit message"` failed
Stdout
On branch previous-pr
nothing to commit, working tree clean
Stderr


---- core::config::tests::test_local_committed_modifications stdout ----
Running cd "/tmp/.tmpHfIPXx" && "git" "init"
Running cd "/tmp/.tmpHfIPXx" && "git" "config" "user.name" "Tester"
Running cd "/tmp/.tmpHfIPXx" && "git" "config" "user.email" "tester@rust-lang.org"
Running cd "/tmp/.tmpHfIPXx" && "git" "add" "."
Running cd "/tmp/.tmpHfIPXx" && "git" "commit" "-m" "commit message"
Running cd "/tmp/.tmpHfIPXx" && "git" "rev-parse" "HEAD"
Running cd "/tmp/.tmpHfIPXx" && "git" "branch" "-m" "main"
Running cd "/tmp/.tmpHfIPXx" && "git" "rev-parse" "--abbrev-ref" "HEAD"
Running cd "/tmp/.tmpHfIPXx" && "git" "checkout" "-b" "previous-pr"
Running cd "/tmp/.tmpHfIPXx" && "git" "add" "."
Running cd "/tmp/.tmpHfIPXx" && "git" "commit" "-m" "commit message"
Running cd "/tmp/.tmpHfIPXx" && "git" "rev-parse" "HEAD"
Running cd "/tmp/.tmpHfIPXx" && "git" "switch" "main"
Running cd "/tmp/.tmpHfIPXx" && "git" "merge" "--no-commit" "--no-ff" "previous-pr"
Running cd "/tmp/.tmpHfIPXx" && "git" "rev-parse" "--abbrev-ref" "HEAD"
Running cd "/tmp/.tmpHfIPXx" && "git" "commit" "-m" "Merge of previous-pr into main" "--author" "Merge bot <merge-bot@rust-lang.org>"
Running cd "/tmp/.tmpHfIPXx" && "git" "branch" "-d" "previous-pr"
Running cd "/tmp/.tmpHfIPXx" && "git" "rev-parse" "HEAD"
Running cd "/tmp/.tmpHfIPXx" && "git" "rev-parse" "--abbrev-ref" "HEAD"
Running cd "/tmp/.tmpHfIPXx" && "git" "checkout" "-b" "previous-pr"
Running cd "/tmp/.tmpHfIPXx" && "git" "add" "."
Running cd "/tmp/.tmpHfIPXx" && "git" "commit" "-m" "commit message"
Running cd "/tmp/.tmpHfIPXx" && "git" "rev-parse" "HEAD"
Running cd "/tmp/.tmpHfIPXx" && "git" "switch" "main"
Running cd "/tmp/.tmpHfIPXx" && "git" "merge" "--no-commit" "--no-ff" "previous-pr"
Running cd "/tmp/.tmpHfIPXx" && "git" "rev-parse" "--abbrev-ref" "HEAD"
Running cd "/tmp/.tmpHfIPXx" && "git" "commit" "-m" "Merge of previous-pr into main" "--author" "Merge bot <merge-bot@rust-lang.org>"
Running cd "/tmp/.tmpHfIPXx" && "git" "branch" "-d" "previous-pr"
Running cd "/tmp/.tmpHfIPXx" && "git" "rev-parse" "HEAD"
Running cd "/tmp/.tmpHfIPXx" && "git" "checkout" "-b" "feature"
Running cd "/tmp/.tmpHfIPXx" && "git" "add" "."
Running cd "/tmp/.tmpHfIPXx" && "git" "commit" "-m" "commit message"

thread 'core::config::tests::test_local_committed_modifications' panicked at src/bootstrap/src/utils/tests/git.rs:125:13:
Git command `cd "/tmp/.tmpHfIPXx" && "git" "commit" "-m" "commit message"` failed
Stdout
On branch feature
nothing to commit, working tree clean
Stderr



failures:
    core::config::tests::test_local_changes_subtree_that_used_bors
    core::config::tests::test_local_committed_modifications

Originally posted by @nnethercote in #138591 (comment)

UPD: still fails even if fully default git config is used

thread 'core::config::tests::test_local_committed_modifications' panicked at src/bootstrap/src/utils/tests/git.rs:125:13:
Git command `cd "/tmp/.tmpMwcVVE" && GIT_CONFIG_NOSYSTEM="1" GIT_CONFIG_SYSTEM="/tmp/non-existent-config" "git" "commit" "-m" "commit message"` failed
Stdout
On branch feature
nothing to commit, working tree clean
Stderr
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Apr 28, 2025
@jieyouxu jieyouxu added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. S-needs-repro Status: This issue has no reproduction and needs a reproduction to make progress. A-bootstrap-config Area: bootstrap `config.toml` and the config system C-bug Category: This is a bug. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Apr 28, 2025
@jieyouxu
Copy link
Member Author

jieyouxu commented Apr 28, 2025

I tried the following on WSL Ubuntu but can't repro:

  • Against latest master, with committed modifications / fresh, git 2.49.0
  • Against latest master, with committed modifications / fresh, git 2.45.2

Also tried on native MSVC against latest master, fresh, git 2.46.2.windows.1, no repro either...

@jieyouxu
Copy link
Member Author

jieyouxu commented Apr 28, 2025

@nnethercote does it fail on a fresh branch against latest master (0134651)? Trying to narrow down env differences. Does it fail with a blank bootstrap config?

@nnethercote
Copy link
Contributor

@Kobzol and I worked it out: I have a line /x in my .gitignore, and this test creates a file with that name.

It would be nice to teach the test to ignore the user's .gitconfig/.gitignore, to prevent other problems like this from happening.

@jieyouxu jieyouxu added A-testsuite Area: The testsuite used to check the correctness of rustc T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) and removed S-needs-repro Status: This issue has no reproduction and needs a reproduction to make progress. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 28, 2025
ChrisDenton added a commit to ChrisDenton/rust that referenced this issue Apr 28, 2025
…jieyouxu

Make bootstrap git tests more self-contained

Based on https://stackoverflow.com/a/67512433/1107768.

Fixes: rust-lang#140387

r? `@jieyouxu`
@nnethercote
Copy link
Contributor

I googled for a bit and couldn't find a way to temporarily ignore a local .gitconfig file.

Probably a good thing here would be to make the filename longer to make accidental matches like this less likely.

@nnethercote
Copy link
Contributor

Oh, I overlooked #140394. That looks like a good solution :)

ChrisDenton added a commit to ChrisDenton/rust that referenced this issue Apr 28, 2025
…jieyouxu

Make bootstrap git tests more self-contained

Based on https://stackoverflow.com/a/67512433/1107768.

Fixes: rust-lang#140387

r? ``@jieyouxu``
@bors bors closed this as completed in ec2dad7 Apr 29, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Apr 29, 2025
Rollup merge of rust-lang#140394 - Kobzol:git-test-self-contained, r=jieyouxu

Make bootstrap git tests more self-contained

Based on https://stackoverflow.com/a/67512433/1107768.

Fixes: rust-lang#140387

r? ```@jieyouxu```
github-actions bot pushed a commit to rust-lang/miri that referenced this issue Apr 29, 2025
@tshepang
Copy link
Member

@nnethercote as a sidenote, you can use .git/info/exclude to add custom ignores

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-bootstrap-config Area: bootstrap `config.toml` and the config system A-testsuite Area: The testsuite used to check the correctness of rustc 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.

4 participants