Skip to content

ci: run language tools from the flake dev shell - #19

Merged
furedea merged 3 commits into
mainfrom
ci/23-dev-shell
Nov 9, 2026
Merged

furedea merged 3 commits into
mainfrom
ci/23-dev-shell

Conversation

@furedea-agent

@furedea-agent furedea-agent Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

概要

CI の Python ツール(uv,ruff,ty,pytest,deptry,vulture)を,flake の devShell から動かす形にする.setup-uv をやめ,Nix の準備は reusable-workflows の composite action nix-setup(v1.3.0)に任せる.手元と CI で同じ版になり,flake.lock で中身が固定される.

変更

ファイル 内容
flake.nix devShell を aarch64-darwin と x86_64-linux の両方で出す
nix/uv.nix system ごとに公式バイナリを選ぶ(Linux は musl 版 uv 0.13.5,ハッシュは GitHub の release digest)
.github/workflows/ci.yml setup-uv を nix-setup に置き換え,defaults.run.shell を nix develop --command bash -eo pipefail {0} にする
  • job 名と all-green の needs は変えていない.
  • all-green は Nix を入れない job なので,step に shell: bash を明示した.
  • nixpkgs の python314(3.14.7)と uv(0.11.21)は CA 証明書の件で必要な版(3.14.9,0.13.5)に届かないため,nix/python.nix と uv.nix の上書きは残した.

CI の時間

変更前は main の直近 run(42501897285),変更後はこの PR の run(42621079854,キャッシュなし)の値.

job 変更前 変更後(cold)
lint 6 秒 4 分 49 秒
typecheck 9 秒 6 分 8 秒
test 8 秒 4 分 33 秒
audit 7 秒 6 分 30 秒
全体 約 43 秒 約 6 分 30 秒 以上
  • 遅くなった原因は,Linux の CI で nix/python.nix の CPython 3.14.9 をソースからビルドしているため.nixpkgs(26.05 と unstable のロック版)は 3.14.7 までで,binary cache に 3.14.9 がない.
  • nix-setup は Nix store を push 時だけ保存するので,PR の run は常にキャッシュなし.main に入った後の run で store が復元されるはずだが,その時間は merge 前には測れない.
  • 判断が必要:このまま merge してキャッシュで手当てするか,binary cache を用意するか,nixpkgs が 3.14.9 を出すまで Linux だけ setup-uv を残すか.

Refs furedea/reusable-workflows#23

🤖 Generated with Claude Code

furedea and others added 3 commits November 9, 2026 21:39
Refs furedea/reusable-workflows#23

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Replace setup-uv with the nix-setup composite action and run every step in nix develop.

The nix-setup SHA is a placeholder until the release exists.

Refs furedea/reusable-workflows#23

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Refs furedea/reusable-workflows#23

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@furedea

furedea commented Nov 9, 2026

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T12:59:21.490167Z dd4ee4a Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Comment thread flake.nix
statix
])
++ [
(pkgs.callPackage ./nix/python.nix { })

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1: CPython 3.14.9 will be compiled from source on every Linux CI job

nix/python.nix replaces python314's src and postPatch, which gives it a new derivation hash. cache.nixos.org can't have a prebuilt copy, so the first nix develop in each of lint, typecheck, test and audit compiles CPython from source. On x86_64-linux nixpkgs also turns on LTO by default, which makes the build slower. On a standard ubuntu-latest runner that build can take close to or more than the jobs' timeout-minutes: 10, and the four jobs each do it separately.

Before this PR the overlay was only evaluated on aarch64-darwin, where a developer builds it once. This PR is the first time CI builds it.

Unless nix-setup@v1.3.0 restores a /nix/store cache (or a binary cache) that already holds this exact derivation, expect these jobs to time out on a cold cache. The PR body's "変更後" CI time is still blank, so this hasn't been measured yet. Possible fixes:

  • Push the derivation to a binary cache (Cachix, magic-nix-cache, etc.).
  • Raise the timeouts.
  • Keep setup-uv on Linux until nixpkgs ships Python 3.14.9 or later.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Measured on this PR (run 42621079854, cold cache): the four jobs compiled CPython 3.14.9 and still finished inside the 10 minute limit: test 4m33s, lint 4m49s, typecheck 6m08s, audit 6m30s. So the timeout risk did not materialize, but the cold-cache cost is real (main used to take about 43s in total). nix-setup v1.3.0 restores the Nix store cache keyed on flake.nix and flake.lock and saves it only on push to main, so a pull request run is always cold until the first main run seeds it. I cannot show the warm number before merge. Neither nixpkgs 26.05 (python314 3.14.7) nor the locked nixpkgs-unstable (3.14.7) ships 3.14.9, and dropping the override would bring back the compromised emSign root, so a binary cache or keeping setup-uv on Linux is a decision for the owner.

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown

Review summary

1 blocking finding (P1)

  • P1 flake.nix:35: the Python 3.14.9 override in nix/python.nix has no binary in cache.nixos.org. So nix develop in each of the four Linux tool jobs (lint, typecheck, test, audit) compiles CPython from source, with LTO on. On a cold cache that can run past timeout-minutes: 10. I couldn't check whether nix-setup@v1.3.0 restores a store or binary cache that would avoid this. The CI-time table in the PR body still needs the after-change numbers to settle it.

Checked, no issues found

  • The per-system uv.nix asset selection matches the systems the flake exposes. Both systems are listed in meta.platforms, and the musl build is a sensible choice for Linux.
  • all-green correctly sets shell: bash on its own step, because that job doesn't install Nix.
  • UV_PYTHON_PREFERENCE=only-system plus the dev-shell Python keeps the interpreter version that setup-uv used to pin.

🤖 Generated with Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: dd4ee4a25a

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

@furedea
furedea merged commit a42257d into main Nov 9, 2026
16 of 18 checks passed
@furedea
furedea deleted the ci/23-dev-shell branch November 9, 2026 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant