-
Notifications
You must be signed in to change notification settings - Fork 27
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
System-wide Stackage Install #67
Comments
The quickstart guide also suggests installing the cabal.config into the directory you are in and cabal updating there. I understand that there are a few ways to do this but it could be confusing for newcomers: http://www.yesodweb.com/page/quickstart (I just worked through this with someone in IRC). |
Let me describe the situation fully, and then let's figure out how to update documentation. (And help on that front will be very much appreciated, thank you.) We can state the goal of "Stackage installation" as "make sure that cabal-install only installs acceptable versions of packages." There are two methods of doing that currently:
There are slightly differences between these two approaches (exclusive vs inclusive, whether to allow locally modified packages), but that's not terribly important right now. There are also two locations where these instructions can be given:
There's a bug with all but the most recent cabal-install versions where it ignores remote-repo statements in the local cabal.config file. That has now been resolved, but most people are still using older cabal-installs. Either approach (remote-repo or constraints) can be used with either config file location (global or local). The default instructions tell you to use constraints + local cabal.config. However, for a global installation, it's as simple as copying the constraints into the ~/.cabal/config file. Or, you can modify the remote-repo in ~/.cabal/config as well. I hope that clarifies things a bit. |
If that is the case than I like how the documentation is currently stated. I suppose I was confused because if I append the contents of the
This might have been what originally led me to believe that the remote-repo was necessary in ~/.cabal/config. I do like the current way of using |
Actually that message has me a bit worried, maybe I'm wrong and the global On Sat, Dec 20, 2014, 7:43 PM Christopher Reichert notifications@github.com
|
I think this is the issue: https://github.com/haskell/cabal/blob/64761550bb617ee5d9449512bd3e500489cfd491/cabal-install/Distribution/Client/Sandbox/PackageEnvironment.hs#L408 The ~/.cabal/config only supports individual version constraints (e.g. prepend every one with https://github.com/haskell/cabal/blob/master/Cabal/Distribution/Simple/Setup.hs#L528 I just tested with |
Wow, thanks for digging into that. We should provably raise this question on the cafe to see if this is a generally known issue. So if the cabal.config file used a separate constraint on each line, would it work for both global and local config files. |
I didn't quite have time to send a mail out today but I'd be happy to send it tomorrow morning, if you haven't already. It looks to me like separate constraints are supported in both configs but there could definitely be caveats or issues. It shouldn't be too hard to patch cabal to support |
I haven't sent off the email yet, if you could do so it would be much appreciated. |
Thanks! Look forward to seeing some responses. |
I've added a global config file link to the snapshot pages, which I think does this correctly. Can you give it a shot? |
That works great. I'll be testing it a bit more today since there are also the new base target versions (e.g. |
It seems like this is working. I'm going to close the issue, and let's reopen (or start a new one) if issues arise. Thanks for bringing this up @creichert! |
Don't know if this is related but I'm having terrible trouble trying to set up stackage and yesod inside a Docker container. I've tried the Dockerfile linked to in that question and also a more basic one using the hvr ppa. In the latter case using the global cabal config results in cabal complaining about an |
@garry-cairns I commented on: yesodweb/yesod#960 The global cabal config (http://www.stackage.org/snapshot/nightly-2014-12-22/cabal.config?global=true) only works at There could be a discrepancy in the install instructions but try sticking as close to the install instructions as possible and pasting your output so we can help. |
@snoyberg I feel the current quick-start section is confusing in stackage.org. Currently it states that: "Download the following file, place it next to your cabal config file " Now it's not clear which config file ? Is it system-wide ~/.cabal/config or the cabal file related to a package. In fact this comment of yours explains them properly. I think that message should be clearly conveyed in the home page. |
Good catch, do you think this clears it up? commercialhaskell/stackage-content@a5e6b04 |
Thanks, that's perfect! |
While there is plenty of documentation for setting up stackage in a cabal project, I don't think it's completely clear how to setup a system-wide stackage install.
For example:
I have a fresh install of ghc and cabal, now I want to install yesod-bin and start a new project. However, I want to install yesod-bin from a stackage snapshot.
Currently, most of the instructions are for existing cabal projects or sandbox directories.
My suggestion was to change the remote-repo in the ~/.cabal/config to match the cabal.config distributed on the quick start guide.
This guide suggest copying into cabal project:
http://www.stackage.org/
This Stackage FAQ does suggest changing the remote-repo but not in the ~/.cabal/config file:
https://github.com/fpco/stackage/wiki/Stackage-Server-FAQ
I could be confused myself on the system-wide instructions as I primarily sandbox projects. Could this use some clarification? (I can make these updates)
The text was updated successfully, but these errors were encountered: