Open loewenstein opened 6 years ago
Related: #1594 #3106 #359
Would this approach support the vendored packages living in a directory outside? And could it be made to support getting vendored packages from an http(s) server on a company intranet (disconnected rom the Internet)?
Not sure I get the questions right.
As long as a project can refer to a resolver somewhere there is no limitation to having the vendored snapshot local to the project. @snoyberg is there any limitation where custom snapshots can exist?
Is the second question: "Can I call stack vendor-dependencies
when in a shielded network?"
I would suppose vendoring would reuse the package download facilities of stack itself. If stack can get packages from a server within the intranet than vendoring can.
Does that answer the questions?
is there any limitation where custom snapshots can exist?
I'm not sure what that means.
@snoyberg I was trying to answer @borsboom s question.
Would this approach support the vendored packages living in a directory outside?
The idea of the vendoring proposal is to create a custom snapshot with local archives at
Yes, you should be able to refer to a different filepath for a custom snapshot definition.
Dependency vendoring for Stack
Use cases
With vendored dependencies we get the capability to build, test & run a Haskell project without access to either Hackage or Stackage.
Problem
Stack has to get the Hackage index and download all dependency packages prior to building. As a workaround for use case use case 1 we can
stack build --prefetch --dry-run
to get everything local. As a workaround for use case 2 we can create a tarball from stack-root. However the creation is rather inconvenient and the result larger than we want.Solution
The recently released extensible snapshot work can be used as basis for complete offline builds with limited file system usage. We can download all dependency packages (
stack list-dependencies
and remove ghc package db packages) and list them in a snapshot referring only toghc-x.y.z
snapshot. Given an existing GHC we can use the snapshot and--system-ghc
to build without any internet access.Doing what is described as solution from outside of stack is inconvenient though. That is why we propose to add a command to stack:
The command should download the dependency packages for all targets to (which should default to .
<project root>/vendored
) and create a snapshot YAML at<path>/vendored.yml
including all the downloaded packages and referring to the ghc resolver used byLimitations
We do not propose to vendor ghc itself because that is system dependent. As a consequence GHC has to be provided out of band.