-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make the file generation more transparent #203
Conversation
6395b35
to
f19f09d
Compare
enrichedFlakeInputs = | ||
flakeInputs | ||
// { | ||
"%%organist_internal".nickelLock = builtins.toFile "nickel.lock.ncl" (buildLockFileContents lockFileContents); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be nice to add a little comment explaining why we need to do that, for future you, me and others
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. Fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has the doc been lost in a force push?I can't see it still
run-test.sh
Outdated
@@ -120,7 +119,7 @@ test_example () ( | |||
cp -r "$examplePath" ./example | |||
pushd ./example | |||
prepare_shell | |||
nix run .\#regenerate-files --print-build-logs | |||
# nix run .\#regenerate-files --print-build-logs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this line still there on purpose or should it just be scraped entirely?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, that's purely accidental. Removed it
f19f09d
to
50e4fa2
Compare
It turns out that this blows-up the Nickel evaluation time (~x30 according to my benchmarks). I'll have to investigate why before we can merge this |
x30 for such a change is really suspicious... |
tweag/nickel#1930 seems to be the culprit (possibly also the real culprit for tweag/nickel#1630) |
50e4fa2
to
8aea267
Compare
Rebased on top of #205 . Somehow, this sidesteps the performance issue 🥳 |
8aea267
to
7ebc9b6
Compare
090c89b
to
09a9f68
Compare
7ebc9b6
to
e444d37
Compare
26beeda
to
43dd787
Compare
09a9f68
to
8d6e1bb
Compare
43dd787
to
a32698b
Compare
else | ||
chmod +w sources | ||
fi | ||
cp $expectedLockfileContentsPath sources/nickel.lock.ncl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cp $expectedLockfileContentsPath sources/nickel.lock.ncl | |
cp "$expectedLockfileContentsPath" sources/nickel.lock.ncl |
enrichedFlakeInputs = | ||
flakeInputs | ||
// { | ||
"%%organist_internal".nickelLock = builtins.toFile "nickel.lock.ncl" (buildLockFileContents lockFileContents); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has the doc been lost in a force push?I can't see it still
Removes the need from running `regenerate-files` manually
This is in particular useful when the source file is generated with Nix. Use for instance with: ```nickel { files."foo".file = nix.import_nix "nixpkgs#foo", } ```
3cac2d2
to
d9198a4
Compare
Avoids the need for an explicit `nix run .#regenerate-lockfile`
d9198a4
to
2520576
Compare
Ensure that autocompletion works fine for simple things
Ooops Co-authored-by: Yann Hamdaoui <[email protected]>
Got bitten by tweag/topiary#654 once again Co-authored-by: Yann Hamdaoui <[email protected]>
2520576
to
436e249
Compare
Regenerate the files (defined in
files.*
) automatically when entering the shell (if needed).Also unify that mechanism with the one used to generate the lockfile so that everything is generated at once.
The lockfile generation is slightly hacky because there's no easy way to pass its content from Nix to Nickel. But that'll have to do the job.