Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion .github/workflows/rust-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,28 @@ jobs:
# Must run from inside the dest dir so 7z won't
# embed the directory path inside the zip.
if [[ "${{ matrix.runner }}" == windows* ]]; then
(cd "$dest" && 7z a "${base}.zip" "$base")
if [[ "$base" == "codex-${{ matrix.target }}.exe" ]]; then
# Bundle the sandbox helper binaries into the main codex zip so
# WinGet installs include the required helpers next to codex.exe.
# Fall back to the single-binary zip if the helpers are missing
# to avoid breaking releases.
Comment on lines +291 to +292
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't follow: are we talking about what happens on our CI builder machine? Shouldn't that be deterministic? I'm confused what "Fall back" situation we are designing for here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is me not wanting to break the release, and if it fails to find the binaries (like I'm constructing the filepaths wrong) falling back to what currently happens (each binary in its own zip file)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I plan to remove this once I'm sure this is working.

bundle_dir="$(mktemp -d)"
runner_src="$dest/codex-command-runner-${{ matrix.target }}.exe"
setup_src="$dest/codex-windows-sandbox-setup-${{ matrix.target }}.exe"
if [[ -f "$runner_src" && -f "$setup_src" ]]; then
cp "$dest/$base" "$bundle_dir/$base"
cp "$runner_src" "$bundle_dir/codex-command-runner.exe"
cp "$setup_src" "$bundle_dir/codex-windows-sandbox-setup.exe"
(cd "$bundle_dir" && 7z a "$dest/${base}.zip" .)
else
echo "warning: missing sandbox binaries; falling back to single-binary zip"
echo "warning: expected $runner_src and $setup_src"
(cd "$dest" && 7z a "${base}.zip" "$base")
Comment on lines +302 to +304
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why shouldn't this break the release build? Hasn't something gone horribly wrong if this is true?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mostly don't want to break the build while I am testing/iterating on this. Like making sure I don't have a typo or something. Once it's working, I would revert any fallbacks and then the build would break if something was missing

fi
rm -rf "$bundle_dir"
else
(cd "$dest" && 7z a "${base}.zip" "$base")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this step should just be run for "codex-windows-sandbox-setup-${{ matrix.target }}.exe", is that right?

If so, maybe we should make an elif for that right here and then a final else that raises an exception that $base does not match one of the expected patterns.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the bundling part of it should happen in the loop for "codex-${{ matrix.target }}.exe"
all other binaries should be as they are today, just the binary by itself in a zip file

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, it is both of these:

codex-windows-sandbox-setup-${{ matrix.target }}.exe
codex-windows-command-runner-${{ matrix.target }}.exe

Does each of these need to be in its own .zip? Do we encourage users to download these individually?

It feels like we should favor the big codex.zip now that it will include everything?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, both of those are being included in codex.zip with this change. That is what winget will use

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The existing build script for the npm package appears to rely on a .zst being available for both codex-windows-sandbox-setup and codex-command-runner:

def _archive_name_for_target(artifact_prefix: str, target: str) -> str:
if "windows" in target:
return f"{artifact_prefix}-{target}.exe.zst"
return f"{artifact_prefix}-{target}.zst"

so I guess we still need to publish both of these until we update that script.

fi
fi

# Also create .zst (existing behaviour) *and* remove the original
Expand Down
Loading