`file-embed`: Additions to `extra-source-files` don't trigger rebuild of module

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

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

評価

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

調査の方向性

添付された embed-datadir-0.1.tar.gz の reproducer から始め、extra-source-files に記載されたファイルを変更または追加した後の stack run と cabal run の動作を比較してください。これらのファイルに対する Stack の再ビルド判断を追跡してください。完了の条件は、リストとファイル内容の両方への変更によって実行可能ファイルが再ビルドされ、最新の埋め込みデータが含まれることです。

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

説明

component: build resolution: upstream issue

Report against Stack-3.3.1 (latest).
I noticed that Stack does not seem to honor the extra-source-files when deciding whether to rebuild a project, in contrast to Cabal which does so.

This is relevant when using file-embed to embed files into the executable. Changes to the embedded files should trigger a recompilation to keep the executable up-to-date.

E.g. I want that these files are always embedded in their latest version:

extra-source-files:
    data/README.md
    data/sub/Foo.md

I added the second one in a second step. I see the following behavioral difference between Stack and Cabal:

$ stack run                                                                              ✔ │ ghc-9.4.8 hs │ 10:06:41 
File: README.md
Content: "This is a test of the `file-embed` package,\napplied to the `data-dir` of a Haskell project.\n"

$ cabal run                                                                              ✔ │ ghc-9.4.8 hs │ 10:14:10 
File: README.md
Content: "This is a test of the `file-embed` package,\napplied to the `data-dir` of a Haskell project.\n"
File: sub/Foo.md
Content: "This is a file in a subdirectory.\nIt contains 2 lines.\n"

WANT: Changes to the amount and content of the extra-source-files should trigger a rebuild.

I attach a reproducer to play with.

embed-datadir-0.1.tar.gz

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