System.Teminal.hsc fails to compile on a Solaris-family OS
@Bodigrim đang làm issue này rồi.
Từ ngày 28/9/2025.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
This has been reported at https://www.reddit.com/r/haskell/comments/1nrt23b/comment/ngka3xp/ as a failure to a build Stack itself:
<command-line>: note: this is the location of the previous definition
In file included from /root/stack-3.7.1/dist-newstyle/build/x86_64-solaris/ghc-9.8.2/stack-3.7.1/build/System/Terminal_hsc_make.c:1:
Terminal.hsc: In function 'main':
Terminal.hsc:28:15: error: invalid application of 'sizeof' to incomplete type 'struct winsize'
/opt/local/lib/ghc-9.8.2/lib/template-hsc.h:96:39: note: in definition of macro 'hsc_size'
96 | hsc_printf("(%ld)", (long) sizeof(t));
| ^
/opt/local/lib/ghc-9.8.2/lib/template-hsc.h:102:9: error: field 'b' has incomplete type
102 | x b; \
| ^
Terminal.hsc:29:5: note: in expansion of macro 'hsc_alignment'
In file included from /opt/local/lib/ghc-9.8.2/lib/template-hsc.h:11:
/opt/local/lib/ghc-9.8.2/lib/template-hsc.h:82:24: error: invalid use of undefined type 'struct winsize'
82 | (long) offsetof (t, f));
|
This seemingly stems from
https://github.com/commercialhaskell/stack/blob/b2457a8f147c228bd2aba9c00cb16e3c28cd0a3a/src/unix/System/Terminal.hsc#L27-L32
I have no idea what's going on. Looking at a similar functionality in https://github.com/biegunka/terminal-size/blob/master/src/System/Console/Terminal/Posix.hsc, I notice a suspicious line
#let alignment t = "%lu", (unsigned long)offsetof(struct {char x__; t (y__); }, y__)
which might or might not have to do something with the latter error.
BTW is there a reason stack does not use terminal-size to get the terminal width and rolls out its own implementation?
- 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
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.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của commercialhaskell/stack
-
Build Stack against Cabal >= 3.18Có thể đã có người làm @mpilgrem đã nhận 14 ngày trước. Đang mở
commercialhaskell/stack#6976 · 1 người được giao ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
commercialhaskell/stack#6954 ·
-
Support type-checking without compilingCó thể làm lại được @mpilgrem đã nhận 135 ngày trước và không có pull request nào đang mở. Đang mởcomponent: build type: enhancement
commercialhaskell/stack#6951 · 3 reaction · 1 người được giao ·
-
Support semaphore-compat 2.0.0Có thể làm lại được @mpilgrem đã nhận 158 ngày trước và không có pull request nào đang mở. Đang mởcomponent: build in progress type: enhancement
commercialhaskell/stack#6934 · 3 bình luận · 1 người được giao ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
commercialhaskell/stack#6864 · 1 bình luận ·
Tất cả issue của commercialhaskell/stack
Issue tương tự
-
documentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
alunduil/network-arbitrary#293 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:client bug priority-low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
bug triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 91/100
simplex-chat/simplex-chat#8372 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
compiler-explorer/compiler-explorer#9710 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
agda/agda#8965 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày