Skip to content

setup.sh: keep the replaced-script handoff directly behind the dependency pass - #15747

Merged
danielhanchen merged 1 commit into
mainfrom
ci-setup-rerun-before-venv-flag
Oct 28, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
ci-setup-rerun-before-venv-flag

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

Shell installer tests fails on main, so every PR's staging CI run of that lane is red (e.g. #15725, a frontend-only change):

FAIL: the rerun check directly follows that dependency pass (expected '    _setup_rerun_if_replaced', got '    _SETUP_VENV_CHANGED=true')
Results: 31 passed, 1 failed
tests/sh/test_setup_rerun_after_replace.sh exited 1

#15646 (precompile bytecode after setup) added _SETUP_VENV_CHANGED=true between install_python_stack and _setup_rerun_if_replaced, and pinned that order in its own tests/python/test_installer_compile_bytecode.py. tests/sh/test_setup_rerun_after_replace.sh pins the opposite: the handoff to a replaced setup.sh must sit directly behind the dependency pass, so no line of the old copy runs after the update has swapped the file. The two tests now contradict each other on main.

Both intents can hold at once:

  • The flag is a plain local assignment that only feeds the precompile gate near the end of the script.
  • That gate already fires on UNSLOTH_SETUP_RERUN=1 too: if { [ "${_SETUP_VENV_CHANGED:-false}" = true ] || [ "${UNSLOTH_SETUP_RERUN:-}" = 1 ]; }.

So setting it after the handoff changes nothing:

  • No replacement: the flag is set before anything reads it.
  • Replacement: the exec'd new copy precompiles because of UNSLOTH_SETUP_RERUN (an unexported shell variable would not have survived the exec anyway).

Change

  • studio/setup.sh: _setup_rerun_if_replaced moves back directly behind install_python_stack. _SETUP_VENV_CHANGED=true follows it, still inside the dependency-pass branch, with a one-line comment on why the order is safe.
  • tests/python/test_installer_compile_bytecode.py: asserts the handoff is the line right after the dependency pass, and that the flag is set right behind it in the same branch. It keeps the existing checks on the gate and the UNSLOTH_SETUP_RERUN fallback.

Testing

  • tests/sh/test_setup_rerun_after_replace.sh: 31 passed, 1 failed on main; 32 passed with this change.
  • tests/python/test_installer_compile_bytecode.py: 30 passed, on both main and this change.
  • Every other test that pins this block passes: 12 shell suites and 4 studio pytest files, including test_setup_full_deps_override.sh, test_node_pin_update.sh, the CUDA / XPU / AMD fast-path escapes and test_ci_shell_suite_coverage.py.
  • bash -n studio/setup.sh is clean.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T11:29:18.248714Z 892ede5 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 892ede540d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit 4b71ee3 into main Oct 28, 2026
6 of 65 checks passed
@danielhanchen
danielhanchen deleted the ci-setup-rerun-before-venv-flag branch October 28, 2026 11:35
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.

1 participant