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

libdevil+pkgsMusl: cannot find -ldeflate #132218

Closed
int-index opened this issue Jul 31, 2021 · 3 comments
Closed

libdevil+pkgsMusl: cannot find -ldeflate #132218

int-index opened this issue Jul 31, 2021 · 3 comments
Labels
0.kind: bug Something is broken

Comments

@int-index
Copy link
Contributor

int-index commented Jul 31, 2021

Describe the bug

When building libdevil in pkgsMusl, the build fails with the following linker error:

libtool: link: g++ -shared -nostdlib /nix/store/4c13cwcklgkmkyi296a9mfqr1rb6sv6m-musl-1.2.2/lib/crti.o /nix/store/i7a5x595a3b9p8ln16agnnsrf894gdbm-gcc-10.3.0/lib/gcc/x86_64-unknown-linux-musl/10.3.0/crtbeginS.o  .libs/libIL_la-il_alloc.o .libs/libIL_la-il_doom.o .libs/libIL_la-il_stack.o .libs/libIL_la-il_pcx.o .libs/libIL_la-il_rle.o .libs/libIL_la-il_bits.o .libs/libIL_la-il_endian.o .libs/libIL_la-il_exr.o .libs/libIL_la-il_jpeg.o .libs/libIL_la-il_pic.o .libs/libIL_la-il_sgi.o .libs/libIL_la-il_bmp.o .libs/libIL_la-il_error.o .libs/libIL_la-il_lif.o .libs/libIL_la-il_png.o .libs/libIL_la-il_states.o .libs/libIL_la-il_convbuff.o .libs/libIL_la-il_files.o .libs/libIL_la-il_main.o .libs/libIL_la-il_pnm.o .libs/libIL_la-il_targa.o .libs/libIL_la-il_wdp.o .libs/libIL_la-il_convert.o .libs/libIL_la-il_gif.o .libs/libIL_la-il_manip.o .libs/libIL_la-il_profiles.o .libs/libIL_la-il_tiff.o .libs/libIL_la-il_cut.o .libs/libIL_la-il_header.o .libs/libIL_la-il_mdl.o .libs/libIL_la-il_quantizer.o .libs/libIL_la-il_utility.o .libs/libIL_la-il_dcx.o .libs/libIL_la-il_icon.o .libs/libIL_la-il_mng.o .libs/libIL_la-il_raw.o .libs/libIL_la-il_wal.o .libs/libIL_la-il_dds.o .libs/libIL_la-il_internal.o .libs/libIL_la-il_pal.o .libs/libIL_la-il_rawdata.o .libs/libIL_la-il_devil.o .libs/libIL_la-il_io.o .libs/libIL_la-il_pcd.o .libs/libIL_la-il_register.o .libs/libIL_la-il_psd.o .libs/libIL_la-il_fastconv.o .libs/libIL_la-il_neuquant.o .libs/libIL_la-il_dds-save.o .libs/libIL_la-il_psp.o .libs/libIL_la-il_pix.o .libs/libIL_la-il_pxr.o .libs/libIL_la-il_vtf.o .libs/libIL_la-il_xpm.o .libs/libIL_la-il_hdr.o .libs/libIL_la-il_icns.o .libs/libIL_la-il_jp2.o .libs/libIL_la-altivec_common.o .libs/libIL_la-altivec_typeconversion.o .libs/libIL_la-il_sun.o .libs/libIL_la-il_nvidia.o .libs/libIL_la-il_wbmp.o .libs/libIL_la-il_squish.o .libs/libIL_la-il_iff.o .libs/libIL_la-il_ilbm.o .libs/libIL_la-il_size.o .libs/libIL_la-il_tpl.o .libs/libIL_la-il_fits.o .libs/libIL_la-il_iwi.o .libs/libIL_la-il_blp.o .libs/libIL_la-il_ftx.o .libs/libIL_la-il_dicom.o .libs/libIL_la-il_rot.o .libs/libIL_la-il_texture.o .libs/libIL_la-il_dpx.o .libs/libIL_la-il_utx.o .libs/libIL_la-il_mp3.o   -Wl,-rpath -Wl,/nix/store/rslf9ramqpm0cigzshx9sb9m81awjkxg-libtiff-4.3.0/lib -Wl,-rpath -Wl,/nix/store/b493yxrr0glvv3988mkagqlq5k8rg5g1-xz-5.2.5/lib -Wl,-rpath -Wl,/nix/store/31xrqmhrqx1mki5dl695mbwln1nvzxbc-libpng-apng-1.6.37/lib -Wl,-rpath -Wl,/nix/store/wxrvirazjpjg28n7b4ic4xanma2g6j8i-libmng-2.0.3/lib -Wl,-rpath -Wl,/nix/store/4dp91920k88hf9xiwvk560imljzmhkx7-lcms-1.19/lib -Wl,-rpath -Wl,/nix/store/ffqns4hqmfarz4v0786bkr527ycba5l3-gcc-10.3.0-lib/lib/../lib64 -Wl,-rpath -Wl,/nix/store/rslf9ramqpm0cigzshx9sb9m81awjkxg-libtiff-4.3.0/lib -Wl,-rpath -Wl,/nix/store/b493yxrr0glvv3988mkagqlq5k8rg5g1-xz-5.2.5/lib -Wl,-rpath -Wl,/nix/store/31xrqmhrqx1mki5dl695mbwln1nvzxbc-libpng-apng-1.6.37/lib -Wl,-rpath -Wl,/nix/store/wxrvirazjpjg28n7b4ic4xanma2g6j8i-libmng-2.0.3/lib -Wl,-rpath -Wl,/nix/store/4dp91920k88hf9xiwvk560imljzmhkx7-lcms-1.19/lib -Wl,-rpath -Wl,/nix/store/ffqns4hqmfarz4v0786bkr527ycba5l3-gcc-10.3.0-lib/lib/../lib64 /nix/store/rslf9ramqpm0cigzshx9sb9m81awjkxg-libtiff-4.3.0/lib/libtiff.so /nix/store/b493yxrr0glvv3988mkagqlq5k8rg5g1-xz-5.2.5/lib/liblzma.so -ldeflate /nix/store/31xrqmhrqx1mki5dl695mbwln1nvzxbc-libpng-apng-1.6.37/lib/libpng16.so /nix/store/wxrvirazjpjg28n7b4ic4xanma2g6j8i-libmng-2.0.3/lib/libmng.so /nix/store/4dp91920k88hf9xiwvk560imljzmhkx7-lcms-1.19/lib/liblcms.so -ljpeg -L/nix/store/y3yaq4iz18cwdy00182raqrqqkij0cl1-openexr-2.5.7/lib -lIlmImf-2_5 -lImath-2_5 -lHalf-2_5 -lIex-2_5 -lIexMath-2_5 -lIlmThread-2_5 -lz -L/nix/store/5c4bda86vh2f3ylcs0mhxfgfnnp2yv0y-libjpeg-turbo-2.1.0/lib -L/nix/store/1dlhc7w4dlacgmkjbcx9454givv4kdqj-zlib-1.2.11/lib -L/nix/store/31xrqmhrqx1mki5dl695mbwln1nvzxbc-libpng-apng-1.6.37/lib -L/nix/store/b493yxrr0glvv3988mkagqlq5k8rg5g1-xz-5.2.5/lib -L/nix/store/rslf9ramqpm0cigzshx9sb9m81awjkxg-libtiff-4.3.0/lib -L/nix/store/2265hgdd0p74kpksylmi36nvi5giidpq-lcms2-2.12/lib -L/nix/store/wxrvirazjpjg28n7b4ic4xanma2g6j8i-libmng-2.0.3/lib -L/nix/store/4dp91920k88hf9xiwvk560imljzmhkx7-lcms-1.19/lib -L/nix/store/4m1k3nygch371wakfvw3syfybmwjgggs-ilmbase-2.5.7/lib -L/nix/store/4c13cwcklgkmkyi296a9mfqr1rb6sv6m-musl-1.2.2/lib -L/nix/store/ffqns4hqmfarz4v0786bkr527ycba5l3-gcc-10.3.0-lib/lib -L/nix/store/4qq14211l3470xlhcjl3r0lcx2f53p88-gcc-wrapper-10.3.0/bin -L/nix/store/i7a5x595a3b9p8ln16agnnsrf894gdbm-gcc-10.3.0/lib/gcc/x86_64-unknown-linux-musl/10.3.0 -L/nix/store/i7a5x595a3b9p8ln16agnnsrf894gdbm-gcc-10.3.0/lib/gcc/x86_64-unknown-linux-musl/10.3.0/../../../../lib64 -L/nix/store/i7a5x595a3b9p8ln16agnnsrf894gdbm-gcc-10.3.0/lib/gcc/x86_64-unknown-linux-musl/10.3.0/../../.. /nix/store/ffqns4hqmfarz4v0786bkr527ycba5l3-gcc-10.3.0-lib/lib/../lib64/libstdc++.so -lm -lc -lgcc_s /nix/store/i7a5x595a3b9p8ln16agnnsrf894gdbm-gcc-10.3.0/lib/gcc/x86_64-unknown-linux-musl/10.3.0/crtendS.o /nix/store/4c13cwcklgkmkyi296a9mfqr1rb6sv6m-musl-1.2.2/lib/crtn.o  -msse -msse2 -msse3   -pthread -Wl,-soname -Wl,libIL.so.1 -o .libs/libIL.so.1.1.0
/nix/store/vf20zcyqr3qzcjhdidzk377qankcqsqa-binutils-2.35.1/bin/ld: cannot find -ldeflate
  CC       muxinternal.lo
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:501: libIL.la] Error 1
make[1]: Leaving directory '/build/devil-1.7.8/lib'
make: *** [Makefile:322: all-recursive] Error 1
builder for '/nix/store/n24v74x7736yaycg9yk2cccqva0fdwig-libdevil-1.7.8.drv' failed with exit code 2

Steps To Reproduce

Steps to reproduce the behavior:

  1. check out nixpkgs commit 95f1154f993bc788bad7df1feed1b98c7e7381cb (that was latest master when I started testing)
  2. in pkgs/development/interpreters/python/cpython/default.nix set enableLTO to false to work around Python3 fails to build with musl #131557
  3. run nix-shell -p pkgsMusl.libdevil

Expected behavior

Successful build.

Additional context

The fix is to add libdeflate to build inputs, done in #132220

Notify maintainers

@Phreedom

Metadata

$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 5.10.45, NixOS, 21.11.git.09c38c29f2c (Porcupine)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.3.12`
 - nixpkgs: `/etc/nixos/nixpkgs`

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute: pkgsMusl.libdevil
# a list of nixos modules affected by the problem
module:
@risicle
Copy link
Contributor

risicle commented Jul 31, 2021

I'm having a hard time reproducing this. Building on master, 802d739 (with the python change you mentioned) results in /nix/store/biqlmhcb4k2bgwb46746ar13a8n4qxh2-libdevil-1.7.8.drv, which builds fine for me on nixos x86_64.

@int-index
Copy link
Contributor Author

Thanks for looking into this. There may be more factors at play than I assumed. I was definitely getting this error when working on https://github.com/nh2/static-haskell-nix which uses pkgsMusl, but maybe one of the overrides there causes the issue to surface.

In any case, -ldeflate is one of the options passed to g++, so libdeflate should be in buildInputs, right?

@int-index
Copy link
Contributor Author

Wait, no. Grepping through libdevil sources, I see no mention of libdeflate. So it has got to be one of the overrides doing the wrong thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants