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

Nix doesn't build on musl libc anymore #11931

Open
theoparis opened this issue Nov 21, 2024 · 3 comments
Open

Nix doesn't build on musl libc anymore #11931

theoparis opened this issue Nov 21, 2024 · 3 comments
Labels

Comments

@theoparis
Copy link

theoparis commented Nov 21, 2024

Describe the bug

I discovered the following issues when trying to build Nix on Chimera Linux:

Issue 1

FAILED: src/libutil/libnixutil.so.p/unix_file-descriptor.cc.o
sccache c++ -Isrc/libutil/libnixutil.so.p -Isrc/libutil -I../src/libutil -Isrc/libutil/linux -I../src/libutil/linux -Isrc/libutil/unix -I../src/libutil/unix -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c++2a -O0 -g -include config-util.hh -Wdeprecated-copy -Werror=suggest-override -Werror=switch -Werror=switch-enum -Werror=unused-result -Wignored-qualifiers -Wimplicit-fallthrough -Wno-deprecated-declarations -fPIC -DBOOST_CONTEXT_DYN_LINK=1 -DBOOST_COROUTINES_DYN_LINK=1 -DBOOST_ALL_NO_LIB -pthread -MD -MQ src/libutil/libnixutil.so.p/unix_file-descriptor.cc.o -MF src/libutil/libnixutil.so.p/unix_file-descriptor.cc.o.d -o src/libutil/libnixutil.so.p/unix_file-descriptor.cc.o -c ../src/libutil/unix/file-descriptor.cc
../src/libutil/unix/file-descriptor.cc:131:20: error: use of undeclared identifier 'SYS_close_range'
  131 |     return syscall(SYS_close_range, first, last, (unsigned int)flags);
      |                    ^
1 error generated.
[57/400] Compiling C++ object src/libstore/libnixstore.so.p/binary-cache-store.cc.o
ninja: build stopped: subcommand failed

Issue 2 (I installed rapidcheck with cmake and ninja)

src/libutil-test-support/build-utils-meson/export/meson.build:14:20: ERROR: requires argument not a string, library with pkgconfig-generated file or pkgconfig-dependency object, got <CMakeDependency rapidcheck: True None>

Issue 3

d -o src/libfetchers/libnixfetchers.so.p/git-utils.cc.o -c ../src/libfetchers/git-utils.cc
../src/libfetchers/git-utils.cc:288:13: error: use of undeclared identifier 'git_mempack_write_
thin_pack'
  288 |             git_mempack_write_thin_pack(mempack_backend, packBuilder.get())
      |             ^
1 error generated.

Steps To Reproduce

Build Nix on chimera linux or a musl libc system

Expected behavior

Successful build of the nix cli

nix-env --version output

Additional context

Related discussion on the musl mailing list from 2022: https://www.openwall.com/lists/musl/2022/08/18/3
https://github.com/search?q=repo%3Abminor%2Fmusl+sys_close_range&type=code returns nothing

Priorities

Add 👍 to issues you find important.

@theoparis theoparis added the bug label Nov 21, 2024
@theoparis
Copy link
Author

theoparis commented Nov 21, 2024

It seems like the alpine maintainers also encountered issue 3... Why is Nix using an unstable version of libgit2???

https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/75312

@theoparis
Copy link
Author

Related #11925

@Ericson2314
Copy link
Member

We contributed that change to libgit2. You'll need to grab the patch. Hopefully they'll release soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants