-
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
Stack not finding correct GHC via nixpkgs #6536
Comments
@harris-chris, thanks for reporting. I am at a personal disadvantage in that I am not a Nix user. However, I can look into who makes, and names, GHC versions for Nix. it seems to me that, currently, Nix uses |
Would you accept a PR for this? I'm not necessarily going to be able to
provide one, but if I have some time I'd be happy to attempt it.
…On Sat, Mar 30, 2024, 5:21 AM Mike Pilgrem ***@***.***> wrote:
@harris-chris <https://github.com/harris-chris>, thanks for reporting. I
am at a personal disadvantage in that I am not a Nix user. However, I can
look into who makes, and names, GHC versions for Nix.
—
Reply to this email directly, view it on GitHub
<#6536 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALDMVSBPWRPWLJA66Y2Q23DY2W5KNAVCNFSM6AAAAABFNWUXVWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRXGY4TSOBSGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@harris-chris, pull requests are welcome, but at NixOS/nixpkgs#300085 it has been suggested that Nix packages exist that are not found by https://search.nixos.org/packages. So first, I think we need to establish whether or not there is an upstream issue with missing packages. |
I'm hitting this with Can I tell stack to use 965 instead? |
@tmplt, is that correct? If I try the following on Ubuntu (via WSL 2), where
That list includes |
It does, as it does on my system. It also happens to include
On my system it fails to find I'm using Nix 2.18.1. Regression? |
I am not a Nix user, but this is my further experience:
Edit snapshot: lts-22.19 # GHC 9.6.4
compiler: ghc-9.6.5 # Desired compiler
nix:
enable: true Then:
behaves as expected. |
If my recollection is correct, this is because stack is trying to find ghc in the user's local |
Hello - you may already be aware of this, but there's two ways in which the stack/nix infrastructure can go wrong:
src/Stack/Nix.hs
useswith (import <nixpkgs> {})
- this then relies on the state on the user's machine. This<nixpkgs>
will be the nixpkgs in the$NIX_PATH
, which might be quite out of date since many people have moved over wholesale to flakes these days.nixCompilerVersion
function insrc/Stack/Config.Nix.hs
will (not unreasonably) look for a ghc version innixpkgs
that has the name formathaskell.compiler.ghc<major><minor><patch>
, likehaskell.compiler.ghc964
. This should work except that the ghc versions in nixpkgs don't always seem to adhere to this format, eghaskell.compiler.ghc96
is ghc 9.6.4, andhaskell.compiler.ghc964
doesn't exist.I'm not sure what the best solution to this is, it might be worth storing a map from resolver -> (nixpkgs commit, nixpkgs ghc package name) in the source code, and then falling back to using the existing approach if a resolver is requested that isn't in the map.
The text was updated successfully, but these errors were encountered: