Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failure: musl (building on darwin for x86_64-unknown-linux-musl) #285141

Closed
timbertson opened this issue Jan 31, 2024 · 1 comment
Closed
Labels
0.kind: build failure A package fails to build 6.topic: musl Running or building packages with musl libc

Comments

@timbertson
Copy link
Contributor

timbertson commented Jan 31, 2024

Steps To Reproduce

$ cat > test.nix <<EOF
with import <nixpkgs> {
	crossSystem.config = "x86_64-unknown-linux-musl";
};
stdenv
EOF

$ nix-build test.nix

Build log

Build is successful, however the installation produces an inaccessible file:

$ ls -l /nix/store/fgkznmnz1swzp8ck75fa2zvj62pkjgvq-musl-x86_64-unknown-linux-musl-1.2.3/lib/ld-musl-x86_64.so.1
ls: cannot read symbolic link '/nix/store/fgkznmnz1swzp8ck75fa2zvj62pkjgvq-musl-x86_64-unknown-linux-musl-1.2.3/lib/ld-musl-x86_64.so.1': Permission denied
lrwx------ 1 root wheel 7 Jan  1  1970 /nix/store/fgkznmnz1swzp8ck75fa2zvj62pkjgvq-musl-x86_64-unknown-linux-musl-1.2.3/lib/ld-musl-x86_64.so.1

The permissions are 0700, which is only possible on a mac (on linux symlinks always have permission 0777 reference).

The relevant log is:

Running phase: installPhase
install flags: -j12 SHELL=/nix/store/1jir4q091l8df6n00ialfwc6c7j5yark-bash-5.2-p15/bin/bash pkgconfigdir=/nix/store/r1qd33gkzdxipfdidbvnhpnrn66gpp9x-musl-x86_64-unknown-linux-musl-1.2.3-dev/lib/pkgconfig m4datadir=/nix/store/r1qd33gkzdxipfdidbvnhpnrn66gpp9x-musl-x86_64-unknown-linux-musl-1.2.3-dev/share/aclocal aclocaldir=/nix/store/r1qd33gkzdxipfdidbvnhpnrn66gpp9x-musl-x86_64-unknown-linux-musl-1.2.3-dev/share/aclocal install
./tools/install.sh -D -m 644 lib/Scrt1.o /nix/store/a6kkq8ckik47p85xvzacy8rqdkdrcasm-musl-x86_64-unknown-linux-musl-1.2.3/lib/Scrt1.o
./tools/install.sh -D -m 644 lib/crt1.o /nix/store/a6kkq8ckik47p85xvzacy8rqdkdrcasm-musl-x86_64-unknown-linux-musl-1.2.3/lib/crt1.o
./tools/install.sh -D -m 644 lib/rcrt1.o /nix/store/a6kkq8ckik47p85xvzacy8rqdkdrcasm-musl-x86_64-unknown-linux-musl-1.2.3/lib/rcrt1.o
./tools/install.sh -D -m 644 lib/crti.o /nix/store/a6kkq8ckik47p85xvzacy8rqdkdrcasm-musl-x86_64-unknown-linux-musl-1.2.3/lib/crti.o
./tools/install.sh -D -m 644 lib/crtn.o /nix/store/a6kkq8ckik47p85xvzacy8rqdkdrcasm-musl-x86_64-unknown-linux-musl-1.2.3/lib/crtn.o
./tools/install.sh -D -m 644 lib/libc.a /nix/store/a6kkq8ckik47p85xvzacy8rqdkdrcasm-musl-x86_64-unknown-linux-musl-1.2.3/lib/libc.a
./tools/install.sh -D -m 755 lib/libc.so /nix/store/a6kkq8ckik47p85xvzacy8rqdkdrcasm-musl-x86_64-unknown-linux-musl-1.2.3/lib/libc.so
./tools/install.sh -D -m 644 lib/libm.a /nix/store/a6kkq8ckik47p85xvzacy8rqdkdrcasm-musl-x86_64-unknown-linux-musl-1.2.3/lib/libm.a
./tools/install.sh -D -m 644 lib/librt.a /nix/store/a6kkq8ckik47p85xvzacy8rqdkdrcasm-musl-x86_64-unknown-linux-musl-1.2.3/lib/librt.a
./tools/install.sh -D -m 644 lib/libpthread.a /nix/store/a6kkq8ckik47p85xvzacy8rqdkdrcasm-musl-x86_64-unknown-linux-musl-1.2.3/lib/libpthread.a
./tools/install.sh -D -m 644 lib/libcrypt.a /nix/store/a6kkq8ckik47p85xvzacy8rqdkdrcasm-musl-x86_64-unknown-linux-musl-1.2.3/lib/libcrypt.a
./tools/install.sh -D -m 644 lib/libutil.a /nix/store/a6kkq8ckik47p85xvzacy8rqdkdrcasm-musl-x86_64-unknown-linux-musl-1.2.3/lib/libutil.a
./tools/install.sh -D -m 644 lib/libxnet.a /nix/store/a6kkq8ckik47p85xvzacy8rqdkdrcasm-musl-x86_64-unknown-linux-musl-1.2.3/lib/libxnet.a
./tools/install.sh -D -m 644 lib/libresolv.a /nix/store/a6kkq8ckik47p85xvzacy8rqdkdrcasm-musl-x86_64-unknown-linux-musl-1.2.3/lib/libresolv.a
./tools/install.sh -D -m 644 lib/libdl.a /nix/store/a6kkq8ckik47p85xvzacy8rqdkdrcasm-musl-x86_64-unknown-linux-musl-1.2.3/lib/libdl.a
./tools/install.sh -D -m 644 lib/musl-gcc.specs /nix/store/a6kkq8ckik47p85xvzacy8rqdkdrcasm-musl-x86_64-unknown-linux-musl-1.2.3/lib/musl-gcc.specs
./tools/install.sh -D -l libc.so /nix/store/a6kkq8ckik47p85xvzacy8rqdkdrcasm-musl-x86_64-unknown-linux-musl-1.2.3/lib/ld-musl-x86_64.so.1 || true
./tools/install.sh -D -m 644 include/aio.h /nix/store/r1qd33gkzdxipfdidbvnhpnrn66gpp9x-musl-x86_64-unknown-linux-musl-1.2.3-dev/include/aio.h
./tools/install.sh -D -m 644 include/alloca.h /nix/store/r1qd33gkzdxipfdidbvnhpnrn66gpp9x-musl-x86_64-unknown-linux-musl-1.2.3-dev/include/alloca.h
./tools/install.sh -D -m 644 include/ar.h /nix/store/r1qd33gkzdxipfdidbvnhpnrn66gpp9x-musl-x86_64-unknown-linux-musl-1.2.3-dev/include/ar.h
./tools/install.sh -D -m 644 include/arpa/ftp.h /nix/store/r1qd33gkzdxipfdidbvnhpnrn66gpp9x-musl-x86_64-unknown-linux-musl-1.2.3-dev/include/arpa/ftp.h
./tools/install.sh -D -m 644 include/arpa/inet.h /nix/store/r1qd33gkzdxipfdidbvnhpnrn66gpp9x-musl-x86_64-unknown-linux-musl-1.2.3-dev/include/arpa/inet.h
./tools/install.sh -D -m 644 include/arpa/nameser.h /nix/store/r1qd33gkzdxipfdidbvnhpnrn66gpp9x-musl-x86_64-unknown-linux-musl-1.2.3-dev/include/arpa/nameser.h
./tools/install.sh -D -m 644 include/arpa/nameser_compat.h /nix/store/r1qd33gkzdxipfdidbvnhpnrn66gpp9x-musl-x86_64-unknown-linux-musl-1.2.3-dev/include/arpa/nameser_compat.h
./tools/install.sh -D -m 644 include/arpa/telnet.h /nix/store/r1qd33gkzdxipfdidbvnhpnrn66gpp9x-musl-x86_64-unknown-linux-musl-1.2.3-dev/include/arpa/telnet.h
( ... )

Note that the line for installing lib/ld-musl-x86_64.so.1 doesn't include the -m 644 flag

Additional context

Add any other context about the problem here.

Notify maintainers

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
output here

Add a 👍 reaction to issues you find important.

@timbertson timbertson added the 0.kind: build failure A package fails to build label Jan 31, 2024
@timbertson timbertson changed the title Build failure: pkgsCross.aarch64-multiplatform.gcc is broken on aarch64-darwin musl (building on darwin for x86_64-unknown-linux-musl) Build failure: musl (building on darwin for x86_64-unknown-linux-musl) Jan 31, 2024
timbertson added a commit to timbertson/runix that referenced this issue Jan 31, 2024
Uses timbertson/nixpkgs#22-11-musl to workaround NixOS/nixpkgs#285141
timbertson added a commit to timbertson/nixpkgs that referenced this issue Feb 10, 2024
@FliegendeWurst
Copy link
Member

Fixed in #229439

@tomodachi94 tomodachi94 added the 6.topic: musl Running or building packages with musl libc label Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: build failure A package fails to build 6.topic: musl Running or building packages with musl libc
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants