Repository navigation
ci: run language tools from the flake dev shell - #112
Conversation
…hell CI will run every language tool from the flake dev shell, so Node.js 22 (same 22.23.3 that setup-node pinned) joins the default shell, and a separate agent-harness-build shell provides cargo and rustc for building the locked agent-harness where its flake has no package. Refs furedea/reusable-workflows#23 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Replace setup-uv, setup-node, setup-rust-toolchain, install-nix-action and cache-nix-action with the nix-setup composite action (v1.3.0), and run every tool step through `nix develop`. The jobs that must not run in the dev shell (bootstrap, nix-build, all-green) keep plain bash. Job names and the all-green needs are unchanged. Refs furedea/reusable-workflows#23 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
| @@ -20,20 +20,14 @@ runs: | |||
| path: ${{ runner.temp }}/agent-harness/bin/agent-harness | |||
| key: agent-harness-v1-${{ runner.os }}-${{ runner.arch }}-${{ steps.agent_harness.outputs.revision }} | |||
There was a problem hiding this comment.
P1 — The cached binary now depends on the Nix store, but the cache key still only uses the agent-harness revision.
Before this change, cargo install used the rustup toolchain and the system linker, so the binary linked against /lib64/ld-linux-x86-64.so.2. Now it builds inside nix develop .#agent-harness-build, and Nix's cc-wrapper sets the ELF interpreter and RPATH to a specific /nix/store/...-glibc-* path. Nothing outside the binary records that dependency.
How it breaks:
- Someone bumps
nixpkgsinflake.lockbut notagent-harness(agent-harnessfollows ournixpkgs, sonix flake update nixpkgsdoes exactly this). - The key
agent-harness-v1-<os>-<arch>-<rev>still matches, so the old binary is restored. - The restored Nix store holds the closure for the new nixpkgs, and the old glibc path is missing (or was garbage-collected before the save).
agent-harnessfails withNo such file or directory(missing interpreter) intest,renderandexecpolicy.
The same thing happens if the Nix store cache misses or is evicted while the binary cache still hits.
Also, the v1 entries already in the cache hold rustup-built binaries, so this PR's own CI run will likely hit them and never exercise the new Nix build. The rustc 1.95 build the description says CI will confirm may never actually run.
Suggested fix: bump the key (e.g. v2) and include the nixpkgs lock, e.g. hashFiles('flake.lock') or the nixpkgs locked rev. Another option is to build a static or system-linked binary.
There was a problem hiding this comment.
Fixed in c0f4b1c: the cache key is now agent-harness-v2----. A nixpkgs bump changes the key, and the v1 entries (rustup-built binaries) are no longer hit, so this run builds with the Nix rustc.
Review summary1 blocking finding (P1)
Checked, no problem found
This PR only changes CI, so I did not flag missing tests. 🤖 Generated with Claude Code |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
The binary is now built in the Nix dev shell and links against a Nix store glibc, so a cache entry restored after a nixpkgs bump would not run. Bump the key to v2 and add the flake.lock hash. This also drops the entries of rustup-built binaries, so the Nix build is exercised. Refs furedea/reusable-workflows#23 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
| AGENT_HARNESS_REV: ${{ steps.agent_harness.outputs.revision }} | ||
| run: | | ||
| cargo install \ | ||
| nix develop .#agent-harness-build --command cargo install \ |
There was a problem hiding this comment.
P2: This switches the Rust toolchain from the pinned 1.98.1 to the nixpkgs rustc, which is 1.95.0 according to the PR description. Because cargo install --locked uses the exact locked dependency versions, it fails if any crate in agent-harness's Cargo.lock sets a rust-version above 1.95. A missing MSRV in agent-harness's own Cargo.toml doesn't rule this out. The build could also break later, when agent-harness or one of its locked dependencies moves to a newer Rust feature, while the nixpkgs input stays put. To keep the old guarantee, pin the toolchain, for example with fenix or rust-overlay at 1.98.1. Otherwise, check this path's CI run on a cache miss before merging.
There was a problem hiding this comment.
Not changing this. The v2 cache key missed, so the final run built agent-harness with the Nix rustc 1.95.0 and passed: the Install locked agent-harness step took 56 s in render (13:06:59 to 13:07:55; a cache hit takes about 1 s), and test, render and execpolicy all passed on that binary. That is the cache-miss check the comment asks for. Pinning 1.98.1 would need a new flake input (fenix or rust-overlay) for a toolchain the build does not need. If a locked crate later needs a newer Rust, the build fails visibly in CI and the toolchain follows nixpkgs.
| with: | ||
| version: "0.13.5" | ||
| python-version: "3.15.1" | ||
| save: false |
There was a problem hiding this comment.
P2: lint, typecheck and audit keep timeout-minutes: 10, but they now enter the default devShell. That shell includes the custom Python 3.15.1 from nix/python.nix, which is built from source and isn't in cache.nixos.org. Before, these jobs got a prebuilt Python from setup-uv. When the Nix store cache misses, or a flake.lock bump changes the Python derivation so the prefix-restored cache no longer contains it, each job compiles CPython (LTO on Linux) and then runs uv sync. That can exceed 10 minutes and fail. Consider raising these timeouts to match test/shell-lint (20).
There was a problem hiding this comment.
Fixed in e7d8543: lint, typecheck and audit now have timeout-minutes: 20, the same as test and shell-lint. The run on that commit passed (all-green).
Review summaryNo blocking findings (0 × P0/P1). Two P2 comments are posted inline:
Checked and found no problem:
I couldn't fetch the agent-harness |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
lint, typecheck and audit now enter the dev shell, whose Python 3.15.1 is built from source when the Nix store cache misses. Raise their timeout from 10 to 20 minutes, as test and shell-lint have. Refs furedea/reusable-workflows#23 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
|
Review summary (read-only) No P0–P3 findings. What I checked:
One limit: I couldn't read the pinned The Rust downgrade (1.98.1 → nixpkgs 1.95.0) is already discussed in the PR, and the CI run shows it builds. |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
## 概要 CPython 3.15.2 は,侵害された eMudhra 中間証明書を `ssl` モジュールの拒否リストに加えた最初の 3.15 系リリースです(3.15.1 は同梱の pip と certifi の更新のみ).nixpkgs は 3.15.0 のままなので,自前ビルドの `nix/python.nix` を 3.15.2 に上げます. ## 変更 - `nix/python.nix`: 3.15.2 に更新(`nix store prefetch-file` の SRI ハッシュ).TODO コメントを「nixpkgs が 3.15.2 以降を提供したら削除」に書き換え.mimetypes の postPatch は引き続き必要なので維持. - `pyproject.toml` / `uv.lock`: `requires-python` を `>= 3.15.2, < 3.16` に更新.`uv.lock` は `requires-python` の 1 行のみ変更(`pytest-mock==3.15.1` は無関係なので据え置き). - `scripts/bootstrap_server.sh`: Nix のないサーバー向けに,uv を 0.13.6(3.15.2 をインストールできる最初のリリース),`PYTHON_VERSION` を 3.15.2 に更新.uv の x86_64-unknown-linux-musl の SHA256 は,公開されている `.sha256` と実際にダウンロードした tarball の両方で一致を確認.Renovate の注釈は維持. - `tests/bootstrap_server.bats` / `tests/test-helper/setup.bash`: 上記の値に追従.偽 uv の既定バージョンも 0.13.6 に更新. - README / README_ja: 表記を 3.15.2 に更新. CI は #112 で devShell 経由になったため,`ci.yml` の変更は不要です. `nix/uv.nix` の uv 0.13.5 は devShell が Nix の Python を使うため,今回は対象外です. ## 検証 - `nix flake check`: 通過(3.15.2 のビルドと mimetypes の postPatch を含む) - `nix develop` 内:`python --version` は 3.15.2,`uv run python -c 'import sys; print(sys.executable)'` は worktree の `.venv/bin/python` - `uv run pytest`: 4466 passed,1 skipped,4 xfailed - `bats tests/bootstrap_server.bats`: 81 件すべて通過 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: furedea <[email protected]> Co-authored-by: Claude Sonnet 5.5 <[email protected]>
概要
CI で使う言語のツールを,flake の devShell から動かす形に統一する(furedea/reusable-workflows#23 のレーン 2).
setup-uv,setup-node,setup-rust-toolchain,install-nix-action,cache-nix-actionをやめ,reusable-workflows の composite actionnix-setup(v1.3.0)に置き換えた.defaults.run.shellをnix develop --command bash -eo pipefail {0}にした.bootstrap,nix-build,all-greenは devShell が要らないのでbashに戻した.nodejs_22(22.23.3,setup-nodeの pin と同じ)を追加した.install-agent-harnessは Rust の installer をやめ,devShellagent-harness-build(cargo,rustc)でcargo installする.キャッシュキーはv2にし,flake.lockのハッシュを加えた(バイナリが Nix の glibc に依存するため).lint,typecheck,auditのtimeout-minutesを 10 から 20 にした(キャッシュ未命中時に Python 3.15.1 をビルドするため).all-greenの needs は変えていない.x86_64-linuxの devShell は元からある.計画
agent-config 専用の Issue はなく,計画は furedea/reusable-workflows#23 のレーン表(レーン 2)に従う.
検証
nix flake check --all-systems --no-build --option allow-import-from-derivation falsenode --versionbats tests/bootstrap_server.batsshfmt,nixfmt --checkall-green,claude-review,codex-reviewともに成功CI の時間
変更前は main の直近成功 run(42614971850),変更後はこの PR の run(c0f4b1c は 42622498139,最終の e7d8543 は 42627453854).
test,render,execpolicyを除き,ほぼ同じだった.nix-checkである.全体の差(5 分 8 秒から 6 分 33 秒)は,ほぼnix-checkの変動(4 分 58 秒から 6 分 23 秒)と一致する.main の別の run(42613251996)も全体で 8 分 19 秒だった.レビューの指摘
v2にし,flake.lockのハッシュを加えたtest,render,execpolicy成功).返信済みlint,typecheck,auditの timeout が 10 分計画からの変更点
install-agent-harnessの Rust は,nixpkgs の rustc 1.95.0 になる(以前は 1.98.1 を pin).上のとおり CI のビルドで確認した.Refs furedea/reusable-workflows#23
🤖 Generated with Claude Code