-
Notifications
You must be signed in to change notification settings - Fork 17
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
snapshot creates a minimal registry.dat from elm.json without network access #54
Conversation
Rather than reading the package list from the internet, this running mode just takes elm.json as correct and writes only those packages to registry.dat. This produces a much smaller file which is more amenable for being included in distributions, and more importantly can run inside network sandboxes, since it just needs the elm.json file.
3dd6a55
to
802f2e9
Compare
I also didn't update the readme in this PR; again I'll do that once I know if these changes will be accepted :) |
I'd just make this behavior by default and build it when we need it that's great! |
Do you want to keep the downloading behaviour as an option, or shall I just replace it with the new behaviour? |
Just the new one.
…On Sat, Sep 21, 2024, 23:43 Ben Millwood ***@***.***> wrote:
Do you want to keep the downloading behaviour as an option, or shall I
just replace it with the new behaviour?
—
Reply to this email directly, view it on GitHub
<#54 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAA63A6HJFPVIOPYU2QMQ5LZXXZBPAVCNFSM6AAAAABOT3ZGEGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNRVGM2DIOBYGE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
afc3100
to
9c488c2
Compare
The new one from parsing elm.json should be sufficient. Also, add the ability to customise the paths for elm.json and registry.dat. Inspired by me trying to test using `cabal run`, and not knowing how to do that outside the repo working directory (where my elm.json is).
9c488c2
to
b6685f2
Compare
e8f91e6
to
afc37b0
Compare
@bmillwood I'm fine bumping stack/cabal to GHC 9.6 and dropping support for older GHCs, I don't expect this to be used as a library. |
ah, I was about to ask :) well, it works now, so I won't do that here, but doing that would have the nice side-effect of no longer needing CPP at all |
I wrote that feature request assuming that the registry.dat file contains some metadata that elm.json doesn't have, but that turns out not to be true, so we don't even need to reach out to the package server at all: we can write registry.dat purely from elm.json. This code does that. We could probably simplify
fetchElmDeps
using this to just generate registry.dat at build time instead of taking it as an input, but I'll wait to see whether you have any opinions on this first.