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

Statically built Nix doesn't install its libraries #7021

Open
sternenseemann opened this issue Sep 10, 2022 · 1 comment
Open

Statically built Nix doesn't install its libraries #7021

sternenseemann opened this issue Sep 10, 2022 · 1 comment
Labels
bug build-problem Nix fails to compile or test; also improvements to build process

Comments

@sternenseemann
Copy link
Member

Describe the bug

$ nix-build -A pkgsStatic.nix
$ ls result/lib
systemd  tmpfiles.d

However, the still installed pkg-config files claim libraries are available:

$ nix-build -A pkgsStatic.nix.dev
$ cat result-dev/lib/pkgconfig/nix-main.pc 
prefix=/nix/store/756yh330xipm9fdncislpp46cxfh33an-nix-static-x86_64-unknown-linux-musl-2.11.0
libdir=/nix/store/756yh330xipm9fdncislpp46cxfh33an-nix-static-x86_64-unknown-linux-musl-2.11.0/lib
includedir=/nix/store/sssclazqrxw13h362k5afq729160zqw3-nix-static-x86_64-unknown-linux-musl-2.11.0-dev/include

Name: Nix
Description: Nix Package Manager
Version: 2.11.0
Libs: -L${libdir} -lnixmain
Cflags: -I${includedir}/nix -std=c++17

I think the static archive should be installed when static linking for the benefit of the packages that link against Nix. In nixpkgs of course we should use a separate output for this, so we don't redundantly ship parts of Nix to users of just the executable.

See also NixOS/nixpkgs#188401 (comment).

@roberth roberth added build-problem Nix fails to compile or test; also improvements to build process and removed installer labels Sep 15, 2022
zhaofengli added a commit to zhaofengli/nix that referenced this issue Jan 6, 2023
@zhaofengli
Copy link
Member

Was looking into getting Attic to build statically, and came across this issue. I submitted #7567.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug build-problem Nix fails to compile or test; also improvements to build process
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants