Skip to content
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

Migrate --nix support to use haskell.compiler.ghcXYZ attributes instead of haskell.packages.lts_X_Y #2259

Closed
peti opened this issue Jun 8, 2016 · 10 comments

Comments

@peti
Copy link
Contributor

peti commented Jun 8, 2016

The haskell.packages.lts_X_Y package sets will disappear from Nixpkgs in the foreseeable future and stack should not rely on them any longer. Instead, please access the appropriate compiler using the haskell.compiler.ghcXYZ attributes instead. http://permalink.gmane.org/gmane.linux.distributions.nixos/20505 has more details about the motivation behind that upcoming change.

@YPares
Copy link
Collaborator

YPares commented Jun 8, 2016

Ok, so what would be the cleanest way to get the required GHC version from the LTS?

@mgsloan
Copy link
Contributor

mgsloan commented Jun 8, 2016

I do not see the reason for this change, and it will break existing stack versions and build configurations. This message seems to be frustrated with a variety of non-fundamental, fixable issues. Please consider this more carefully.

If changes to nix / nixpkgs become too much of a maintenance burden, we may need to consider whether stack will continue having first class support for nix. I am not sure how the nix support would need to be adapted to support this, it may not even be viable to adapt it.

  1. Stackage does not "maintain" any of its LTS releases. Rather, the
    Stackage volunteers compile a list of package versions, test and verify
    them to the best of their abilities, release that list, and then they
    never touch it again.

How about bringing up this issue on stackage, or integrating the nix feedback into the curation of stackage?

  1. Following LTS strictly may deprive us of important security updates.

Ok, this seems to be more like "I don't want stable package sets". Follow lts non-strictly if you do want security updates.

  1. Stackage Nightly is not a stable package set.

So we do want stable package sets! :)

This seems like an impedence mismatch between how nightlies have been exposed to nix users. If "haskellPackages" is always the latest nightly, then yes, you shouldn't do that if you want reliable builds.

If you want something stable, use lts. If you want something unstable, use nightly. It's that simple.

  1. Stackage releases come out only after a complete test build of all
    packages has succeeded. Unfortunately, those tests don't always catch
    all issues we might run into, because we compile packages in a different
    environment.

Ok, lets work with you guys to curate stackage via feedback from nix.

My summary of the issues covered is:

  1. Wanting snapshots to be more stable in some ways and unstable in others (security)
  2. Nix predicate of success /= stackage predicate of success, and you are understandably frustrated with maintaining the mismatch.

IMHO, these reasons are not sufficient to justify this. That said, I am not a nix user and I don't experience the maintenance burden. These are indeed tricky problems, their resolution isn't trivial. However, I don't see how dropping stackage makes (1) any easier, and we can collaborate to address (2).

Please keep in mind that the stackage process is not set in stone, we are still experimenting with it. Please help us refine the process rather than ditching it.

@mgsloan
Copy link
Contributor

mgsloan commented Jun 8, 2016

Ok, so what would be the cleanest way to get the required GHC version from the LTS?

The snapshot specifies a compiler version, so stack knows that once it's loaded. Do you need to get the GHC version outside of stack itself?

@peti
Copy link
Contributor Author

peti commented Jun 8, 2016

@mgsloan, to the best of my knowledge, adapting Stack to use the compiler attributes rather than the (obsolete) LTS package set attributes should be a harmless change that won't pose any serious problems. I realize it's inconvenient having to make that switch, and I am sorry about that. We did not take that decision lightly and there was a discussion with various Stackage team members beforehand. Alas, things turned out such that the level of support Nix used to offer seems clearly unsustainable, hence the change.

@YPares
Copy link
Collaborator

YPares commented Jun 10, 2016

@mgsloan Nope, I meant within stack's code actually.

@mgsloan
Copy link
Contributor

mgsloan commented Jun 10, 2016

Gotcha!

asks (envConfigCompilerVersion . getEnvConfig) :: (MonadReader env m, HasEnvConfig env) => m CompilerVersion

@YPares
Copy link
Collaborator

YPares commented Jun 15, 2016

Okay, it required a bit of working around as the monad outside the nix-shell wasn't an instance of HasEnvConfig, so I submitted a PR so people may review the solution I'm proposing: #2270.

@YPares
Copy link
Collaborator

YPares commented Jun 15, 2016

@mgsloan Ok, so it isn't fixed, sorry.
I can't use setupEnv to get the wanted GHC version because it expects GHC to be already installed.
And as I said, I'm outside any HasEnvConfig monad.
Any idea?

@YPares
Copy link
Collaborator

YPares commented Jun 15, 2016

@mgsloan Okay, I found another (simpler) way. I think it's good now.

@peti
Copy link
Contributor Author

peti commented Jul 20, 2016

LTS package sets will disappear from Nixpkgs master this week. We'll keep the haskell.packages.lts_x_y.ghc attributes around for a while though to remain backwards compatible.

peti added a commit to peti/nixpkgs that referenced this issue Jul 21, 2016
This is the first step towards dropping Stackage support. We keep LTS 6.x
around because I don't want to downgrade our default compiler to GHC 7.x,
but once LTS 7.x comes out we'll switch our main package set to that and
drop Nightly.

More details are at:

  http://permalink.gmane.org/gmane.linux.distributions.nixos/20505

Closes NixOS#14897.

Also relevant:

 - NixOS#16130
 - commercialhaskell/stack#2259
@YPares YPares closed this as completed Aug 29, 2016
peti added a commit to NixOS/nixpkgs that referenced this issue Mar 3, 2017
Stack no longer uses them since a long time: commercialhaskell/stack#2259.

(cherry picked from commit 09a593b)
peti added a commit to NixOS/nixpkgs that referenced this issue Mar 3, 2017
adrianpk added a commit to adrianpk/nixpkgs that referenced this issue May 31, 2024
Stack no longer uses them since a long time: commercialhaskell/stack#2259.

(cherry picked from commit 09a593b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants