
在duckdb的actionhttps://github.com/duckdb/duckdb/actions/runs/27048492166中见到有musl的CLIhttps://github.com/duckdb/duckdb/actions/runs/27048492166/artifacts/7449890831和插件https://github.com/duckdb/duckdb/actions/runs/27048492166/artifacts/7450171388。下载试用发现如下问题。rootDESKTOP-59T6U68:/mnt/c/d# ./duckdbmusl -bash: ./duckdbmusl: No such file or directory用ldd命令检测缺少libc.musl的so文件rootDESKTOP-59T6U68:/mnt/c/d# ldd ./duckdbmusl linux-vdso.so.1 (0x00007fff6cd8e000) libstdc.so.6 /lib/x86_64-linux-gnu/libstdc.so.6 (0x00007f66cd800000) libgcc_s.so.1 /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f66cdb0d000) libc.musl-x86_64.so.1 not found libm.so.6 /lib/x86_64-linux-gnu/libm.so.6 (0x00007f66cd719000) libc.so.6 /lib/x86_64-linux-gnu/libc.so.6 (0x00007f66cd400000) /lib/ld-musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2 (0x00007f66d13cd000)查看网上的信息知道要安装musl库rootDESKTOP-59T6U68:/mnt/c/d# apt install musl-dev Reading package lists... Done Building dependency tree... Done Reading state information... Done The following additional packages will be installed: gcc gcc-11 libasan6 libcc1-0 libgcc-11-dev libitm1 liblsan0 libquadmath0 libtsan0 libubsan1 musl Suggested packages: gcc-multilib make autoconf automake libtool flex bison gdb gcc-doc gcc-11-multilib gcc-11-doc gcc-11-locales Recommended packages: linux-musl-dev The following NEW packages will be installed: gcc gcc-11 libasan6 libcc1-0 libgcc-11-dev libitm1 liblsan0 libquadmath0 libtsan0 libubsan1 musl musl-dev 0 upgraded, 12 newly installed, 0 to remove and 54 not upgraded. Need to get 30.5 MB of archives. After this operation, 93.8 MB of additional disk space will be used. Do you want to continue? [Y/n] n Abort. rootDESKTOP-59T6U68:/mnt/c/d# apt install musl Reading package lists... Done Building dependency tree... Done Reading state information... Done The following NEW packages will be installed: musl 0 upgraded, 1 newly installed, 0 to remove and 54 not upgraded. Need to get 407 kB of archives. After this operation, 779 kB of additional disk space will be used. Get:1 http://archive.ubuntu.com/ubuntu jammy/universe amd64 musl amd64 1.2.2-4 [407 kB] Fetched 407 kB in 2s (225 kB/s) Selecting previously unselected package musl:amd64. (Reading database ... 84126 files and directories currently installed.) Preparing to unpack .../musl_1.2.2-4_amd64.deb ... Unpacking musl:amd64 (1.2.2-4) ... Setting up musl:amd64 (1.2.2-4) ... Processing triggers for man-db (2.10.2-1) ...安装完后还是报错rootDESKTOP-59T6U68:/mnt/c/d# ./duckdbmusl Error loading shared library libstdc.so.6: No such file or directory (needed by ./duckdbmusl) Error loading shared library libgcc_s.so.1: No such file or directory (needed by ./duckdbmusl) Error relocating ./duckdbmusl: _ZNSt7__cxx1119basic_ostringstreamIcSt11char_traitsIcESaIcEEC1Ev: symbol not found Error relocating ./duckdbmusl: _ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE17find_first_not_ofEPKcmm: symbol not found ...而从前面ldd可知libstdc.so.6库文件是存在的。改用gcc容器来运行出错信息相同rootDESKTOP-59T6U68:/mnt/c/d# docker exec -it gcc bash root6ae32a5ffcde:/# cd /par root6ae32a5ffcde:/par# ldd ./duckdbmusl linux-vdso.so.1 (0x00007fffac545000) libstdc.so.6 /usr/local/lib64/libstdc.so.6 (0x00007fbed525b000) libgcc_s.so.1 /usr/local/lib64/libgcc_s.so.1 (0x00007fbed522e000) libc.musl-x86_64.so.1 not found libm.so.6 /lib/x86_64-linux-gnu/libm.so.6 (0x00007fbed514e000) libc.so.6 /lib/x86_64-linux-gnu/libc.so.6 (0x00007fbed4f6c000) /lib/ld-musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2 (0x00007fbed8d6c000) root6ae32a5ffcde:/par# apt install musl Reading package lists... Done Building dependency tree... Done Reading state information... Done The following NEW packages will be installed: musl 0 upgraded, 1 newly installed, 0 to remove and 117 not upgraded. Need to get 406 kB of archives. After this operation, 777 kB of additional disk space will be used. Get:1 https://mirrors.tuna.tsinghua.edu.cn/debian bookworm/main amd64 musl amd64 1.2.3-1 [406 kB] Fetched 406 kB in 0s (2435 kB/s) debconf: delaying package configuration, since apt-utils is not installed Selecting previously unselected package musl:amd64. (Reading database ... 65236 files and directories currently installed.) Preparing to unpack .../musl_1.2.3-1_amd64.deb ... Unpacking musl:amd64 (1.2.3-1) ... Setting up musl:amd64 (1.2.3-1) ... N: Ignoring file debian.sources_org in directory /etc/apt/sources.list.d/ as it has an invalid filename extension root6ae32a5ffcde:/par# ./duckdbmusl rootDESKTOP-59T6U68:/mnt/c/d# docker exec -it gcc bash root6ae32a5ffcde:/# apt install musl-dev Reading package lists... Done Building dependency tree... Done Reading state information... Done Recommended packages: linux-musl-dev The following NEW packages will be installed: musl-dev 0 upgraded, 1 newly installed, 0 to remove and 117 not upgraded. Need to get 587 kB of archives. After this operation, 3114 kB of additional disk space will be used. Get:1 https://mirrors.tuna.tsinghua.edu.cn/debian bookworm/main amd64 musl-dev amd64 1.2.3-1 [587 kB] Fetched 587 kB in 0s (3126 kB/s) debconf: delaying package configuration, since apt-utils is not installed Selecting previously unselected package musl-dev:amd64. (Reading database ... 65250 files and directories currently installed.) Preparing to unpack .../musl-dev_1.2.3-1_amd64.deb ... Unpacking musl-dev:amd64 (1.2.3-1) ... Setting up musl-dev:amd64 (1.2.3-1) ... N: Ignoring file debian.sources_org in directory /etc/apt/sources.list.d/ as it has an invalid filename extension root6ae32a5ffcde:/# ./duckdbmusl bash: ./duckdbmusl: No such file or directory root6ae32a5ffcde:/# cd /par root6ae32a5ffcde:/par#再改用自带musl的alpine容器duckdbmusl还是一样的错而同样依赖musl的cpython musl版本可以执行成功。rootDESKTOP-59T6U68:/mnt/c/d# docker container list -a|grep al 9d3934fdf92d m.daocloud.io/docker.io/alpine:latest /bin/sh 17 months ago Created alp2 rootDESKTOP-59T6U68:/mnt/c/d# docker start alp2 alp2 rootDESKTOP-59T6U68:/mnt/c/d# docker exec -it alp2 sh / # cd /par sh: cd: cant cd to /par: No such file or directory / # whereis musl sh: whereis: not found / # ls bin cpython-3.14.5rc1%2B20260504-x86_64-unknown-linux-musl-install_only_stripped.tar.gz dev etc home lib media mnt opt proc root run sbin srv sys tmp usr var / # cd tmp /tmp # ls primes.py python /tmp #重新拉取最新版alpine镜像执行duckdbmusl错误信息不变rootDESKTOP-59T6U68:/mnt/c/d# docker pull docker.1ms.run/alpine Trying to pull docker.1ms.run/alpine:latest... Getting image source signatures Copying blob 6a0ac1617861 done Copying config 3cb067eab6 done Writing manifest to image destination Storing signatures 3cb067eab609612d81b4d82ff8ad71d73482bb3059a87b642d7e14f0ed659cde rootDESKTOP-59T6U68:/mnt/c/d# 3cb067eab609612d81b4d82ff8ad71d73482bb3059a87b642d7e14f0ed659cde rootDESKTOP-59T6U68:/mnt/c/d# docker run -itd -v /mnt/c/d:/par --networkhost --name alp324 docker.1ms.run/alpine 516dd703c736c70b10554e1a5fff9ee32aaca534a4ee7da07bcade288bda163b rootDESKTOP-59T6U68:/mnt/c/d# docker exec -it alp324 sh / # uname -a Linux DESKTOP-59T6U68 6.6.87.2-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC Thu Jun 5 18:30:46 UTC 2025 x86_64 Linux / # cat /etc/issue Welcome to Alpine Linux 3.23 Kernel \r on \m (\l) / # cd /par /par # ./duckdbmusl Error loading shared library libstdc.so.6: No such file or directory (needed by ./duckdbmusl) Error loading shared library libgcc_s.so.1: No such file or directory (needed by ./duckdbmusl) Error relocating ./duckdbmusl: _ZNSt7__cxx1119basic_ostringstreamIcSt11char_traitsIcESaIcEEC1Ev: symbol not found Error relocating ./duckdbmusl: _ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE17find_first_not_ofEPKcmm: symbol not found /par # cd musl /par/musl # python/bin/python Cannot read termcap database; using dumb terminal settings. Python 3.15.0b2 (main, Jun 2 2026, 22:24:25) [Clang 22.1.3 ] on linux Type help, copyright, credits or license for more information. 按照duckdb存储库上这个帖子https://github.com/duckdb/duckdb/discussions/12523和文档https://duckdb.org/docs/current/dev/building/linux的信息安装了libstdc就可以了。/ # apk add libstdc (1/2) Installing libgcc (15.2.0-r2) (2/2) Installing libstdc (15.2.0-r2) OK: 10.9 MiB in 18 packages / # cd /par /par # ./duckdbmusl DuckDB v1.6.0-dev8190 (Development Version, 7b77b875db) Enter .help for usage hints. memory D至于为什么gcc镜像里的libstdc不能用可能与musl需要的版本冲突。