Skip to content

fix(nix): use correct version from Cargo.toml in flake build - #11770

Merged
etraut-openai merged 1 commit into
openai:mainfrom
rupurt:fix/nix-flake-version
Feb 13, 2026
Merged

etraut-openai merged 1 commit into
openai:mainfrom
rupurt:fix/nix-flake-version

Conversation

@rupurt

@rupurt rupurt commented Feb 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • When building via nix build, the binary reports codex-cli 0.0.0 because the workspace Cargo.toml uses 0.0.0 as a placeholder on main. This causes the update checker to always prompt users to upgrade even when running the latest code.
  • Reads the version from codex-rs/Cargo.toml at flake evaluation time using builtins.fromTOML and patches it into the workspace Cargo.toml before cargo builds via postPatch.
  • On release commits (e.g. tag rust-v0.101.0), the real version is used as-is. On main branch builds, falls back to 0.0.0-dev+<shortRev> (or 0.0.0-dev+dirty), which the update checker's parse_version ignores — suppressing the spurious upgrade prompt.
Scenario Cargo.toml version Nix version Binary reports Upgrade nag?
Release commit (e.g. rust-v0.101.0) 0.101.0 0.101.0 codex-cli 0.101.0 Only if newer exists
Main branch (committed) 0.0.0 0.0.0-dev+b934ffc codex-cli 0.0.0-dev+b934ffc No
Main branch (uncommitted) 0.0.0 0.0.0-dev+dirty codex-cli 0.0.0-dev+dirty No

Test plan

  • nix build from main branch and verify codex --version reports 0.0.0-dev+<shortRev> instead of 0.0.0
  • Verify the update checker does not show a spurious upgrade prompt for dev builds
  • Confirm that on a release commit where Cargo.toml has a real version, the binary reports that version correctly

@github-actions

github-actions Bot commented Feb 13, 2026 •

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@rupurt

rupurt commented Feb 13, 2026

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@rupurt
rupurt force-pushed the fix/nix-flake-version branch from d409696 to 1038584 Compare February 13, 2026 19:32
When building via `nix build`, the binary reported `codex-cli 0.0.0`
because the workspace Cargo.toml uses `0.0.0` as a placeholder on
main. This caused the update checker to always prompt users to upgrade.

Read the version from `codex-rs/Cargo.toml` at flake evaluation time
and patch it into the workspace before cargo builds:

- Release commits (e.g. `rust-v0.101.0`): uses the real version as-is
- Main branch builds: falls back to `0.0.0-dev+<shortRev>` which the
  update checker ignores, suppressing the spurious upgrade prompt
@rupurt
rupurt force-pushed the fix/nix-flake-version branch from 1038584 to b02aa0c Compare February 13, 2026 19:32
github-actions Bot added a commit that referenced this pull request Feb 13, 2026
@etraut-openai

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. You're on a roll.

ℹ️ 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".

@etraut-openai
etraut-openai merged commit a4bb598 into openai:main Feb 13, 2026
47 of 55 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 13, 2026
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.

2 participants