Would `stack vendor-dependencies` be a valuable contribution to stack?

11 views
Skip to first unread message

Jan von Löwenstein

unread,
Jan 11, 2018, 12:52:04 PM1/11/18
to haskell-stack
Hi,

I have got two use cases where Haskell code will be compiled remotely and potentially without internet access. 
One being Bosh (https://bosh.io) releases and another Cloud Foundry (https://cloudfoundry.org) applications. 

I plan to solve the offline compilation capability by 1. providing a GHC out of band and `--system-ghc` and the new custom snapshot feature introduced with Stack 1.6 

Instead of creating a separate cli, say `hvendor`, I would prefer to put it into stack as an additional command. First and foremost I want to reuse the code for reading stack.yml files and calculating a projects dependencies (like e.g. `stack list-dependencies`). Especially since I want to calculate project dependencies with respect to a given snapshot (`stack vendor-dependencies lts-10.3`) while the projects stack.yml will reference the custom, vendored snapshot. 

What do you think of the idea in general and a potential contribution in particular? 
Is anybody else seeing more use cases for dependency vendoring? 
Should I open an issue for discussing this further?

Regards 
Jan

Neil Mitchell

unread,
Jan 12, 2018, 4:38:27 AM1/12/18
to Jan von Löwenstein, haskell-stack
Hi Jan,

What does vendor-dependencies do? Is the ultimate goal to use stack
offline? If so, https://github.com/ndmitchell/offline-stack might be
what you are looking for. Out the box Stack can be configured to work
with offline dependencies, but it's a pain. That site gives a precise
recipe for doing it, plus links to all the issues that stack has and
that fixing would be useful.

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/CAJtP4w41-oFCSp5yPEaW7RP-jkbt_YnJNPvN%2B%2BFjStA6iWDErg%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

Jan von Löwenstein

unread,
Jan 12, 2018, 12:51:30 PM1/12/18
to Neil Mitchell, haskell-stack

Hi Neil,

The command would download all dependencies as source tarballs and create a custom snapshot pointing to all tarballs.

I want to build offline on a remote and rather ephemeral machine. E.g. Bosh starts up a vm for compliation on demand and tears it down right afterwards. That means putting a complete mirror there is just too much data to send over the wire again and again and again.
For cloudfoundry buildpacks it is similar.

Best
Jan

Neil Mitchell

unread,
Jan 12, 2018, 3:08:48 PM1/12/18
to Jan von Löwenstein, haskell-stack
Hi Jan,

That does indeed seem valuable - certainly it would simplify the offline story.

Thanks, Neil

On Fri, Jan 12, 2018 at 5:51 PM, Jan von Löwenstein

Jan von Löwenstein

unread,
Jan 28, 2018, 8:28:51 AM1/28/18
to haskell-stack
Just opened https://github.com/commercialhaskell/stack/issues/3813 to discuss the feature and implementation.
Reply all
Reply to author
Forward
0 new messages