ci: Move macos snippet under DANGER_RUN_CI_ON_HOST
What changed, and why it matters
This is a code cleanup change in Bitcoin Core's internal CI (continuous integration) tooling. It moves a macOS-specific setup step so it sits inside the branch that already handles running tests directly on the host machine. There is no change to Bitcoin's network code, wallet, consensus rules, or anything users interact with. It only affects how the project's own automated tests are organized.
No security action required. Treat as ordinary repository maintenance.
Security signals we found
No security-relevant code change: CI-only refactor with identical runtime behavior
No change to cryptographic, consensus, networking, or wallet code
No change to privilege boundaries or input handling
No vendor security disclosure or advisory language present
Evidence from the diff
The commit is a move-only refactor in ci/test/02_run_container.py. The macOS-specific GNU getopt lookup (brew –prefix gnu-getopt and setting IN_GETOPT_BIN) is relocated from after the container-creation block into the DANGER_RUN_CI_ON_HOST branch. The behavior is unchanged: the snippet still runs only when CI_OS_NAME=macos, and it still executes before ./ci/test/02_run_container.sh. The commit message explicitly calls this a ‘move-only refactor’ and suggests –color-moved to verify.
Changed components
ci/test/02_run_container.pyInspect captured patch +8 / −9
diff --git a/ci/test/02_run_container.py b/ci/test/02_run_container.py
index 0865350d..377ccfa9 100755
--- a/ci/test/02_run_container.py
+++ b/ci/test/02_run_container.py
@@ -59,6 +59,14 @@ def main():
# Modify PATH to prepend the retry script, needed for CI_RETRY_EXE
os.environ["PATH"] = f"{os.environ['BASE_ROOT_DIR']}/ci/retry:{os.environ['PATH']}"
+ # GNU getopt is required for the CI_RETRY_EXE script
+ if os.getenv("CI_OS_NAME") == "macos":
+ prefix = run(
+ ["brew", "--prefix", "gnu-getopt"],
+ stdout=subprocess.PIPE,
+ text=True,
+ ).stdout.strip()
+ os.environ["IN_GETOPT_BIN"] = f"{prefix}/bin/getopt"
else:
CI_IMAGE_LABEL = "bitcoin-ci-test"
@@ -156,15 +164,6 @@ def main():
).stdout.strip()
os.environ["CI_CONTAINER_ID"] = container_id
- # GNU getopt is required for the CI_RETRY_EXE script
- if os.getenv("CI_OS_NAME") == "macos":
- prefix = run(
- ["brew", "--prefix", "gnu-getopt"],
- stdout=subprocess.PIPE,
- text=True,
- ).stdout.strip()
- os.environ["IN_GETOPT_BIN"] = f"{prefix}/bin/getopt"
-
run(["./ci/test/02_run_container.sh"]) # run the remainder
if not os.getenv("DANGER_RUN_CI_ON_HOST"):
print("Stop and remove CI container by ID")
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.