Skip to content

nix develop-based fast path in CI - #230

Draft
katrinafyi wants to merge 23 commits into
mainfrom
nix-thingy2
Draft

nix develop-based fast path in CI#230
katrinafyi wants to merge 23 commits into
mainfrom
nix-thingy2

Conversation

@katrinafyi

@katrinafyi katrinafyi commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

i am back on the nix opam shell grind. i want it to give a fast path for ci which is less maintenance steps and less flaky than the docker image. it should still support falling back to opam install in case the nix shell is missing some packages, so that a failing nix build doesn't block CI.

i'm abandoning my approach from last week, because that approach was using opam install --fake which is "dangerous and likely to break your opam environment". the goal of that was to somehow "teach" opam about the nixpkgs ocaml packages so opam will only install the missing ones, but i think this would be very fragile and didn't get to a proof of concept stage.

instead, i think it can be something much simpler. you just use all nixpkgs ocaml packages and if that fails, then use all opam packages. it's a lot slower in the fallback case, but hopefully that should be rare enough that it doesn't matter.

future work (beyond today), will look at caching the nixpkgs packages in github actions

  • port other jobs too
  • gate thingy behind all nix jobs succeeding

katrinafyi and others added 14 commits August 4, 2026 16:44
having separate `out` and `dev` seems to cause problems.......
and `nix` unconditionally, just to make sure that they work. it would
have to look something like:
- `nix build`
- `opam exec dune`
- `nix develop --command dune build`

i guess that `opam exec dune` should be the only one that is blocking?
but then the other ones are only useful to get fast negative feedback
earlier? and the automerge is still stuck behind the slow one.

maybe only run `opam exec` in main?
ocaml5.4.1-sherlodoc> File "sherlodoc/test/dune", lines 1-12, characters 0-227:
ocaml5.4.1-sherlodoc>  1 | (rule
ocaml5.4.1-sherlodoc>  2 |  (target
ocaml5.4.1-sherlodoc>  3 |   (dir docs))
ocaml5.4.1-sherlodoc> ....
ocaml5.4.1-sherlodoc> 10 |    (run mkdir -p docs)
ocaml5.4.1-sherlodoc> 11 |    (run odig odoc --cache-dir=docs --no-pkg-deps  tyxml)
ocaml5.4.1-sherlodoc> 12 |    (run rm docs/html/tyxml/_doc-dir))))
ocaml5.4.1-sherlodoc> (cd _build/default/sherlodoc/test && /nix/store/frk7ipp0rf5ja0c9bs011k8269jm46h4-ocaml5.4.1-odig-0.1.0/bin/odig odoc --cache-dir=docs --no-pkg-deps tyxml)
ocaml5.4.1-sherlodoc> odig: Error: Unknown package tyxml.
ocaml5.4.1-sherlodoc> (cd _build/default/sherlodoc/query/test && ./test.exe)
ocaml5.4.1-sherlodoc> Testing `Query'.

thingy
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