Discourage messing with boot packages

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

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
38/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
haskell
領域
build-system

調査の方向性

[S-4804] と推奨される extra-deps メッセージを出力する build-plan の失敗経路から調査を開始し、boot-package のオーバーライドがどのように識別されるかを追跡します。boot-package をオーバーライドすることによる連鎖的な影響を推奨文が警告し、適切な場合にはそのようなオーバーライドを避けるよう提案すれば完了です。この issue では stack ls dependencies における警告の可能性にも言及されていますが、その範囲は定義されていません。

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

説明

General summary/comments (optional)

When failing to produce a build plan due to a constraint on a boot package, warn that overriding the version for the boot package has more cascading implications than for a regular package (cf [S-4804])

Steps to reproduce

Trying to build current Ormolu HEAD (2db4b1f761caf6b9092f5702937bfc075ad56534) against lts-23.17 ^[not a bug for them, I just try to cut down on the number of different LTSs I build against on my machine] I get

Error: [S-4804]
       Stack failed to construct a build plan.
       
       While constructing the build plan, Stack encountered the following errors. The 'Stack
       configuration' refers to the set of package versions specified by the snapshot (after any dropped
       packages, or pruned GHC boot packages; if a boot package is replaced, Stack prunes all other such
       packages that depend on it) and any extra-deps:
       
       In the dependencies for ghc-lib-parser-9.12.1.20250105:
         * filepath must match >=1.5 && <1.6, but filepath-1.4.301.0 is in the Stack configuration (latest
           matching version is 1.5.4.0).
       The above is/are needed due to ormolu-0.8.0.0 -> ghc-lib-parser-9.12.1.20250105
       
       Some different approaches to resolving some or all of this:
       
         * To ignore all version constraints and build anyway, pass --allow-newer, or, in
           /home/gesh/.local/share/stack/config.yaml (global configuration) or
           /home/gesh/aur/1+mine/static/ormolu-static-git/src/ormolu-static-git/stack.yaml (project-level
           configuration), set allow-newer: true.
         
         * To ignore certain version constraints and build anyway, also add these package names under
           allow-newer-deps: ghc-lib-parser.
         
         * Recommended action: try adding the following to your extra-deps in
           /home/gesh/aur/1+mine/static/ormolu-static-git/src/ormolu-static-git/stack.yaml
           (project-level configuration):
           
           - filepath-1.5.4.0@sha256:099c33e0e570dad93390e1c01c1f4bc6e4f13587de8e199df3c94a6cb62c7434,4945

Note the recommendation to pin a specific version of filepath -- a boot package. However, pinning that means pinning every package depending on it (in my case, directory, process, and unix). Moreover, the intermediate states are confusing, given that despite the lts specifying e.g. unix-2.8.6.0, I still need to manually specify it in stack.yaml for it to be picked up -- as stack ls dependencies confirms (it, too, could warn on this).

(Incidentally, --allow-newer-deps didn't help here, and was actually a misnomer -- it made stack try to build against an older version of filepath than ghc-lib-parser wanted, which failed)

I expected the recommended solution to have a caveat warning the package was a boot package, and perhaps a recommendation away from respecifying boot packages

Stack version
stack --version
Version 3.5.1, Git revision 5c774d7ca92f4716ef7a51d5da21a5c3713517a5 x86_64 hpack-0.38.0
Method of installation

https://aur.archlinux.org/packages/stack-static

Platform

Arch Linux

Related: #4897

主要言語
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 を短くまとめたダイジェスト。