nickel-lang / organist

Control all your tooling from a single console
MIT License
421 stars 21 forks source link

Autogenerate nickel.lock.ncl #118

Closed YorikSar closed 1 year ago

YorikSar commented 1 year ago

Re-generate expected contents of nickel.lock.ncl on every importNcl call, check if it matches one in the sources and generate a new source tree with new nickel.lock.ncl if it doesn't. Note that expected lockfile contents depend only on flake parameters. Also note that when lockfile contents don't match the expected value, we'll make a full copy of the source tree during evalutaion of Nickel file.

Fixes #105 Fixes #116

thufschmitt commented 1 year ago

This has quite a performance impact (from ~9s to open a fresh shell to ~17s in the happy path and 22s in the unhappy one).

I suspect this is due to us now doing two ifds instead of one. Do you think that putting the lockfile generation in the same derivation as the Nickel evaluation could speed things up?

YorikSar commented 1 year ago

@thufschmitt Now we generate and compare lockfile contents in Nix and don't use additional IFD for that. Note that lockfile contents currently contain an additional newline in the end. I'll fix it a bit later.