Pin the development and CI toolchain with a Nix flake #428
Labels
No labels
bug
contract
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
iterative-works/iw-cli#428
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The tool versions for development and for CI come from two unrelated sources, and
neither is pinned in this repository.
CI.
.github/Dockerfile.cibuilds the image from.github/deps/, which isgitignored. To rebuild the image a person follows a manual procedure in
.github/ci-image.md:33-45that runsdocker cpto take binaries out of anothercontainer by hand. The Dockerfile does not declare most versions — it globs
jdk-*andnode-v20.*, so the real versions live only in a markdown table.The workflow pulls
iw-cli-ci:lateston a self-hosted runner, so the image canchange with no commit here.
Development. Each machine supplies its own tools. Nothing ties a developer's
JDK, scala-cli, mill, node or bats to the versions CI uses.
The two sets agree today by luck, not by construction. Tool drift is found only
when CI turns red.
Proposal
Declare the toolchain once in a Nix flake, commit
flake.lock, and derive boththe developer shell and CI from it.
Tools to cover: JDK 21, scala-cli, coursier, scalafix, mill 1.1.5, Node 20 with
corepack, bats 1.12.0, tmux, jq, rsync, python3, git, gh, glab, fj.
CI route — decide during analysis, not now
Two routes are open. Choose one when the issue is analysed.
dockerTools.buildLayeredImage. The image becomes a derived artifact and thehand-assembly step disappears.
nix develop --command ./iw ./test. A self-hosted runner keeps a warm store,so there is no image to build and none to push.
Known constraints
libraries and Yarn 4 still resolves the Node packages (and still needs
WEBAWESOME_NPM_TOKEN). The result is one declared toolset, not a reproduciblebuild. Tool drift is the problem that actually occurred, so this still hits the
target.
fjis unlikely to be in nixpkgs, and mill 1.1.5and the pinned scala-cli version may not match the nixpkgs versions. These need
fetchurlderivations or an overlay../iwis the entry point for every command. Without direnv each call becomesnix develop -c ./iw …. An.envrcwithuse flakesolves this, but then eachdeveloper must install direnv. Decide this with the CI route.
Origin
Found while triaging LESSONS.md for IW-422. A captured lesson claimed
batswasabsent from the machine and had to be run through
nix-shell -p bats. By triagetime the claim was already false —
bats1.12.0 was in the user profile. Thelesson was deleted, because the real problem is not a missing binary but an
unpinned toolchain.