Skip to content

Avoid upgrading installed Git during Linux CI setup - #337

Open
dajiaohuang wants to merge 2 commits into
Dobiasd:masterfrom
dajiaohuang:fix/ci-keep-installed-git-20261021
Open

dajiaohuang wants to merge 2 commits into
Dobiasd:masterfrom
dajiaohuang:fix/ci-keep-installed-git-20261021

Conversation

@dajiaohuang

Copy link
Copy Markdown

Linux CI setup only needs Git to be available, but apt-get install -y git also upgrades an already installed copy. In the captured GCC 9 failure on PR #336, Git 2.30.2 was already working, apt-get update fetched its indexes successfully, and setup then attempted an unnecessary upgrade whose bullseye-security package URL returned 404. Build and Test never ran. Exact evidence: job 117076513097, run attempt 2, head b239483.

Add --no-upgrade to the install command. Existing Git is retained, while missing Git is still installed. This behavior is supported by the Debian bullseye APT manual. The index update and compiler matrix are unchanged; this does not repair a repository outage when Git actually needs installing.

Validation: two new integration tests run the actual setup script through real APT 2.8.3 on Linux, using a task-local file repository, package status, configuration, cache and download-only mode. Original canonical-LF script fails when a newer Git artifact is absent; missing-Git control downloads a valid synthetic package. The changed script passes both cases, and fixture status remains unchanged (no package installation). bash -n and git diff --check pass. Run with python3 -m unittest discover -s script -p test_ci_setup_linux.py -v.

A preliminary Windows checkout CRLF run failed before meaningful APT assertions; the baseline was repeated using the byte-verified canonical Git blob. gh run view --job ... --log-failed also returned a later attempt's log, so the evidence above was reconciled through the exact job metadata/log endpoints instead. No Docker/compiler image, production package mirror, full C++ suite/matrix, hosted CI rerun, or successful #336 CI acceptance is claimed. This is an independent CI repair against master, leaving #336's docs branch unchanged.

@Dobiasd

Dobiasd commented Oct 21, 2026

Copy link
Copy Markdown
Owner

Thank you very much!

Do you think the fix itself could be enough and we can drop the new integration test file?

@dajiaohuang

dajiaohuang commented Oct 21, 2026 •

Copy link
Copy Markdown
Author

Yes—the one-line apt-get install -y --no-upgrade git change is the essential fix. I removed the standalone integration-test file in commit 8ea2977 to keep this PR focused: the current workflow does not invoke it (script/ci.sh run_tests runs the C++ CTest suite), so it would not provide automatic regression coverage. The isolated APT test had validated both installed-Git and missing-Git behavior before removal; no new tests were run for this deletion.

@Dobiasd

Dobiasd commented Oct 21, 2026

Copy link
Copy Markdown
Owner

Perfect, thanks! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants