From ffdce51cd5bd31c1680d4f28b383837682cb7d41 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 27 Mar 2025 00:09:20 -0400 Subject: [PATCH 1/4] Fix a bunch of missing meson boilerplate These other libraries need this too --- src/libcmd/meson.build | 5 +++++ src/libexpr/meson.build | 5 +++++ src/libfetchers/meson.build | 5 +++++ src/libflake/meson.build | 5 +++++ src/libmain/meson.build | 5 +++++ 5 files changed, 25 insertions(+) diff --git a/src/libcmd/meson.build b/src/libcmd/meson.build index 4145f408a..114c099df 100644 --- a/src/libcmd/meson.build +++ b/src/libcmd/meson.build @@ -113,10 +113,15 @@ headers = [config_h] + files( 'repl.hh', ) +subdir('nix-meson-build-support/export-all-symbols') +subdir('nix-meson-build-support/windows-version') + this_library = library( 'nixcmd', sources, dependencies : deps_public + deps_private + deps_other, + include_directories : include_dirs, + link_args: linker_export_flags, prelink : true, # For C++ static initializers install : true, ) diff --git a/src/libexpr/meson.build b/src/libexpr/meson.build index 348c2320e..040da3dbc 100644 --- a/src/libexpr/meson.build +++ b/src/libexpr/meson.build @@ -186,6 +186,9 @@ headers = [config_h] + files( subdir('primops') +subdir('nix-meson-build-support/export-all-symbols') +subdir('nix-meson-build-support/windows-version') + this_library = library( 'nixexpr', sources, @@ -193,6 +196,8 @@ this_library = library( lexer_tab, generated_headers, dependencies : deps_public + deps_private + deps_other, + include_directories : include_dirs, + link_args: linker_export_flags, prelink : true, # For C++ static initializers install : true, ) diff --git a/src/libfetchers/meson.build b/src/libfetchers/meson.build index 725254b56..f8efbc8d3 100644 --- a/src/libfetchers/meson.build +++ b/src/libfetchers/meson.build @@ -76,10 +76,15 @@ headers = files( 'tarball.hh', ) +subdir('nix-meson-build-support/export-all-symbols') +subdir('nix-meson-build-support/windows-version') + this_library = library( 'nixfetchers', sources, dependencies : deps_public + deps_private + deps_other, + include_directories : include_dirs, + link_args: linker_export_flags, prelink : true, # For C++ static initializers install : true, ) diff --git a/src/libflake/meson.build b/src/libflake/meson.build index 006d7911e..b780722de 100644 --- a/src/libflake/meson.build +++ b/src/libflake/meson.build @@ -68,11 +68,16 @@ headers = files( 'flake/url-name.hh', ) +subdir('nix-meson-build-support/export-all-symbols') +subdir('nix-meson-build-support/windows-version') + this_library = library( 'nixflake', sources, generated_headers, dependencies : deps_public + deps_private + deps_other, + include_directories : include_dirs, + link_args: linker_export_flags, prelink : true, # For C++ static initializers install : true, ) diff --git a/src/libmain/meson.build b/src/libmain/meson.build index 00f945f49..6a0a22295 100644 --- a/src/libmain/meson.build +++ b/src/libmain/meson.build @@ -82,10 +82,15 @@ headers = [config_h] + files( 'shared.hh', ) +subdir('nix-meson-build-support/export-all-symbols') +subdir('nix-meson-build-support/windows-version') + this_library = library( 'nixmain', sources, dependencies : deps_public + deps_private + deps_other, + include_directories : include_dirs, + link_args: linker_export_flags, prelink : true, # For C++ static initializers install : true, ) From 459fb59493d62b97e7e5219d542fcddc62aab0b5 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Fri, 28 Mar 2025 10:45:27 -0400 Subject: [PATCH 2/4] Remove boost env vars https://github.com/NixOS/nixpkgs/issues/86131 is now fixed! --- packaging/dev-shell.nix | 4 ---- src/libexpr/package.nix | 7 ------- src/libstore/package.nix | 7 ------- src/libutil/package.nix | 7 ------- 4 files changed, 25 deletions(-) diff --git a/packaging/dev-shell.nix b/packaging/dev-shell.nix index 1b6c37f35..e824ebf71 100644 --- a/packaging/dev-shell.nix +++ b/packaging/dev-shell.nix @@ -72,10 +72,6 @@ pkgs.nixComponents.nix-util.overrideAttrs ( src = null; env = { - # Needed for Meson to find Boost. - # https://github.com/NixOS/nixpkgs/issues/86131. - BOOST_INCLUDEDIR = "${lib.getDev pkgs.nixDependencies.boost}/include"; - BOOST_LIBRARYDIR = "${lib.getLib pkgs.nixDependencies.boost}/lib"; # For `make format`, to work without installing pre-commit _NIX_PRE_COMMIT_HOOKS_CONFIG = "${(pkgs.formats.yaml { }).generate "pre-commit-config.yaml" modular.pre-commit.settings.rawConfig diff --git a/src/libexpr/package.nix b/src/libexpr/package.nix index 533dae9f2..141b77fac 100644 --- a/src/libexpr/package.nix +++ b/src/libexpr/package.nix @@ -81,13 +81,6 @@ mkMesonLibrary (finalAttrs: { (lib.mesonEnable "gc" enableGC) ]; - env = { - # Needed for Meson to find Boost. - # https://github.com/NixOS/nixpkgs/issues/86131. - BOOST_INCLUDEDIR = "${lib.getDev boost}/include"; - BOOST_LIBRARYDIR = "${lib.getLib boost}/lib"; - }; - meta = { platforms = lib.platforms.unix ++ lib.platforms.windows; }; diff --git a/src/libstore/package.nix b/src/libstore/package.nix index 31867d331..11c8be261 100644 --- a/src/libstore/package.nix +++ b/src/libstore/package.nix @@ -78,13 +78,6 @@ mkMesonLibrary (finalAttrs: { (lib.mesonOption "sandbox-shell" "${busybox-sandbox-shell}/bin/busybox") ]; - env = { - # Needed for Meson to find Boost. - # https://github.com/NixOS/nixpkgs/issues/86131. - BOOST_INCLUDEDIR = "${lib.getDev boost}/include"; - BOOST_LIBRARYDIR = "${lib.getLib boost}/lib"; - }; - meta = { platforms = lib.platforms.unix ++ lib.platforms.windows; }; diff --git a/src/libutil/package.nix b/src/libutil/package.nix index a0b80ade7..8114dd645 100644 --- a/src/libutil/package.nix +++ b/src/libutil/package.nix @@ -58,13 +58,6 @@ mkMesonLibrary (finalAttrs: { (lib.mesonEnable "cpuid" stdenv.hostPlatform.isx86_64) ]; - env = { - # Needed for Meson to find Boost. - # https://github.com/NixOS/nixpkgs/issues/86131. - BOOST_INCLUDEDIR = "${lib.getDev boost}/include"; - BOOST_LIBRARYDIR = "${lib.getLib boost}/lib"; - }; - meta = { platforms = lib.platforms.unix ++ lib.platforms.windows; }; From fb9c9ee35ae5c020e683ca29ba743ef3e4ab9d4d Mon Sep 17 00:00:00 2001 From: John Ericson Date: Fri, 28 Mar 2025 10:50:46 -0400 Subject: [PATCH 3/4] Link the right issue about the bad AWS pkg-config It is https://github.com/aws/aws-sdk-cpp/issues/2673 --- src/libstore/meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libstore/meson.build b/src/libstore/meson.build index 7b38bafe0..18ec9a73a 100644 --- a/src/libstore/meson.build +++ b/src/libstore/meson.build @@ -112,7 +112,8 @@ deps_public += nlohmann_json sqlite = dependency('sqlite3', 'sqlite', version : '>=3.6.19') deps_private += sqlite -# AWS C++ SDK has bad pkg-config +# AWS C++ SDK has bad pkg-config. See +# https://github.com/aws/aws-sdk-cpp/issues/2673 for details. aws_s3 = dependency('aws-cpp-sdk-s3', required : false) configdata.set('ENABLE_S3', aws_s3.found().to_int()) if aws_s3.found() From e4c571c2f1e25108a32546057ac6d53065c0b8f6 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Fri, 28 Mar 2025 11:04:48 -0400 Subject: [PATCH 4/4] Add a `withAWS` flag to libstore Nixpkgs wants this, at least. --- src/libstore/package.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libstore/package.nix b/src/libstore/package.nix index 11c8be261..f992684df 100644 --- a/src/libstore/package.nix +++ b/src/libstore/package.nix @@ -21,6 +21,10 @@ version, embeddedSandboxShell ? stdenv.hostPlatform.isStatic, + + withAWS ? + # Default is this way because there have been issues building this dependency + stdenv.hostPlatform == stdenv.buildPlatform && (stdenv.isLinux || stdenv.isDarwin), }: let @@ -60,9 +64,7 @@ mkMesonLibrary (finalAttrs: { ++ lib.optional stdenv.hostPlatform.isLinux libseccomp # There have been issues building these dependencies ++ lib.optional stdenv.hostPlatform.isDarwin darwin.apple_sdk.libs.sandbox - ++ lib.optional ( - stdenv.hostPlatform == stdenv.buildPlatform && (stdenv.isLinux || stdenv.isDarwin) - ) aws-sdk-cpp; + ++ lib.optional withAWS aws-sdk-cpp; propagatedBuildInputs = [ nix-util