Generating fully resolved snapshots

9 views
Skip to first unread message

Alexander Bondarenko

unread,
Mar 31, 2020, 2:27:17 PM3/31/20
to haskell-stack
Hi!

Stack 2.1.3 had "freeze --snapshot" command that put all "completed" parts together with originals. The result then could be fed to "--resolver" option removing the need to download stuff or update pantry db.
This allows a read-only stack root which then can be shipped as a deb package.

With 2.3 removing the command one has to mess around lock files to assemble the said snapshot. Are there any alternatives? Maybe bring back snapshot generation as a standalone command?

Michael Snoyman

unread,
Apr 1, 2020, 4:55:44 AM4/1/20
to Alexander Bondarenko, haskell-stack
Thanks for raising this before the release :)

The functionality for adding complete package information to a snapshot file lives in the pantry package, not in Stack. I think I'd like to go in the direction of exposing this functionality via Pantry instead of Stack, since I don't want to add the complexity back into Stack. Also, the original reason for removing the freeze functionality was due to questions of how to handle now-deprecated hpack-only packages. I'd rather not get into that debate again, and leave that handling up to the caller.

I've put together a Gist demonstrating how to complete a snapshot layer:


It includes a `foo.yaml` custom snapshot file, and a `Main.hs` which uses that snapshot for running, and then generates a `bar.yaml` with the package and snapshot information completed. I could imagine adding an executable-maybe optional-to the pantry package to expose this functionality. What do you think?

--
You received this message because you are subscribed to the Google Groups "haskell-stack" group.
To unsubscribe from this group and stop receiving emails from it, send an email to haskell-stac...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/haskell-stack/dedd93bb-4488-4b8c-982b-b83776cfdd0e%40googlegroups.com.

Alexander Bondarenko

unread,
Apr 1, 2020, 12:10:43 PM4/1/20
to haskell-stack
Thanks! This would be most helpful.
To unsubscribe from this group and stop receiving emails from it, send an email to haskel...@googlegroups.com.

IC Rainbow

unread,
Apr 2, 2020, 12:34:25 PM4/2/20
to haskell-stack
Now, having integrated snapshot resolver into my build I think making
it a standalone executable would be much better.
Pantry brings quite a few dependencies and grafting it unto Shake
build looks suboptimal.
And I worry about stack/pantry being buildable with latest and
greatest stackage snapshots. Tracking nightlies isn't a priority for
stack, but sometimes a need of our own.
> To unsubscribe from this group and stop receiving emails from it, send an email to haskell-stac...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/haskell-stack/09f7bac3-9451-4d62-9ae8-dcf76a3cf150%40googlegroups.com.

Michael Snoyman

unread,
Apr 5, 2020, 3:37:04 AM4/5/20
to IC Rainbow, haskell-stack
I'm not sure what you're saying your desired outcome is here. Are you planning on using the Haskell file I provided and compiling it yourself?

IC Rainbow

unread,
Apr 5, 2020, 8:04:43 AM4/5/20
to Michael Snoyman, haskell-stack
I'm still in a PoC phase for now, but yep, I put a variation of your
snippet in my tool. It required tuning my extra-deps for LTS-13 build.
Reply all
Reply to author
Forward
0 new messages