Skip to content

Conversation

@bolinfest
Copy link
Collaborator

@bolinfest bolinfest commented May 7, 2025

This PR introduces an optional build flag, --native, that will build a version of the Codex npm module that:

  • Includes both the Node.js and native Rust versions (for Mac and Linux)
  • Will run the native version if CODEX_RUST=1 is set
  • Runs the TypeScript version otherwise

Note this PR also updates the workflow URL to https://github.com/openai/codex/actions/runs/14872557396, as that is a build from today that includes everything up through #843.

Test Plan:

In ~/code/codex/codex-cli, I ran:

pnpm stage-release --native

The end of the output was:

Staged version 0.1.2505121317 for release in /var/folders/wm/f209bc1n2bd_r0jncn9s6j_00000gp/T/tmp.xd2p5ETYGN
Test Node:
    node /var/folders/wm/f209bc1n2bd_r0jncn9s6j_00000gp/T/tmp.xd2p5ETYGN/bin/codex.js --help
Test Rust:
    CODEX_RUST=1 node /var/folders/wm/f209bc1n2bd_r0jncn9s6j_00000gp/T/tmp.xd2p5ETYGN/bin/codex.js --help
Next:  cd "/var/folders/wm/f209bc1n2bd_r0jncn9s6j_00000gp/T/tmp.xd2p5ETYGN" && npm publish --tag native

I verified that running each of these commands ran the expected version of Codex.

While here, I also added bin to the files list in package.json, which should have been done as part of #757, as that added new entries to bin that were matched by .gitignore but should have been included in a release.

@bolinfest bolinfest force-pushed the pr844 branch 2 times, most recently from 1db64b9 to f11b4bc Compare May 7, 2025 01:57
@bolinfest bolinfest marked this pull request as ready for review May 7, 2025 01:59
@bolinfest bolinfest requested a review from fouad-openai May 7, 2025 01:59
fi

# Print final hint for convenience
echo "Next: cd \"$TMPDIR\" && npm publish"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@fouad-openai do you want this to print something else if --native was passed to indicate publishing to a different tag?

Copy link
Collaborator

Choose a reason for hiding this comment

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

yeah maybe we should include a --tag for npm publish like --tag native or thinking something else?

@bolinfest bolinfest force-pushed the pr844 branch 4 times, most recently from c428265 to e656347 Compare May 12, 2025 20:32
@bolinfest bolinfest merged commit 73fe138 into main May 12, 2025
4 checks passed
@bolinfest bolinfest deleted the pr844 branch May 12, 2025 20:38
@github-actions github-actions bot locked and limited conversation to collaborators May 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants