[codex] Copy user Bazel settings into Codex worktrees#25925
Merged
Conversation
9abebe0 to
0bb909b
Compare
0bb909b to
bee40eb
Compare
bolinfest
approved these changes
Jun 3, 2026
bolinfest
left a comment
Collaborator
There was a problem hiding this comment.
If the user runs this in some other context, should it not copy if the target already exists so it doesn't overwrite it?
bee40eb to
48b202e
Compare
Collaborator
Author
Yes, made that change. Also converted the script to Python re: slack thread. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Codex-created linked worktrees do not include ignored files from the main worktree. Bazel users who keep local overrides in
user.bazelrctherefore lose those settings in every new worktree.The setup must also work on Windows and must not overwrite a file that already exists in the worktree.
What changed
The checked-in Codex environment now invokes
.codex/environments/setup.py. The script resolves the main worktree and current worktree, then usescopy_from_main_worktree_to_worktree(repo_relative_path)to copy ignored files into new worktrees without overwriting existing destinations.main()currently copiesuser.bazelrc. Additional repository-relative paths can be added as further calls to the same helper.Validation
user.bazelrc.