Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2026-10-20
21:28 • Ticket [3ff2d724d0] build failure on Alpine Linux (MUSL) - sys/queue.h no such f... artifact: 2fb1cc1b1a user: jan.nijtmans
18:37 • Closed ticket [3ff2d724d0]. artifact: bbb226f9eb user: serhiy.storchaka
18:36
Fix [3ff2d724d0]: build failure on Alpine Linux (MUSL) - sys/queue.h no such file or directory check-in: 617c86df64 user: serhiy.storchaka tags: core-9-0-branch
18:34
Fix [3ff2d724d0]: build failure on Alpine Linux (MUSL) - sys/queue.h no such file or directory check-in: 5e89bab5e2 user: serhiy.storchaka tags: trunk, main
13:29 • Ticket [3ff2d724d0] build failure on Alpine Linux (MUSL) - sys/queue.h no such f... artifact: e55bda0ad7 user: oehhar
13:07 • Ticket [3ff2d724d0]: 4 changes artifact: bf351e114b user: serhiy.storchaka
13:06
Fix [3ff2d724d0]: Tcl did not build with musl (e.g. Alpine Linux without bsd-compat-headers), which ... closed check-in: f7ece61aa8 user: serhiy.storchaka tags: epoll-no-sys-queue
2024-08-07
19:11 • Ticket [3ff2d724d0] build failure on Alpine Linux (MUSL) - sys/queue.h no such f... artifact: a851049851 user: oehhar
17:35 • Ticket [3ff2d724d0]: 3 changes artifact: 79de9cd0ce user: danmack42
16:51 • Ticket [3ff2d724d0]: 3 changes artifact: e3d0e620cd user: jan.nijtmans
16:16 • Ticket [3ff2d724d0]: 3 changes artifact: e02ad8ec2a user: danmack42
15:34 • New ticket [3ff2d724d0]. artifact: dc81ee7682 user: danmack42

build failure on Alpine Linux (MUSL) - sys/queue.h no such file or directory

Closed / Fixed3ff2d724d03ba7d6edb8159fe1f4871619db8567Created 2 years agoUpdated 43 days ago
Descriptionplain2024-08-07 15:34:15
Downloaded tcl9.0b3 gz tarball from sourceforge.  Did a generic configure on Alpine Linux v3.20 and tried a source build.  During build, errors at this point:

/home/mack/src/tcltk/tcl9.0b3/unix/tclEpollNotfy.c:28:10: fatal error: sys/queue.h: No such file or directory
   28 | #include <sys/queue.h>
      |          ^~~~~~~~~~~~~
compilation terminated.

Looks like a new dependency on queue.h which does exist on alpine.
Tcl version: 8.6.14 builds without any problems.

Thank you,
Referenced by3
  • 617c86df64Fix [3ff2d724d0]: build failure on Alpine Linux (MUSL) - sys/queue.h no such file or directory check-in2026-10-20 18:36:54
  • 5e89bab5e2Fix [3ff2d724d0]: build failure on Alpine Linux (MUSL) - sys/queue.h no such file or directory check-in2026-10-20 18:34:22
  • f7ece61aa8Fix [3ff2d724d0]: Tcl did not build with musl (e.g. Alpine Linux without bsd-compat-headers), which has no <sys/queue.h>. Define the six list macros that tclEpollNotfy.c uses instead of including that header. check-in2026-10-20 13:06:40
danmack42plain2024-08-07 16:16:03
as a workaround, I just copied the netbsd version of queue.h file into the compat directory and changed the sys/queue.h to ../compat/queue.h for now.
jan.nijtmanswiki2024-08-07 16:51:52

I think you will find your answer here.

apk add --no-cache bsd-compat-headers

Hope this helps, Jan Nijtmans

danmack42plain2024-08-07 17:35:10
thank you, that's it.   appreciate your help.

dan
oehharwiki2024-08-07 19:11:38

Would it be helpful to add this information into the TCL migration guide or release notes? Or is this a general purpose problem and not related to TCL?

Should "configure" detect this?

Thanks, Harald

serhiy.storchakawiki2026-10-20 13:07:22

As Harald asked, Tcl itself can avoid this: tclEpollNotfy.c only needs six list macros from <sys/queue.h>, which musl does not provide. Proposed fix in branch epoll-no-sys-queue: define them in tclEpollNotfy.c instead of including that header, so no configure check and no bsd-compat-headers are needed. Tested on Alpine 3.24 without bsd-compat-headers: the current main fails as reported, with the branch it builds and the event, socket, I/O and notifier tests pass; also tested on Linux with glibc.

oehharwiki2026-10-20 13:29:32

Great. The preprocessor gymnastics feel good. It would be ok for me to merge.

Thanks, Harald

serhiy.storchaka Closed ticket [3ff2d724d0]. [History diff]2026-10-20 18:37:41
jan.nijtmanswiki2026-10-20 21:28:33

Please don't forget the changes.md/changes entries

Log in (anonymous is fine) to add a comment.