Stack not finding correct GHC via nixpkgs

オープン
#6,536 コメント 8 件 リアクション 2 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
haskell
領域
build-system

調査の方向性

src/Stack/Nix.hs と src/Stack/Config.Nix.hs を読み、nixpkgs の選択方法と GHC パッケージ名の導出方法を追跡します。古い NIX_PATH の場合と、GHC パッケージに短い名前を使用する resolver の場合の失敗を再現し、その後、想定される fallback または mapping の動作を確立して、両方のケースを検証します。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Haskell
スター
4.1k
フォーク
857
平均マージ
17時間 32分
マージ済み PR(30日)
5

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

commercialhaskell/stack のほかの issue

commercialhaskell/stack の issue をすべて見る

似ている issue

Haskell の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。