Stack not finding correct GHC via nixpkgs

Aperta
#6,536 8 commenti 2 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
haskell
Ambito
build-system

Direzione di ricerca

Leggi src/Stack/Nix.hs e src/Stack/Config.Nix.hs per tracciare come viene selezionato nixpkgs e come viene derivato il nome del pacchetto GHC. Riproduci i fallimenti per un NIX_PATH obsoleto e per un resolver il cui pacchetto GHC usa il nome più breve, quindi stabilisci il comportamento previsto di fallback o mapping e verifica entrambi i casi.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

component: nix resolution: upstream issue

Hello - you may already be aware of this, but there's two ways in which the stack/nix infrastructure can go wrong:

  1. The nix expression generated in src/Stack/Nix.hs uses with (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.
  2. The nixCompilerVersion function in src/Stack/Config.Nix.hs will (not unreasonably) look for a ghc version in nixpkgs that has the name format haskell.compiler.ghc<major><minor><patch>, like haskell.compiler.ghc964. This should work except that the ghc versions in nixpkgs don't always seem to adhere to this format, eg haskell.compiler.ghc96 is ghc 9.6.4, and haskell.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.

Lingua principale
Haskell
Stelle
4.1k
Fork
857
Merge medio
17h 32m
PR unite (30g)
5

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di commercialhaskell/stack

Tutte le issue di commercialhaskell/stack

Issue simili

Altre issue su Haskell

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.