cabal-install reconfigures each time PATH changes

Đang mở
#12,481 2 bình luận 4 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 3 ngày

@sheaf đang làm issue này rồi.

Từ ngày 23/10/2026.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

attention: pr-welcome blocked: needs reproducer cabal-install: cmd/(re)configure regression in 3.16 type: bug

Since 55aba1413b1b24f4eefa573300a8787f4804f734 (#10817 fixing #2015), cabal-install re-configures anytime PATH changes. That's a horrible user experience, in my opinion.

I think that commit was the wrong way to fix #2015. In that ticket, people were (rightfully) complaining that cabal repl inherited a stale PATH. This is because cabal baked in the value of PATH into the ghc ConfiguredProgram at the time of configuring ghc. I think that's nuts, and the fix was somehow to always reconfigure???

Even PR #10817 agrees that this is not ideal: "An alternative approach would be to stop baking the PATH variable into the environment of programs, but this would require more substantial changes to how Cabal manages environment variables." and I agree.

I argue we should change Cabal to store PATH symbolically (as an un-expanded variable) in ConfiguredProgram, and expand that variable in runProgramInvocation at program invocation time. This allows all of the existing override logic to work as before, but it does not require baking in PATH into ConfiguredProgram and thus completely sidesteps the issue. Then we no longer need to reconfigure if PATH changes.

Ngôn ngữ chính
Haskell
Star
1.8k
Fork
766
Merge trung bình
5 ngày 21 giờ
Pull request đã merge (30 ngày)
27

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

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 haskell/cabal

Tất cả issue của haskell/cabal

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.