Trying to build sysutils/nix (2.3.11_1) in poudriere on 12.4-stable/amd64 triggers linker errors with some undefined symbols in AWS libs. ============ . . LD src/libstore/libnixstore.so ld: error: undefined symbol: Aws::Crt::ByteCursorFromArray(unsigned char const*, unsigned long) >>> referenced by DefaultEndpointProvider.h:53 (/usr/local/include/aws/core/endpoint/DefaultEndpointProvider.h:53) >>> src/libstore/s3-binary-cache-store.o:(Aws::Endpoint::DefaultEndpointProvider<Aws::Client::GenericClientConfiguration<true>, Aws::Endpoint::BuiltInParameters, Aws::Endpoint::ClientContextParameters>::DefaultEndpointProvider(char const*, unsigned long)) >>> referenced by DefaultEndpointProvider.h:54 (/usr/local/include/aws/core/endpoint/DefaultEndpointProvider.h:54) >>> src/libstore/s3-binary-cache-store.o:(Aws::Endpoint::DefaultEndpointProvider<Aws::Client::GenericClientConfiguration<true>, Aws::Endpoint::BuiltInParameters, Aws::Endpoint::ClientContextParameters>::DefaultEndpointProvider(char const*, unsigned long)) >>> referenced by DefaultEndpointProvider.h:53 (/usr/local/include/aws/core/endpoint/DefaultEndpointProvider.h:53) >>> src/libstore/s3-binary-cache-store.o:(Aws::Endpoint::DefaultEndpointProvider<Aws::S3::S3ClientConfiguration, Aws::S3::Endpoint::S3BuiltInParameters, Aws::S3::Endpoint::S3ClientContextParameters>::DefaultEndpointProvider(char const*, unsigned long)) >>> referenced 1 more times ld: error: undefined symbol: Aws::Crt::ApiAllocator() >>> referenced by DefaultEndpointProvider.h:53 (/usr/local/include/aws/core/endpoint/DefaultEndpointProvider.h:53) >>> src/libstore/s3-binary-cache-store.o:(Aws::Endpoint::DefaultEndpointProvider<Aws::Client::GenericClientConfiguration<true>, Aws::Endpoint::BuiltInParameters, Aws::Endpoint::ClientContextParameters>::DefaultEndpointProvider(char const*, unsigned long)) >>> referenced by DefaultEndpointProvider.h:53 (/usr/local/include/aws/core/endpoint/DefaultEndpointProvider.h:53) >>> src/libstore/s3-binary-cache-store.o:(Aws::Endpoint::DefaultEndpointProvider<Aws::S3::S3ClientConfiguration, Aws::S3::Endpoint::S3BuiltInParameters, Aws::S3::Endpoint::S3ClientContextParameters>::DefaultEndpointProvider(char const*, unsigned long)) ld: error: undefined symbol: Aws::Crt::Endpoints::RuleEngine::RuleEngine(aws_byte_cursor const&, aws_byte_cursor const&, aws_allocator*) >>> referenced by DefaultEndpointProvider.h:53 (/usr/local/include/aws/core/endpoint/DefaultEndpointProvider.h:53) >>> src/libstore/s3-binary-cache-store.o:(Aws::Endpoint::DefaultEndpointProvider<Aws::Client::GenericClientConfiguration<true>, Aws::Endpoint::BuiltInParameters, Aws::Endpoint::ClientContextParameters>::DefaultEndpointProvider(char const*, unsigned long)) >>> referenced by DefaultEndpointProvider.h:53 (/usr/local/include/aws/core/endpoint/DefaultEndpointProvider.h:53) >>> src/libstore/s3-binary-cache-store.o:(Aws::Endpoint::DefaultEndpointProvider<Aws::S3::S3ClientConfiguration, Aws::S3::Endpoint::S3BuiltInParameters, Aws::S3::Endpoint::S3ClientContextParameters>::DefaultEndpointProvider(char const*, unsigned long)) ld: error: undefined symbol: Aws::Crt::Endpoints::RuleEngine::~RuleEngine() >>> referenced by DefaultEndpointProvider.h:59 (/usr/local/include/aws/core/endpoint/DefaultEndpointProvider.h:59) >>> src/libstore/s3-binary-cache-store.o:(Aws::Endpoint::DefaultEndpointProvider<Aws::Client::GenericClientConfiguration<true>, Aws::Endpoint::BuiltInParameters, Aws::Endpoint::ClientContextParameters>::DefaultEndpointProvider(char const*, unsigned long)) >>> referenced by DefaultEndpointProvider.h:63 (/usr/local/include/aws/core/endpoint/DefaultEndpointProvider.h:63) >>> src/libstore/s3-binary-cache-store.o:(Aws::Endpoint::DefaultEndpointProvider<Aws::Client::GenericClientConfiguration<true>, Aws::Endpoint::BuiltInParameters, Aws::Endpoint::ClientContextParameters>::~DefaultEndpointProvider()) >>> referenced by DefaultEndpointProvider.h:59 (/usr/local/include/aws/core/endpoint/DefaultEndpointProvider.h:59) >>> src/libstore/s3-binary-cache-store.o:(Aws::Endpoint::DefaultEndpointProvider<Aws::S3::S3ClientConfiguration, Aws::S3::Endpoint::S3BuiltInParameters, Aws::S3::Endpoint::S3ClientContextParameters>::DefaultEndpointProvider(char const*, unsigned long)) >>> referenced 1 more times c++: error: linker command failed with exit code 1 (use -v to see invocation) gmake[1]: *** [mk/lib.mk:104: src/libstore/libnixstore.so] Error 1 gmake[1]: Leaving directory '/wrkdirs/usr/ports/sysutils/nix/work/nix-2.3.11' ===> Compilation failed unexpectedly. ============
Created attachment 240342 [details] [patch] update nix to 2.13.2 - resolves aws linking issues The attached patch updates nix to 2.13.2 - remove stale patches - add new BUILD_DEPENDS & LIB_DEPENDS - add CPUID option to optionally link with libcpuid (relevant to amd64 according to configure script) - update (and simplify) list of files to strip (no need to strip sym links to nix) - minor Makefile shuffling per portclippy suggestion (CPE_VENDOR line) - update plist
Thanks for the patch. I cannot review the patch at the moment, but if any other committer would like to merge it, I'm alright with it.
Created attachment 240491 [details] [patch] update nix to 2.13.2 - resolves aws linking issues (v2) Here is an update to the previous patch to include missing deps now needed for 1.13.2, get non-default PREFIX working, and get 'make test' fully working. In a bit more detail v2 includes the following changes missed in the previous patch: - Add missing build deps: googletest, jq, nlohmann-json - Add missing lib deps: USES+=libarchive - Change HAS_CONFIGURE to GNU_CONFIGURE to get PREFIX working - Specify GNU_CONFIGURE_MANPREFIX in share/ (matches plist) - needed after switch to GNU_CONFIGURE which specifies --mandir. - Use static patches instead of REINPLACE_CMD for linux/freebsd test compatibility fixes (sed -i, wc -l, GNU vs BSD cmp & touch). Some of these could be upstreamed. - Fix getSelfExe for FreeBSD [[1]]. The patch for this can be submitted upstream. - Update _ALL_TESTS (also see files/Makefile.regentestlist to help future developers when updating this port - the previous comment instructions for updating _ALL_TESTS do not work for 2.13.2). QA: poudriere testport -P (ok - 12-stable (amd64 & i386)) portlint, portclippy (ok) 'make test' (ok, amd64) [[1]] The getSelfExe() fix was noticed when the tests/flakes/flakes.sh test was run: error: executing 'nix': No such file or directory error: … while reading the response from the build hook The reason is that src/libstore/build/hook-instance.c uses execv(3) which does not use PATH from the environment (like execvp(3)). So it needs a full path to the executable. And with the failure of getSelfExe() (before the patch), it would just use "nix" (instead of "/usr/local/bin/nix"). Hence the ENOENT failure.
Created attachment 240514 [details] [patch] update nix to 2.13.2 - resolves aws linking issues (v3) Minor update to patch. I noticed that gxargs is no longer a test dependency. That's the only change to the v3 patch (vs v2).
Created attachment 240518 [details] [backtrace] i386 core dump for a 'nix flake' test FYI, while 'make test' on amd64 passed, it did not on i386. Attached is a backtrace of a core file produced by 'nix flake metadata flake1' in tests/flakes/flakes.sh I don't necessarily think this failure on i386 is a show stopper for updating to the latest nix, it's worth noting. I don't know if the old nix worked on i386 either (I could never build it with the latest versions dependencies - maybe it used to build on i386 with old aws-sdk-cpp, for instance?). I'll try to dig in and find the root cause at some point. Maybe setting TEST_BROKEN_i386 is the appropriate course of action for now. It may be that the test failure is an indication that the tool is broken on i386 entirely. I don't know yet.
The port is now marked broken with ports 9716c216d0b35bbae4a1946ed04506b1bc1c6f19 which did not reference this bug 269637 Also upstream is now at 2.15.0. I will generate a new patch against the newer release when I have a chance. But the current patch will unbreak the port and could be committed as a step to getting this port updated.
Can you share a refreshed patch based on current git tree. This patch no longer applies to the tree.
This patch applied to me, just with -p1 with /usr/ports as the cwd
I only had to add ${LOCALBASE}/include/nlohmann/json.hpp:devel/nlohman n-json to BUILD_DEPENDS to make it build on FreeBSD 14
Created attachment 245360 [details] [patch] update nix to 2.13.2 - resolves aws linking issues (v4) (In reply to Muhammad Moinur Rahman from comment #7) Here's a refresh of the patch. No functional changes from the patch as described in comment 3 and comment 4 - just re-generated against the latest ports tree.
Created attachment 245361 [details] [patch] update nix to 2.13.2 - resolves aws linking issues (v5) (In reply to John Hein from comment #10) Forgot to remove BROKEN.
Created attachment 245362 [details] [patch] update nix to 2.13.2 - resolves aws linking issues (v6) (In reply to John Hein from comment #11) Sigh. Really regen against latest ports tree (missed recent PORTREVISION bump).
I don't know why you asked for my approval as I am not the maintainer. But you should try these patches on a poudriere tester. There are lots of dependencies missing. I have tried to add some of the missing ones but it's going on and on. So I will stop here for now and request you to recheck this please. Take your time to solve this; there is no hurry. Just an example of what went wrong: https://pkg.bofh.network/data/132-default/2023-10-02_06h42m09s/logs/errors/nix-2.13.2.log Trying to build a port locally and submitting the patches is not helpful as you might be missing the dependencies which are already installed in your host.
I just tried to install this port anyway so I made copy of the port and commented BROKEN= to my surprise it actually complied fine without any other changes. Perhaps the AWS sdk needed updating at the time? nix-2.3.11_4 Name : nix Version : 2.3.11_4 Installed on : Fri Dec 15 22:36:27 2023 PST Origin : sysutils/nix-work Architecture : FreeBSD:13:amd64 Prefix : /usr/local Categories : sysutils Licenses : LGPL21 Maintainer : ports@FreeBSD.org WWW : https://nixos.org/nix/ Comment : Purely functional package manager Options : DOCS : off Shared Libs required: libsqlite3.so.0 libsodium.so.23 libgc.so.1 libeditline.so.1 libcurl.so.4 libbrotlienc.so.1 libbrotlidec.so.1 libboost_thread.so.1.83.0 libboost_system.so.1.83.0 libboost_context.so.1.83.0 libaws-cpp-sdk-transfer.so libaws-cpp-sdk-s3.so libaws-cpp-sdk-core.so Shared Libs provided: libnixutil.so libnixstore.so libnixmain.so libnixexpr.so Annotations : FreeBSD_version: 1302001 cpe : cpe:2.3:a:nix_project:nix:2.3.11:::::freebsd13:x64:4 Flat size : 5.62MiB Description : Nix is a purely functional package manager. This means that it treats packages like values in purely functional programming languages such as Haskell -- they are built by functions that don't have side-effects, and they never change after they have been built. Nix stores packages in the Nix store, usually the directory /nix/store, where each package has its own unique subdirectory such as /nix/store/b6gvzjyb2pg0kjfwrjmg1vfhh54ad73z-firefox-33.1/ where b6gvzjyb2pg0... is a unique identifier for the package that captures all its dependencies (it's a cryptographic hash of the package's build dependency graph). This enables many powerful features.