-
Notifications
You must be signed in to change notification settings - Fork 843
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
Feature discussion - Stack System Root #2205
Comments
Sounds like an excellent addition to me! Pinging @borsboom It reminds me a little bit of the extra-package-dbs mechanism, which allow you to add additional package dbs between the global db and snapshot. Not sure if it's a simplification, but it may be worth reusing that mechanism / unifying it with that mechanism. See the discussion here of how that feature works. |
It just occurred to me that for this feature, instead of introducing a new environment variable, perhaps we can instead make the existing |
This could be used to make Haskell Platform and Stack compatible. Users could install stack after installing HP and earn all the HP-installed packages for free. We just need HP to setup the packages in a structure that |
@da-x Particularly considering that stackable Lets say you build package The best thing I can come up with to make this less prone to user error is the following implementation strategy: Have some command like If this command is run and This implementation can support stacks! However, you'd need to check for cycles :) |
@sinelaw Is that for new Haskell Platform or old? With old Haskell Platform it does reuse the packages if they are the correct versions, as they are in the global DB. |
I think that for the general use case, it should be safe to assume that by convention nothing gets removed from the read-only root on which your read-write root depends on. Same for modifications that are not simply additions. On the bright side, a new version of a package or GHC is always an addition, so we are good there. At worst case, if that assumption does get violated, at least for removals, you should only need to do On Linux, for the long-term, I imagine that the read-only roots can come from Debs or RPMs and reside in BTW, do we want to |
I've thought a bit more on the
True, it should be able to recover in a sane manner.
I suppose that would indeed make sense. I'm a little worried about it affecting stack's traceability - how easy it is for the user to figure out why something is happening. However, we already have another similar mechanism - extensible-snapshots - #863 So, I'm in favor of it. At some point we're going to need some kind of command that tells you what the accumulated config is and why. Till then, I think this is enough of an "expert-mode" feature that doing something like mappending them together is reasonable. |
I would love for this to happen. See this Stack Overflow submission:
|
This is probably a naïve question, but why can't Alternatively, can't |
Is there any progress on this? |
Sorry, but I don't have any plans to continue implementing this. Anyone else is invited to resume and pick this up. |
I open this issue for tracking and discussing a new feature I'm implementing for Stack, which I describe here.
Your comments are appreciated.
There is a working implementation of the feature in here.
Intro
This change adds a new, optional configurable path that is available via
STACK_SYSTEM_ROOT
environment, and also override-able via astack-system-root
Stack config option, or a --stack-system-root command line argument.The Stack System Root path is an additional directory bearing the same structure as
~/.stack
, but is considered a read-only cache for anything that is stored under~/.stack
. When Stackruns, it first checks for availability of stuff under the Stack System Root (downloads, installed GHC, indices, etc.), and only afterward tries to either download, build, or install stuff to
~/.stack
.Any existing
STACK_ROOT
directory can be used as a Stack System Root, for another user, requiring only read-only access from that user.This allows for:
Example
As
bob
, we can build some package, let's saycpio-conduit
, but set our STACK_ROOT to be shared with another user:Then, as
alice
, we start empty, and setSTACK_SYSTEM_ROOT
to that same path, which is read-only for us.If we build the same package using the same Stack snapshot, then in this case, everything should be taken from the already populated
STACK_ROOT
ofbob
, even though it's read only. There wouldn't even be network accesses. If we depend on anything thatbob
does not have in the sharedSTACK_ROOT
, then our own writableSTACK_ROOT
would be populated as usual.After this build,
alice
's own.stack
is nearly empty (just some empty directories and an emptypackage.cache
):Our ghc-pkg looks like:
The text was updated successfully, but these errors were encountered: