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

Đang mở
#6,689 11 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
haskell
Lĩnh vực
build-system

Hướng nghiên cứu

Bắt đầu với reproducer embed-datadir-0.1.tar.gz đính kèm và so sánh hành vi của stack run và cabal run sau khi thay đổi hoặc thêm các tệp được liệt kê trong extra-source-files. Theo dõi quyết định rebuild của Stack đối với các tệp đó; công việc được hoàn tất khi các thay đổi cả trong danh sách lẫn nội dung tệp khiến executable được rebuild và bao gồm dữ liệu nhúng mới nhất.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
Haskell
Star
4.1k
Fork
857
Merge trung bình
17 giờ 32 phút
Pull request đã merge (30 ngày)
5

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của commercialhaskell/stack

Tất cả issue của commercialhaskell/stack

Issue tương tự

Thêm issue về Haskell

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.