Maintaining a local copy of all stack artifacts

12 views
Skip to first unread message

Greg Steuck

unread,
Dec 8, 2017, 1:37:57 AM12/8/17
to haskell-stack
How hard is it to keep an offline stack environment?

Imagine I have sufficient disk and occasional network connectivity. I want to download everything I may ever need for using a fixed version of stack (1.6.1) and a fixed version of resolver (lts-9.17).

I want to be in a position where I can run any stack command while disconnected and have it not access the network even as my project grows more dependencies within lts boundaries.

I tried to search Google for things similar to this with only 2 year old stack-offline matching my search. Is it the best option out there?

Thanks
Greg

Neil Mitchell

unread,
Dec 8, 2017, 1:49:23 AM12/8/17
to Greg Steuck, haskell-stack
Hi Greg,

See the other stack-offline, namely
https://github.com/ndmitchell/offline-stack/. That works on the
assumption you are sometimes connected and can mirror to a local
server, then other machines can use it from that local server entirely
offline. It also links to a bunch of stack tickets that would make the
whole process a lot easier:
https://github.com/ndmitchell/offline-stack/issues

I've been using the logic in this offline-stack script for real for at
least a year and it works great. Do be aware it's more a test of logic
than a product though, you'll need to tweak it for your use case.

Thanks, Neil
> --
> 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 post to this group, send email to haskel...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/haskell-stack/47e7886a-7803-4593-8832-1e0f4df05f15%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Luke Murphy

unread,
Dec 8, 2017, 1:50:02 AM12/8/17
to Greg Steuck, haskell-stack
Hey Greg,

It's a lovely idea but I am not sure it is so easy to do right now.

There are a number of outstanding issues in this regard:

https://github.com/commercialhaskell/stack/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+offline

Best,
Luke

On 0, Greg Steuck <hac...@nest.cx> wrote:
> How hard is it to keep an offline stack environment?
>
> Imagine I have sufficient disk and occasional network connectivity. I want
> to download everything I may ever need for using a fixed version of stack
> (1.6.1) and a fixed version of resolver (lts-9.17).
>
> I want to be in a position where I can run any stack command while
> disconnected and have it not access the network even as my project grows
> more dependencies within lts boundaries.
>
> I tried to search Google for things similar to this with only 2 year
> old [1]stack-offline matching my search. Is it the best option out there?
>
> Thanks
> Greg
>
> --
> 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 [2]haskell-stac...@googlegroups.com.
> To post to this group, send email to [3]haskel...@googlegroups.com.
> To view this discussion on the web visit
> [4]https://groups.google.com/d/msgid/haskell-stack/47e7886a-7803-4593-8832-1e0f4df05f15%40googlegroups.com.
> For more options, visit [5]https://groups.google.com/d/optout.
>
>References
>
> Visible links
> 1. https://github.com/cblp/stack-offline
> 2. mailto:haskell-stac...@googlegroups.com
> 3. mailto:haskel...@googlegroups.com
> 4. https://groups.google.com/d/msgid/haskell-stack/47e7886a-7803-4593-8832-1e0f4df05f15%40googlegroups.com?utm_medium=email&utm_source=footer
> 5. https://groups.google.com/d/optout

Alexander Bondarenko

unread,
Dec 8, 2017, 12:47:27 PM12/8/17
to haskell-stack
Hello,

That's the question that bugs me a lot recently.
Mine has a twist though. I'd like to have multiple resolvers available (with their resp. GHCs), but only a subset of the packages needed to build my projects with.
You could make a complete mirror with haskell-stack-mirror-script[1], but it'll take ~30GB and some time.
What I need is a stack-root-in-a-box you can drop to a new machine and get building.

I've started (yet again) to produce such a tool that, given a config with projects and paths, would produce an immutable stack root with dependencies preinstalled.
And then maybe wrap it up as a deb package / docker image / remote upload...

Michael Sloan

unread,
Dec 9, 2017, 12:29:12 AM12/9/17
to Alexander Bondarenko, haskell-stack
This used to exist in the form of https://hub.docker.com/r/fpco/stack-full/ , but it is no longer updated.  Not sure why, but my guess is that the it wasn't worth the effort to maintain, and our workflows have shifted away from using it.

It may be interesting to write a script that gets all the package names in a snapshot, and passes them to `stack build`.  Would be curious to see if that works.  In theory, it should, I believe that the `stack-build` image should have all 3rd party libraries needed to build all of stackage.

-Michael

--
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-stack+unsubscribe@googlegroups.com.
To post to this group, send email to haskel...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/haskell-stack/c8fce138-e87b-4e40-9bb5-4d20a8ebff7b%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages