nix 2.16.1+dfsg-3 FTBFS

Bug #2037314 reported by Mateus Rodrigues de Morais
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nix (Debian)
Fix Released
Unknown
nix (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

nix 2.16.1+dfsg-3 fails to build from source:

```
...
g++ -o src/libstore/tests/libnixstore-tests -L/usr/lib/x86_64-linux-gnu -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -Wl,-z,relro -Wl,-z,now -L/usr/lib/x86_64-linux-gnu -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -Wl,-z,relro -Wl,-z,now -lgtest_main -lgtest src/libstore/tests/libnixstore-tests.a -lrapidcheck -lgtest_main -lgtest src/libutil/tests/libnixutil-tests.a -lrapidcheck -lgtest_main -lgtest src/libutil/libnixutil.a -pthread -lcrypto -ldl -pthread -lbrotlienc -lbrotlicommon -lbrotlidec -lbrotlicommon -larchive -lnettle -lacl -llzma -lzstd -llz4 -lbz2 -lz -lxml2 -lz -L/usr/lib/x86_64-linux-gnu -lboost_context -lcpuid src/libstore/libnixstore.a -lsqlite3 -lm -lz -lcurl -lnghttp2 -lidn2 -lrtmp -lssh -lssh -lpsl -lnettle -lgnutls -lgssapi_krb5 -llber -lldap -llber -lzstd -lbrotlidec -lz -lsodium -pthread -pthread -ldl -lseccomp src/libutil/libnixutil.a -pthread -lcrypto -ldl -pthread -lbrotlienc -lbrotlicommon -lbrotlidec -lbrotlicommon -larchive -lnettle -lacl -llzma -lzstd -llz4 -lbz2 -lz -lxml2 -lz -L/usr/lib/x86_64-linux-gnu -lboost_context -lcpuid src/libutil/libnixutil.a -pthread -lcrypto -ldl -pthread -lbrotlienc -lbrotlicommon -lbrotlidec -lbrotlicommon -larchive -lnettle -lacl -llzma -lzstd -llz4 -lbz2 -lz -lxml2 -lz -L/usr/lib/x86_64-linux-gnu -lboost_context -lcpuid
g++ -o src/libexpr/tests/libnixexpr-tests -L/usr/lib/x86_64-linux-gnu -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -Wl,-z,relro -Wl,-z,now -L/usr/lib/x86_64-linux-gnu -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -Wl,-z,relro -Wl,-z,now src/libexpr/tests/derived-path.o src/libexpr/tests/error_traces.o src/libexpr/tests/json.o src/libexpr/tests/primops.o src/libexpr/tests/trivial.o src/libexpr/tests/value/context.o -lgtest_main -lgtest -lgmock src/libstore/tests/libnixstore-tests.a -lrapidcheck -lgtest_main -lgtest src/libutil/tests/libnixutil-tests.a -lrapidcheck -lgtest_main -lgtest src/libutil/libnixutil.a -pthread -lcrypto -ldl -pthread -lbrotlienc -lbrotlicommon -lbrotlidec -lbrotlicommon -larchive -lnettle -lacl -llzma -lzstd -llz4 -lbz2 -lz -lxml2 -lz -L/usr/lib/x86_64-linux-gnu -lboost_context -lcpuid src/libstore/libnixstore.a -lsqlite3 -lm -lz -lcurl -lnghttp2 -lidn2 -lrtmp -lssh -lssh -lpsl -lnettle -lgnutls -lgssapi_krb5 -llber -lldap -llber -lzstd -lbrotlidec -lz -lsodium -pthread -pthread -ldl -lseccomp src/libutil/libnixutil.a -pthread -lcrypto -ldl -pthread -lbrotlienc -lbrotlicommon -lbrotlidec -lbrotlicommon -larchive -lnettle -lacl -llzma -lzstd -llz4 -lbz2 -lz -lxml2 -lz -L/usr/lib/x86_64-linux-gnu -lboost_context -lcpuid src/libutil/libnixutil.a -pthread -lcrypto -ldl -pthread -lbrotlienc -lbrotlicommon -lbrotlidec -lbrotlicommon -larchive -lnettle -lacl -llzma -lzstd -llz4 -lbz2 -lz -lxml2 -lz -L/usr/lib/x86_64-linux-gnu -lboost_context -lcpuid src/libexpr/libnixexpr.a -lboost_context -pthread -ldl src/libutil/libnixutil.a -pthread -lcrypto -ldl -pthread -lbrotlienc -lbrotlicommon -lbrotlidec -lbrotlicommon -larchive -lnettle -lacl -llzma -lzstd -llz4 -lbz2 -lz -lxml2 -lz -L/usr/lib/x86_64-linux-gnu -lboost_context -lcpuid src/libstore/libnixstore.a -lsqlite3 -lm -lz -lcurl -lnghttp2 -lidn2 -lrtmp -lssh -lssh -lpsl -lnettle -lgnutls -lgssapi_krb5 -llber -lldap -llber -lzstd -lbrotlidec -lz -lsodium -pthread -pthread -ldl -lseccomp src/libutil/libnixutil.a -pthread -lcrypto -ldl -pthread -lbrotlienc -lbrotlicommon -lbrotlidec -lbrotlicommon -larchive -lnettle -lacl -llzma -lzstd -llz4 -lbz2 -lz -lxml2 -lz -L/usr/lib/x86_64-linux-gnu -lboost_context -lcpuid src/libfetchers/libnixfetchers.a -pthread src/libutil/libnixutil.a -pthread -lcrypto -ldl -pthread -lbrotlienc -lbrotlicommon -lbrotlidec -lbrotlicommon -larchive -lnettle -lacl -llzma -lzstd -llz4 -lbz2 -lz -lxml2 -lz -L/usr/lib/x86_64-linux-gnu -lboost_context -lcpuid src/libstore/libnixstore.a -lsqlite3 -lm -lz -lcurl -lnghttp2 -lidn2 -lrtmp -lssh -lssh -lpsl -lnettle -lgnutls -lgssapi_krb5 -llber -lldap -llber -lzstd -lbrotlidec -lz -lsodium -pthread -pthread -ldl -lseccomp src/libutil/libnixutil.a -pthread -lcrypto -ldl -pthread -lbrotlienc -lbrotlicommon -lbrotlidec -lbrotlicommon -larchive -lnettle -lacl -llzma -lzstd -llz4 -lbz2 -lz -lxml2 -lz -L/usr/lib/x86_64-linux-gnu -lboost_context -lcpuid -lgc -lpthread -ldl src/libutil/libnixutil.a -pthread -lcrypto -ldl -pthread -lbrotlienc -lbrotlicommon -lbrotlidec -lbrotlicommon -larchive -lnettle -lacl -llzma -lzstd -llz4 -lbz2 -lz -lxml2 -lz -L/usr/lib/x86_64-linux-gnu -lboost_context -lcpuid src/libstore/libnixstore.a -lsqlite3 -lm -lz -lcurl -lnghttp2 -lidn2 -lrtmp -lssh -lssh -lpsl -lnettle -lgnutls -lgssapi_krb5 -llber -lldap -llber -lzstd -lbrotlidec -lz -lsodium -pthread -pthread -ldl -lseccomp src/libutil/libnixutil.a -pthread -lcrypto -ldl -pthread -lbrotlienc -lbrotlicommon -lbrotlidec -lbrotlicommon -larchive -lnettle -lacl -llzma -lzstd -llz4 -lbz2 -lz -lxml2 -lz -L/usr/lib/x86_64-linux-gnu -lboost_context -lcpuid src/libfetchers/libnixfetchers.a -pthread src/libutil/libnixutil.a -pthread -lcrypto -ldl -pthread -lbrotlienc -lbrotlicommon -lbrotlidec -lbrotlicommon -larchive -lnettle -lacl -llzma -lzstd -llz4 -lbz2 -lz -lxml2 -lz -L/usr/lib/x86_64-linux-gnu -lboost_context -lcpuid src/libstore/libnixstore.a -lsqlite3 -lm -lz -lcurl -lnghttp2 -lidn2 -lrtmp -lssh -lssh -lpsl -lnettle -lgnutls -lgssapi_krb5 -llber -lldap -llber -lzstd -lbrotlidec -lz -lsodium -pthread -pthread -ldl -lseccomp src/libutil/libnixutil.a -pthread -lcrypto -ldl -pthread -lbrotlienc -lbrotlicommon -lbrotlidec -lbrotlicommon -larchive -lnettle -lacl -llzma -lzstd -llz4 -lbz2 -lz -lxml2 -lz -L/usr/lib/x86_64-linux-gnu -lboost_context -lcpuid
/usr/bin/ld: cannot find -lssh: No such file or directory
/usr/bin/ld: cannot find -lssh: No such file or directory
/usr/bin/ld: cannot find -lssh: No such file or directory
/usr/bin/ld: cannot find -lssh: No such file or directory
collect2: error: ld returned 1 exit status
...
```

Full log: https://launchpadlibrarian.net/683922275/buildlog_ubuntu-mantic-amd64.nix_2.16.1+dfsg-3_BUILDING.txt.gz

It currently builds on Debian sid with libssh2-1-dev using -lssh, but this seems to have a different behavior on Ubuntu, which seems to require -lssh2. I could not find the right place in the source tree to make that change.

Related branches

description: updated
description: updated
Revision history for this message
Vladimir Petko (vpa1977) wrote :

-lssh is defined in curl package config '/usr/lib/*/pkgconfig/libcurl.pc'.

It is read via
`# Look for libcurl, a required dependency.
PKG_CHECK_MODULES([LIBCURL], [libcurl], [CXXFLAGS="$LIBCURL_CFLAGS $CXXFLAGS"])
`
in configure.ac

libcurl depends on libssh-dev where as nix does not have this dependency.
adding libssh-dev to the control file solves the failure to build.

Revision history for this message
Mateus Rodrigues de Morais (mateus-morais) wrote :

vpa1977: awesome, thanks for looking into this! Since you're on +1 this week, will you submit the fix or should I?

Revision history for this message
Vladimir Petko (vpa1977) wrote :

I have one ready - I will finish MP and submit it =)

Revision history for this message
Vladimir Petko (vpa1977) wrote :

piuparts test

Revision history for this message
Dave Jones (waveform) wrote :

Sponsored; removing ubuntu-sponsors

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package nix - 2.16.1+dfsg-3ubuntu1

---------------
nix (2.16.1+dfsg-3ubuntu1) mantic; urgency=medium

  * d/control: add libssh-dev dependency (LP: #2037314).
  * d/t/control: disable tests requiring internet access.

 -- Vladimir Petko <email address hidden> Wed, 04 Oct 2023 15:33:09 +1300

Changed in nix (Ubuntu):
status: New → Fix Released
Changed in nix (Debian):
status: Unknown → New
Changed in nix (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.