From 01ffee00337fed43f5064df0d4c5ffcf4bcd57e8 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 24 Mar 2025 16:29:59 +0100 Subject: [PATCH 01/84] Bump version --- .version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.version b/.version index f0465234b..05abc5526 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -2.27.1 +2.27.2 From 79122c66b1d0fb4acc2d32ed808315770d953ba5 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Wed, 25 Dec 2024 21:09:58 +0000 Subject: [PATCH 02/84] local-derivation-goal: improve "illegal reference" error Before the change "illegal reference" was hard to interpret as it did not mention what derivation actually hits it. Today's `nixpkgs` example: Before the change: $ nix build --no-link -f. postgresql_14 ... error: derivation contains an illegal reference specifier 'man' After the change: $ nix build --no-link -f. postgresql_14 ... error: derivation '/nix/store/bxp6g57limvwiga61vdlyvhy7i8rp6wd-postgresql-14.15.drv' output check for 'lib' contains an illegal reference specifier 'man', expected store path or output name (one of [debug, dev, doc, lib, out]) (cherry picked from commit bbdc3197a925b56bdec1220089de7622832bd2a3) --- src/libstore/unix/build/local-derivation-goal.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/libstore/unix/build/local-derivation-goal.cc b/src/libstore/unix/build/local-derivation-goal.cc index b4f5c23a4..500f2aa0d 100644 --- a/src/libstore/unix/build/local-derivation-goal.cc +++ b/src/libstore/unix/build/local-derivation-goal.cc @@ -2920,8 +2920,17 @@ void LocalDerivationGoal::checkOutputs(const std::mappath); - else - throw BuildError("derivation contains an illegal reference specifier '%s'", i); + else { + std::string allOutputs; + for (auto & o : outputs) { + if (! allOutputs.empty()) + allOutputs.append(", "); + allOutputs.append(o.first); + } + throw BuildError("derivation '%s' output check for '%s' contains an illegal reference specifier '%s'," + " expected store path or output name (one of [%s])", + worker.store.printStorePath(drvPath), outputName, i, allOutputs); + } } auto used = recursive From f9d1f3616944301e47ed2803a8171e5303cf7daf Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sat, 18 Jan 2025 09:44:46 +0100 Subject: [PATCH 03/84] nix-util: Add concatMapStrings (cherry picked from commit f3dbaa3f54c54b0a71e230ab097c9a72d17c3ed9) --- src/libutil-tests/strings.cc | 36 ++++++++++++++++++++++++++++++++++++ src/libutil/strings.hh | 14 ++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/src/libutil-tests/strings.cc b/src/libutil-tests/strings.cc index 206890bcf..33a1fae9b 100644 --- a/src/libutil-tests/strings.cc +++ b/src/libutil-tests/strings.cc @@ -80,6 +80,42 @@ TEST(concatStringsSep, buildSingleString) ASSERT_EQ(concatStringsSep(",", strings), "this"); } +TEST(concatMapStringsSep, empty) +{ + Strings strings; + + ASSERT_EQ(concatMapStringsSep(",", strings, [](const std::string & s) { return s; }), ""); +} + +TEST(concatMapStringsSep, justOne) +{ + Strings strings; + strings.push_back("this"); + + ASSERT_EQ(concatMapStringsSep(",", strings, [](const std::string & s) { return s; }), "this"); +} + +TEST(concatMapStringsSep, two) +{ + Strings strings; + strings.push_back("this"); + strings.push_back("that"); + + ASSERT_EQ(concatMapStringsSep(",", strings, [](const std::string & s) { return s; }), "this,that"); +} + +TEST(concatMapStringsSep, map) +{ + std::map strings; + strings["this"] = "that"; + strings["1"] = "one"; + + ASSERT_EQ( + concatMapStringsSep( + ", ", strings, [](const std::pair & s) { return s.first + " -> " + s.second; }), + "1 -> one, this -> that"); +} + /* ---------------------------------------------------------------------------- * dropEmptyInitThenConcatStringsSep * --------------------------------------------------------------------------*/ diff --git a/src/libutil/strings.hh b/src/libutil/strings.hh index c4fd3daa1..ae0f0070e 100644 --- a/src/libutil/strings.hh +++ b/src/libutil/strings.hh @@ -55,6 +55,20 @@ extern template std::string concatStringsSep(std::string_view, const std::list &); extern template std::string concatStringsSep(std::string_view, const std::vector &); +/** + * Apply a function to the `iterable`'s items and concat them with `separator`. + */ +template +std::string concatMapStringsSep(std::string_view separator, const C & iterable, F fn) +{ + std::vector strings; + strings.reserve(iterable.size()); + for (const auto & elem : iterable) { + strings.push_back(fn(elem)); + } + return concatStringsSep(separator, strings); +} + /** * Ignore any empty strings at the start of the list, and then concatenate the * given strings with a separator between the elements. From aa7433982b3ab0a83bd742b5dc4d589fe816615b Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sat, 18 Jan 2025 09:49:25 +0100 Subject: [PATCH 04/84] nix-util: Use small_vector in concatMapStringsSep (cherry picked from commit 32898dc46a21c628d3ae275310307c56cbe8ab03) --- src/libutil/strings.cc | 1 + src/libutil/strings.hh | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libutil/strings.cc b/src/libutil/strings.cc index 402b7ae98..b94bca611 100644 --- a/src/libutil/strings.cc +++ b/src/libutil/strings.cc @@ -37,6 +37,7 @@ basicSplitString(std::basic_string_view s, std::basic_string_view &); template std::string concatStringsSep(std::string_view, const std::set &); template std::string concatStringsSep(std::string_view, const std::vector &); +template std::string concatStringsSep(std::string_view, const boost::container::small_vector &); typedef std::string_view strings_2[2]; template std::string concatStringsSep(std::string_view, const strings_2 &); diff --git a/src/libutil/strings.hh b/src/libutil/strings.hh index ae0f0070e..521e3425f 100644 --- a/src/libutil/strings.hh +++ b/src/libutil/strings.hh @@ -6,6 +6,8 @@ #include #include +#include + namespace nix { /* @@ -54,6 +56,7 @@ std::string concatStringsSep(const std::string_view sep, const C & ss); extern template std::string concatStringsSep(std::string_view, const std::list &); extern template std::string concatStringsSep(std::string_view, const std::set &); extern template std::string concatStringsSep(std::string_view, const std::vector &); +extern template std::string concatStringsSep(std::string_view, const boost::container::small_vector &); /** * Apply a function to the `iterable`'s items and concat them with `separator`. @@ -61,7 +64,7 @@ extern template std::string concatStringsSep(std::string_view, const std::vector template std::string concatMapStringsSep(std::string_view separator, const C & iterable, F fn) { - std::vector strings; + boost::container::small_vector strings; strings.reserve(iterable.size()); for (const auto & elem : iterable) { strings.push_back(fn(elem)); From db1950e76807c47c0667969f751a53ddbf2cc063 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sat, 18 Jan 2025 09:58:17 +0100 Subject: [PATCH 05/84] checkRefs: use concatMapStringsSep (cherry picked from commit 2b4d461c14e01eb86f5b253e7df93c595f45f52e) --- src/libstore/unix/build/local-derivation-goal.cc | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/libstore/unix/build/local-derivation-goal.cc b/src/libstore/unix/build/local-derivation-goal.cc index 500f2aa0d..0ccc4211b 100644 --- a/src/libstore/unix/build/local-derivation-goal.cc +++ b/src/libstore/unix/build/local-derivation-goal.cc @@ -2921,15 +2921,10 @@ void LocalDerivationGoal::checkOutputs(const std::mappath); else { - std::string allOutputs; - for (auto & o : outputs) { - if (! allOutputs.empty()) - allOutputs.append(", "); - allOutputs.append(o.first); - } + std::string outputsListing = concatMapStringsSep(", ", outputs, [](auto & o) { return o.first; }); throw BuildError("derivation '%s' output check for '%s' contains an illegal reference specifier '%s'," " expected store path or output name (one of [%s])", - worker.store.printStorePath(drvPath), outputName, i, allOutputs); + worker.store.printStorePath(drvPath), outputName, i, outputsListing); } } From 6f54b90f36a337a47b3772ca19c16e1f47d99650 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sat, 18 Jan 2025 10:21:08 +0100 Subject: [PATCH 06/84] test illegal reference specifier error message (cherry picked from commit f4def47c899a8f637449a3d3670c843a706218ca) --- tests/functional/check-refs.nix | 6 ++++++ tests/functional/check-refs.sh | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/tests/functional/check-refs.nix b/tests/functional/check-refs.nix index 471d95753..9512c73c1 100644 --- a/tests/functional/check-refs.nix +++ b/tests/functional/check-refs.nix @@ -79,4 +79,10 @@ rec { buildCommand = ''echo ${dep} > "''${outputs[out]}"''; }; + test12 = makeTest 12 { + builder = builtins.toFile "builder.sh" "mkdir $out $lib"; + outputs = ["out" "lib"]; + disallowedReferences = ["dev"]; + }; + } diff --git a/tests/functional/check-refs.sh b/tests/functional/check-refs.sh index 5c3ac915e..8eb93b48d 100755 --- a/tests/functional/check-refs.sh +++ b/tests/functional/check-refs.sh @@ -60,3 +60,7 @@ if ! isTestOnNixOS; then fi fi + +# test12 should fail (syntactically invalid). +expectStderr 1 nix-build -vvv -o "$RESULT" check-refs.nix -A test12 >"$TEST_ROOT/test12.stderr" +grepQuiet -F "output check for 'lib' contains an illegal reference specifier 'dev', expected store path or output name (one of [lib, out])" < "$TEST_ROOT/test12.stderr" From c2cffe62490f195bd5f11650c11f37bbf80b0f3c Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Mon, 24 Mar 2025 22:34:09 +0000 Subject: [PATCH 07/84] tests/functional/check-refs.sh: guard test12 against too old nix daemon Otherwise without the change the test fails on nix-2.26 as: error: derivation contains an illegal reference specifier 'dev' Note: the error message does not match intended change. (cherry picked from commit 1e7c7244cf6e7f0fba83764153a31a9ff780cb7e) --- tests/functional/check-refs.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/functional/check-refs.sh b/tests/functional/check-refs.sh index 8eb93b48d..590c3fb53 100755 --- a/tests/functional/check-refs.sh +++ b/tests/functional/check-refs.sh @@ -61,6 +61,8 @@ if ! isTestOnNixOS; then fi -# test12 should fail (syntactically invalid). -expectStderr 1 nix-build -vvv -o "$RESULT" check-refs.nix -A test12 >"$TEST_ROOT/test12.stderr" -grepQuiet -F "output check for 'lib' contains an illegal reference specifier 'dev', expected store path or output name (one of [lib, out])" < "$TEST_ROOT/test12.stderr" +if isDaemonNewer "2.28pre20241225"; then + # test12 should fail (syntactically invalid). + expectStderr 1 nix-build -vvv -o "$RESULT" check-refs.nix -A test12 >"$TEST_ROOT/test12.stderr" + grepQuiet -F "output check for 'lib' contains an illegal reference specifier 'dev', expected store path or output name (one of [lib, out])" < "$TEST_ROOT/test12.stderr" +fi From cadfed692ce3dd36a56916e111c0a366991828f3 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Mon, 24 Mar 2025 22:45:28 +0000 Subject: [PATCH 08/84] tests/functional/check-refs.nix: format newly added test (cherry picked from commit 4d72e0f73bc31ac200d57caba65f6355760df032) --- tests/functional/check-refs.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/functional/check-refs.nix b/tests/functional/check-refs.nix index 9512c73c1..bdd5c4f8d 100644 --- a/tests/functional/check-refs.nix +++ b/tests/functional/check-refs.nix @@ -81,8 +81,11 @@ rec { test12 = makeTest 12 { builder = builtins.toFile "builder.sh" "mkdir $out $lib"; - outputs = ["out" "lib"]; - disallowedReferences = ["dev"]; + outputs = [ + "out" + "lib" + ]; + disallowedReferences = [ "dev" ]; }; } From 1763cf115b1d0475cdb241c97ad5e96f5d319e1e Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 27 Mar 2025 00:09:20 -0400 Subject: [PATCH 09/84] Fix a bunch of missing meson boilerplate These other libraries need this too (cherry picked from commit ffdce51cd5bd31c1680d4f28b383837682cb7d41) --- 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 dffcc1742..fc04c4691 100644 --- a/src/libexpr/meson.build +++ b/src/libexpr/meson.build @@ -187,6 +187,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, @@ -194,6 +197,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 b757d0d76..27effe73c 100644 --- a/src/libflake/meson.build +++ b/src/libflake/meson.build @@ -58,10 +58,15 @@ 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, 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 71b0edcfe384f8131e3dfa62e209f4c4ca43bc9f Mon Sep 17 00:00:00 2001 From: John Ericson Date: Fri, 28 Mar 2025 10:45:27 -0400 Subject: [PATCH 10/84] Remove boost env vars https://github.com/NixOS/nixpkgs/issues/86131 is now fixed! (cherry picked from commit 459fb59493d62b97e7e5219d542fcddc62aab0b5) --- 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 602840bfd22ca8c38341e85d0b74abebf6e2f29c Mon Sep 17 00:00:00 2001 From: John Ericson Date: Fri, 28 Mar 2025 10:50:46 -0400 Subject: [PATCH 11/84] Link the right issue about the bad AWS pkg-config It is https://github.com/aws/aws-sdk-cpp/issues/2673 (cherry picked from commit fb9c9ee35ae5c020e683ca29ba743ef3e4ab9d4d) --- 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 496c5b10d..1ea1f57bc 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 5056aae63aac449e8aa60ac5bf6b9ab18a8eba2a Mon Sep 17 00:00:00 2001 From: John Ericson Date: Fri, 28 Mar 2025 11:04:48 -0400 Subject: [PATCH 12/84] Add a `withAWS` flag to libstore Nixpkgs wants this, at least. (cherry picked from commit e4c571c2f1e25108a32546057ac6d53065c0b8f6) --- 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 From e308524097ddae789ff9b92f1b8019702669b5ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Wed, 12 Mar 2025 17:49:45 +0100 Subject: [PATCH 13/84] use createDirs consistently everywhere (cherry picked from commit a8217f2642fa336f79154a485e090f3cbe79652c) --- src/libstore/builtins/unpack-channel.cc | 6 +----- src/libutil/tarfile.cc | 4 ++-- src/nix/flake.cc | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/libstore/builtins/unpack-channel.cc b/src/libstore/builtins/unpack-channel.cc index a6369ee1c..43fbb62cd 100644 --- a/src/libstore/builtins/unpack-channel.cc +++ b/src/libstore/builtins/unpack-channel.cc @@ -23,11 +23,7 @@ void builtinUnpackChannel( throw Error("channelName is not allowed to contain filesystem separators, got %1%", channelName); } - try { - fs::create_directories(out); - } catch (fs::filesystem_error &) { - throw SysError("creating directory '%1%'", out.string()); - } + createDirs(out); unpackTarfile(src, out); diff --git a/src/libutil/tarfile.cc b/src/libutil/tarfile.cc index e412930bb..9e54c9be2 100644 --- a/src/libutil/tarfile.cc +++ b/src/libutil/tarfile.cc @@ -166,7 +166,7 @@ void unpackTarfile(Source & source, const fs::path & destDir) { auto archive = TarArchive(source); - fs::create_directories(destDir); + createDirs(destDir); extract_archive(archive, destDir); } @@ -174,7 +174,7 @@ void unpackTarfile(const fs::path & tarFile, const fs::path & destDir) { auto archive = TarArchive(tarFile); - fs::create_directories(destDir); + createDirs(destDir); extract_archive(archive, destDir); } diff --git a/src/nix/flake.cc b/src/nix/flake.cc index e2099c401..7c9951c4c 100644 --- a/src/nix/flake.cc +++ b/src/nix/flake.cc @@ -905,7 +905,7 @@ struct CmdFlakeInitCommon : virtual Args, EvalCommand std::function copyDir; copyDir = [&](const SourcePath & from, const fs::path & to) { - fs::create_directories(to); + createDirs(to); for (auto & [name, entry] : from.readDirectory()) { checkInterrupt(); From 9c20bb18de7cee6dbc994b33d55f9c23c285e88b Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 26 Mar 2025 08:59:29 +0000 Subject: [PATCH 14/84] libutil: Fix error message I encountered this with a misconfigured libutil. I doubt that a non-lutimes config is viable, because tests were failing. (cherry picked from commit 1cffcd91a91c8d7b9bed0da35405344c0c6b98dd) --- src/libutil/file-system.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libutil/file-system.cc b/src/libutil/file-system.cc index 6fe93b63a..3c18a97b1 100644 --- a/src/libutil/file-system.cc +++ b/src/libutil/file-system.cc @@ -680,7 +680,7 @@ void setWriteTime( if (utimes(path.c_str(), times) == -1) throw SysError("changing modification time of %s (not a symlink)", path); } else { - throw Error("Cannot modification time of symlink %s", path); + throw Error("Cannot change modification time of symlink %s", path); } #endif #endif From 84a25dc84662bcaadac07ad2b8d2e7ae45cdcc06 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 28 Mar 2025 19:25:13 +0100 Subject: [PATCH 15/84] nix daemon: Don't open the store This makes it behave the same as nix-daemon. Opening the store in the parent can cause a SIGBUS in libsqlite in the child: #0 0x00007f141cf6f789 in __memset_avx2_unaligned_erms () from /nix/store/wn7v2vhyyyi6clcyn0s9ixvl7d4d87ic-glibc-2.40-36/lib/libc.so.6 #1 0x00007f141c322fe8 in walIndexAppend () from /nix/store/bbd59cqw259149r2ddk4w1q0lr2fch8c-sqlite-3.46.1/lib/libsqlite3.so.0 #2 0x00007f141c3711a2 in pagerWalFrames () from /nix/store/bbd59cqw259149r2ddk4w1q0lr2fch8c-sqlite-3.46.1/lib/libsqlite3.so.0 #3 0x00007f141c38317e in sqlite3PagerCommitPhaseOne.part.0 () from /nix/store/bbd59cqw259149r2ddk4w1q0lr2fch8c-sqlite-3.46.1/lib/libsqlite3.so.0 #4 0x00007f141c383555 in sqlite3BtreeCommitPhaseOne.part.0 () from /nix/store/bbd59cqw259149r2ddk4w1q0lr2fch8c-sqlite-3.46.1/lib/libsqlite3.so.0 #5 0x00007f141c384797 in sqlite3VdbeHalt () from /nix/store/bbd59cqw259149r2ddk4w1q0lr2fch8c-sqlite-3.46.1/lib/libsqlite3.so.0 #6 0x00007f141c3b8f60 in sqlite3VdbeExec () from /nix/store/bbd59cqw259149r2ddk4w1q0lr2fch8c-sqlite-3.46.1/lib/libsqlite3.so.0 #7 0x00007f141c3bbfef in sqlite3_step () from /nix/store/bbd59cqw259149r2ddk4w1q0lr2fch8c-sqlite-3.46.1/lib/libsqlite3.so.0 #8 0x00007f141c3bd0e5 in sqlite3_exec () from /nix/store/bbd59cqw259149r2ddk4w1q0lr2fch8c-sqlite-3.46.1/lib/libsqlite3.so.0 #9 0x00007f141da140e0 in nix::SQLiteTxn::commit() () from /nix/store/1m4r8s7s1v54zq9isncvjgia02bffxlz-determinate-nix-store-3.1.0/lib/libnixstore.so #10 0x00007f141d9ce69c in nix::LocalStore::registerValidPaths(std::map, std::allocator > > const&)::{lambda()#1}::operator()() const () from /nix/store/1m4r8s7s1v54zq9isncvjgia02bffxlz-determinate-nix-store-3.1.0/lib/libnixstore.so (cherry picked from commit 9590167290ffbe712e87386e8981b04f9b07b348) --- src/nix/unix/daemon.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nix/unix/daemon.cc b/src/nix/unix/daemon.cc index b4c7c10ed..fd572ce30 100644 --- a/src/nix/unix/daemon.cc +++ b/src/nix/unix/daemon.cc @@ -546,7 +546,7 @@ static int main_nix_daemon(int argc, char * * argv) static RegisterLegacyCommand r_nix_daemon("nix-daemon", main_nix_daemon); -struct CmdDaemon : StoreCommand +struct CmdDaemon : Command { bool stdio = false; std::optional isTrustedOpt = std::nullopt; @@ -615,7 +615,7 @@ struct CmdDaemon : StoreCommand ; } - void run(ref store) override + void run() override { runDaemon(stdio, isTrustedOpt, processOps); } From 44c2bd35e01fc2166c2273f9490d5103c10591f0 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Fri, 28 Mar 2025 13:15:21 -0400 Subject: [PATCH 16/84] Fix windows build PR #12767 accidentally broke it. (cherry picked from commit 99041b4d84e48b746908b8f0a6cffb32cd1be4a9) --- src/libstore/local-store.cc | 2 +- src/libutil/file-system.cc | 4 ++-- src/libutil/file-system.hh | 9 ++------- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index 67d5a1dcb..1db6e0ef5 100644 --- a/src/libstore/local-store.cc +++ b/src/libstore/local-store.cc @@ -116,7 +116,7 @@ LocalStore::LocalStore( state->stmts = std::make_unique(); /* Create missing state directories if they don't already exist. */ - createDirs(realStoreDir); + createDirs(realStoreDir.get()); if (readOnly) { experimentalFeatureSettings.require(Xp::ReadOnlyLocalStore); } else { diff --git a/src/libutil/file-system.cc b/src/libutil/file-system.cc index 3c18a97b1..0adafc0e4 100644 --- a/src/libutil/file-system.cc +++ b/src/libutil/file-system.cc @@ -475,12 +475,12 @@ void createDir(const Path & path, mode_t mode) throw SysError("creating directory '%1%'", path); } -void createDirs(const Path & path) +void createDirs(const fs::path & path) { try { fs::create_directories(path); } catch (fs::filesystem_error & e) { - throw SysError("creating directory '%1%'", path); + throw SysError("creating directory '%1%'", path.string()); } } diff --git a/src/libutil/file-system.hh b/src/libutil/file-system.hh index 204907339..49d120cb7 100644 --- a/src/libutil/file-system.hh +++ b/src/libutil/file-system.hh @@ -231,14 +231,9 @@ void deletePath(const std::filesystem::path & path, uint64_t & bytesFreed); /** * Create a directory and all its parents, if necessary. * - * In the process of being deprecated for - * `std::filesystem::create_directories`. + * Wrapper around `std::filesystem::create_directories` to handle exceptions. */ -void createDirs(const Path & path); -inline void createDirs(PathView path) -{ - return createDirs(Path(path)); -} +void createDirs(const std::filesystem::path & path); /** * Create a single directory. From 4f3f26cd9619810ba52de29c345f402a41e9fac4 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sat, 1 Mar 2025 22:54:57 +0100 Subject: [PATCH 17/84] .mergify.yml: Add backport 2.27-maintenance entry --- .mergify.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.mergify.yml b/.mergify.yml index 021157eb9..e134b0f46 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -117,3 +117,14 @@ pull_request_rules: labels: - automatic backport - merge-queue + + - name: backport patches to 2.27 + conditions: + - label=backport 2.27-maintenance + actions: + backport: + branches: + - "2.27-maintenance" + labels: + - automatic backport + - merge-queue From 1d2fbfe99b14fc7da2b886fe300df50db123416d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 31 Mar 2025 16:37:36 +0200 Subject: [PATCH 18/84] Disable packaging-overriding Fixes #12690. (cherry picked from commit a4be66828a1421e7c603e5ed22827ee54d2c7f94) --- flake.nix | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/flake.nix b/flake.nix index 5e1e4ece7..037281eb5 100644 --- a/flake.nix +++ b/flake.nix @@ -230,24 +230,28 @@ This shouldn't build anything significant; just check that things (including derivations) are _set up_ correctly. */ - packaging-overriding = - let - pkgs = nixpkgsFor.${system}.native; - nix = self.packages.${system}.nix; - in - assert (nix.appendPatches [ pkgs.emptyFile ]).libs.nix-util.src.patches == [ pkgs.emptyFile ]; - if pkgs.stdenv.buildPlatform.isDarwin then - lib.warn "packaging-overriding check currently disabled because of a permissions issue on macOS" pkgs.emptyFile - else - # If this fails, something might be wrong with how we've wired the scope, - # or something could be broken in Nixpkgs. - pkgs.testers.testEqualContents { - assertion = "trivial patch does not change source contents"; - expected = "${./.}"; - actual = - # Same for all components; nix-util is an arbitrary pick - (nix.appendPatches [ pkgs.emptyFile ]).libs.nix-util.src; - }; + # Disabled due to a bug in `testEqualContents` (see + # https://github.com/NixOS/nix/issues/12690). + /* + packaging-overriding = + let + pkgs = nixpkgsFor.${system}.native; + nix = self.packages.${system}.nix; + in + assert (nix.appendPatches [ pkgs.emptyFile ]).libs.nix-util.src.patches == [ pkgs.emptyFile ]; + if pkgs.stdenv.buildPlatform.isDarwin then + lib.warn "packaging-overriding check currently disabled because of a permissions issue on macOS" pkgs.emptyFile + else + # If this fails, something might be wrong with how we've wired the scope, + # or something could be broken in Nixpkgs. + pkgs.testers.testEqualContents { + assertion = "trivial patch does not change source contents"; + expected = "${./.}"; + actual = + # Same for all components; nix-util is an arbitrary pick + (nix.appendPatches [ pkgs.emptyFile ]).libs.nix-util.src; + }; + */ } // (lib.optionalAttrs (builtins.elem system linux64BitSystems)) { dockerImage = self.hydraJobs.dockerImage.${system}; From 4642570e79b8f2220de4dd9920b39b1456b24a6c Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 26 Mar 2025 08:55:44 +0000 Subject: [PATCH 19/84] nix-expr: Add primops to EvalSettings (cherry picked from commit 3c4c0953e0a50649de91b43ef57e4a632726d25b) --- src/libexpr/eval-settings.cc | 9 +++++++++ src/libexpr/eval-settings.hh | 12 ++++++++++++ src/libexpr/eval.cc | 2 +- src/libexpr/eval.hh | 2 +- src/libexpr/primops.cc | 8 +++++++- 5 files changed, 30 insertions(+), 3 deletions(-) diff --git a/src/libexpr/eval-settings.cc b/src/libexpr/eval-settings.cc index ade0abf9a..ebb9e5bbd 100644 --- a/src/libexpr/eval-settings.cc +++ b/src/libexpr/eval-settings.cc @@ -103,4 +103,13 @@ Path getNixDefExpr() : getHome() + "/.nix-defexpr"; } +void EvalSettings::addPrimOp(PrimOp && primOp) +{ + extraPrimOps.emplace_back(std::move(primOp)); } +void EvalSettings::addPrimOp(const PrimOp & primOp) +{ + extraPrimOps.emplace_back(PrimOp(primOp)); +} + +} // namespace nix \ No newline at end of file diff --git a/src/libexpr/eval-settings.hh b/src/libexpr/eval-settings.hh index fe947aefd..368173b01 100644 --- a/src/libexpr/eval-settings.hh +++ b/src/libexpr/eval-settings.hh @@ -7,6 +7,7 @@ namespace nix { class EvalState; +struct PrimOp; struct EvalSettings : Config { @@ -50,6 +51,17 @@ struct EvalSettings : Config LookupPathHooks lookupPathHooks; + std::vector extraPrimOps; + + /** + * Register a primop to be added when an EvalState is created from these settings. + */ + void addPrimOp(PrimOp && primOp); + /** + * Register a primop to be added when an EvalState is created from these settings. + */ + void addPrimOp(const PrimOp & primOp); + Setting enableNativeCode{this, false, "allow-unsafe-native-code-during-evaluation", R"( Enable built-in functions that allow executing native code. diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index 4e15175ac..53b649606 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -353,7 +353,7 @@ EvalState::EvalState( #include "fetchurl.nix.gen.hh" ); - createBaseEnv(); + createBaseEnv(settings); } diff --git a/src/libexpr/eval.hh b/src/libexpr/eval.hh index eb6f667a2..9b8899ccf 100644 --- a/src/libexpr/eval.hh +++ b/src/libexpr/eval.hh @@ -633,7 +633,7 @@ private: unsigned int baseEnvDispl = 0; - void createBaseEnv(); + void createBaseEnv(const EvalSettings & settings); Value * addConstant(const std::string & name, Value & v, Constant info); diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index 54682ea31..b078592e7 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -4669,7 +4669,7 @@ RegisterPrimOp::RegisterPrimOp(PrimOp && primOp) } -void EvalState::createBaseEnv() +void EvalState::createBaseEnv(const EvalSettings & evalSettings) { baseEnv.up = 0; @@ -4928,6 +4928,12 @@ void EvalState::createBaseEnv() addPrimOp(std::move(primOpAdjusted)); } + for (auto & primOp : evalSettings.extraPrimOps) { + auto primOpAdjusted = primOp; + primOpAdjusted.arity = std::max(primOp.args.size(), primOp.arity); + addPrimOp(std::move(primOpAdjusted)); + } + /* Add a wrapper around the derivation primop that computes the `drvPath' and `outPath' attributes lazily. From f07e4e27ce8b03a97b14917cefa9a288156fc495 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 26 Mar 2025 08:59:05 +0000 Subject: [PATCH 20/84] C API: (breaking) remove nix-flake-c global init (cherry picked from commit 6a192ec0cdb92ec7100e2a193606512ffb295062) --- doc/manual/rl-next/c-api-flake-init.md | 20 +++++++++ src/libflake-c/nix_api_flake.cc | 11 ++--- src/libflake-c/nix_api_flake.h | 10 ++++- src/libflake-tests/nix_api_flake.cc | 6 +-- src/libflake/flake/flake-primops.cc | 59 ++++++++++++++++++++++++++ src/libflake/flake/flake-primops.hh | 13 ++++++ src/libflake/flake/flake.cc | 43 ------------------- src/libflake/flake/flake.hh | 8 ---- src/libflake/flake/settings.cc | 6 +++ src/libflake/flake/settings.hh | 13 +++--- src/libflake/meson.build | 1 + src/nix/main.cc | 3 +- 12 files changed, 124 insertions(+), 69 deletions(-) create mode 100644 doc/manual/rl-next/c-api-flake-init.md create mode 100644 src/libflake/flake/flake-primops.cc create mode 100644 src/libflake/flake/flake-primops.hh diff --git a/doc/manual/rl-next/c-api-flake-init.md b/doc/manual/rl-next/c-api-flake-init.md new file mode 100644 index 000000000..d6e7c3890 --- /dev/null +++ b/doc/manual/rl-next/c-api-flake-init.md @@ -0,0 +1,20 @@ +--- +synopsis: C API `nix_flake_init_global` removed +prs: 12759 +issues: 5638 +--- + +In order to improve the modularity of the code base, we are removing a use of global state, and therefore the `nix_flake_init_global` function. + +Instead, use `nix_flake_settings_add_to_eval_state_builder`. For example: + +```diff +- nix_flake_init_global(ctx, settings); +- HANDLE_ERROR(ctx); +- + nix_eval_state_builder * builder = nix_eval_state_builder_new(ctx, store); + HANDLE_ERROR(ctx); + ++ nix_flake_settings_add_to_eval_state_builder(ctx, settings, builder); ++ HANDLE_ERROR(ctx); +``` diff --git a/src/libflake-c/nix_api_flake.cc b/src/libflake-c/nix_api_flake.cc index 17cf6572d..2479bf2e0 100644 --- a/src/libflake-c/nix_api_flake.cc +++ b/src/libflake-c/nix_api_flake.cc @@ -1,6 +1,7 @@ #include "nix_api_flake.h" #include "nix_api_flake_internal.hh" #include "nix_api_util_internal.h" +#include "nix_api_expr_internal.h" #include "flake/flake.hh" @@ -18,15 +19,11 @@ void nix_flake_settings_free(nix_flake_settings * settings) delete settings; } -nix_err nix_flake_init_global(nix_c_context * context, nix_flake_settings * settings) +nix_err nix_flake_settings_add_to_eval_state_builder( + nix_c_context * context, nix_flake_settings * settings, nix_eval_state_builder * builder) { - static std::shared_ptr registeredSettings; try { - if (registeredSettings) - throw nix::Error("nix_flake_init_global already initialized"); - - registeredSettings = settings->settings; - nix::flake::initLib(*registeredSettings); + settings->settings->configureEvalSettings(builder->settings); } NIXC_CATCH_ERRS } diff --git a/src/libflake-c/nix_api_flake.h b/src/libflake-c/nix_api_flake.h index 80051298d..75675835e 100644 --- a/src/libflake-c/nix_api_flake.h +++ b/src/libflake-c/nix_api_flake.h @@ -35,9 +35,15 @@ nix_flake_settings * nix_flake_settings_new(nix_c_context * context); void nix_flake_settings_free(nix_flake_settings * settings); /** - * @brief Register Flakes support process-wide. + * @brief Initialize a `nix_flake_settings` to contain `builtins.getFlake` and + * potentially more. + * + * @param[out] context Optional, stores error information + * @param[in] settings The settings to use for e.g. `builtins.getFlake` + * @param[in] builder The builder to modify */ -nix_err nix_flake_init_global(nix_c_context * context, nix_flake_settings * settings); +nix_err nix_flake_settings_add_to_eval_state_builder( + nix_c_context * context, nix_flake_settings * settings, nix_eval_state_builder * builder); #ifdef __cplusplus } // extern "C" diff --git a/src/libflake-tests/nix_api_flake.cc b/src/libflake-tests/nix_api_flake.cc index 21109d181..834b2e681 100644 --- a/src/libflake-tests/nix_api_flake.cc +++ b/src/libflake-tests/nix_api_flake.cc @@ -25,13 +25,13 @@ TEST_F(nix_api_store_test, nix_api_init_global_getFlake_exists) assert_ctx_ok(); ASSERT_NE(nullptr, settings); - nix_flake_init_global(ctx, settings); - assert_ctx_ok(); - nix_eval_state_builder * builder = nix_eval_state_builder_new(ctx, store); ASSERT_NE(nullptr, builder); assert_ctx_ok(); + nix_flake_settings_add_to_eval_state_builder(ctx, settings, builder); + assert_ctx_ok(); + auto state = nix_eval_state_build(ctx, builder); assert_ctx_ok(); ASSERT_NE(nullptr, state); diff --git a/src/libflake/flake/flake-primops.cc b/src/libflake/flake/flake-primops.cc new file mode 100644 index 000000000..f04887e85 --- /dev/null +++ b/src/libflake/flake/flake-primops.cc @@ -0,0 +1,59 @@ +#include "flake-primops.hh" +#include "eval.hh" +#include "flake.hh" +#include "flakeref.hh" +#include "settings.hh" + +namespace nix::flake::primops { + +PrimOp getFlake(const Settings & settings) +{ + auto prim_getFlake = [&settings](EvalState & state, const PosIdx pos, Value ** args, Value & v) { + std::string flakeRefS( + state.forceStringNoCtx(*args[0], pos, "while evaluating the argument passed to builtins.getFlake")); + auto flakeRef = nix::parseFlakeRef(state.fetchSettings, flakeRefS, {}, true); + if (state.settings.pureEval && !flakeRef.input.isLocked()) + throw Error( + "cannot call 'getFlake' on unlocked flake reference '%s', at %s (use --impure to override)", + flakeRefS, + state.positions[pos]); + + callFlake( + state, + lockFlake( + settings, + state, + flakeRef, + LockFlags{ + .updateLockFile = false, + .writeLockFile = false, + .useRegistries = !state.settings.pureEval && settings.useRegistries, + .allowUnlocked = !state.settings.pureEval, + }), + v); + }; + + return PrimOp{ + .name = "__getFlake", + .args = {"args"}, + .doc = R"( + Fetch a flake from a flake reference, and return its output attributes and some metadata. For example: + + ```nix + (builtins.getFlake "nix/55bc52401966fbffa525c574c14f67b00bc4fb3a").packages.x86_64-linux.nix + ``` + + Unless impure evaluation is allowed (`--impure`), the flake reference + must be "locked", e.g. contain a Git revision or content hash. An + example of an unlocked usage is: + + ```nix + (builtins.getFlake "github:edolstra/dwarffs").rev + ``` + )", + .fun = prim_getFlake, + .experimentalFeature = Xp::Flakes, + }; +} + +} // namespace nix::flake::primops diff --git a/src/libflake/flake/flake-primops.hh b/src/libflake/flake/flake-primops.hh new file mode 100644 index 000000000..662761c4e --- /dev/null +++ b/src/libflake/flake/flake-primops.hh @@ -0,0 +1,13 @@ +#pragma once + +#include "eval.hh" +#include "flake/settings.hh" + +namespace nix::flake::primops { + +/** + * Returns a `builtins.getFlake` primop with the given nix::flake::Settings. + */ +nix::PrimOp getFlake(const Settings & settings); + +} // namespace nix::flake \ No newline at end of file diff --git a/src/libflake/flake/flake.cc b/src/libflake/flake/flake.cc index e573c55c4..23463af39 100644 --- a/src/libflake/flake/flake.cc +++ b/src/libflake/flake/flake.cc @@ -973,49 +973,6 @@ void callFlake(EvalState & state, state.callFunction(*vCallFlake, args, vRes, noPos); } -void initLib(const Settings & settings) -{ - auto prim_getFlake = [&settings](EvalState & state, const PosIdx pos, Value * * args, Value & v) - { - std::string flakeRefS(state.forceStringNoCtx(*args[0], pos, "while evaluating the argument passed to builtins.getFlake")); - auto flakeRef = parseFlakeRef(state.fetchSettings, flakeRefS, {}, true); - if (state.settings.pureEval && !flakeRef.input.isLocked()) - throw Error("cannot call 'getFlake' on unlocked flake reference '%s', at %s (use --impure to override)", flakeRefS, state.positions[pos]); - - callFlake(state, - lockFlake(settings, state, flakeRef, - LockFlags { - .updateLockFile = false, - .writeLockFile = false, - .useRegistries = !state.settings.pureEval && settings.useRegistries, - .allowUnlocked = !state.settings.pureEval, - }), - v); - }; - - RegisterPrimOp::primOps->push_back({ - .name = "__getFlake", - .args = {"args"}, - .doc = R"( - Fetch a flake from a flake reference, and return its output attributes and some metadata. For example: - - ```nix - (builtins.getFlake "nix/55bc52401966fbffa525c574c14f67b00bc4fb3a").packages.x86_64-linux.nix - ``` - - Unless impure evaluation is allowed (`--impure`), the flake reference - must be "locked", e.g. contain a Git revision or content hash. An - example of an unlocked usage is: - - ```nix - (builtins.getFlake "github:edolstra/dwarffs").rev - ``` - )", - .fun = prim_getFlake, - .experimentalFeature = Xp::Flakes, - }); -} - static void prim_parseFlakeRef( EvalState & state, const PosIdx pos, diff --git a/src/libflake/flake/flake.hh b/src/libflake/flake/flake.hh index d8cd9aac0..d7a151587 100644 --- a/src/libflake/flake/flake.hh +++ b/src/libflake/flake/flake.hh @@ -14,14 +14,6 @@ namespace flake { struct Settings; -/** - * Initialize `libnixflake` - * - * So far, this registers the `builtins.getFlake` primop, which depends - * on the choice of `flake:Settings`. - */ -void initLib(const Settings & settings); - struct FlakeInput; typedef std::map FlakeInputs; diff --git a/src/libflake/flake/settings.cc b/src/libflake/flake/settings.cc index 6a0294e62..f5f9f96d0 100644 --- a/src/libflake/flake/settings.cc +++ b/src/libflake/flake/settings.cc @@ -1,7 +1,13 @@ #include "flake/settings.hh" +#include "flake/flake-primops.hh" namespace nix::flake { Settings::Settings() {} +void Settings::configureEvalSettings(nix::EvalSettings & evalSettings) +{ + evalSettings.addPrimOp(primops::getFlake(*this)); } + +} // namespace nix diff --git a/src/libflake/flake/settings.hh b/src/libflake/flake/settings.hh index 991eaca1f..f629f3e74 100644 --- a/src/libflake/flake/settings.hh +++ b/src/libflake/flake/settings.hh @@ -1,21 +1,24 @@ #pragma once ///@file -#include "types.hh" #include "config.hh" -#include "util.hh" - -#include -#include #include +namespace nix { +// Forward declarations +struct EvalSettings; + +} // namespace nix + namespace nix::flake { struct Settings : public Config { Settings(); + void configureEvalSettings(nix::EvalSettings & evalSettings); + Setting useRegistries{ this, true, diff --git a/src/libflake/meson.build b/src/libflake/meson.build index 27effe73c..642b85aea 100644 --- a/src/libflake/meson.build +++ b/src/libflake/meson.build @@ -44,6 +44,7 @@ sources = files( 'flake/flake.cc', 'flake/flakeref.cc', 'flake/lockfile.cc', + 'flake/flake-primops.cc', 'flake/settings.cc', 'flake/url-name.cc', ) diff --git a/src/nix/main.cc b/src/nix/main.cc index 0a6b77e9e..188d424bc 100644 --- a/src/nix/main.cc +++ b/src/nix/main.cc @@ -18,6 +18,7 @@ #include "network-proxy.hh" #include "eval-cache.hh" #include "flake/flake.hh" +#include "flake/settings.hh" #include "self-exe.hh" #include "json-utils.hh" #include "crash-handler.hh" @@ -368,7 +369,7 @@ void mainWrapped(int argc, char * * argv) initNix(); initGC(); - flake::initLib(flakeSettings); + flakeSettings.configureEvalSettings(evalSettings); /* Set the build hook location From cdb1d2c4c83b1cf93edbb1944c5ff17aab594fc0 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 26 Mar 2025 09:32:26 +0000 Subject: [PATCH 21/84] nix-flake: Move primops registration to configureEvalSettings (cherry picked from commit d48101109d8058751bfa5cbc13afeec8b7a8a680) --- src/libflake/flake/flake-primops.cc | 101 ++++++++++++++++++++++++++ src/libflake/flake/flake-primops.hh | 3 + src/libflake/flake/flake.cc | 106 ---------------------------- src/libflake/flake/settings.cc | 2 + 4 files changed, 106 insertions(+), 106 deletions(-) diff --git a/src/libflake/flake/flake-primops.cc b/src/libflake/flake/flake-primops.cc index f04887e85..98ebdee5f 100644 --- a/src/libflake/flake/flake-primops.cc +++ b/src/libflake/flake/flake-primops.cc @@ -56,4 +56,105 @@ PrimOp getFlake(const Settings & settings) }; } +static void prim_parseFlakeRef(EvalState & state, const PosIdx pos, Value ** args, Value & v) +{ + std::string flakeRefS( + state.forceStringNoCtx(*args[0], pos, "while evaluating the argument passed to builtins.parseFlakeRef")); + auto attrs = nix::parseFlakeRef(state.fetchSettings, flakeRefS, {}, true).toAttrs(); + auto binds = state.buildBindings(attrs.size()); + for (const auto & [key, value] : attrs) { + auto s = state.symbols.create(key); + auto & vv = binds.alloc(s); + std::visit( + overloaded{ + [&vv](const std::string & value) { vv.mkString(value); }, + [&vv](const uint64_t & value) { vv.mkInt(value); }, + [&vv](const Explicit & value) { vv.mkBool(value.t); }}, + value); + } + v.mkAttrs(binds); +} + +nix::PrimOp parseFlakeRef({ + .name = "__parseFlakeRef", + .args = {"flake-ref"}, + .doc = R"( + Parse a flake reference, and return its exploded form. + + For example: + + ```nix + builtins.parseFlakeRef "github:NixOS/nixpkgs/23.05?dir=lib" + ``` + + evaluates to: + + ```nix + { dir = "lib"; owner = "NixOS"; ref = "23.05"; repo = "nixpkgs"; type = "github"; } + ``` + )", + .fun = prim_parseFlakeRef, + .experimentalFeature = Xp::Flakes, +}); + +static void prim_flakeRefToString(EvalState & state, const PosIdx pos, Value ** args, Value & v) +{ + state.forceAttrs(*args[0], noPos, "while evaluating the argument passed to builtins.flakeRefToString"); + fetchers::Attrs attrs; + for (const auto & attr : *args[0]->attrs()) { + auto t = attr.value->type(); + if (t == nInt) { + auto intValue = attr.value->integer().value; + + if (intValue < 0) { + state + .error( + "negative value given for flake ref attr %1%: %2%", state.symbols[attr.name], intValue) + .atPos(pos) + .debugThrow(); + } + + attrs.emplace(state.symbols[attr.name], uint64_t(intValue)); + } else if (t == nBool) { + attrs.emplace(state.symbols[attr.name], Explicit{attr.value->boolean()}); + } else if (t == nString) { + attrs.emplace(state.symbols[attr.name], std::string(attr.value->string_view())); + } else { + state + .error( + "flake reference attribute sets may only contain integers, Booleans, " + "and strings, but attribute '%s' is %s", + state.symbols[attr.name], + showType(*attr.value)) + .debugThrow(); + } + } + auto flakeRef = FlakeRef::fromAttrs(state.fetchSettings, attrs); + v.mkString(flakeRef.to_string()); +} + +nix::PrimOp flakeRefToString({ + .name = "__flakeRefToString", + .args = {"attrs"}, + .doc = R"( + Convert a flake reference from attribute set format to URL format. + + For example: + + ```nix + builtins.flakeRefToString { + dir = "lib"; owner = "NixOS"; ref = "23.05"; repo = "nixpkgs"; type = "github"; + } + ``` + + evaluates to + + ```nix + "github:NixOS/nixpkgs/23.05?dir=lib" + ``` + )", + .fun = prim_flakeRefToString, + .experimentalFeature = Xp::Flakes, +}); + } // namespace nix::flake::primops diff --git a/src/libflake/flake/flake-primops.hh b/src/libflake/flake/flake-primops.hh index 662761c4e..203060563 100644 --- a/src/libflake/flake/flake-primops.hh +++ b/src/libflake/flake/flake-primops.hh @@ -10,4 +10,7 @@ namespace nix::flake::primops { */ nix::PrimOp getFlake(const Settings & settings); +extern nix::PrimOp parseFlakeRef; +extern nix::PrimOp flakeRefToString; + } // namespace nix::flake \ No newline at end of file diff --git a/src/libflake/flake/flake.cc b/src/libflake/flake/flake.cc index 23463af39..47feeb087 100644 --- a/src/libflake/flake/flake.cc +++ b/src/libflake/flake/flake.cc @@ -973,112 +973,6 @@ void callFlake(EvalState & state, state.callFunction(*vCallFlake, args, vRes, noPos); } -static void prim_parseFlakeRef( - EvalState & state, - const PosIdx pos, - Value * * args, - Value & v) -{ - std::string flakeRefS(state.forceStringNoCtx(*args[0], pos, - "while evaluating the argument passed to builtins.parseFlakeRef")); - auto attrs = parseFlakeRef(state.fetchSettings, flakeRefS, {}, true).toAttrs(); - auto binds = state.buildBindings(attrs.size()); - for (const auto & [key, value] : attrs) { - auto s = state.symbols.create(key); - auto & vv = binds.alloc(s); - std::visit(overloaded { - [&vv](const std::string & value) { vv.mkString(value); }, - [&vv](const uint64_t & value) { vv.mkInt(value); }, - [&vv](const Explicit & value) { vv.mkBool(value.t); } - }, value); - } - v.mkAttrs(binds); -} - -static RegisterPrimOp r3({ - .name = "__parseFlakeRef", - .args = {"flake-ref"}, - .doc = R"( - Parse a flake reference, and return its exploded form. - - For example: - - ```nix - builtins.parseFlakeRef "github:NixOS/nixpkgs/23.05?dir=lib" - ``` - - evaluates to: - - ```nix - { dir = "lib"; owner = "NixOS"; ref = "23.05"; repo = "nixpkgs"; type = "github"; } - ``` - )", - .fun = prim_parseFlakeRef, - .experimentalFeature = Xp::Flakes, -}); - - -static void prim_flakeRefToString( - EvalState & state, - const PosIdx pos, - Value * * args, - Value & v) -{ - state.forceAttrs(*args[0], noPos, - "while evaluating the argument passed to builtins.flakeRefToString"); - fetchers::Attrs attrs; - for (const auto & attr : *args[0]->attrs()) { - auto t = attr.value->type(); - if (t == nInt) { - auto intValue = attr.value->integer().value; - - if (intValue < 0) { - state.error("negative value given for flake ref attr %1%: %2%", state.symbols[attr.name], intValue).atPos(pos).debugThrow(); - } - - attrs.emplace(state.symbols[attr.name], uint64_t(intValue)); - } else if (t == nBool) { - attrs.emplace(state.symbols[attr.name], - Explicit { attr.value->boolean() }); - } else if (t == nString) { - attrs.emplace(state.symbols[attr.name], - std::string(attr.value->string_view())); - } else { - state.error( - "flake reference attribute sets may only contain integers, Booleans, " - "and strings, but attribute '%s' is %s", - state.symbols[attr.name], - showType(*attr.value)).debugThrow(); - } - } - auto flakeRef = FlakeRef::fromAttrs(state.fetchSettings, attrs); - v.mkString(flakeRef.to_string()); -} - -static RegisterPrimOp r4({ - .name = "__flakeRefToString", - .args = {"attrs"}, - .doc = R"( - Convert a flake reference from attribute set format to URL format. - - For example: - - ```nix - builtins.flakeRefToString { - dir = "lib"; owner = "NixOS"; ref = "23.05"; repo = "nixpkgs"; type = "github"; - } - ``` - - evaluates to - - ```nix - "github:NixOS/nixpkgs/23.05?dir=lib" - ``` - )", - .fun = prim_flakeRefToString, - .experimentalFeature = Xp::Flakes, -}); - } std::optional LockedFlake::getFingerprint( diff --git a/src/libflake/flake/settings.cc b/src/libflake/flake/settings.cc index f5f9f96d0..4ceca38ec 100644 --- a/src/libflake/flake/settings.cc +++ b/src/libflake/flake/settings.cc @@ -8,6 +8,8 @@ Settings::Settings() {} void Settings::configureEvalSettings(nix::EvalSettings & evalSettings) { evalSettings.addPrimOp(primops::getFlake(*this)); + evalSettings.addPrimOp(primops::parseFlakeRef); + evalSettings.addPrimOp(primops::flakeRefToString); } } // namespace nix From 9dfadd369491d271cac093c49b910c73c9c24ac9 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 26 Mar 2025 19:22:40 +0000 Subject: [PATCH 22/84] nix-expr: remove EvalSettings::addPrimOp, add const Not required for a struct and potentially confusing. (cherry picked from commit 6fc9651d57d171b2a295edee96d1fad30aca92aa) --- src/libexpr/eval-settings.cc | 9 --------- src/libexpr/eval-settings.hh | 9 --------- src/libflake/flake/settings.cc | 8 ++++---- src/libflake/flake/settings.hh | 2 +- 4 files changed, 5 insertions(+), 23 deletions(-) diff --git a/src/libexpr/eval-settings.cc b/src/libexpr/eval-settings.cc index ebb9e5bbd..b54afdce1 100644 --- a/src/libexpr/eval-settings.cc +++ b/src/libexpr/eval-settings.cc @@ -103,13 +103,4 @@ Path getNixDefExpr() : getHome() + "/.nix-defexpr"; } -void EvalSettings::addPrimOp(PrimOp && primOp) -{ - extraPrimOps.emplace_back(std::move(primOp)); -} -void EvalSettings::addPrimOp(const PrimOp & primOp) -{ - extraPrimOps.emplace_back(PrimOp(primOp)); -} - } // namespace nix \ No newline at end of file diff --git a/src/libexpr/eval-settings.hh b/src/libexpr/eval-settings.hh index 368173b01..d16fd4035 100644 --- a/src/libexpr/eval-settings.hh +++ b/src/libexpr/eval-settings.hh @@ -53,15 +53,6 @@ struct EvalSettings : Config std::vector extraPrimOps; - /** - * Register a primop to be added when an EvalState is created from these settings. - */ - void addPrimOp(PrimOp && primOp); - /** - * Register a primop to be added when an EvalState is created from these settings. - */ - void addPrimOp(const PrimOp & primOp); - Setting enableNativeCode{this, false, "allow-unsafe-native-code-during-evaluation", R"( Enable built-in functions that allow executing native code. diff --git a/src/libflake/flake/settings.cc b/src/libflake/flake/settings.cc index 4ceca38ec..cac7c4384 100644 --- a/src/libflake/flake/settings.cc +++ b/src/libflake/flake/settings.cc @@ -5,11 +5,11 @@ namespace nix::flake { Settings::Settings() {} -void Settings::configureEvalSettings(nix::EvalSettings & evalSettings) +void Settings::configureEvalSettings(nix::EvalSettings & evalSettings) const { - evalSettings.addPrimOp(primops::getFlake(*this)); - evalSettings.addPrimOp(primops::parseFlakeRef); - evalSettings.addPrimOp(primops::flakeRefToString); + evalSettings.extraPrimOps.emplace_back(primops::getFlake(*this)); + evalSettings.extraPrimOps.emplace_back(primops::parseFlakeRef); + evalSettings.extraPrimOps.emplace_back(primops::flakeRefToString); } } // namespace nix diff --git a/src/libflake/flake/settings.hh b/src/libflake/flake/settings.hh index f629f3e74..5f0d9fb21 100644 --- a/src/libflake/flake/settings.hh +++ b/src/libflake/flake/settings.hh @@ -17,7 +17,7 @@ struct Settings : public Config { Settings(); - void configureEvalSettings(nix::EvalSettings & evalSettings); + void configureEvalSettings(nix::EvalSettings & evalSettings) const; Setting useRegistries{ this, From 5663827c7d62e305833e007584c7de82ba7cb303 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 26 Mar 2025 20:02:06 +0000 Subject: [PATCH 23/84] Move call-flake.nix to nix-flake As suggested by Ericson2314 in review https://github.com/NixOS/nix/pull/12759#issuecomment-2755352343 (cherry picked from commit 0c75581d8b7cfbfa7a8db9b5dcbf0cbf0709009f) --- src/libexpr/eval.cc | 4 ---- src/libexpr/eval.hh | 4 +--- src/libexpr/meson.build | 1 - src/{libexpr => libflake}/call-flake.nix | 0 src/libflake/flake/flake.cc | 24 ++++++++++++++++++++++-- src/libflake/meson.build | 10 ++++++++++ src/libflake/package.nix | 1 + 7 files changed, 34 insertions(+), 10 deletions(-) rename src/{libexpr => libflake}/call-flake.nix (100%) diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index 53b649606..b9b89773f 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -288,10 +288,6 @@ EvalState::EvalState( CanonPath("derivation-internal.nix"), #include "primops/derivation.nix.gen.hh" )} - , callFlakeInternal{internalFS->addFile( - CanonPath("call-flake.nix"), - #include "call-flake.nix.gen.hh" - )} , store(store) , buildStore(buildStore ? buildStore : store) , debugRepl(nullptr) diff --git a/src/libexpr/eval.hh b/src/libexpr/eval.hh index 9b8899ccf..5e3e915c6 100644 --- a/src/libexpr/eval.hh +++ b/src/libexpr/eval.hh @@ -274,14 +274,12 @@ public: /** * In-memory filesystem for internal, non-user-callable Nix - * expressions like call-flake.nix. + * expressions like `derivation.nix`. */ const ref internalFS; const SourcePath derivationInternal; - const SourcePath callFlakeInternal; - /** * Store used to materialise .drv files. */ diff --git a/src/libexpr/meson.build b/src/libexpr/meson.build index fc04c4691..040da3dbc 100644 --- a/src/libexpr/meson.build +++ b/src/libexpr/meson.build @@ -126,7 +126,6 @@ generated_headers = [] foreach header : [ 'imported-drv-to-derivation.nix', 'fetchurl.nix', - 'call-flake.nix', ] generated_headers += gen_header.process(header) endforeach diff --git a/src/libexpr/call-flake.nix b/src/libflake/call-flake.nix similarity index 100% rename from src/libexpr/call-flake.nix rename to src/libflake/call-flake.nix diff --git a/src/libflake/flake/flake.cc b/src/libflake/flake/flake.cc index 47feeb087..b4b987027 100644 --- a/src/libflake/flake/flake.cc +++ b/src/libflake/flake/flake.cc @@ -16,6 +16,8 @@ #include +#include "memory-source-accessor.hh" + namespace nix { using namespace flake; @@ -921,6 +923,25 @@ LockedFlake lockFlake( } } +static ref makeInternalFS() { + auto internalFS = make_ref(MemorySourceAccessor {}); + internalFS->setPathDisplay("«flakes-internal»", ""); + internalFS->addFile( + CanonPath("call-flake.nix"), + #include "call-flake.nix.gen.hh" + ); + return internalFS; +} + +static auto internalFS = makeInternalFS(); + +static Value * requireInternalFile(EvalState & state, CanonPath path) { + SourcePath p {internalFS, path}; + auto v = state.allocValue(); + state.evalFile(p, *v); // has caching + return v; +} + void callFlake(EvalState & state, const LockedFlake & lockedFlake, Value & vRes) @@ -960,8 +981,7 @@ void callFlake(EvalState & state, auto & vOverrides = state.allocValue()->mkAttrs(overrides); - auto vCallFlake = state.allocValue(); - state.evalFile(state.callFlakeInternal, *vCallFlake); + Value * vCallFlake = requireInternalFile(state, CanonPath("call-flake.nix")); auto vLocks = state.allocValue(); vLocks->mkString(lockFileStr); diff --git a/src/libflake/meson.build b/src/libflake/meson.build index 642b85aea..b780722de 100644 --- a/src/libflake/meson.build +++ b/src/libflake/meson.build @@ -39,6 +39,15 @@ add_project_arguments( subdir('nix-meson-build-support/common') +subdir('nix-meson-build-support/generate-header') + +generated_headers = [] +foreach header : [ + 'call-flake.nix', +] + generated_headers += gen_header.process(header) +endforeach + sources = files( 'flake/config.cc', 'flake/flake.cc', @@ -65,6 +74,7 @@ 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, diff --git a/src/libflake/package.nix b/src/libflake/package.nix index 5240ce5e3..d7250c252 100644 --- a/src/libflake/package.nix +++ b/src/libflake/package.nix @@ -28,6 +28,7 @@ mkMesonLibrary (finalAttrs: { ../../.version ./.version ./meson.build + ./call-flake.nix (fileset.fileFilter (file: file.hasExt "cc") ./.) (fileset.fileFilter (file: file.hasExt "hh") ./.) ]; From 569631b1d5c92f7d7cd9ed4a5ce1602bb3071c30 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Fri, 28 Mar 2025 14:14:45 +0000 Subject: [PATCH 24/84] Unexpose config headers (low hanging fruit only) - Some headers were completely redundant and have been removed. - Other headers have been turned private. - Unnecessary meson.build code has been removed. - libutil-tests now has a private config header, where previously it had none. This removes the need to expose a package version macro publicly. (cherry picked from commit b86a76044e282a8f1de06cd89af683d40a48f233) --- src/libcmd/meson.build | 5 ++--- src/libexpr-c/meson.build | 16 +--------------- src/libexpr-tests/meson.build | 3 --- src/libflake-c/meson.build | 17 +---------------- src/libmain-c/meson.build | 17 +---------------- src/libmain/meson.build | 3 ++- src/libstore-c/meson.build | 15 +-------------- src/libstore-tests/meson.build | 2 -- src/libstore/meson.build | 1 + src/libutil-c/meson.build | 6 ++---- src/libutil-c/nix_api_util.cc | 2 ++ src/libutil-tests/meson.build | 14 ++++++++++---- src/libutil/meson.build | 2 ++ src/nix/meson.build | 3 --- tests/functional/plugins/meson.build | 1 - 15 files changed, 25 insertions(+), 82 deletions(-) diff --git a/src/libcmd/meson.build b/src/libcmd/meson.build index 114c099df..85d22a5f3 100644 --- a/src/libcmd/meson.build +++ b/src/libcmd/meson.build @@ -63,9 +63,7 @@ add_project_arguments( # It would be nice for our headers to be idempotent instead. '-include', 'config-util.hh', '-include', 'config-store.hh', - # '-include', 'config-fetchers.h', '-include', 'config-expr.hh', - '-include', 'config-main.hh', '-include', 'config-cmd.hh', language : 'cpp', ) @@ -93,7 +91,7 @@ sources = files( include_dirs = [include_directories('.')] -headers = [config_h] + files( +headers = files( 'built-path.hh', 'command-installable-value.hh', 'command.hh', @@ -119,6 +117,7 @@ subdir('nix-meson-build-support/windows-version') this_library = library( 'nixcmd', sources, + config_h, dependencies : deps_public + deps_private + deps_other, include_directories : include_dirs, link_args: linker_export_flags, diff --git a/src/libexpr-c/meson.build b/src/libexpr-c/meson.build index 9487132cf..8405525ca 100644 --- a/src/libexpr-c/meson.build +++ b/src/libexpr-c/meson.build @@ -14,8 +14,6 @@ cxx = meson.get_compiler('cpp') subdir('nix-meson-build-support/deps-lists') -configdata = configuration_data() - deps_private_maybe_subproject = [ dependency('nix-util'), dependency('nix-store'), @@ -27,14 +25,6 @@ deps_public_maybe_subproject = [ ] subdir('nix-meson-build-support/subprojects') -# TODO rename, because it will conflict with downstream projects -configdata.set_quoted('PACKAGE_VERSION', meson.project_version()) - -config_h = configure_file( - configuration : configdata, - output : 'config-expr.h', -) - add_project_arguments( # TODO(Qyriad): Yes this is how the autoconf+Make system did it. # It would be nice for our headers to be idempotent instead. @@ -44,10 +34,6 @@ add_project_arguments( '-include', 'config-store.hh', '-include', 'config-expr.hh', - # From C libraries, for our public, installed headers too - '-include', 'config-util.h', - '-include', 'config-store.h', - '-include', 'config-expr.h', language : 'cpp', ) @@ -61,7 +47,7 @@ sources = files( include_dirs = [include_directories('.')] -headers = [config_h] + files( +headers = files( 'nix_api_expr.h', 'nix_api_external.h', 'nix_api_value.h', diff --git a/src/libexpr-tests/meson.build b/src/libexpr-tests/meson.build index 667a0d7b7..9f6edb9b3 100644 --- a/src/libexpr-tests/meson.build +++ b/src/libexpr-tests/meson.build @@ -41,9 +41,6 @@ add_project_arguments( '-include', 'config-util.hh', '-include', 'config-store.hh', '-include', 'config-expr.hh', - '-include', 'config-util.h', - '-include', 'config-store.h', - '-include', 'config-expr.h', language : 'cpp', ) diff --git a/src/libflake-c/meson.build b/src/libflake-c/meson.build index 85d20644d..469e0ade4 100644 --- a/src/libflake-c/meson.build +++ b/src/libflake-c/meson.build @@ -14,8 +14,6 @@ cxx = meson.get_compiler('cpp') subdir('nix-meson-build-support/deps-lists') -configdata = configuration_data() - deps_private_maybe_subproject = [ dependency('nix-util'), dependency('nix-store'), @@ -29,14 +27,6 @@ deps_public_maybe_subproject = [ ] subdir('nix-meson-build-support/subprojects') -# TODO rename, because it will conflict with downstream projects -configdata.set_quoted('PACKAGE_VERSION', meson.project_version()) - -config_h = configure_file( - configuration : configdata, - output : 'config-flake.h', -) - add_project_arguments( # TODO(Qyriad): Yes this is how the autoconf+Make system did it. # It would be nice for our headers to be idempotent instead. @@ -48,11 +38,6 @@ add_project_arguments( # not generated (yet?) # '-include', 'config-flake.hh', - # From C libraries, for our public, installed headers too - '-include', 'config-util.h', - '-include', 'config-store.h', - '-include', 'config-expr.h', - '-include', 'config-flake.h', language : 'cpp', ) @@ -64,7 +49,7 @@ sources = files( include_dirs = [include_directories('.')] -headers = [config_h] + files( +headers = files( 'nix_api_flake.h', ) diff --git a/src/libmain-c/meson.build b/src/libmain-c/meson.build index d875d2c3f..0e9380a12 100644 --- a/src/libmain-c/meson.build +++ b/src/libmain-c/meson.build @@ -14,8 +14,6 @@ cxx = meson.get_compiler('cpp') subdir('nix-meson-build-support/deps-lists') -configdata = configuration_data() - deps_private_maybe_subproject = [ dependency('nix-util'), dependency('nix-store'), @@ -27,14 +25,6 @@ deps_public_maybe_subproject = [ ] subdir('nix-meson-build-support/subprojects') -# TODO rename, because it will conflict with downstream projects -configdata.set_quoted('PACKAGE_VERSION', meson.project_version()) - -config_h = configure_file( - configuration : configdata, - output : 'config-main.h', -) - add_project_arguments( # TODO(Qyriad): Yes this is how the autoconf+Make system did it. # It would be nice for our headers to be idempotent instead. @@ -42,12 +32,7 @@ add_project_arguments( # From C++ libraries, only for internals '-include', 'config-util.hh', '-include', 'config-store.hh', - '-include', 'config-main.hh', - # From C libraries, for our public, installed headers too - '-include', 'config-util.h', - '-include', 'config-store.h', - '-include', 'config-main.h', language : 'cpp', ) @@ -59,7 +44,7 @@ sources = files( include_dirs = [include_directories('.')] -headers = [config_h] + files( +headers = files( 'nix_api_main.h', ) diff --git a/src/libmain/meson.build b/src/libmain/meson.build index 6a0a22295..7c24abb29 100644 --- a/src/libmain/meson.build +++ b/src/libmain/meson.build @@ -74,7 +74,7 @@ endif include_dirs = [include_directories('.')] -headers = [config_h] + files( +headers = files( 'common-args.hh', 'loggers.hh', 'plugin.hh', @@ -88,6 +88,7 @@ subdir('nix-meson-build-support/windows-version') this_library = library( 'nixmain', sources, + config_h, dependencies : deps_public + deps_private + deps_other, include_directories : include_dirs, link_args: linker_export_flags, diff --git a/src/libstore-c/meson.build b/src/libstore-c/meson.build index 17d18609f..2e2275fee 100644 --- a/src/libstore-c/meson.build +++ b/src/libstore-c/meson.build @@ -14,8 +14,6 @@ cxx = meson.get_compiler('cpp') subdir('nix-meson-build-support/deps-lists') -configdata = configuration_data() - deps_private_maybe_subproject = [ dependency('nix-util'), dependency('nix-store'), @@ -25,14 +23,6 @@ deps_public_maybe_subproject = [ ] subdir('nix-meson-build-support/subprojects') -# TODO rename, because it will conflict with downstream projects -configdata.set_quoted('PACKAGE_VERSION', meson.project_version()) - -config_h = configure_file( - configuration : configdata, - output : 'config-store.h', -) - add_project_arguments( # TODO(Qyriad): Yes this is how the autoconf+Make system did it. # It would be nice for our headers to be idempotent instead. @@ -41,9 +31,6 @@ add_project_arguments( '-include', 'config-util.hh', '-include', 'config-store.hh', - # From C libraries, for our public, installed headers too - '-include', 'config-util.h', - '-include', 'config-store.h', language : 'cpp', ) @@ -55,7 +42,7 @@ sources = files( include_dirs = [include_directories('.')] -headers = [config_h] + files( +headers = files( 'nix_api_store.h', ) diff --git a/src/libstore-tests/meson.build b/src/libstore-tests/meson.build index 3ba0795e9..9f3d8e1d4 100644 --- a/src/libstore-tests/meson.build +++ b/src/libstore-tests/meson.build @@ -45,8 +45,6 @@ add_project_arguments( # It would be nice for our headers to be idempotent instead. '-include', 'config-util.hh', '-include', 'config-store.hh', - '-include', 'config-util.h', - '-include', 'config-store.h', language : 'cpp', ) diff --git a/src/libstore/meson.build b/src/libstore/meson.build index 1ea1f57bc..a592cbf98 100644 --- a/src/libstore/meson.build +++ b/src/libstore/meson.build @@ -67,6 +67,7 @@ endforeach has_acl_support = cxx.has_header('sys/xattr.h') \ and cxx.has_function('llistxattr') \ and cxx.has_function('lremovexattr') +# TODO: used in header - make proper public header and make sure it's included. Affects ABI! configdata.set('HAVE_ACL_SUPPORT', has_acl_support.to_int()) if host_machine.system() == 'darwin' diff --git a/src/libutil-c/meson.build b/src/libutil-c/meson.build index ac1297665..2733a33ba 100644 --- a/src/libutil-c/meson.build +++ b/src/libutil-c/meson.build @@ -23,7 +23,6 @@ deps_public_maybe_subproject = [ ] subdir('nix-meson-build-support/subprojects') -# TODO rename, because it will conflict with downstream projects configdata.set_quoted('PACKAGE_VERSION', meson.project_version()) config_h = configure_file( @@ -38,8 +37,6 @@ add_project_arguments( # From C++ libraries, only for internals '-include', 'config-util.hh', - # From C libraries, for our public, installed headers too - '-include', 'config-util.h', language : 'cpp', ) @@ -51,7 +48,7 @@ sources = files( include_dirs = [include_directories('.')] -headers = [config_h] + files( +headers = files( 'nix_api_util.h', ) @@ -64,6 +61,7 @@ subdir('nix-meson-build-support/windows-version') this_library = library( 'nixutilc', sources, + config_h, dependencies : deps_public + deps_private + deps_other, include_directories : include_dirs, link_args: linker_export_flags, diff --git a/src/libutil-c/nix_api_util.cc b/src/libutil-c/nix_api_util.cc index 992ea0a2a..3e061d53e 100644 --- a/src/libutil-c/nix_api_util.cc +++ b/src/libutil-c/nix_api_util.cc @@ -7,6 +7,8 @@ #include #include +#include "config-util.h" + nix_c_context * nix_c_context_create() { return new nix_c_context(); diff --git a/src/libutil-tests/meson.build b/src/libutil-tests/meson.build index ad2c61711..f982d6cf6 100644 --- a/src/libutil-tests/meson.build +++ b/src/libutil-tests/meson.build @@ -32,11 +32,16 @@ deps_private += rapidcheck gtest = dependency('gtest', main : true) deps_private += gtest +configdata = configuration_data() +configdata.set_quoted('PACKAGE_VERSION', meson.project_version()) + +config_h = configure_file( + configuration : configdata, + output : 'config-util-tests.hh', +) + add_project_arguments( - # TODO(Qyriad): Yes this is how the autoconf+Make system did it. - # It would be nice for our headers to be idempotent instead. - '-include', 'config-util.hh', - '-include', 'config-util.h', + '-include', 'config-util-tests.hh', language : 'cpp', ) @@ -79,6 +84,7 @@ include_dirs = [include_directories('.')] this_exe = executable( meson.project_name(), sources, + config_h, dependencies : deps_private_subproject + deps_private + deps_other, include_directories : include_dirs, # TODO: -lrapidcheck, see ../libutil-support/build.meson diff --git a/src/libutil/meson.build b/src/libutil/meson.build index 9e70d0549..8af3272a8 100644 --- a/src/libutil/meson.build +++ b/src/libutil/meson.build @@ -33,12 +33,14 @@ check_funcs = [ 'pipe2', # Optionally used to preallocate files to be large enough before # writing to them. + # WARNING: define also used in libstore 'posix_fallocate', # Optionally used to get more information about processes failing due # to a signal on Unix. 'strsignal', # Optionally used to try to close more file descriptors (e.g. before # forking) on Unix. + # WARNING: also used in libexpr 'sysconf', # Optionally used for changing the mtime of files and symlinks. 'utimensat', diff --git a/src/nix/meson.build b/src/nix/meson.build index 79ad840f6..1ad53c807 100644 --- a/src/nix/meson.build +++ b/src/nix/meson.build @@ -57,9 +57,6 @@ add_project_arguments( '-include', 'config-util.hh', '-include', 'config-store.hh', '-include', 'config-expr.hh', - #'-include', 'config-fetchers.hh', - '-include', 'config-main.hh', - '-include', 'config-cmd.hh', '-include', 'config-nix-cli.hh', language : 'cpp', ) diff --git a/tests/functional/plugins/meson.build b/tests/functional/plugins/meson.build index 3d6b2f0e1..13acdbbc5 100644 --- a/tests/functional/plugins/meson.build +++ b/tests/functional/plugins/meson.build @@ -6,7 +6,6 @@ libplugintest = shared_module( # It would be nice for our headers to be idempotent instead. '-include', 'config-util.hh', '-include', 'config-store.hh', - # '-include', 'config-fetchers.hh', '-include', 'config-expr.hh', ], dependencies : [ From 3e2f4891c4ec025ff0646afee24afc5ef5a7db90 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 3 Mar 2025 18:22:25 -0500 Subject: [PATCH 25/84] Advanced attributes organize MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is supposed to firstly improve the docs as they are, and secondly hint at how the core conceptual information ought to be moved to the store derivation section of the manual. Co-authored-by: Jörg Thalheim (cherry picked from commit 637aa0944d02bb7d4bccba5fe6fc9973a93ca656) --- .../source/language/advanced-attributes.md | 298 +++++++++--------- 1 file changed, 154 insertions(+), 144 deletions(-) diff --git a/doc/manual/source/language/advanced-attributes.md b/doc/manual/source/language/advanced-attributes.md index 0722386c4..bf196e0b8 100644 --- a/doc/manual/source/language/advanced-attributes.md +++ b/doc/manual/source/language/advanced-attributes.md @@ -2,6 +2,83 @@ Derivations can declare some infrequently used optional attributes. +## Inputs + + - [`exportReferencesGraph`]{#adv-attr-exportReferencesGraph}\ + This attribute allows builders access to the references graph of + their inputs. The attribute is a list of inputs in the Nix store + whose references graph the builder needs to know. The value of + this attribute should be a list of pairs `[ name1 path1 name2 + path2 ... ]`. The references graph of each *pathN* will be stored + in a text file *nameN* in the temporary build directory. The text + files have the format used by `nix-store --register-validity` + (with the deriver fields left empty). For example, when the + following derivation is built: + + ```nix + derivation { + ... + exportReferencesGraph = [ "libfoo-graph" libfoo ]; + }; + ``` + + the references graph of `libfoo` is placed in the file + `libfoo-graph` in the temporary build directory. + + `exportReferencesGraph` is useful for builders that want to do + something with the closure of a store path. Examples include the + builders in NixOS that generate the initial ramdisk for booting + Linux (a `cpio` archive containing the closure of the boot script) + and the ISO-9660 image for the installation CD (which is populated + with a Nix store containing the closure of a bootable NixOS + configuration). + + - [`passAsFile`]{#adv-attr-passAsFile}\ + A list of names of attributes that should be passed via files rather + than environment variables. For example, if you have + + ```nix + passAsFile = ["big"]; + big = "a very long string"; + ``` + + then when the builder runs, the environment variable `bigPath` + will contain the absolute path to a temporary file containing `a + very long string`. That is, for any attribute *x* listed in + `passAsFile`, Nix will pass an environment variable `xPath` + holding the path of the file containing the value of attribute + *x*. This is useful when you need to pass large strings to a + builder, since most operating systems impose a limit on the size + of the environment (typically, a few hundred kilobyte). + + - [`__structuredAttrs`]{#adv-attr-structuredAttrs}\ + If the special attribute `__structuredAttrs` is set to `true`, the other derivation + attributes are serialised into a file in JSON format. The environment variable + `NIX_ATTRS_JSON_FILE` points to the exact location of that file both in a build + and a [`nix-shell`](../command-ref/nix-shell.md). This obviates the need for + [`passAsFile`](#adv-attr-passAsFile) since JSON files have no size restrictions, + unlike process environments. + + It also makes it possible to tweak derivation settings in a structured way; see + [`outputChecks`](#adv-attr-outputChecks) for example. + + As a convenience to Bash builders, + Nix writes a script that initialises shell variables + corresponding to all attributes that are representable in Bash. The + environment variable `NIX_ATTRS_SH_FILE` points to the exact + location of the script, both in a build and a + [`nix-shell`](../command-ref/nix-shell.md). This includes non-nested + (associative) arrays. For example, the attribute `hardening.format = true` + ends up as the Bash associative array element `${hardening[format]}`. + + > **Warning** + > + > If set to `true`, other advanced attributes such as [`allowedReferences`](#adv-attr-allowedReferences), [`allowedReferences`](#adv-attr-allowedReferences), [`allowedRequisites`](#adv-attr-allowedRequisites), + [`disallowedReferences`](#adv-attr-disallowedReferences) and [`disallowedRequisites`](#adv-attr-disallowedRequisites), maxSize, and maxClosureSize. + will have no effect. + +## Output checks + - [`allowedReferences`]{#adv-attr-allowedReferences}\ The optional attribute `allowedReferences` specifies a list of legal references (dependencies) of the output of the builder. For example, @@ -55,34 +132,89 @@ Derivations can declare some infrequently used optional attributes. dependency on `foobar` or any other derivation depending recursively on `foobar`. - - [`exportReferencesGraph`]{#adv-attr-exportReferencesGraph}\ - This attribute allows builders access to the references graph of - their inputs. The attribute is a list of inputs in the Nix store - whose references graph the builder needs to know. The value of - this attribute should be a list of pairs `[ name1 path1 name2 - path2 ... ]`. The references graph of each *pathN* will be stored - in a text file *nameN* in the temporary build directory. The text - files have the format used by `nix-store --register-validity` - (with the deriver fields left empty). For example, when the - following derivation is built: + - [`outputChecks`]{#adv-attr-outputChecks}\ + When using [structured attributes](#adv-attr-structuredAttrs), the `outputChecks` + attribute allows defining checks per-output. + + In addition to + [`allowedReferences`](#adv-attr-allowedReferences), [`allowedRequisites`](#adv-attr-allowedRequisites), + [`disallowedReferences`](#adv-attr-disallowedReferences) and [`disallowedRequisites`](#adv-attr-disallowedRequisites), + the following attributes are available: + + - `maxSize` defines the maximum size of the resulting [store object](@docroot@/store/store-object.md). + - `maxClosureSize` defines the maximum size of the output's closure. + - `ignoreSelfRefs` controls whether self-references should be considered when + checking for allowed references/requisites. + + Example: ```nix - derivation { - ... - exportReferencesGraph = [ "libfoo-graph" libfoo ]; + __structuredAttrs = true; + + outputChecks.out = { + # The closure of 'out' must not be larger than 256 MiB. + maxClosureSize = 256 * 1024 * 1024; + + # It must not refer to the C compiler or to the 'dev' output. + disallowedRequisites = [ stdenv.cc "dev" ]; + }; + + outputChecks.dev = { + # The 'dev' output must not be larger than 128 KiB. + maxSize = 128 * 1024; }; ``` - the references graph of `libfoo` is placed in the file - `libfoo-graph` in the temporary build directory. +## Other output modifications - `exportReferencesGraph` is useful for builders that want to do - something with the closure of a store path. Examples include the - builders in NixOS that generate the initial ramdisk for booting - Linux (a `cpio` archive containing the closure of the boot script) - and the ISO-9660 image for the installation CD (which is populated - with a Nix store containing the closure of a bootable NixOS - configuration). + - [`unsafeDiscardReferences`]{#adv-attr-unsafeDiscardReferences}\ + + When using [structured attributes](#adv-attr-structuredAttrs), the + attribute `unsafeDiscardReferences` is an attribute set with a boolean value for each output name. + If set to `true`, it disables scanning the output for runtime dependencies. + + Example: + + ```nix + __structuredAttrs = true; + unsafeDiscardReferences.out = true; + ``` + + This is useful, for example, when generating self-contained filesystem images with + their own embedded Nix store: hashes found inside such an image refer + to the embedded store and not to the host's Nix store. + +## Build scheduling + + - [`preferLocalBuild`]{#adv-attr-preferLocalBuild}\ + If this attribute is set to `true` and [distributed building is enabled](@docroot@/command-ref/conf-file.md#conf-builders), then, if possible, the derivation will be built locally instead of being forwarded to a remote machine. + This is useful for derivations that are cheapest to build locally. + + - [`allowSubstitutes`]{#adv-attr-allowSubstitutes}\ + If this attribute is set to `false`, then Nix will always build this derivation (locally or remotely); it will not try to substitute its outputs. + This is useful for derivations that are cheaper to build than to substitute. + + This attribute can be ignored by setting [`always-allow-substitutes`](@docroot@/command-ref/conf-file.md#conf-always-allow-substitutes) to `true`. + + > **Note** + > + > If set to `false`, the [`builder`] should be able to run on the system type specified in the [`system` attribute](./derivations.md#attr-system), since the derivation cannot be substituted. + + [`builder`]: ./derivations.md#attr-builder + +- [`requiredSystemFeatures`]{#adv-attr-requiredSystemFeatures}\ + + If a derivation has the `requiredSystemFeatures` attribute, then Nix will only build it on a machine that has the corresponding features set in its [`system-features` configuration](@docroot@/command-ref/conf-file.md#conf-system-features). + + For example, setting + + ```nix + requiredSystemFeatures = [ "kvm" ]; + ``` + + ensures that the derivation can only be built on a machine with the `kvm` feature. + +# Impure builder configuration - [`impureEnvVars`]{#adv-attr-impureEnvVars}\ This attribute allows you to specify a list of environment variables @@ -119,128 +251,6 @@ Derivations can declare some infrequently used optional attributes. [`impure-env`](@docroot@/command-ref/conf-file.md#conf-impure-env) configuration setting. - - [`passAsFile`]{#adv-attr-passAsFile}\ - A list of names of attributes that should be passed via files rather - than environment variables. For example, if you have - - ```nix - passAsFile = ["big"]; - big = "a very long string"; - ``` - - then when the builder runs, the environment variable `bigPath` - will contain the absolute path to a temporary file containing `a - very long string`. That is, for any attribute *x* listed in - `passAsFile`, Nix will pass an environment variable `xPath` - holding the path of the file containing the value of attribute - *x*. This is useful when you need to pass large strings to a - builder, since most operating systems impose a limit on the size - of the environment (typically, a few hundred kilobyte). - - - [`preferLocalBuild`]{#adv-attr-preferLocalBuild}\ - If this attribute is set to `true` and [distributed building is enabled](@docroot@/command-ref/conf-file.md#conf-builders), then, if possible, the derivation will be built locally instead of being forwarded to a remote machine. - This is useful for derivations that are cheapest to build locally. - - - [`allowSubstitutes`]{#adv-attr-allowSubstitutes}\ - If this attribute is set to `false`, then Nix will always build this derivation (locally or remotely); it will not try to substitute its outputs. - This is useful for derivations that are cheaper to build than to substitute. - - This attribute can be ignored by setting [`always-allow-substitutes`](@docroot@/command-ref/conf-file.md#conf-always-allow-substitutes) to `true`. - - > **Note** - > - > If set to `false`, the [`builder`] should be able to run on the system type specified in the [`system` attribute](./derivations.md#attr-system), since the derivation cannot be substituted. - - [`builder`]: ./derivations.md#attr-builder - - - [`__structuredAttrs`]{#adv-attr-structuredAttrs}\ - If the special attribute `__structuredAttrs` is set to `true`, the other derivation - attributes are serialised into a file in JSON format. The environment variable - `NIX_ATTRS_JSON_FILE` points to the exact location of that file both in a build - and a [`nix-shell`](../command-ref/nix-shell.md). This obviates the need for - [`passAsFile`](#adv-attr-passAsFile) since JSON files have no size restrictions, - unlike process environments. - - It also makes it possible to tweak derivation settings in a structured way; see - [`outputChecks`](#adv-attr-outputChecks) for example. - - As a convenience to Bash builders, - Nix writes a script that initialises shell variables - corresponding to all attributes that are representable in Bash. The - environment variable `NIX_ATTRS_SH_FILE` points to the exact - location of the script, both in a build and a - [`nix-shell`](../command-ref/nix-shell.md). This includes non-nested - (associative) arrays. For example, the attribute `hardening.format = true` - ends up as the Bash associative array element `${hardening[format]}`. - - > **Warning** - > - > If set to `true`, other advanced attributes such as [`allowedReferences`](#adv-attr-allowedReferences), [`allowedReferences`](#adv-attr-allowedReferences), [`allowedRequisites`](#adv-attr-allowedRequisites), - [`disallowedReferences`](#adv-attr-disallowedReferences) and [`disallowedRequisites`](#adv-attr-disallowedRequisites), maxSize, and maxClosureSize. - will have no effect. - - - [`outputChecks`]{#adv-attr-outputChecks}\ - When using [structured attributes](#adv-attr-structuredAttrs), the `outputChecks` - attribute allows defining checks per-output. - - In addition to - [`allowedReferences`](#adv-attr-allowedReferences), [`allowedRequisites`](#adv-attr-allowedRequisites), - [`disallowedReferences`](#adv-attr-disallowedReferences) and [`disallowedRequisites`](#adv-attr-disallowedRequisites), - the following attributes are available: - - - `maxSize` defines the maximum size of the resulting [store object](@docroot@/store/store-object.md). - - `maxClosureSize` defines the maximum size of the output's closure. - - `ignoreSelfRefs` controls whether self-references should be considered when - checking for allowed references/requisites. - - Example: - - ```nix - __structuredAttrs = true; - - outputChecks.out = { - # The closure of 'out' must not be larger than 256 MiB. - maxClosureSize = 256 * 1024 * 1024; - - # It must not refer to the C compiler or to the 'dev' output. - disallowedRequisites = [ stdenv.cc "dev" ]; - }; - - outputChecks.dev = { - # The 'dev' output must not be larger than 128 KiB. - maxSize = 128 * 1024; - }; - ``` - - - [`unsafeDiscardReferences`]{#adv-attr-unsafeDiscardReferences}\ - - When using [structured attributes](#adv-attr-structuredAttrs), the - attribute `unsafeDiscardReferences` is an attribute set with a boolean value for each output name. - If set to `true`, it disables scanning the output for runtime dependencies. - - Example: - - ```nix - __structuredAttrs = true; - unsafeDiscardReferences.out = true; - ``` - - This is useful, for example, when generating self-contained filesystem images with - their own embedded Nix store: hashes found inside such an image refer - to the embedded store and not to the host's Nix store. - -- [`requiredSystemFeatures`]{#adv-attr-requiredSystemFeatures}\ - - If a derivation has the `requiredSystemFeatures` attribute, then Nix will only build it on a machine that has the corresponding features set in its [`system-features` configuration](@docroot@/command-ref/conf-file.md#conf-system-features). - - For example, setting - - ```nix - requiredSystemFeatures = [ "kvm" ]; - ``` - - ensures that the derivation can only be built on a machine with the `kvm` feature. - ## Setting the derivation type As discussed in [Derivation Outputs and Types of Derivations](@docroot@/store/derivation/outputs/index.md), there are multiples kinds of derivations / kinds of derivation outputs. From 12825ab9720d3ae9311a0e905148a32dfff2f0f8 Mon Sep 17 00:00:00 2001 From: Farid Zakaria Date: Fri, 7 Mar 2025 23:07:03 -0800 Subject: [PATCH 26/84] Fix minor documentation typos Was reading the store chapter and came across a few small typos and edits. (cherry picked from commit 33493b9eada8722250257414545934d0feb09f73) --- doc/manual/source/store/derivation/outputs/index.md | 10 +++++----- .../source/store/file-system-object/content-address.md | 3 ++- .../source/store/store-object/content-address.md | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/doc/manual/source/store/derivation/outputs/index.md b/doc/manual/source/store/derivation/outputs/index.md index 15070a18f..b02e6eca0 100644 --- a/doc/manual/source/store/derivation/outputs/index.md +++ b/doc/manual/source/store/derivation/outputs/index.md @@ -1,7 +1,7 @@ # Derivation Outputs and Types of Derivations As stated on the [main pages on derivations](../index.md#store-derivation), -a derivation produces [store objects], which are known as the *outputs* of the derivation. +a derivation produces [store objects](@docroot@/store/store-object.md), which are known as the *outputs* of the derivation. Indeed, the entire point of derivations is to produce these outputs, and to reliably and reproducably produce these derivations each time the derivation is run. One of the parts of a derivation is its *outputs specification*, which specifies certain information about the outputs the derivation produces when run. @@ -9,7 +9,7 @@ The outputs specification is a map, from names to specifications for individual ## Output Names {#outputs} -Output names can be any string which is also a valid [store path] name. +Output names can be any string which is also a valid [store path](@docroot@/store/store-path.md) name. The name mapped to each output specification is not actually the name of the output. In the general case, the output store object has name `derivationName + "-" + outputSpecName`, not any other metadata about it. However, an output spec named "out" describes and output store object whose name is just the derivation name. @@ -24,11 +24,11 @@ However, an output spec named "out" describes and output store object whose name > > - The store path of `dev` will be: `/nix/store/-hello-dev`. -The outputs are the derivations are the [store objects][store object] it is obligated to produce. +The outputs are the derivations are the [store objects](@docroot@/store/store-object.md) it is obligated to produce. > **Note** > -> The formal terminology here is somewhat at adds with everyday communication in the Nix community today. +> The formal terminology here is somewhat at odds with everyday communication in the Nix community today. > "output" in casual usage tends to refer to either to the actual output store object, or the notional output spec, depending on context. > > For example "hello's `dev` output" means the store object referred to by the store path `/nix/store/-hello-dev`. @@ -64,7 +64,7 @@ The rules for this are fairly concise: (This is an arbitrary restriction that could be lifted.) -- The output is either *fixed* or *floating*, indicating whether the its store path is known prior to building it. +- The output is either *fixed* or *floating*, indicating whether the store path is known prior to building it. - With fixed content-addressing it is fixed. diff --git a/doc/manual/source/store/file-system-object/content-address.md b/doc/manual/source/store/file-system-object/content-address.md index 72b087fe9..04a1021f1 100644 --- a/doc/manual/source/store/file-system-object/content-address.md +++ b/doc/manual/source/store/file-system-object/content-address.md @@ -46,7 +46,7 @@ be many different serialisations. For these reasons, Nix has its very own archive format—the Nix Archive (NAR) format, which is carefully designed to avoid the problems described above. -The exact specification of the Nix Archive format is in `protocols/nix-archive.md` +The exact specification of the Nix Archive format is in [specified here](../../protocols/nix-archive.md). ## Content addressing File System Objects beyond a single serialisation pass @@ -80,6 +80,7 @@ Thus, Git can encode some, but not all of Nix's "File System Objects", and this In the future, we may support a Git-like hash for such file system objects, or we may adopt another Merkle DAG format which is capable of representing all Nix file system objects. + [file system object]: ../file-system-object.md [store object]: ../store-object.md [xp-feature-git-hashing]: @docroot@/development/experimental-features.md#xp-feature-git-hashing diff --git a/doc/manual/source/store/store-object/content-address.md b/doc/manual/source/store/store-object/content-address.md index ff77dd4b6..5742b9fe1 100644 --- a/doc/manual/source/store/store-object/content-address.md +++ b/doc/manual/source/store/store-object/content-address.md @@ -50,7 +50,7 @@ The hashes of these modified input streams are used instead. When validating the content address of a store object after the fact, the above process works as written. However, when first creating the store object we don't know the store object's store path, as explained just above. -We therefore, strictly speaking, do not know what value we will be replacing with the sentinental value in the inputs to hash functions. +We therefore, strictly speaking, do not know what value we will be replacing with the sentinel value in the inputs to hash functions. What instead happens is that the provisional store object --- the data from which we wish to create a store object --- is paired with a provisional "scratch" store path (that presumably was chosen when the data was created). That provisional store path is instead what is replaced with the sentinel value, rather than the final store object which we do not yet know. From b50c557e747119d5d95dd1b15e7d19fd09393095 Mon Sep 17 00:00:00 2001 From: Sergei Zimmerman <145775305+xokdvium@users.noreply.github.com> Date: Sat, 8 Mar 2025 21:08:35 +0000 Subject: [PATCH 27/84] flake: Enable UBSAN for checks Doing this makes catching non-obvious bugs easier. GHA CI workload is already a concern and there isn't much benefit in running the tests with and without sanitizers at the same time, so UBSAN is enabled for default checks. This change doesn't affect production builds in any way, but is rather a step in the direction of improving automated testing during development. Relates to #10969. (cherry picked from commit 874587516ca21b55ad03ae6fa2b5428b199452eb) --- flake.nix | 38 +++++++++++++++++++++++++++++++++----- src/libutil/strings.cc | 4 +++- 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/flake.nix b/flake.nix index 037281eb5..87f1350e0 100644 --- a/flake.nix +++ b/flake.nix @@ -267,18 +267,46 @@ flatMapAttrs ( { - "" = nixpkgsFor.${system}.native; + # Run all tests with UBSAN enabled. Running both with ubsan and + # without doesn't seem to have much immediate benefit for doubling + # the GHA CI workaround. + # + # TODO: Work toward enabling "address,undefined" if it seems feasible. + # This would maybe require dropping Boost coroutines and ignoring intentional + # memory leaks with detect_leaks=0. + "" = rec { + nixpkgs = nixpkgsFor.${system}.native; + nixComponents = nixpkgs.nixComponents.overrideScope ( + nixCompFinal: nixCompPrev: { + mesonComponentOverrides = _finalAttrs: prevAttrs: { + mesonFlags = + (prevAttrs.mesonFlags or [ ]) + # TODO: Macos builds instrumented with ubsan take very long + # to run functional tests. + ++ lib.optionals (!nixpkgs.stdenv.hostPlatform.isDarwin) [ + (lib.mesonOption "b_sanitize" "undefined") + ]; + }; + } + ); + }; } // lib.optionalAttrs (!nixpkgsFor.${system}.native.stdenv.hostPlatform.isDarwin) { # TODO: enable static builds for darwin, blocked on: # https://github.com/NixOS/nixpkgs/issues/320448 # TODO: disabled to speed up GHA CI. - #"static-" = nixpkgsFor.${system}.native.pkgsStatic; + # "static-" = { + # nixpkgs = nixpkgsFor.${system}.native.pkgsStatic; + # }; } ) ( - nixpkgsPrefix: nixpkgs: - flatMapAttrs nixpkgs.nixComponents ( + nixpkgsPrefix: + { + nixpkgs, + nixComponents ? nixpkgs.nixComponents, + }: + flatMapAttrs nixComponents ( pkgName: pkg: flatMapAttrs pkg.tests or { } ( testName: test: { @@ -287,7 +315,7 @@ ) ) // lib.optionalAttrs (nixpkgs.stdenv.hostPlatform == nixpkgs.stdenv.buildPlatform) { - "${nixpkgsPrefix}nix-functional-tests" = nixpkgs.nixComponents.nix-functional-tests; + "${nixpkgsPrefix}nix-functional-tests" = nixComponents.nix-functional-tests; } ) // devFlake.checks.${system} or { } diff --git a/src/libutil/strings.cc b/src/libutil/strings.cc index b94bca611..1635321bb 100644 --- a/src/libutil/strings.cc +++ b/src/libutil/strings.cc @@ -17,8 +17,10 @@ struct view_stringbuf : public std::stringbuf } }; -std::string_view toView(const std::ostringstream & os) +__attribute__((no_sanitize("undefined"))) std::string_view toView(const std::ostringstream & os) { + /* Downcasting like this is very much undefined behavior, so we disable + UBSAN for this function. */ auto buf = static_cast(os.rdbuf()); return buf->toView(); } From 12f77a2fb91d6022fcd561a50dec56149116dcfe Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Thu, 27 Feb 2025 17:48:28 +0100 Subject: [PATCH 28/84] packaging: Make hydraJobs.build.* complete (cherry picked from commit d6139a339b98c3a5675757d6df52c79124d953b6) --- packaging/hydra.nix | 102 +++++++++++++++++++++++++++++++++----------- 1 file changed, 78 insertions(+), 24 deletions(-) diff --git a/packaging/hydra.nix b/packaging/hydra.nix index 44cbd753c..74e245f26 100644 --- a/packaging/hydra.nix +++ b/packaging/hydra.nix @@ -29,32 +29,86 @@ let # Technically we could just return `pkgs.nixComponents`, but for Hydra it's # convention to transpose it, and to transpose it efficiently, we need to # enumerate them manually, so that we don't evaluate unnecessary package sets. - forAllPackages = lib.genAttrs [ - "nix-everything" - "nix-util" - "nix-util-c" - "nix-util-test-support" - "nix-util-tests" - "nix-store" - "nix-store-c" - "nix-store-test-support" - "nix-store-tests" - "nix-fetchers" - "nix-fetchers-tests" - "nix-expr" - "nix-expr-c" - "nix-expr-test-support" - "nix-expr-tests" - "nix-flake" - "nix-flake-tests" - "nix-main" - "nix-main-c" - "nix-cmd" - "nix-cli" - "nix-functional-tests" - ]; + # See listingIsComplete below. + forAllPackages = forAllPackages' { }; + forAllPackages' = + { + enableBindings ? false, + enableDocs ? false, # already have separate attrs for these + }: + lib.genAttrs ( + [ + "nix-everything" + "nix-util" + "nix-util-c" + "nix-util-test-support" + "nix-util-tests" + "nix-store" + "nix-store-c" + "nix-store-test-support" + "nix-store-tests" + "nix-fetchers" + "nix-fetchers-tests" + "nix-expr" + "nix-expr-c" + "nix-expr-test-support" + "nix-expr-tests" + "nix-flake" + "nix-flake-c" + "nix-flake-tests" + "nix-main" + "nix-main-c" + "nix-cmd" + "nix-cli" + "nix-functional-tests" + ] + ++ lib.optionals enableBindings [ + "nix-perl-bindings" + ] + ++ lib.optionals enableDocs [ + "nix-manual" + "nix-internal-api-docs" + "nix-external-api-docs" + ] + ); in { + /** + An internal check to make sure our package listing is complete. + */ + listingIsComplete = + let + arbitrarySystem = "x86_64-linux"; + listedPkgs = forAllPackages' { + enableBindings = true; + enableDocs = true; + } (_: null); + actualPkgs = lib.concatMapAttrs ( + k: v: if lib.strings.hasPrefix "nix-" k then { ${k} = null; } else { } + ) nixpkgsFor.${arbitrarySystem}.native.nixComponents; + diff = lib.concatStringsSep "\n" ( + lib.concatLists ( + lib.mapAttrsToList ( + k: _: + if (listedPkgs ? ${k}) && !(actualPkgs ? ${k}) then + [ "- ${k}: redundant?" ] + else if !(listedPkgs ? ${k}) && (actualPkgs ? ${k}) then + [ "- ${k}: missing?" ] + else + [ ] + ) (listedPkgs // actualPkgs) + ) + ); + in + if listedPkgs == actualPkgs then + { } + else + throw '' + Please update the components list in hydra.nix (or fix this check) + Differences: + ${diff} + ''; + # Binary package for various platforms. build = forAllPackages ( pkgName: forAllSystems (system: nixpkgsFor.${system}.native.nixComponents.${pkgName}) From 5805f9cb93cbc49f9cf649b71b54c58735bd5864 Mon Sep 17 00:00:00 2001 From: Dmitry Bogatov Date: Sat, 8 Mar 2025 19:00:00 -0500 Subject: [PATCH 29/84] Improve the documentation of the store path protocol 1. Fix confusing wording that might imply unnecessary double-hashing. 2. Add references to specifics of base-32 encoding. 3. Fix incorrect description that sha256 hash of `fingerprint` is truncated. "Truncated" is actual wording used in Nix theses, but it has unusual meaning, that is better conveyed by word "compressed", which is used by the reference C++ implementation. 4. Clarify details of base16 encoding. (cherry picked from commit a0facb2aba1f643e7c2333bbf89e3765ca3f0351) --- doc/manual/source/protocols/store-path.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/doc/manual/source/protocols/store-path.md b/doc/manual/source/protocols/store-path.md index 9abd83f4f..8469195ad 100644 --- a/doc/manual/source/protocols/store-path.md +++ b/doc/manual/source/protocols/store-path.md @@ -20,9 +20,12 @@ where - `store-dir` = the [store directory](@docroot@/store/store-path.md#store-directory) -- `digest` = base-32 representation of the first 160 bits of a [SHA-256] hash of `fingerprint` +- `digest` = base-32 representation of the compressed to 160 bits [SHA-256] hash of `fingerprint` - This the hash part of the store name +For the definition of the hash compression algorithm, please refer to the section 5.1 of +the [Nix thesis](https://edolstra.github.io/pubs/phd-thesis.pdf), which also defines the +specifics of base-32 encoding. Note that base-32 encoding processes the hash bytestring from +the end, while base-16 processes in from the beginning. ## Fingerprint @@ -70,7 +73,8 @@ where `id` is the name of the output (usually, "out"). For content-addressed store objects, `id`, is always "out". -- `inner-digest` = base-16 representation of a SHA-256 hash of `inner-fingerprint` +- `inner-digest` = base-16 representation of a SHA-256 hash of `inner-fingerprint`. The + base-16 encoding uses lower-cased hex digits. ## Inner fingerprint @@ -82,7 +86,7 @@ where - if `type` = `"source:" ...`: - the hash of the [Nix Archive (NAR)] serialization of the [file system object](@docroot@/store/file-system-object.md) of the store object. + the [Nix Archive (NAR)] serialization of the [file system object](@docroot@/store/file-system-object.md) of the store object. - if `type` = `"output:" id`: From 5ab3b9c616a3cdca087fa86a0234783cfd502db7 Mon Sep 17 00:00:00 2001 From: Dmitry Bogatov Date: Tue, 11 Mar 2025 12:30:21 -0400 Subject: [PATCH 30/84] Update doc/manual/source/protocols/store-path.md Co-authored-by: John Ericson (cherry picked from commit affd9bbab7b9da0c60c023209bebe91fdbcdd3d5) --- doc/manual/source/protocols/store-path.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/manual/source/protocols/store-path.md b/doc/manual/source/protocols/store-path.md index 8469195ad..ee7fb3a12 100644 --- a/doc/manual/source/protocols/store-path.md +++ b/doc/manual/source/protocols/store-path.md @@ -73,8 +73,8 @@ the end, while base-16 processes in from the beginning. `id` is the name of the output (usually, "out"). For content-addressed store objects, `id`, is always "out". -- `inner-digest` = base-16 representation of a SHA-256 hash of `inner-fingerprint`. The - base-16 encoding uses lower-cased hex digits. +- `inner-digest` = base-16 representation of a SHA-256 hash of `inner-fingerprint`. + The base-16 encoding uses lower-cased hex digits. ## Inner fingerprint From a5c9b10083ffedd0c16e10eb5a1e8cad86bf9383 Mon Sep 17 00:00:00 2001 From: Sergei Zimmerman Date: Sun, 23 Mar 2025 22:10:43 +0000 Subject: [PATCH 31/84] libcmd/repl: Make `AbstractNixRepl::create` respect its `store` argument The only reference (according to clangd) to this function also uses `openStore`, so this is a no-op. (cherry picked from commit 8066e4b0c30d68bd7431f8a8c9c11d44765b0bf9) --- src/libcmd/repl.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcmd/repl.cc b/src/libcmd/repl.cc index 281e1f6f0..68bf41329 100644 --- a/src/libcmd/repl.cc +++ b/src/libcmd/repl.cc @@ -839,7 +839,7 @@ std::unique_ptr AbstractNixRepl::create( { return std::make_unique( lookupPath, - openStore(), + std::move(store), state, getValues ); From 49fa3e186981ef8dece5486d5d6ddf9b38a9d10a Mon Sep 17 00:00:00 2001 From: Sergei Zimmerman Date: Sun, 23 Mar 2025 22:13:14 +0000 Subject: [PATCH 32/84] libcmd/repl: Fix missing `runNix` in repl Without this :u, :sh and :i repl commands fail with: > Cannot run 'nix-shell'/`nix-env` because no method of calling the Nix > CLI was provided. This is a configuration problem pertaining to how > this program was built. Remove the default ctor argument as it evidently makes catching refactoring bugs much harder. `NixRepl` implementation lives completely in `repl.cc`, so we can be as explicit as necessary. (cherry picked from commit 44055dc09d12e85c3187a1a793c129ccb5d89050) --- src/libcmd/repl.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libcmd/repl.cc b/src/libcmd/repl.cc index 68bf41329..38b219643 100644 --- a/src/libcmd/repl.cc +++ b/src/libcmd/repl.cc @@ -124,7 +124,7 @@ std::string removeWhitespace(std::string s) NixRepl::NixRepl(const LookupPath & lookupPath, nix::ref store, ref state, - std::function getValues, RunNix * runNix = nullptr) + std::function getValues, RunNix * runNix) : AbstractNixRepl(state) , debugTraceIndex(0) , getValues(getValues) @@ -841,7 +841,8 @@ std::unique_ptr AbstractNixRepl::create( lookupPath, std::move(store), state, - getValues + getValues, + runNix ); } @@ -859,7 +860,8 @@ ReplExitStatus AbstractNixRepl::runSimple( lookupPath, openStore(), evalState, - getValues + getValues, + /*runNix=*/nullptr ); repl->initEnv(); From 20ce98f87bf7e09724880e171bbf90ca8e44bcf3 Mon Sep 17 00:00:00 2001 From: Sergei Zimmerman Date: Sun, 23 Mar 2025 22:13:40 +0000 Subject: [PATCH 33/84] tests/functional: Add regression test for broken `:sh` in repl Can't really test `:u` because it needs . (cherry picked from commit d371aadb2b6587572ce84f3899c19ae9d14eb435) --- tests/functional/repl.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/functional/repl.sh b/tests/functional/repl.sh index 59d1f1be0..5d99fbb02 100755 --- a/tests/functional/repl.sh +++ b/tests/functional/repl.sh @@ -56,6 +56,10 @@ testRepl () { nix repl "${nixArgs[@]}" 2>&1 <<< "builtins.currentSystem" \ | grep "$(nix-instantiate --eval -E 'builtins.currentSystem')" + # regression test for #12163 + replOutput=$(nix repl "${nixArgs[@]}" 2>&1 <<< ":sh import $testDir/simple.nix") + echo "$replOutput" | grepInverse "error: Cannot run 'nix-shell'" + expectStderr 1 nix repl "${testDir}/simple.nix" \ | grepQuiet -s "error: path '$testDir/simple.nix' is not a flake" } From 97356e9945e2b65d8c3ab64796fa8b722183a646 Mon Sep 17 00:00:00 2001 From: Brian McKenna Date: Fri, 7 Mar 2025 23:20:11 +1100 Subject: [PATCH 34/84] rapidcheck: change to working arbitrary instances Here we're switching to combinators instead of dereference operator. It turns out the dereference operator was being executed upon test setup, meaning that we were only using a only single value for each of the executions of the property tests! Really not good. And on Windows, we instead get: operator* is not allowed in this context https://github.com/emil-e/rapidcheck/blob/ff6af6fc683159deb51c543b065eba14dfcf329b/src/gen/detail/GenerationHandler.cpp#L16C31-L16C71 Now a few of the property tests fail, because we're generating cases which haven't been exercised before. (cherry picked from commit 9a04f1e73214df9cc477a36d219fcfede7bc763c) --- .../tests/value/context.cc | 33 ++++++---- .../tests/derived-path.cc | 62 ++++++++++++------- .../tests/outputs-spec.cc | 24 +++---- 3 files changed, 72 insertions(+), 47 deletions(-) diff --git a/src/libexpr-test-support/tests/value/context.cc b/src/libexpr-test-support/tests/value/context.cc index 8658bdaef..36837cd6a 100644 --- a/src/libexpr-test-support/tests/value/context.cc +++ b/src/libexpr-test-support/tests/value/context.cc @@ -8,23 +8,32 @@ using namespace nix; Gen Arbitrary::arbitrary() { - return gen::just(NixStringContextElem::DrvDeep { - .drvPath = *gen::arbitrary(), + return gen::map(gen::arbitrary(), [](StorePath drvPath) { + return NixStringContextElem::DrvDeep{ + .drvPath = drvPath, + }; }); } Gen Arbitrary::arbitrary() { - switch (*gen::inRange(0, std::variant_size_v)) { - case 0: - return gen::just(*gen::arbitrary()); - case 1: - return gen::just(*gen::arbitrary()); - case 2: - return gen::just(*gen::arbitrary()); - default: - assert(false); - } + return gen::mapcat( + gen::inRange(0, std::variant_size_v), + [](uint8_t n) -> Gen { + switch (n) { + case 0: + return gen::map( + gen::arbitrary(), [](NixStringContextElem a) { return a; }); + case 1: + return gen::map( + gen::arbitrary(), [](NixStringContextElem a) { return a; }); + case 2: + return gen::map( + gen::arbitrary(), [](NixStringContextElem a) { return a; }); + default: + assert(false); + } + }); } } diff --git a/src/libstore-test-support/tests/derived-path.cc b/src/libstore-test-support/tests/derived-path.cc index 078615bbd..b9f6a3171 100644 --- a/src/libstore-test-support/tests/derived-path.cc +++ b/src/libstore-test-support/tests/derived-path.cc @@ -9,49 +9,63 @@ using namespace nix; Gen Arbitrary::arbitrary() { - return gen::just(DerivedPath::Opaque { - .path = *gen::arbitrary(), + return gen::map(gen::arbitrary(), [](StorePath path) { + return DerivedPath::Opaque{ + .path = path, + }; }); } Gen Arbitrary::arbitrary() { - return gen::just(SingleDerivedPath::Built { - .drvPath = make_ref(*gen::arbitrary()), - .output = (*gen::arbitrary()).name, + return gen::mapcat(gen::arbitrary(), [](SingleDerivedPath drvPath) { + return gen::map(gen::arbitrary(), [drvPath](StorePathName outputPath) { + return SingleDerivedPath::Built{ + .drvPath = make_ref(drvPath), + .output = outputPath.name, + }; + }); }); } Gen Arbitrary::arbitrary() { - return gen::just(DerivedPath::Built { - .drvPath = make_ref(*gen::arbitrary()), - .outputs = *gen::arbitrary(), + return gen::mapcat(gen::arbitrary(), [](SingleDerivedPath drvPath) { + return gen::map(gen::arbitrary(), [drvPath](OutputsSpec outputs) { + return DerivedPath::Built{ + .drvPath = make_ref(drvPath), + .outputs = outputs, + }; + }); }); } Gen Arbitrary::arbitrary() { - switch (*gen::inRange(0, std::variant_size_v)) { - case 0: - return gen::just(*gen::arbitrary()); - case 1: - return gen::just(*gen::arbitrary()); - default: - assert(false); - } + return gen::mapcat(gen::inRange(0, std::variant_size_v), [](uint8_t n) { + switch (n) { + case 0: + return gen::map(gen::arbitrary(), [](SingleDerivedPath a) { return a; }); + case 1: + return gen::map(gen::arbitrary(), [](SingleDerivedPath a) { return a; }); + default: + assert(false); + } + }); } Gen Arbitrary::arbitrary() { - switch (*gen::inRange(0, std::variant_size_v)) { - case 0: - return gen::just(*gen::arbitrary()); - case 1: - return gen::just(*gen::arbitrary()); - default: - assert(false); - } + return gen::mapcat(gen::inRange(0, std::variant_size_v), [](uint8_t n) { + switch (n) { + case 0: + return gen::map(gen::arbitrary(), [](DerivedPath a) { return a; }); + case 1: + return gen::map(gen::arbitrary(), [](DerivedPath a) { return a; }); + default: + assert(false); + } + }); } } diff --git a/src/libstore-test-support/tests/outputs-spec.cc b/src/libstore-test-support/tests/outputs-spec.cc index e9d602203..1a3020f17 100644 --- a/src/libstore-test-support/tests/outputs-spec.cc +++ b/src/libstore-test-support/tests/outputs-spec.cc @@ -7,18 +7,20 @@ using namespace nix; Gen Arbitrary::arbitrary() { - switch (*gen::inRange(0, std::variant_size_v)) { - case 0: - return gen::just((OutputsSpec) OutputsSpec::All { }); - case 1: - return gen::just((OutputsSpec) OutputsSpec::Names { - *gen::nonEmpty(gen::container(gen::map( - gen::arbitrary(), - [](StorePathName n) { return n.name; }))), + return gen::mapcat( + gen::inRange(0, std::variant_size_v), [](uint8_t n) -> Gen { + switch (n) { + case 0: + return gen::just((OutputsSpec) OutputsSpec::All{}); + case 1: + return gen::map( + gen::nonEmpty(gen::container( + gen::map(gen::arbitrary(), [](StorePathName n) { return n.name; }))), + [](StringSet names) { return (OutputsSpec) OutputsSpec::Names{names}; }); + default: + assert(false); + } }); - default: - assert(false); - } } } From 02bdedbeb642362be7347e7019322d5888571c33 Mon Sep 17 00:00:00 2001 From: Brian McKenna Date: Sat, 8 Mar 2025 10:56:44 +1100 Subject: [PATCH 35/84] coerceToSingleDerivedPathUnchecked: pass through experimental features This fixes a few of the property tests, now that the property tests are actually generating arbitrary data - some of that data now requiring experimental features to function properly. (cherry picked from commit c82ef825d4669d9720da4857ad9b1d270330c369) --- src/libexpr-tests/derived-path.cc | 11 +++++++---- src/libexpr-tests/value/context.cc | 4 +++- src/libexpr/eval.cc | 12 ++++++------ src/libexpr/eval.hh | 6 +++--- src/libstore-tests/derived-path.cc | 8 ++++++-- 5 files changed, 25 insertions(+), 16 deletions(-) diff --git a/src/libexpr-tests/derived-path.cc b/src/libexpr-tests/derived-path.cc index d5fc6f201..634f9bf69 100644 --- a/src/libexpr-tests/derived-path.cc +++ b/src/libexpr-tests/derived-path.cc @@ -44,11 +44,11 @@ RC_GTEST_FIXTURE_PROP( * to worry about race conditions if the tests run concurrently. */ ExperimentalFeatureSettings mockXpSettings; - mockXpSettings.set("experimental-features", "ca-derivations"); + mockXpSettings.set("experimental-features", "ca-derivations dynamic-derivations"); auto * v = state.allocValue(); state.mkOutputString(*v, b, std::nullopt, mockXpSettings); - auto [d, _] = state.coerceToSingleDerivedPathUnchecked(noPos, *v, ""); + auto [d, _] = state.coerceToSingleDerivedPathUnchecked(noPos, *v, "", mockXpSettings); RC_ASSERT(SingleDerivedPath { b } == d); } @@ -57,9 +57,12 @@ RC_GTEST_FIXTURE_PROP( prop_derived_path_built_out_path_round_trip, (const SingleDerivedPath::Built & b, const StorePath & outPath)) { + ExperimentalFeatureSettings mockXpSettings; + mockXpSettings.set("experimental-features", "dynamic-derivations"); + auto * v = state.allocValue(); - state.mkOutputString(*v, b, outPath); - auto [d, _] = state.coerceToSingleDerivedPathUnchecked(noPos, *v, ""); + state.mkOutputString(*v, b, outPath, mockXpSettings); + auto [d, _] = state.coerceToSingleDerivedPathUnchecked(noPos, *v, "", mockXpSettings); RC_ASSERT(SingleDerivedPath { b } == d); } diff --git a/src/libexpr-tests/value/context.cc b/src/libexpr-tests/value/context.cc index 761286dbd..c8d62772f 100644 --- a/src/libexpr-tests/value/context.cc +++ b/src/libexpr-tests/value/context.cc @@ -124,7 +124,9 @@ RC_GTEST_PROP( prop_round_rip, (const NixStringContextElem & o)) { - RC_ASSERT(o == NixStringContextElem::parse(o.to_string())); + ExperimentalFeatureSettings xpSettings; + xpSettings.set("experimental-features", "dynamic-derivations"); + RC_ASSERT(o == NixStringContextElem::parse(o.to_string(), xpSettings)); } #endif diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index b9b89773f..2dcee49d9 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -2245,18 +2245,18 @@ std::string_view EvalState::forceString(Value & v, const PosIdx pos, std::string } -void copyContext(const Value & v, NixStringContext & context) +void copyContext(const Value & v, NixStringContext & context, const ExperimentalFeatureSettings & xpSettings) { if (v.payload.string.context) for (const char * * p = v.payload.string.context; *p; ++p) - context.insert(NixStringContextElem::parse(*p)); + context.insert(NixStringContextElem::parse(*p, xpSettings)); } -std::string_view EvalState::forceString(Value & v, NixStringContext & context, const PosIdx pos, std::string_view errorCtx) +std::string_view EvalState::forceString(Value & v, NixStringContext & context, const PosIdx pos, std::string_view errorCtx, const ExperimentalFeatureSettings & xpSettings) { auto s = forceString(v, pos, errorCtx); - copyContext(v, context); + copyContext(v, context, xpSettings); return s; } @@ -2462,10 +2462,10 @@ StorePath EvalState::coerceToStorePath(const PosIdx pos, Value & v, NixStringCon } -std::pair EvalState::coerceToSingleDerivedPathUnchecked(const PosIdx pos, Value & v, std::string_view errorCtx) +std::pair EvalState::coerceToSingleDerivedPathUnchecked(const PosIdx pos, Value & v, std::string_view errorCtx, const ExperimentalFeatureSettings & xpSettings) { NixStringContext context; - auto s = forceString(v, context, pos, errorCtx); + auto s = forceString(v, context, pos, errorCtx, xpSettings); auto csize = context.size(); if (csize != 1) error( diff --git a/src/libexpr/eval.hh b/src/libexpr/eval.hh index 5e3e915c6..8bb8bbd32 100644 --- a/src/libexpr/eval.hh +++ b/src/libexpr/eval.hh @@ -159,7 +159,7 @@ void printEnvBindings(const SymbolTable & st, const StaticEnv & se, const Env & std::unique_ptr mapStaticEnvBindings(const SymbolTable & st, const StaticEnv & se, const Env & env); -void copyContext(const Value & v, NixStringContext & context); +void copyContext(const Value & v, NixStringContext & context, const ExperimentalFeatureSettings & xpSettings = experimentalFeatureSettings); std::string printValue(EvalState & state, Value & v); @@ -525,7 +525,7 @@ public: */ void forceFunction(Value & v, const PosIdx pos, std::string_view errorCtx); std::string_view forceString(Value & v, const PosIdx pos, std::string_view errorCtx); - std::string_view forceString(Value & v, NixStringContext & context, const PosIdx pos, std::string_view errorCtx); + std::string_view forceString(Value & v, NixStringContext & context, const PosIdx pos, std::string_view errorCtx, const ExperimentalFeatureSettings & xpSettings = experimentalFeatureSettings); std::string_view forceStringNoCtx(Value & v, const PosIdx pos, std::string_view errorCtx); template @@ -577,7 +577,7 @@ public: /** * Part of `coerceToSingleDerivedPath()` without any store IO which is exposed for unit testing only. */ - std::pair coerceToSingleDerivedPathUnchecked(const PosIdx pos, Value & v, std::string_view errorCtx); + std::pair coerceToSingleDerivedPathUnchecked(const PosIdx pos, Value & v, std::string_view errorCtx, const ExperimentalFeatureSettings & xpSettings = experimentalFeatureSettings); /** * Coerce to `SingleDerivedPath`. diff --git a/src/libstore-tests/derived-path.cc b/src/libstore-tests/derived-path.cc index c62d79a78..64e3a12c9 100644 --- a/src/libstore-tests/derived-path.cc +++ b/src/libstore-tests/derived-path.cc @@ -84,7 +84,9 @@ RC_GTEST_FIXTURE_PROP( prop_legacy_round_rip, (const DerivedPath & o)) { - RC_ASSERT(o == DerivedPath::parseLegacy(*store, o.to_string_legacy(*store))); + ExperimentalFeatureSettings xpSettings; + xpSettings.set("experimental-features", "dynamic-derivations"); + RC_ASSERT(o == DerivedPath::parseLegacy(*store, o.to_string_legacy(*store), xpSettings)); } RC_GTEST_FIXTURE_PROP( @@ -92,7 +94,9 @@ RC_GTEST_FIXTURE_PROP( prop_round_rip, (const DerivedPath & o)) { - RC_ASSERT(o == DerivedPath::parse(*store, o.to_string(*store))); + ExperimentalFeatureSettings xpSettings; + xpSettings.set("experimental-features", "dynamic-derivations"); + RC_ASSERT(o == DerivedPath::parse(*store, o.to_string(*store), xpSettings)); } #endif From bbbaf4afa032df8b100266c491bebb00cd1ed587 Mon Sep 17 00:00:00 2001 From: Brian McKenna Date: Sat, 8 Mar 2025 19:51:25 +1100 Subject: [PATCH 36/84] DerivedPathTest: disable prop_legacy_round_rip until fixed (cherry picked from commit c58202c6f98e452ff4b61aa5b65a5b3c7de63a3b) --- src/libstore-tests/derived-path.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libstore-tests/derived-path.cc b/src/libstore-tests/derived-path.cc index 64e3a12c9..97ded5183 100644 --- a/src/libstore-tests/derived-path.cc +++ b/src/libstore-tests/derived-path.cc @@ -79,9 +79,14 @@ TEST_F(DerivedPathTest, built_built_xp) { #ifndef COVERAGE +/* TODO: Disabled due to the following error: + + path '00000000000000000000000000000000-0^0' is not a valid store path: + name '0^0' contains illegal character '^' +*/ RC_GTEST_FIXTURE_PROP( DerivedPathTest, - prop_legacy_round_rip, + DISABLED_prop_legacy_round_rip, (const DerivedPath & o)) { ExperimentalFeatureSettings xpSettings; From c0b219cf46dad26da76ca10389c8d9559f3f7997 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Fri, 28 Mar 2025 13:01:20 -0400 Subject: [PATCH 37/84] Cleanup config header for libcmd - Since it's now private, give it a rename. Note that I want to switch the word order on the public ones too. - Since it is only needed by two files, just include there rather than the nasty blanket-forced thing. (cherry picked from commit 326548bae56b6d751d87778854c3056442325423) --- src/libcmd/markdown.cc | 2 ++ src/libcmd/meson.build | 3 +-- src/libcmd/repl-interacter.cc | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/libcmd/markdown.cc b/src/libcmd/markdown.cc index 4566e6ba6..faf4c6610 100644 --- a/src/libcmd/markdown.cc +++ b/src/libcmd/markdown.cc @@ -4,6 +4,8 @@ #include "finally.hh" #include "terminal.hh" +#include "cmd-config-private.hh" + #if HAVE_LOWDOWN # include # include diff --git a/src/libcmd/meson.build b/src/libcmd/meson.build index 85d22a5f3..70d3b95da 100644 --- a/src/libcmd/meson.build +++ b/src/libcmd/meson.build @@ -55,7 +55,7 @@ endif config_h = configure_file( configuration : configdata, - output : 'config-cmd.hh', + output : 'cmd-config-private.hh', ) add_project_arguments( @@ -64,7 +64,6 @@ add_project_arguments( '-include', 'config-util.hh', '-include', 'config-store.hh', '-include', 'config-expr.hh', - '-include', 'config-cmd.hh', language : 'cpp', ) diff --git a/src/libcmd/repl-interacter.cc b/src/libcmd/repl-interacter.cc index 187af46ea..d8c8dd99d 100644 --- a/src/libcmd/repl-interacter.cc +++ b/src/libcmd/repl-interacter.cc @@ -1,3 +1,5 @@ +#include "cmd-config-private.hh" + #include #ifdef USE_READLINE From 15658b259f43da8ea4a5bcac5f874149e2fb3e49 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 20 Feb 2025 14:15:07 -0500 Subject: [PATCH 38/84] Separate headers from source files The short answer for why we need to do this is so we can consistently do `#include "nix/..."`. Without this change, there are ways to still make that work, but they are hacky, and they have downsides such as making it harder to make sure headers from the wrong Nix library (e..g. `libnixexpr` headers in `libnixutil`) aren't being used. The C API alraedy used `nix_api_*`, so its headers are *not* put in subdirectories accordingly. Progress on #7876 We resisted doing this for a while because it would be annoying to not have the header source file pairs close by / easy to change file path/name from one to the other. But I am ameliorating that with symlinks in the next commit. (cherry picked from commit f3e1c47f47ba051c16ebdb6f792c69350316c7ed) --- doc/manual/source/development/testing.md | 12 +- maintainers/flake-module.nix | 338 +++++++++--------- nix-meson-build-support/export/meson.build | 1 - src/build-remote/build-remote.cc | 26 +- src/libcmd/built-path.cc | 8 +- src/libcmd/command-installable-value.cc | 2 +- src/libcmd/command.cc | 20 +- src/libcmd/common-eval-args.cc | 34 +- src/libcmd/editor-for.cc | 6 +- src/libcmd/{ => include/nix}/built-path.hh | 4 +- .../nix}/command-installable-value.hh | 4 +- src/libcmd/{ => include/nix}/command.hh | 10 +- .../{ => include/nix}/common-eval-args.hh | 8 +- .../nix}/compatibility-settings.hh | 2 +- src/libcmd/{ => include/nix}/editor-for.hh | 4 +- .../nix}/installable-attr-path.hh | 32 +- .../nix}/installable-derived-path.hh | 2 +- .../{ => include/nix}/installable-flake.hh | 4 +- .../{ => include/nix}/installable-value.hh | 4 +- src/libcmd/{ => include/nix}/installables.hh | 12 +- src/libcmd/{ => include/nix}/legacy.hh | 0 src/libcmd/{ => include/nix}/markdown.hh | 0 src/libcmd/include/nix/meson.build | 23 ++ .../{ => include/nix}/misc-store-flags.hh | 4 +- src/libcmd/{ => include/nix}/network-proxy.hh | 2 +- .../{ => include/nix}/repl-interacter.hh | 4 +- src/libcmd/{ => include/nix}/repl.hh | 2 +- src/libcmd/installable-attr-path.cc | 36 +- src/libcmd/installable-derived-path.cc | 4 +- src/libcmd/installable-flake.cc | 38 +- src/libcmd/installable-value.cc | 6 +- src/libcmd/installables.cc | 48 +-- src/libcmd/legacy.cc | 2 +- src/libcmd/markdown.cc | 10 +- src/libcmd/meson.build | 28 +- src/libcmd/misc-store-flags.cc | 2 +- src/libcmd/network-proxy.cc | 4 +- src/libcmd/package.nix | 1 + src/libcmd/repl-interacter.cc | 12 +- src/libcmd/repl.cc | 52 +-- src/libexpr-c/meson.build | 8 +- src/libexpr-c/nix_api_expr.cc | 10 +- src/libexpr-c/nix_api_expr_internal.h | 10 +- src/libexpr-c/nix_api_external.cc | 12 +- src/libexpr-c/nix_api_external.h | 7 +- src/libexpr-c/nix_api_value.cc | 16 +- src/libexpr-c/nix_api_value.h | 7 +- .../include/nix/meson.build | 9 + .../{ => include/nix}/tests/libexpr.hh | 18 +- .../{ => include/nix}/tests/nix_api_expr.hh | 2 +- .../{ => include/nix}/tests/value/context.hh | 2 +- src/libexpr-test-support/meson.build | 14 +- src/libexpr-test-support/package.nix | 1 + .../tests/value/context.cc | 4 +- src/libexpr-tests/derived-path.cc | 4 +- src/libexpr-tests/error_traces.cc | 2 +- src/libexpr-tests/eval.cc | 4 +- src/libexpr-tests/json.cc | 4 +- src/libexpr-tests/main.cc | 4 +- src/libexpr-tests/meson.build | 6 +- src/libexpr-tests/nix_api_expr.cc | 6 +- src/libexpr-tests/nix_api_external.cc | 4 +- src/libexpr-tests/nix_api_value.cc | 6 +- src/libexpr-tests/primops.cc | 6 +- src/libexpr-tests/search-path.cc | 2 +- src/libexpr-tests/trivial.cc | 2 +- src/libexpr-tests/value/context.cc | 6 +- src/libexpr-tests/value/print.cc | 6 +- src/libexpr-tests/value/value.cc | 4 +- src/libexpr/attr-path.cc | 4 +- src/libexpr/attr-set.cc | 4 +- src/libexpr/eval-cache.cc | 14 +- src/libexpr/eval-error.cc | 6 +- src/libexpr/eval-gc.cc | 12 +- src/libexpr/eval-settings.cc | 10 +- src/libexpr/eval.cc | 45 +-- src/libexpr/function-trace.cc | 4 +- src/libexpr/get-drvs.cc | 10 +- src/libexpr/{ => include/nix}/attr-path.hh | 2 +- src/libexpr/{ => include/nix}/attr-set.hh | 4 +- src/libexpr/{ => include/nix}/eval-cache.hh | 6 +- src/libexpr/{ => include/nix}/eval-error.hh | 4 +- src/libexpr/{ => include/nix}/eval-gc.hh | 0 src/libexpr/{ => include/nix}/eval-inline.hh | 8 +- .../{ => include/nix}/eval-settings.hh | 4 +- src/libexpr/{ => include/nix}/eval.hh | 30 +- .../{ => include/nix}/function-trace.hh | 2 +- .../{ => include/nix}/gc-small-vector.hh | 2 +- src/libexpr/{ => include/nix}/get-drvs.hh | 4 +- .../{ => include/nix}/json-to-value.hh | 2 +- .../{ => include/nix}/lexer-helpers.hh | 0 src/libexpr/include/nix/meson.build | 37 ++ src/libexpr/{ => include/nix}/nixexpr.hh | 8 +- src/libexpr/{ => include/nix}/parser-state.hh | 2 +- src/libexpr/{ => include/nix}/primops.hh | 2 +- .../{ => include/nix}/print-ambiguous.hh | 2 +- .../{ => include/nix}/print-options.hh | 0 src/libexpr/{ => include/nix}/print.hh | 4 +- .../{ => include/nix}/repl-exit-status.hh | 0 src/libexpr/{ => include/nix}/search-path.hh | 4 +- src/libexpr/{ => include/nix}/symbol-table.hh | 6 +- .../{ => include/nix}/value-to-json.hh | 4 +- src/libexpr/{ => include/nix}/value-to-xml.hh | 4 +- src/libexpr/{ => include/nix}/value.hh | 12 +- .../{ => include/nix}/value/context.hh | 6 +- src/libexpr/json-to-value.cc | 6 +- src/libexpr/lexer-helpers.cc | 3 +- src/libexpr/lexer.l | 6 +- src/libexpr/meson.build | 44 +-- src/libexpr/nixexpr.cc | 12 +- src/libexpr/package.nix | 1 + src/libexpr/parser.y | 16 +- src/libexpr/paths.cc | 4 +- src/libexpr/primops.cc | 32 +- src/libexpr/primops/context.cc | 8 +- src/libexpr/primops/fetchClosure.cc | 10 +- src/libexpr/primops/fetchMercurial.cc | 14 +- src/libexpr/primops/fetchTree.cc | 24 +- src/libexpr/primops/fromTOML.cc | 4 +- src/libexpr/print-ambiguous.cc | 8 +- src/libexpr/print.cc | 14 +- src/libexpr/search-path.cc | 2 +- src/libexpr/value-to-json.cc | 8 +- src/libexpr/value-to-xml.cc | 8 +- src/libexpr/value/context.cc | 4 +- src/libfetchers-tests/access-tokens.cc | 11 +- src/libfetchers-tests/git-utils.cc | 12 +- src/libfetchers-tests/meson.build | 6 +- src/libfetchers-tests/public-key.cc | 6 +- src/libfetchers/attrs.cc | 4 +- src/libfetchers/cache.cc | 10 +- src/libfetchers/fetch-settings.cc | 2 +- src/libfetchers/fetch-to-store.cc | 6 +- src/libfetchers/fetchers.cc | 14 +- src/libfetchers/filtering-source-accessor.cc | 2 +- src/libfetchers/git-lfs-fetch.cc | 14 +- src/libfetchers/git-utils.cc | 18 +- src/libfetchers/git.cc | 34 +- src/libfetchers/github.cc | 24 +- src/libfetchers/{ => include/nix}/attrs.hh | 4 +- src/libfetchers/{ => include/nix}/cache.hh | 4 +- .../{ => include/nix}/fetch-settings.hh | 4 +- .../{ => include/nix}/fetch-to-store.hh | 10 +- src/libfetchers/{ => include/nix}/fetchers.hh | 14 +- .../nix}/filtering-source-accessor.hh | 2 +- .../{ => include/nix}/git-lfs-fetch.hh | 6 +- .../{ => include/nix}/git-utils.hh | 4 +- src/libfetchers/include/nix/meson.build | 15 + src/libfetchers/{ => include/nix}/registry.hh | 4 +- .../{ => include/nix}/store-path-accessor.hh | 2 +- src/libfetchers/{ => include/nix}/tarball.hh | 8 +- src/libfetchers/indirect.cc | 6 +- src/libfetchers/mercurial.cc | 20 +- src/libfetchers/meson.build | 22 +- src/libfetchers/package.nix | 1 + src/libfetchers/path.cc | 8 +- src/libfetchers/registry.cc | 14 +- src/libfetchers/store-path-accessor.cc | 4 +- src/libfetchers/tarball.cc | 22 +- src/libflake-c/meson.build | 10 +- src/libflake-c/nix_api_flake.cc | 2 +- src/libflake-c/nix_api_flake_internal.hh | 4 +- src/libflake-tests/flakeref.cc | 4 +- src/libflake-tests/meson.build | 6 +- src/libflake-tests/nix_api_flake.cc | 4 +- src/libflake-tests/url-name.cc | 2 +- src/libflake/flake/config.cc | 8 +- src/libflake/flake/flake-primops.cc | 10 +- src/libflake/flake/flake.cc | 33 +- src/libflake/flake/flakeref.cc | 10 +- src/libflake/flake/lockfile.cc | 10 +- src/libflake/flake/settings.cc | 4 +- src/libflake/flake/url-name.cc | 2 +- .../{ => include/nix}/flake/flake-primops.hh | 6 +- src/libflake/{ => include/nix}/flake/flake.hh | 8 +- .../{ => include/nix}/flake/flakeref.hh | 8 +- .../{ => include/nix}/flake/lockfile.hh | 2 +- .../{ => include/nix}/flake/settings.hh | 2 +- .../{ => include/nix}/flake/url-name.hh | 8 +- src/libflake/include/nix/meson.build | 11 + src/libflake/meson.build | 18 +- src/libflake/package.nix | 1 + src/libmain-c/meson.build | 6 +- src/libmain-c/nix_api_main.cc | 2 +- src/libmain/common-args.cc | 16 +- src/libmain/{ => include/nix}/common-args.hh | 4 +- src/libmain/{ => include/nix}/loggers.hh | 2 +- src/libmain/include/nix/meson.build | 16 + src/libmain/{ => include/nix}/plugin.hh | 0 src/libmain/{ => include/nix}/progress-bar.hh | 2 +- src/libmain/{ => include/nix}/shared.hh | 14 +- src/libmain/loggers.cc | 6 +- src/libmain/meson.build | 21 +- src/libmain/package.nix | 1 + src/libmain/plugin.cc | 4 +- src/libmain/progress-bar.cc | 10 +- src/libmain/shared.cc | 20 +- src/libmain/unix/stack.cc | 4 +- src/libstore-c/meson.build | 6 +- src/libstore-c/nix_api_store.cc | 8 +- src/libstore-c/nix_api_store_internal.h | 2 +- .../{tests => }/derived-path.cc | 2 +- .../include/nix/meson.build | 12 + .../{ => include/nix}/tests/derived-path.hh | 6 +- .../{ => include/nix}/tests/libstore.hh | 2 +- .../{ => include/nix}/tests/nix_api_store.hh | 4 +- .../{ => include/nix}/tests/outputs-spec.hh | 4 +- .../{ => include/nix}/tests/path.hh | 2 +- .../{ => include/nix}/tests/protocol.hh | 4 +- src/libstore-test-support/meson.build | 21 +- .../{tests => }/outputs-spec.cc | 2 +- src/libstore-test-support/package.nix | 1 + src/libstore-test-support/{tests => }/path.cc | 8 +- src/libstore-tests/common-protocol.cc | 10 +- src/libstore-tests/content-address.cc | 2 +- .../derivation-advanced-attrs.cc | 18 +- src/libstore-tests/derivation.cc | 8 +- src/libstore-tests/derived-path.cc | 4 +- src/libstore-tests/downstream-placeholder.cc | 2 +- src/libstore-tests/http-binary-cache-store.cc | 2 +- src/libstore-tests/legacy-ssh-store.cc | 2 +- .../local-binary-cache-store.cc | 2 +- src/libstore-tests/local-overlay-store.cc | 2 +- src/libstore-tests/local-store.cc | 8 +- src/libstore-tests/machines.cc | 8 +- src/libstore-tests/meson.build | 4 +- src/libstore-tests/nar-info-disk-cache.cc | 4 +- src/libstore-tests/nar-info.cc | 8 +- src/libstore-tests/nix_api_store.cc | 4 +- src/libstore-tests/outputs-spec.cc | 2 +- src/libstore-tests/path-info.cc | 6 +- src/libstore-tests/path.cc | 10 +- src/libstore-tests/references.cc | 2 +- src/libstore-tests/s3-binary-cache-store.cc | 2 +- src/libstore-tests/serve-protocol.cc | 14 +- src/libstore-tests/ssh-store.cc | 2 +- src/libstore-tests/store-reference.cc | 8 +- src/libstore-tests/uds-remote-store.cc | 2 +- src/libstore-tests/worker-protocol.cc | 14 +- src/libstore/binary-cache-store.cc | 30 +- src/libstore/build-result.cc | 2 +- src/libstore/build/derivation-goal.cc | 36 +- .../build/drv-output-substitution-goal.cc | 10 +- src/libstore/build/entry-points.cc | 10 +- src/libstore/build/goal.cc | 4 +- src/libstore/build/substitution-goal.cc | 10 +- src/libstore/build/worker.cc | 18 +- src/libstore/builtins/buildenv.cc | 6 +- src/libstore/builtins/fetchurl.cc | 10 +- src/libstore/builtins/unpack-channel.cc | 4 +- src/libstore/common-protocol.cc | 16 +- src/libstore/common-ssh-store-config.cc | 4 +- src/libstore/content-address.cc | 6 +- src/libstore/daemon.cc | 36 +- src/libstore/derivation-options.cc | 10 +- src/libstore/derivations.cc | 22 +- src/libstore/derived-path-map.cc | 4 +- src/libstore/derived-path.cc | 8 +- src/libstore/downstream-placeholder.cc | 4 +- src/libstore/dummy-store.cc | 4 +- src/libstore/export-import.cc | 10 +- src/libstore/filetransfer.cc | 20 +- src/libstore/gc.cc | 16 +- src/libstore/globals.cc | 22 +- src/libstore/http-binary-cache-store.cc | 10 +- .../{ => include/nix}/binary-cache-store.hh | 8 +- .../{ => include/nix}/build-result.hh | 4 +- .../nix}/build/derivation-goal.hh | 14 +- .../build/drv-output-substitution-goal.hh | 8 +- src/libstore/{ => include/nix}/build/goal.hh | 4 +- .../nix}/build/substitution-goal.hh | 8 +- .../{ => include/nix}/build/worker.hh | 10 +- src/libstore/{ => include/nix}/builtins.hh | 2 +- .../{ => include/nix}/builtins/buildenv.hh | 2 +- .../{ => include/nix}/common-protocol-impl.hh | 4 +- .../{ => include/nix}/common-protocol.hh | 2 +- .../nix}/common-ssh-store-config.hh | 2 +- .../{ => include/nix}/content-address.hh | 8 +- src/libstore/{ => include/nix}/daemon.hh | 4 +- .../{ => include/nix}/derivation-options.hh | 4 +- src/libstore/{ => include/nix}/derivations.hh | 16 +- .../{ => include/nix}/derived-path-map.hh | 4 +- .../{ => include/nix}/derived-path.hh | 8 +- .../nix}/downstream-placeholder.hh | 6 +- .../{ => include/nix}/filetransfer.hh | 10 +- src/libstore/{ => include/nix}/gc-store.hh | 2 +- src/libstore/{ => include/nix}/globals.hh | 10 +- .../nix}/http-binary-cache-store.hh | 2 +- .../{ => include/nix}/indirect-root-store.hh | 2 +- src/libstore/{ => include/nix}/keys.hh | 2 +- .../{ => include/nix}/legacy-ssh-store.hh | 12 +- .../nix}/length-prefixed-protocol-helper.hh | 2 +- .../nix}/local-binary-cache-store.hh | 2 +- .../{ => include/nix}/local-fs-store.hh | 6 +- .../{ => include/nix}/local-overlay-store.hh | 2 +- src/libstore/{ => include/nix}/local-store.hh | 10 +- src/libstore/{ => include/nix}/log-store.hh | 2 +- src/libstore/{ => include/nix}/machines.hh | 4 +- .../nix}/make-content-addressed.hh | 2 +- src/libstore/include/nix/meson.build | 81 +++++ src/libstore/{ => include/nix}/names.hh | 2 +- .../{ => include/nix}/nar-accessor.hh | 2 +- .../{ => include/nix}/nar-info-disk-cache.hh | 6 +- src/libstore/{ => include/nix}/nar-info.hh | 6 +- .../{ => include/nix}/outputs-spec.hh | 4 +- .../{ => include/nix}/parsed-derivations.hh | 4 +- src/libstore/{ => include/nix}/path-info.hh | 8 +- .../{ => include/nix}/path-references.hh | 4 +- src/libstore/{ => include/nix}/path-regex.hh | 0 .../{ => include/nix}/path-with-outputs.hh | 4 +- src/libstore/{ => include/nix}/path.hh | 2 +- src/libstore/{ => include/nix}/pathlocks.hh | 2 +- .../nix}/posix-fs-canonicalise.hh | 4 +- src/libstore/{ => include/nix}/profiles.hh | 4 +- src/libstore/{ => include/nix}/realisation.hh | 10 +- .../{ => include/nix}/remote-fs-accessor.hh | 6 +- .../nix}/remote-store-connection.hh | 8 +- .../{ => include/nix}/remote-store.hh | 6 +- .../nix}/s3-binary-cache-store.hh | 2 +- src/libstore/{ => include/nix}/s3.hh | 2 +- .../nix}/serve-protocol-connection.hh | 4 +- .../{ => include/nix}/serve-protocol-impl.hh | 4 +- .../{ => include/nix}/serve-protocol.hh | 2 +- src/libstore/{ => include/nix}/sqlite.hh | 2 +- src/libstore/{ => include/nix}/ssh-store.hh | 8 +- src/libstore/{ => include/nix}/ssh.hh | 6 +- src/libstore/{ => include/nix}/store-api.hh | 28 +- src/libstore/{ => include/nix}/store-cast.hh | 2 +- .../{ => include/nix}/store-dir-config.hh | 10 +- .../{ => include/nix}/store-reference.hh | 2 +- .../{ => include/nix}/uds-remote-store.hh | 6 +- .../nix}/worker-protocol-connection.hh | 4 +- .../{ => include/nix}/worker-protocol-impl.hh | 4 +- .../{ => include/nix}/worker-protocol.hh | 2 +- src/libstore/indirect-root-store.cc | 2 +- src/libstore/keys.cc | 6 +- src/libstore/legacy-ssh-store.cc | 28 +- .../{ => include/nix}/fchmodat2-compat.hh | 0 src/libstore/linux/include/nix/meson.build | 6 + .../linux/{ => include/nix}/personality.hh | 0 src/libstore/linux/meson.build | 7 +- src/libstore/linux/personality.cc | 4 +- src/libstore/local-binary-cache-store.cc | 8 +- src/libstore/local-fs-store.cc | 14 +- src/libstore/local-overlay-store.cc | 10 +- src/libstore/local-store.cc | 40 +-- src/libstore/log-store.cc | 2 +- src/libstore/machines.cc | 6 +- src/libstore/make-content-addressed.cc | 4 +- src/libstore/meson.build | 85 +---- src/libstore/misc.cc | 24 +- src/libstore/names.cc | 4 +- src/libstore/nar-accessor.cc | 4 +- src/libstore/nar-info-disk-cache.cc | 12 +- src/libstore/nar-info.cc | 10 +- src/libstore/optimise-store.cc | 10 +- src/libstore/outputs-spec.cc | 10 +- src/libstore/package.nix | 3 + src/libstore/parsed-derivations.cc | 2 +- src/libstore/path-info.cc | 10 +- src/libstore/path-references.cc | 6 +- src/libstore/path-with-outputs.cc | 6 +- src/libstore/path.cc | 2 +- src/libstore/pathlocks.cc | 8 +- src/libstore/posix-fs-canonicalise.cc | 12 +- src/libstore/profiles.cc | 10 +- src/libstore/realisation.cc | 8 +- src/libstore/remote-fs-accessor.cc | 4 +- src/libstore/remote-store.cc | 40 +-- src/libstore/s3-binary-cache-store.cc | 16 +- src/libstore/serve-protocol-connection.cc | 8 +- src/libstore/serve-protocol.cc | 16 +- src/libstore/sqlite.cc | 10 +- src/libstore/ssh-store.cc | 18 +- src/libstore/ssh.cc | 12 +- src/libstore/store-api.cc | 42 +-- src/libstore/store-reference.cc | 10 +- src/libstore/uds-remote-store.cc | 6 +- src/libstore/unix/build/child.cc | 6 +- src/libstore/unix/build/hook-instance.cc | 14 +- .../unix/build/local-derivation-goal.cc | 54 +-- .../unix/{ => include/nix}/build/child.hh | 0 .../{ => include/nix}/build/hook-instance.hh | 6 +- .../nix}/build/local-derivation-goal.hh | 6 +- src/libstore/unix/include/nix/meson.build | 8 + .../unix/{ => include/nix}/user-lock.hh | 0 src/libstore/unix/meson.build | 12 +- src/libstore/unix/pathlocks.cc | 8 +- src/libstore/unix/user-lock.cc | 10 +- src/libstore/windows/pathlocks.cc | 10 +- src/libstore/worker-protocol-connection.cc | 8 +- src/libstore/worker-protocol.cc | 16 +- src/libutil-c/meson.build | 6 +- src/libutil-c/nix_api_util.cc | 8 +- src/libutil-c/nix_api_util_internal.h | 2 +- src/libutil-test-support/{tests => }/hash.cc | 4 +- .../include/nix/meson.build | 11 + .../nix}/tests/characterization.hh | 6 +- .../nix}/tests/gtest-with-params.hh | 0 .../{ => include/nix}/tests/hash.hh | 2 +- .../{ => include/nix}/tests/nix_api_util.hh | 0 .../nix}/tests/string_callback.hh | 0 .../tests/tracing-file-system-object-sink.hh | 2 +- src/libutil-test-support/meson.build | 16 +- src/libutil-test-support/package.nix | 1 + .../{tests => }/string_callback.cc | 2 +- .../tracing-file-system-object-sink.cc | 2 +- src/libutil-tests/args.cc | 4 +- src/libutil-tests/canon-path.cc | 2 +- src/libutil-tests/checked-arithmetic.cc | 4 +- src/libutil-tests/chunked-vector.cc | 2 +- src/libutil-tests/closure.cc | 2 +- src/libutil-tests/compression.cc | 2 +- src/libutil-tests/config.cc | 4 +- src/libutil-tests/executable-path.cc | 2 +- src/libutil-tests/file-content-address.cc | 2 +- src/libutil-tests/file-system.cc | 12 +- src/libutil-tests/git.cc | 6 +- src/libutil-tests/hash.cc | 2 +- src/libutil-tests/hilite.cc | 2 +- src/libutil-tests/json-utils.cc | 4 +- src/libutil-tests/logging.cc | 4 +- src/libutil-tests/lru-cache.cc | 2 +- src/libutil-tests/nix_api_util.cc | 8 +- src/libutil-tests/pool.cc | 2 +- src/libutil-tests/position.cc | 2 +- src/libutil-tests/processes.cc | 2 +- src/libutil-tests/references.cc | 2 +- src/libutil-tests/spawn.cc | 2 +- src/libutil-tests/strings.cc | 4 +- src/libutil-tests/suggestions.cc | 2 +- src/libutil-tests/terminal.cc | 8 +- src/libutil-tests/url.cc | 2 +- src/libutil-tests/util.cc | 10 +- src/libutil-tests/xml-writer.cc | 2 +- src/libutil/archive.cc | 12 +- src/libutil/args.cc | 14 +- src/libutil/canon-path.cc | 8 +- src/libutil/compression.cc | 10 +- src/libutil/compute-levels.cc | 2 +- src/libutil/config-global.cc | 2 +- src/libutil/config.cc | 18 +- src/libutil/current-process.cc | 16 +- src/libutil/english.cc | 2 +- src/libutil/environment-variables.cc | 4 +- src/libutil/error.cc | 12 +- src/libutil/executable-path.cc | 10 +- src/libutil/exit.cc | 2 +- src/libutil/experimental-features.cc | 8 +- src/libutil/file-content-address.cc | 8 +- src/libutil/file-descriptor.cc | 6 +- src/libutil/file-system.cc | 18 +- src/libutil/fs-sink.cc | 10 +- src/libutil/git.cc | 10 +- src/libutil/hash.cc | 10 +- src/libutil/hilite.cc | 2 +- .../nix}/abstract-setting-to-json.hh | 4 +- src/libutil/{ => include/nix}/ansicolor.hh | 0 src/libutil/{ => include/nix}/archive.hh | 6 +- src/libutil/{ => include/nix}/args.hh | 6 +- src/libutil/{ => include/nix}/args/root.hh | 2 +- src/libutil/{ => include/nix}/callback.hh | 0 src/libutil/{ => include/nix}/canon-path.hh | 0 .../{ => include/nix}/checked-arithmetic.hh | 0 .../{ => include/nix}/chunked-vector.hh | 2 +- src/libutil/{ => include/nix}/closure.hh | 2 +- src/libutil/{ => include/nix}/comparator.hh | 0 src/libutil/{ => include/nix}/compression.hh | 6 +- .../{ => include/nix}/compute-levels.hh | 2 +- .../{ => include/nix}/config-global.hh | 2 +- src/libutil/{ => include/nix}/config-impl.hh | 4 +- src/libutil/{ => include/nix}/config.hh | 4 +- .../{ => include/nix}/current-process.hh | 2 +- src/libutil/{ => include/nix}/english.hh | 0 .../nix}/environment-variables.hh | 4 +- src/libutil/{ => include/nix}/error.hh | 4 +- src/libutil/{ => include/nix}/exec.hh | 2 +- .../{ => include/nix}/executable-path.hh | 2 +- src/libutil/{ => include/nix}/exit.hh | 0 .../nix}/experimental-features.hh | 4 +- .../{ => include/nix}/file-content-address.hh | 2 +- .../{ => include/nix}/file-descriptor.hh | 4 +- .../{ => include/nix}/file-path-impl.hh | 0 src/libutil/{ => include/nix}/file-path.hh | 4 +- src/libutil/{ => include/nix}/file-system.hh | 10 +- src/libutil/{ => include/nix}/finally.hh | 0 src/libutil/{ => include/nix}/fmt.hh | 2 +- src/libutil/{ => include/nix}/fs-sink.hh | 6 +- src/libutil/{ => include/nix}/git.hh | 10 +- src/libutil/{ => include/nix}/hash.hh | 8 +- src/libutil/{ => include/nix}/hilite.hh | 0 src/libutil/{ => include/nix}/json-impls.hh | 2 +- src/libutil/{ => include/nix}/json-utils.hh | 2 +- src/libutil/{ => include/nix}/logging.hh | 8 +- src/libutil/{ => include/nix}/lru-cache.hh | 0 .../nix}/memory-source-accessor.hh | 6 +- src/libutil/include/nix/meson.build | 87 +++++ src/libutil/{ => include/nix}/muxable-pipe.hh | 6 +- src/libutil/{ => include/nix}/os-string.hh | 0 src/libutil/{ => include/nix}/pool.hh | 4 +- src/libutil/{ => include/nix}/pos-idx.hh | 0 src/libutil/{ => include/nix}/pos-table.hh | 6 +- src/libutil/{ => include/nix}/position.hh | 2 +- .../nix}/posix-source-accessor.hh | 2 +- src/libutil/{ => include/nix}/processes.hh | 10 +- src/libutil/{ => include/nix}/ref.hh | 0 src/libutil/{ => include/nix}/references.hh | 2 +- .../{ => include/nix}/regex-combinators.hh | 0 src/libutil/{ => include/nix}/repair-flag.hh | 0 src/libutil/{ => include/nix}/serialise.hh | 6 +- src/libutil/{ => include/nix}/signals.hh | 8 +- .../{ => include/nix}/signature/local-keys.hh | 2 +- .../{ => include/nix}/signature/signer.hh | 4 +- .../{ => include/nix}/source-accessor.hh | 6 +- src/libutil/{ => include/nix}/source-path.hh | 8 +- src/libutil/{ => include/nix}/split.hh | 2 +- src/libutil/{ => include/nix}/std-hash.hh | 0 .../{ => include/nix}/strings-inline.hh | 2 +- src/libutil/{ => include/nix}/strings.hh | 0 src/libutil/{ => include/nix}/suggestions.hh | 2 +- src/libutil/{ => include/nix}/sync.hh | 2 +- src/libutil/{ => include/nix}/tarfile.hh | 4 +- src/libutil/{ => include/nix}/terminal.hh | 0 src/libutil/{ => include/nix}/thread-pool.hh | 4 +- src/libutil/{ => include/nix}/topo-sort.hh | 2 +- src/libutil/{ => include/nix}/types.hh | 0 .../{ => include/nix}/unix-domain-socket.hh | 4 +- src/libutil/{ => include/nix}/url-parts.hh | 0 src/libutil/{ => include/nix}/url.hh | 2 +- src/libutil/{ => include/nix}/users.hh | 2 +- src/libutil/{ => include/nix}/util.hh | 8 +- .../{ => include/nix}/variant-wrapper.hh | 0 src/libutil/{ => include/nix}/xml-writer.hh | 0 src/libutil/json-utils.cc | 6 +- src/libutil/linux/cgroup.cc | 10 +- src/libutil/linux/{ => include/nix}/cgroup.hh | 2 +- src/libutil/linux/include/nix/meson.build | 8 + .../linux/{ => include/nix}/namespaces.hh | 2 +- src/libutil/linux/meson.build | 7 +- src/libutil/linux/namespaces.cc | 14 +- src/libutil/logging.cc | 16 +- src/libutil/memory-source-accessor.cc | 2 +- src/libutil/meson.build | 89 +---- src/libutil/mounted-source-accessor.cc | 2 +- src/libutil/package.nix | 4 + src/libutil/pos-table.cc | 2 +- src/libutil/position.cc | 2 +- src/libutil/posix-source-accessor.cc | 8 +- src/libutil/references.cc | 6 +- src/libutil/serialise.cc | 8 +- src/libutil/signature/local-keys.cc | 6 +- src/libutil/signature/signer.cc | 4 +- src/libutil/source-accessor.cc | 4 +- src/libutil/source-path.cc | 2 +- src/libutil/strings.cc | 6 +- src/libutil/suggestions.cc | 6 +- src/libutil/tarfile.cc | 8 +- src/libutil/terminal.cc | 6 +- src/libutil/thread-pool.cc | 6 +- src/libutil/union-source-accessor.cc | 2 +- src/libutil/unix-domain-socket.cc | 8 +- src/libutil/unix/environment-variables.cc | 2 +- src/libutil/unix/file-descriptor.cc | 8 +- src/libutil/unix/file-path.cc | 4 +- src/libutil/unix/file-system.cc | 2 +- src/libutil/unix/include/nix/meson.build | 8 + .../unix/{ => include/nix}/monitor-fd.hh | 2 +- .../unix/{ => include/nix}/signals-impl.hh | 10 +- src/libutil/unix/meson.build | 7 +- src/libutil/unix/muxable-pipe.cc | 6 +- src/libutil/unix/os-string.cc | 4 +- src/libutil/unix/processes.cc | 14 +- src/libutil/unix/signals.cc | 10 +- src/libutil/unix/users.cc | 8 +- src/libutil/url.cc | 10 +- src/libutil/users.cc | 8 +- src/libutil/util.cc | 8 +- src/libutil/windows/environment-variables.cc | 2 +- src/libutil/windows/file-descriptor.cc | 12 +- src/libutil/windows/file-path.cc | 6 +- src/libutil/windows/file-system.cc | 2 +- src/libutil/windows/include/nix/meson.build | 9 + .../windows/{ => include/nix}/signals-impl.hh | 2 +- .../{ => include/nix}/windows-async-pipe.hh | 2 +- .../{ => include/nix}/windows-error.hh | 2 +- src/libutil/windows/meson.build | 8 +- src/libutil/windows/muxable-pipe.cc | 8 +- src/libutil/windows/os-string.cc | 6 +- src/libutil/windows/processes.cc | 26 +- src/libutil/windows/users.cc | 10 +- src/libutil/windows/windows-async-pipe.cc | 4 +- src/libutil/windows/windows-error.cc | 2 +- src/libutil/xml-writer.cc | 2 +- src/nix-build/nix-build.cc | 38 +- src/nix-channel/nix-channel.cc | 18 +- .../nix-collect-garbage.cc | 18 +- src/nix-copy-closure/nix-copy-closure.cc | 8 +- src/nix-env/nix-env.cc | 36 +- src/nix-env/user-env.cc | 20 +- src/nix-env/user-env.hh | 2 +- src/nix-instantiate/nix-instantiate.cc | 28 +- src/nix-store/dotgraph.cc | 2 +- src/nix-store/dotgraph.hh | 2 +- src/nix-store/graphml.cc | 4 +- src/nix-store/graphml.hh | 2 +- src/nix-store/nix-store.cc | 36 +- src/nix/add-to-store.cc | 14 +- src/nix/app.cc | 20 +- src/nix/build.cc | 10 +- src/nix/bundle.cc | 14 +- src/nix/cat.cc | 6 +- src/nix/config-check.cc | 18 +- src/nix/config.cc | 10 +- src/nix/copy.cc | 8 +- src/nix/crash-handler.cc | 5 +- src/nix/derivation-add.cc | 10 +- src/nix/derivation-show.cc | 10 +- src/nix/derivation.cc | 2 +- src/nix/develop.cc | 20 +- src/nix/diff-closures.cc | 12 +- src/nix/dump-path.cc | 6 +- src/nix/edit.cc | 12 +- src/nix/env.cc | 8 +- src/nix/eval.cc | 14 +- src/nix/flake.cc | 44 +-- src/nix/fmt.cc | 6 +- src/nix/hash.cc | 20 +- src/nix/log.cc | 10 +- src/nix/ls.cc | 8 +- src/nix/main.cc | 49 +-- src/nix/make-content-addressed.cc | 8 +- src/nix/man-pages.cc | 6 +- src/nix/meson.build | 6 +- src/nix/nar.cc | 2 +- src/nix/optimise-store.cc | 6 +- src/nix/path-from-hash-part.cc | 4 +- src/nix/path-info.cc | 12 +- src/nix/prefetch.cc | 29 +- src/nix/profile.cc | 28 +- src/nix/realisation.cc | 4 +- src/nix/registry.cc | 16 +- src/nix/repl.cc | 16 +- src/nix/run.cc | 24 +- src/nix/run.hh | 2 +- src/nix/search.cc | 28 +- src/nix/self-exe.cc | 6 +- src/nix/sigs.cc | 10 +- src/nix/store-copy-log.cc | 14 +- src/nix/store-delete.cc | 12 +- src/nix/store-gc.cc | 12 +- src/nix/store-info.cc | 8 +- src/nix/store-repair.cc | 4 +- src/nix/store.cc | 2 +- src/nix/unix/daemon.cc | 32 +- src/nix/upgrade-nix.cc | 20 +- src/nix/verify.cc | 14 +- src/nix/why-depends.cc | 8 +- src/perl/lib/Nix/Store.xs | 14 +- tests/functional/plugins/meson.build | 6 +- tests/functional/plugins/plugintest.cc | 4 +- .../functional/test-libstoreconsumer/main.cc | 6 +- .../test-libstoreconsumer/meson.build | 4 +- 662 files changed, 2967 insertions(+), 2906 deletions(-) rename src/libcmd/{ => include/nix}/built-path.hh (98%) rename src/libcmd/{ => include/nix}/command-installable-value.hh (87%) rename src/libcmd/{ => include/nix}/command.hh (98%) rename src/libcmd/{ => include/nix}/common-eval-args.hh (92%) rename src/libcmd/{ => include/nix}/compatibility-settings.hh (98%) rename src/libcmd/{ => include/nix}/editor-for.hh (77%) rename src/libcmd/{ => include/nix}/installable-attr-path.hh (65%) rename src/libcmd/{ => include/nix}/installable-derived-path.hh (94%) rename src/libcmd/{ => include/nix}/installable-flake.hh (97%) rename src/libcmd/{ => include/nix}/installable-value.hh (98%) rename src/libcmd/{ => include/nix}/installables.hh (96%) rename src/libcmd/{ => include/nix}/legacy.hh (100%) rename src/libcmd/{ => include/nix}/markdown.hh (100%) create mode 100644 src/libcmd/include/nix/meson.build rename src/libcmd/{ => include/nix}/misc-store-flags.hh (92%) rename src/libcmd/{ => include/nix}/network-proxy.hh (94%) rename src/libcmd/{ => include/nix}/repl-interacter.hh (95%) rename src/libcmd/{ => include/nix}/repl.hh (97%) create mode 100644 src/libexpr-test-support/include/nix/meson.build rename src/libexpr-test-support/{ => include/nix}/tests/libexpr.hh (94%) rename src/libexpr-test-support/{ => include/nix}/tests/nix_api_expr.hh (93%) rename src/libexpr-test-support/{ => include/nix}/tests/value/context.hh (94%) rename src/libexpr/{ => include/nix}/attr-path.hh (95%) rename src/libexpr/{ => include/nix}/attr-set.hh (98%) rename src/libexpr/{ => include/nix}/eval-cache.hh (97%) rename src/libexpr/{ => include/nix}/eval-error.hh (98%) rename src/libexpr/{ => include/nix}/eval-gc.hh (100%) rename src/libexpr/{ => include/nix}/eval-inline.hh (97%) rename src/libexpr/{ => include/nix}/eval-settings.hh (99%) rename src/libexpr/{ => include/nix}/eval.hh (98%) rename src/libexpr/{ => include/nix}/function-trace.hh (88%) rename src/libexpr/{ => include/nix}/gc-small-vector.hh (96%) rename src/libexpr/{ => include/nix}/get-drvs.hh (98%) rename src/libexpr/{ => include/nix}/json-to-value.hh (89%) rename src/libexpr/{ => include/nix}/lexer-helpers.hh (100%) create mode 100644 src/libexpr/include/nix/meson.build rename src/libexpr/{ => include/nix}/nixexpr.hh (99%) rename src/libexpr/{ => include/nix}/parser-state.hh (99%) rename src/libexpr/{ => include/nix}/primops.hh (98%) rename src/libexpr/{ => include/nix}/print-ambiguous.hh (95%) rename src/libexpr/{ => include/nix}/print-options.hh (100%) rename src/libexpr/{ => include/nix}/print.hh (97%) rename src/libexpr/{ => include/nix}/repl-exit-status.hh (100%) rename src/libexpr/{ => include/nix}/search-path.hh (98%) rename src/libexpr/{ => include/nix}/symbol-table.hh (97%) rename src/libexpr/{ => include/nix}/value-to-json.hh (90%) rename src/libexpr/{ => include/nix}/value-to-xml.hh (82%) rename src/libexpr/{ => include/nix}/value.hh (98%) rename src/libexpr/{ => include/nix}/value/context.hh (95%) rename src/libfetchers/{ => include/nix}/attrs.hh (96%) rename src/libfetchers/{ => include/nix}/cache.hh (97%) rename src/libfetchers/{ => include/nix}/fetch-settings.hh (98%) rename src/libfetchers/{ => include/nix}/fetch-to-store.hh (71%) rename src/libfetchers/{ => include/nix}/fetchers.hh (97%) rename src/libfetchers/{ => include/nix}/filtering-source-accessor.hh (98%) rename src/libfetchers/{ => include/nix}/git-lfs-fetch.hh (92%) rename src/libfetchers/{ => include/nix}/git-utils.hh (98%) create mode 100644 src/libfetchers/include/nix/meson.build rename src/libfetchers/{ => include/nix}/registry.hh (96%) rename src/libfetchers/{ => include/nix}/store-path-accessor.hh (87%) rename src/libfetchers/{ => include/nix}/tarball.hh (90%) rename src/libflake/{ => include/nix}/flake/flake-primops.hh (75%) rename src/libflake/{ => include/nix}/flake/flake.hh (98%) rename src/libflake/{ => include/nix}/flake/flakeref.hh (97%) rename src/libflake/{ => include/nix}/flake/lockfile.hh (98%) rename src/libflake/{ => include/nix}/flake/settings.hh (97%) rename src/libflake/{ => include/nix}/flake/url-name.hh (85%) create mode 100644 src/libflake/include/nix/meson.build rename src/libmain/{ => include/nix}/common-args.hh (96%) rename src/libmain/{ => include/nix}/loggers.hh (90%) create mode 100644 src/libmain/include/nix/meson.build rename src/libmain/{ => include/nix}/plugin.hh (100%) rename src/libmain/{ => include/nix}/progress-bar.hh (76%) rename src/libmain/{ => include/nix}/shared.hh (94%) rename src/libstore-test-support/{tests => }/derived-path.cc (98%) create mode 100644 src/libstore-test-support/include/nix/meson.build rename src/libstore-test-support/{ => include/nix}/tests/derived-path.hh (86%) rename src/libstore-test-support/{ => include/nix}/tests/libstore.hh (94%) rename src/libstore-test-support/{ => include/nix}/tests/nix_api_store.hh (96%) rename src/libstore-test-support/{ => include/nix}/tests/outputs-spec.hh (76%) rename src/libstore-test-support/{ => include/nix}/tests/path.hh (94%) rename src/libstore-test-support/{ => include/nix}/tests/protocol.hh (96%) rename src/libstore-test-support/{tests => }/outputs-spec.cc (95%) rename src/libstore-test-support/{tests => }/path.cc (93%) rename src/libstore/{ => include/nix}/binary-cache-store.hh (97%) rename src/libstore/{ => include/nix}/build-result.hh (98%) rename src/libstore/{ => include/nix}/build/derivation-goal.hh (97%) rename src/libstore/{ => include/nix}/build/drv-output-substitution-goal.hh (89%) rename src/libstore/{ => include/nix}/build/goal.hh (99%) rename src/libstore/{ => include/nix}/build/substitution-goal.hh (94%) rename src/libstore/{ => include/nix}/build/worker.hh (98%) rename src/libstore/{ => include/nix}/builtins.hh (92%) rename src/libstore/{ => include/nix}/builtins/buildenv.hh (97%) rename src/libstore/{ => include/nix}/common-protocol-impl.hh (93%) rename src/libstore/{ => include/nix}/common-protocol.hh (99%) rename src/libstore/{ => include/nix}/common-ssh-store-config.hh (98%) rename src/libstore/{ => include/nix}/content-address.hh (98%) rename src/libstore/{ => include/nix}/daemon.hh (82%) rename src/libstore/{ => include/nix}/derivation-options.hh (98%) rename src/libstore/{ => include/nix}/derivations.hh (98%) rename src/libstore/{ => include/nix}/derived-path-map.hh (98%) rename src/libstore/{ => include/nix}/derived-path.hh (98%) rename src/libstore/{ => include/nix}/downstream-placeholder.hh (97%) rename src/libstore/{ => include/nix}/filetransfer.hh (97%) rename src/libstore/{ => include/nix}/gc-store.hh (99%) rename src/libstore/{ => include/nix}/globals.hh (99%) rename src/libstore/{ => include/nix}/http-binary-cache-store.hh (94%) rename src/libstore/{ => include/nix}/indirect-root-store.hh (98%) rename src/libstore/{ => include/nix}/keys.hh (66%) rename src/libstore/{ => include/nix}/legacy-ssh-store.hh (97%) rename src/libstore/{ => include/nix}/length-prefixed-protocol-helper.hh (99%) rename src/libstore/{ => include/nix}/local-binary-cache-store.hh (92%) rename src/libstore/{ => include/nix}/local-fs-store.hh (96%) rename src/libstore/{ => include/nix}/local-overlay-store.hh (99%) rename src/libstore/{ => include/nix}/local-store.hh (98%) rename src/libstore/{ => include/nix}/log-store.hh (95%) rename src/libstore/{ => include/nix}/machines.hh (97%) rename src/libstore/{ => include/nix}/make-content-addressed.hh (94%) create mode 100644 src/libstore/include/nix/meson.build rename src/libstore/{ => include/nix}/names.hh (96%) rename src/libstore/{ => include/nix}/nar-accessor.hh (96%) rename src/libstore/{ => include/nix}/nar-info-disk-cache.hh (94%) rename src/libstore/{ => include/nix}/nar-info.hh (93%) rename src/libstore/{ => include/nix}/outputs-spec.hh (98%) rename src/libstore/{ => include/nix}/parsed-derivations.hh (95%) rename src/libstore/{ => include/nix}/path-info.hh (98%) rename src/libstore/{ => include/nix}/path-references.hh (91%) rename src/libstore/{ => include/nix}/path-regex.hh (100%) rename src/libstore/{ => include/nix}/path-with-outputs.hh (95%) rename src/libstore/{ => include/nix}/path.hh (98%) rename src/libstore/{ => include/nix}/pathlocks.hh (97%) rename src/libstore/{ => include/nix}/posix-fs-canonicalise.hh (96%) rename src/libstore/{ => include/nix}/profiles.hh (99%) rename src/libstore/{ => include/nix}/realisation.hh (96%) rename src/libstore/{ => include/nix}/remote-fs-accessor.hh (91%) rename src/libstore/{ => include/nix}/remote-store-connection.hh (91%) rename src/libstore/{ => include/nix}/remote-store.hh (98%) rename src/libstore/{ => include/nix}/s3-binary-cache-store.hh (98%) rename src/libstore/{ => include/nix}/s3.hh (97%) rename src/libstore/{ => include/nix}/serve-protocol-connection.hh (98%) rename src/libstore/{ => include/nix}/serve-protocol-impl.hh (95%) rename src/libstore/{ => include/nix}/serve-protocol.hh (99%) rename src/libstore/{ => include/nix}/sqlite.hh (99%) rename src/libstore/{ => include/nix}/ssh-store.hh (91%) rename src/libstore/{ => include/nix}/ssh.hh (95%) rename src/libstore/{ => include/nix}/store-api.hh (98%) rename src/libstore/{ => include/nix}/store-cast.hh (94%) rename src/libstore/{ => include/nix}/store-dir-config.hh (95%) rename src/libstore/{ => include/nix}/store-reference.hh (98%) rename src/libstore/{ => include/nix}/uds-remote-store.hh (95%) rename src/libstore/{ => include/nix}/worker-protocol-connection.hh (98%) rename src/libstore/{ => include/nix}/worker-protocol-impl.hh (95%) rename src/libstore/{ => include/nix}/worker-protocol.hh (99%) rename src/libstore/linux/{ => include/nix}/fchmodat2-compat.hh (100%) create mode 100644 src/libstore/linux/include/nix/meson.build rename src/libstore/linux/{ => include/nix}/personality.hh (100%) rename src/libstore/unix/{ => include/nix}/build/child.hh (100%) rename src/libstore/unix/{ => include/nix}/build/hook-instance.hh (85%) rename src/libstore/unix/{ => include/nix}/build/local-derivation-goal.hh (98%) create mode 100644 src/libstore/unix/include/nix/meson.build rename src/libstore/unix/{ => include/nix}/user-lock.hh (100%) rename src/libutil-test-support/{tests => }/hash.cc (91%) create mode 100644 src/libutil-test-support/include/nix/meson.build rename src/libutil-test-support/{ => include/nix}/tests/characterization.hh (96%) rename src/libutil-test-support/{ => include/nix}/tests/gtest-with-params.hh (100%) rename src/libutil-test-support/{ => include/nix}/tests/hash.hh (88%) rename src/libutil-test-support/{ => include/nix}/tests/nix_api_util.hh (100%) rename src/libutil-test-support/{ => include/nix}/tests/string_callback.hh (100%) rename src/libutil-test-support/{ => include/nix}/tests/tracing-file-system-object-sink.hh (97%) rename src/libutil-test-support/{tests => }/string_callback.cc (85%) rename src/libutil-test-support/{tests => }/tracing-file-system-object-sink.cc (95%) rename src/libutil/{ => include/nix}/abstract-setting-to-json.hh (87%) rename src/libutil/{ => include/nix}/ansicolor.hh (100%) rename src/libutil/{ => include/nix}/archive.hh (96%) rename src/libutil/{ => include/nix}/args.hh (99%) rename src/libutil/{ => include/nix}/args/root.hh (98%) rename src/libutil/{ => include/nix}/callback.hh (100%) rename src/libutil/{ => include/nix}/canon-path.hh (100%) rename src/libutil/{ => include/nix}/checked-arithmetic.hh (100%) rename src/libutil/{ => include/nix}/chunked-vector.hh (98%) rename src/libutil/{ => include/nix}/closure.hh (98%) rename src/libutil/{ => include/nix}/comparator.hh (100%) rename src/libutil/{ => include/nix}/compression.hh (90%) rename src/libutil/{ => include/nix}/compute-levels.hh (74%) rename src/libutil/{ => include/nix}/config-global.hh (96%) rename src/libutil/{ => include/nix}/config-impl.hh (98%) rename src/libutil/{ => include/nix}/config.hh (99%) rename src/libutil/{ => include/nix}/current-process.hh (97%) rename src/libutil/{ => include/nix}/english.hh (100%) rename src/libutil/{ => include/nix}/environment-variables.hh (96%) rename src/libutil/{ => include/nix}/error.hh (99%) rename src/libutil/{ => include/nix}/exec.hh (91%) rename src/libutil/{ => include/nix}/executable-path.hh (98%) rename src/libutil/{ => include/nix}/exit.hh (100%) rename src/libutil/{ => include/nix}/experimental-features.hh (98%) rename src/libutil/{ => include/nix}/file-content-address.hh (99%) rename src/libutil/{ => include/nix}/file-descriptor.hh (98%) rename src/libutil/{ => include/nix}/file-path-impl.hh (100%) rename src/libutil/{ => include/nix}/file-path.hh (94%) rename src/libutil/{ => include/nix}/file-system.hh (98%) rename src/libutil/{ => include/nix}/finally.hh (100%) rename src/libutil/{ => include/nix}/fmt.hh (99%) rename src/libutil/{ => include/nix}/fs-sink.hh (97%) rename src/libutil/{ => include/nix}/git.hh (97%) rename src/libutil/{ => include/nix}/hash.hh (98%) rename src/libutil/{ => include/nix}/hilite.hh (100%) rename src/libutil/{ => include/nix}/json-impls.hh (95%) rename src/libutil/{ => include/nix}/json-utils.hh (99%) rename src/libutil/{ => include/nix}/logging.hh (98%) rename src/libutil/{ => include/nix}/lru-cache.hh (100%) rename src/libutil/{ => include/nix}/memory-source-accessor.hh (97%) create mode 100644 src/libutil/include/nix/meson.build rename src/libutil/{ => include/nix}/muxable-pipe.hh (94%) rename src/libutil/{ => include/nix}/os-string.hh (100%) rename src/libutil/{ => include/nix}/pool.hh (99%) rename src/libutil/{ => include/nix}/pos-idx.hh (100%) rename src/libutil/{ => include/nix}/pos-table.hh (97%) rename src/libutil/{ => include/nix}/position.hh (99%) rename src/libutil/{ => include/nix}/posix-source-accessor.hh (98%) rename src/libutil/{ => include/nix}/processes.hh (95%) rename src/libutil/{ => include/nix}/ref.hh (100%) rename src/libutil/{ => include/nix}/references.hh (97%) rename src/libutil/{ => include/nix}/regex-combinators.hh (100%) rename src/libutil/{ => include/nix}/repair-flag.hh (100%) rename src/libutil/{ => include/nix}/serialise.hh (99%) rename src/libutil/{ => include/nix}/signals.hh (90%) rename src/libutil/{ => include/nix}/signature/local-keys.hh (99%) rename src/libutil/{ => include/nix}/signature/signer.hh (94%) rename src/libutil/{ => include/nix}/source-accessor.hh (98%) rename src/libutil/{ => include/nix}/source-path.hh (96%) rename src/libutil/{ => include/nix}/split.hh (97%) rename src/libutil/{ => include/nix}/std-hash.hh (100%) rename src/libutil/{ => include/nix}/strings-inline.hh (99%) rename src/libutil/{ => include/nix}/strings.hh (100%) rename src/libutil/{ => include/nix}/suggestions.hh (98%) rename src/libutil/{ => include/nix}/sync.hh (99%) rename src/libutil/{ => include/nix}/tarfile.hh (96%) rename src/libutil/{ => include/nix}/terminal.hh (100%) rename src/libutil/{ => include/nix}/thread-pool.hh (98%) rename src/libutil/{ => include/nix}/topo-sort.hh (97%) rename src/libutil/{ => include/nix}/types.hh (100%) rename src/libutil/{ => include/nix}/unix-domain-socket.hh (95%) rename src/libutil/{ => include/nix}/url-parts.hh (100%) rename src/libutil/{ => include/nix}/url.hh (98%) rename src/libutil/{ => include/nix}/users.hh (98%) rename src/libutil/{ => include/nix}/util.hh (98%) rename src/libutil/{ => include/nix}/variant-wrapper.hh (100%) rename src/libutil/{ => include/nix}/xml-writer.hh (100%) rename src/libutil/linux/{ => include/nix}/cgroup.hh (97%) create mode 100644 src/libutil/linux/include/nix/meson.build rename src/libutil/linux/{ => include/nix}/namespaces.hh (96%) create mode 100644 src/libutil/unix/include/nix/meson.build rename src/libutil/unix/{ => include/nix}/monitor-fd.hh (99%) rename src/libutil/unix/{ => include/nix}/signals-impl.hh (95%) create mode 100644 src/libutil/windows/include/nix/meson.build rename src/libutil/windows/{ => include/nix}/signals-impl.hh (95%) rename src/libutil/windows/{ => include/nix}/windows-async-pipe.hh (93%) rename src/libutil/windows/{ => include/nix}/windows-error.hh (97%) diff --git a/doc/manual/source/development/testing.md b/doc/manual/source/development/testing.md index d0c3a1c78..ebc0e27d2 100644 --- a/doc/manual/source/development/testing.md +++ b/doc/manual/source/development/testing.md @@ -31,7 +31,7 @@ The unit tests are defined using the [googletest] and [rapidcheck] frameworks. > ├── libexpr > │ ├── meson.build > │ ├── value/context.hh -> │ ├── value/context.cc +> │ ├── include/nix/value/context.cc > │ … > │ > ├── tests @@ -46,8 +46,12 @@ The unit tests are defined using the [googletest] and [rapidcheck] frameworks. > │ │ > │ ├── libexpr-test-support > │ │ ├── meson.build +> │ │ ├── include/nix +> │ │ │ ├── meson.build +> │ │ │ └── tests +> │ │ │ ├── value/context.hh +> │ │ │ … > │ │ └── tests -> │ │ ├── value/context.hh > │ │ ├── value/context.cc > │ │ … > │ │ @@ -59,7 +63,7 @@ The unit tests are defined using the [googletest] and [rapidcheck] frameworks. > ``` The tests for each Nix library (`libnixexpr`, `libnixstore`, etc..) live inside a directory `src/${library_name_without-nix}-test`. -Given an interface (header) and implementation pair in the original library, say, `src/libexpr/value/context.{hh,cc}`, we write tests for it in `src/libexpr-tests/value/context.cc`, and (possibly) declare/define additional interfaces for testing purposes in `src/libexpr-test-support/tests/value/context.{hh,cc}`. +Given an interface (header) and implementation pair in the original library, say, `src/libexpr/include/nix/value/context.hh` and `src/libexpr/value/context.cc`, we write tests for it in `src/libexpr-tests/value/context.cc`, and (possibly) declare/define additional interfaces for testing purposes in `src/libexpr-test-support/include/nix/tests/value/context.hh` and `src/libexpr-test-support/tests/value/context.cc`. Data for unit tests is stored in a `data` subdir of the directory for each unit test executable. For example, `libnixstore` code is in `src/libstore`, and its test data is in `src/libstore-tests/data`. @@ -67,7 +71,7 @@ The path to the `src/${library_name_without-nix}-test/data` directory is passed Note that each executable only gets the data for its tests. The unit test libraries are in `src/${library_name_without-nix}-test-support`. -All headers are in a `tests` subdirectory so they are included with `#include "tests/"`. +All headers are in a `tests` subdirectory so they are included with `#include "nix/tests/"`. The use of all these separate directories for the unit tests might seem inconvenient, as for example the tests are not "right next to" the part of the code they are testing. But organizing the tests this way has one big benefit: diff --git a/maintainers/flake-module.nix b/maintainers/flake-module.nix index 4c75df246..87dc1e18a 100644 --- a/maintainers/flake-module.nix +++ b/maintainers/flake-module.nix @@ -84,340 +84,340 @@ ''^precompiled-headers\.h$'' ''^src/build-remote/build-remote\.cc$'' ''^src/libcmd/built-path\.cc$'' - ''^src/libcmd/built-path\.hh$'' + ''^src/libcmd/include/nix/built-path\.hh$'' ''^src/libcmd/common-eval-args\.cc$'' - ''^src/libcmd/common-eval-args\.hh$'' + ''^src/libcmd/include/nix/common-eval-args\.hh$'' ''^src/libcmd/editor-for\.cc$'' ''^src/libcmd/installable-attr-path\.cc$'' - ''^src/libcmd/installable-attr-path\.hh$'' + ''^src/libcmd/include/nix/installable-attr-path\.hh$'' ''^src/libcmd/installable-derived-path\.cc$'' - ''^src/libcmd/installable-derived-path\.hh$'' + ''^src/libcmd/include/nix/installable-derived-path\.hh$'' ''^src/libcmd/installable-flake\.cc$'' - ''^src/libcmd/installable-flake\.hh$'' + ''^src/libcmd/include/nix/installable-flake\.hh$'' ''^src/libcmd/installable-value\.cc$'' - ''^src/libcmd/installable-value\.hh$'' + ''^src/libcmd/include/nix/installable-value\.hh$'' ''^src/libcmd/installables\.cc$'' - ''^src/libcmd/installables\.hh$'' - ''^src/libcmd/legacy\.hh$'' + ''^src/libcmd/include/nix/installables\.hh$'' + ''^src/libcmd/include/nix/legacy\.hh$'' ''^src/libcmd/markdown\.cc$'' ''^src/libcmd/misc-store-flags\.cc$'' ''^src/libcmd/repl-interacter\.cc$'' - ''^src/libcmd/repl-interacter\.hh$'' + ''^src/libcmd/include/nix/repl-interacter\.hh$'' ''^src/libcmd/repl\.cc$'' - ''^src/libcmd/repl\.hh$'' + ''^src/libcmd/include/nix/repl\.hh$'' ''^src/libexpr-c/nix_api_expr\.cc$'' ''^src/libexpr-c/nix_api_external\.cc$'' ''^src/libexpr/attr-path\.cc$'' - ''^src/libexpr/attr-path\.hh$'' + ''^src/libexpr/include/nix/attr-path\.hh$'' ''^src/libexpr/attr-set\.cc$'' - ''^src/libexpr/attr-set\.hh$'' + ''^src/libexpr/include/nix/attr-set\.hh$'' ''^src/libexpr/eval-cache\.cc$'' - ''^src/libexpr/eval-cache\.hh$'' + ''^src/libexpr/include/nix/eval-cache\.hh$'' ''^src/libexpr/eval-error\.cc$'' - ''^src/libexpr/eval-inline\.hh$'' + ''^src/libexpr/include/nix/eval-inline\.hh$'' ''^src/libexpr/eval-settings\.cc$'' - ''^src/libexpr/eval-settings\.hh$'' + ''^src/libexpr/include/nix/eval-settings\.hh$'' ''^src/libexpr/eval\.cc$'' - ''^src/libexpr/eval\.hh$'' + ''^src/libexpr/include/nix/eval\.hh$'' ''^src/libexpr/function-trace\.cc$'' - ''^src/libexpr/gc-small-vector\.hh$'' + ''^src/libexpr/include/nix/gc-small-vector\.hh$'' ''^src/libexpr/get-drvs\.cc$'' - ''^src/libexpr/get-drvs\.hh$'' + ''^src/libexpr/include/nix/get-drvs\.hh$'' ''^src/libexpr/json-to-value\.cc$'' ''^src/libexpr/nixexpr\.cc$'' - ''^src/libexpr/nixexpr\.hh$'' - ''^src/libexpr/parser-state\.hh$'' + ''^src/libexpr/include/nix/nixexpr\.hh$'' + ''^src/libexpr/include/nix/parser-state\.hh$'' ''^src/libexpr/primops\.cc$'' - ''^src/libexpr/primops\.hh$'' + ''^src/libexpr/include/nix/primops\.hh$'' ''^src/libexpr/primops/context\.cc$'' ''^src/libexpr/primops/fetchClosure\.cc$'' ''^src/libexpr/primops/fetchMercurial\.cc$'' ''^src/libexpr/primops/fetchTree\.cc$'' ''^src/libexpr/primops/fromTOML\.cc$'' ''^src/libexpr/print-ambiguous\.cc$'' - ''^src/libexpr/print-ambiguous\.hh$'' - ''^src/libexpr/print-options\.hh$'' + ''^src/libexpr/include/nix/print-ambiguous\.hh$'' + ''^src/libexpr/include/nix/print-options\.hh$'' ''^src/libexpr/print\.cc$'' - ''^src/libexpr/print\.hh$'' + ''^src/libexpr/include/nix/print\.hh$'' ''^src/libexpr/search-path\.cc$'' - ''^src/libexpr/symbol-table\.hh$'' + ''^src/libexpr/include/nix/symbol-table\.hh$'' ''^src/libexpr/value-to-json\.cc$'' - ''^src/libexpr/value-to-json\.hh$'' + ''^src/libexpr/include/nix/value-to-json\.hh$'' ''^src/libexpr/value-to-xml\.cc$'' - ''^src/libexpr/value-to-xml\.hh$'' - ''^src/libexpr/value\.hh$'' + ''^src/libexpr/include/nix/value-to-xml\.hh$'' + ''^src/libexpr/include/nix/value\.hh$'' ''^src/libexpr/value/context\.cc$'' - ''^src/libexpr/value/context\.hh$'' + ''^src/libexpr/include/nix/value/context\.hh$'' ''^src/libfetchers/attrs\.cc$'' ''^src/libfetchers/cache\.cc$'' - ''^src/libfetchers/cache\.hh$'' + ''^src/libfetchers/include/nix/cache\.hh$'' ''^src/libfetchers/fetch-settings\.cc$'' - ''^src/libfetchers/fetch-settings\.hh$'' + ''^src/libfetchers/include/nix/fetch-settings\.hh$'' ''^src/libfetchers/fetch-to-store\.cc$'' ''^src/libfetchers/fetchers\.cc$'' - ''^src/libfetchers/fetchers\.hh$'' + ''^src/libfetchers/include/nix/fetchers\.hh$'' ''^src/libfetchers/filtering-source-accessor\.cc$'' - ''^src/libfetchers/filtering-source-accessor\.hh$'' + ''^src/libfetchers/include/nix/filtering-source-accessor\.hh$'' ''^src/libfetchers/fs-source-accessor\.cc$'' - ''^src/libfetchers/fs-source-accessor\.hh$'' + ''^src/libfetchers/include/nix/fs-source-accessor\.hh$'' ''^src/libfetchers/git-utils\.cc$'' - ''^src/libfetchers/git-utils\.hh$'' + ''^src/libfetchers/include/nix/git-utils\.hh$'' ''^src/libfetchers/github\.cc$'' ''^src/libfetchers/indirect\.cc$'' ''^src/libfetchers/memory-source-accessor\.cc$'' ''^src/libfetchers/path\.cc$'' ''^src/libfetchers/registry\.cc$'' - ''^src/libfetchers/registry\.hh$'' + ''^src/libfetchers/include/nix/registry\.hh$'' ''^src/libfetchers/tarball\.cc$'' - ''^src/libfetchers/tarball\.hh$'' + ''^src/libfetchers/include/nix/tarball\.hh$'' ''^src/libfetchers/git\.cc$'' ''^src/libfetchers/mercurial\.cc$'' ''^src/libflake/flake/config\.cc$'' ''^src/libflake/flake/flake\.cc$'' - ''^src/libflake/flake/flake\.hh$'' + ''^src/libflake/include/nix/flake/flake\.hh$'' ''^src/libflake/flake/flakeref\.cc$'' - ''^src/libflake/flake/flakeref\.hh$'' + ''^src/libflake/include/nix/flake/flakeref\.hh$'' ''^src/libflake/flake/lockfile\.cc$'' - ''^src/libflake/flake/lockfile\.hh$'' + ''^src/libflake/include/nix/flake/lockfile\.hh$'' ''^src/libflake/flake/url-name\.cc$'' ''^src/libmain/common-args\.cc$'' - ''^src/libmain/common-args\.hh$'' + ''^src/libmain/include/nix/common-args\.hh$'' ''^src/libmain/loggers\.cc$'' - ''^src/libmain/loggers\.hh$'' + ''^src/libmain/include/nix/loggers\.hh$'' ''^src/libmain/progress-bar\.cc$'' ''^src/libmain/shared\.cc$'' - ''^src/libmain/shared\.hh$'' + ''^src/libmain/include/nix/shared\.hh$'' ''^src/libmain/unix/stack\.cc$'' ''^src/libstore/binary-cache-store\.cc$'' - ''^src/libstore/binary-cache-store\.hh$'' - ''^src/libstore/build-result\.hh$'' - ''^src/libstore/builtins\.hh$'' + ''^src/libstore/include/nix/binary-cache-store\.hh$'' + ''^src/libstore/include/nix/build-result\.hh$'' + ''^src/libstore/include/nix/builtins\.hh$'' ''^src/libstore/builtins/buildenv\.cc$'' - ''^src/libstore/builtins/buildenv\.hh$'' - ''^src/libstore/common-protocol-impl\.hh$'' + ''^src/libstore/include/nix/builtins/buildenv\.hh$'' + ''^src/libstore/include/nix/common-protocol-impl\.hh$'' ''^src/libstore/common-protocol\.cc$'' - ''^src/libstore/common-protocol\.hh$'' - ''^src/libstore/common-ssh-store-config\.hh$'' + ''^src/libstore/include/nix/common-protocol\.hh$'' + ''^src/libstore/include/nix/common-ssh-store-config\.hh$'' ''^src/libstore/content-address\.cc$'' - ''^src/libstore/content-address\.hh$'' + ''^src/libstore/include/nix/content-address\.hh$'' ''^src/libstore/daemon\.cc$'' - ''^src/libstore/daemon\.hh$'' + ''^src/libstore/include/nix/daemon\.hh$'' ''^src/libstore/derivations\.cc$'' - ''^src/libstore/derivations\.hh$'' + ''^src/libstore/include/nix/derivations\.hh$'' ''^src/libstore/derived-path-map\.cc$'' - ''^src/libstore/derived-path-map\.hh$'' + ''^src/libstore/include/nix/derived-path-map\.hh$'' ''^src/libstore/derived-path\.cc$'' - ''^src/libstore/derived-path\.hh$'' + ''^src/libstore/include/nix/derived-path\.hh$'' ''^src/libstore/downstream-placeholder\.cc$'' - ''^src/libstore/downstream-placeholder\.hh$'' + ''^src/libstore/include/nix/downstream-placeholder\.hh$'' ''^src/libstore/dummy-store\.cc$'' ''^src/libstore/export-import\.cc$'' ''^src/libstore/filetransfer\.cc$'' - ''^src/libstore/filetransfer\.hh$'' - ''^src/libstore/gc-store\.hh$'' + ''^src/libstore/include/nix/filetransfer\.hh$'' + ''^src/libstore/include/nix/gc-store\.hh$'' ''^src/libstore/globals\.cc$'' - ''^src/libstore/globals\.hh$'' + ''^src/libstore/include/nix/globals\.hh$'' ''^src/libstore/http-binary-cache-store\.cc$'' ''^src/libstore/legacy-ssh-store\.cc$'' - ''^src/libstore/legacy-ssh-store\.hh$'' - ''^src/libstore/length-prefixed-protocol-helper\.hh$'' + ''^src/libstore/include/nix/legacy-ssh-store\.hh$'' + ''^src/libstore/include/nix/length-prefixed-protocol-helper\.hh$'' ''^src/libstore/linux/personality\.cc$'' - ''^src/libstore/linux/personality\.hh$'' + ''^src/libstore/linux/include/nix/personality\.hh$'' ''^src/libstore/local-binary-cache-store\.cc$'' ''^src/libstore/local-fs-store\.cc$'' - ''^src/libstore/local-fs-store\.hh$'' + ''^src/libstore/include/nix/local-fs-store\.hh$'' ''^src/libstore/log-store\.cc$'' - ''^src/libstore/log-store\.hh$'' + ''^src/libstore/include/nix/log-store\.hh$'' ''^src/libstore/machines\.cc$'' - ''^src/libstore/machines\.hh$'' + ''^src/libstore/include/nix/machines\.hh$'' ''^src/libstore/make-content-addressed\.cc$'' - ''^src/libstore/make-content-addressed\.hh$'' + ''^src/libstore/include/nix/make-content-addressed\.hh$'' ''^src/libstore/misc\.cc$'' ''^src/libstore/names\.cc$'' - ''^src/libstore/names\.hh$'' + ''^src/libstore/include/nix/names\.hh$'' ''^src/libstore/nar-accessor\.cc$'' - ''^src/libstore/nar-accessor\.hh$'' + ''^src/libstore/include/nix/nar-accessor\.hh$'' ''^src/libstore/nar-info-disk-cache\.cc$'' - ''^src/libstore/nar-info-disk-cache\.hh$'' + ''^src/libstore/include/nix/nar-info-disk-cache\.hh$'' ''^src/libstore/nar-info\.cc$'' - ''^src/libstore/nar-info\.hh$'' + ''^src/libstore/include/nix/nar-info\.hh$'' ''^src/libstore/outputs-spec\.cc$'' - ''^src/libstore/outputs-spec\.hh$'' + ''^src/libstore/include/nix/outputs-spec\.hh$'' ''^src/libstore/parsed-derivations\.cc$'' ''^src/libstore/path-info\.cc$'' - ''^src/libstore/path-info\.hh$'' + ''^src/libstore/include/nix/path-info\.hh$'' ''^src/libstore/path-references\.cc$'' - ''^src/libstore/path-regex\.hh$'' + ''^src/libstore/include/nix/path-regex\.hh$'' ''^src/libstore/path-with-outputs\.cc$'' ''^src/libstore/path\.cc$'' - ''^src/libstore/path\.hh$'' + ''^src/libstore/include/nix/path\.hh$'' ''^src/libstore/pathlocks\.cc$'' - ''^src/libstore/pathlocks\.hh$'' + ''^src/libstore/include/nix/pathlocks\.hh$'' ''^src/libstore/profiles\.cc$'' - ''^src/libstore/profiles\.hh$'' + ''^src/libstore/include/nix/profiles\.hh$'' ''^src/libstore/realisation\.cc$'' - ''^src/libstore/realisation\.hh$'' + ''^src/libstore/include/nix/realisation\.hh$'' ''^src/libstore/remote-fs-accessor\.cc$'' - ''^src/libstore/remote-fs-accessor\.hh$'' - ''^src/libstore/remote-store-connection\.hh$'' + ''^src/libstore/include/nix/remote-fs-accessor\.hh$'' + ''^src/libstore/include/nix/remote-store-connection\.hh$'' ''^src/libstore/remote-store\.cc$'' - ''^src/libstore/remote-store\.hh$'' + ''^src/libstore/include/nix/remote-store\.hh$'' ''^src/libstore/s3-binary-cache-store\.cc$'' - ''^src/libstore/s3\.hh$'' + ''^src/libstore/include/nix/s3\.hh$'' ''^src/libstore/serve-protocol-impl\.cc$'' - ''^src/libstore/serve-protocol-impl\.hh$'' + ''^src/libstore/include/nix/serve-protocol-impl\.hh$'' ''^src/libstore/serve-protocol\.cc$'' - ''^src/libstore/serve-protocol\.hh$'' + ''^src/libstore/include/nix/serve-protocol\.hh$'' ''^src/libstore/sqlite\.cc$'' - ''^src/libstore/sqlite\.hh$'' + ''^src/libstore/include/nix/sqlite\.hh$'' ''^src/libstore/ssh-store\.cc$'' ''^src/libstore/ssh\.cc$'' - ''^src/libstore/ssh\.hh$'' + ''^src/libstore/include/nix/ssh\.hh$'' ''^src/libstore/store-api\.cc$'' - ''^src/libstore/store-api\.hh$'' - ''^src/libstore/store-dir-config\.hh$'' + ''^src/libstore/include/nix/store-api\.hh$'' + ''^src/libstore/include/nix/store-dir-config\.hh$'' ''^src/libstore/build/derivation-goal\.cc$'' - ''^src/libstore/build/derivation-goal\.hh$'' + ''^src/libstore/include/nix/build/derivation-goal\.hh$'' ''^src/libstore/build/drv-output-substitution-goal\.cc$'' - ''^src/libstore/build/drv-output-substitution-goal\.hh$'' + ''^src/libstore/include/nix/build/drv-output-substitution-goal\.hh$'' ''^src/libstore/build/entry-points\.cc$'' ''^src/libstore/build/goal\.cc$'' - ''^src/libstore/build/goal\.hh$'' + ''^src/libstore/include/nix/build/goal\.hh$'' ''^src/libstore/unix/build/hook-instance\.cc$'' ''^src/libstore/unix/build/local-derivation-goal\.cc$'' - ''^src/libstore/unix/build/local-derivation-goal\.hh$'' + ''^src/libstore/unix/include/nix/build/local-derivation-goal\.hh$'' ''^src/libstore/build/substitution-goal\.cc$'' - ''^src/libstore/build/substitution-goal\.hh$'' + ''^src/libstore/include/nix/build/substitution-goal\.hh$'' ''^src/libstore/build/worker\.cc$'' - ''^src/libstore/build/worker\.hh$'' + ''^src/libstore/include/nix/build/worker\.hh$'' ''^src/libstore/builtins/fetchurl\.cc$'' ''^src/libstore/builtins/unpack-channel\.cc$'' ''^src/libstore/gc\.cc$'' ''^src/libstore/local-overlay-store\.cc$'' - ''^src/libstore/local-overlay-store\.hh$'' + ''^src/libstore/include/nix/local-overlay-store\.hh$'' ''^src/libstore/local-store\.cc$'' - ''^src/libstore/local-store\.hh$'' + ''^src/libstore/include/nix/local-store\.hh$'' ''^src/libstore/unix/user-lock\.cc$'' - ''^src/libstore/unix/user-lock\.hh$'' + ''^src/libstore/unix/include/nix/user-lock\.hh$'' ''^src/libstore/optimise-store\.cc$'' ''^src/libstore/unix/pathlocks\.cc$'' ''^src/libstore/posix-fs-canonicalise\.cc$'' - ''^src/libstore/posix-fs-canonicalise\.hh$'' + ''^src/libstore/include/nix/posix-fs-canonicalise\.hh$'' ''^src/libstore/uds-remote-store\.cc$'' - ''^src/libstore/uds-remote-store\.hh$'' + ''^src/libstore/include/nix/uds-remote-store\.hh$'' ''^src/libstore/windows/build\.cc$'' - ''^src/libstore/worker-protocol-impl\.hh$'' + ''^src/libstore/include/nix/worker-protocol-impl\.hh$'' ''^src/libstore/worker-protocol\.cc$'' - ''^src/libstore/worker-protocol\.hh$'' + ''^src/libstore/include/nix/worker-protocol\.hh$'' ''^src/libutil-c/nix_api_util_internal\.h$'' ''^src/libutil/archive\.cc$'' - ''^src/libutil/archive\.hh$'' + ''^src/libutil/include/nix/archive\.hh$'' ''^src/libutil/args\.cc$'' - ''^src/libutil/args\.hh$'' - ''^src/libutil/args/root\.hh$'' - ''^src/libutil/callback\.hh$'' + ''^src/libutil/include/nix/args\.hh$'' + ''^src/libutil/include/nix/args/root\.hh$'' + ''^src/libutil/include/nix/callback\.hh$'' ''^src/libutil/canon-path\.cc$'' - ''^src/libutil/canon-path\.hh$'' - ''^src/libutil/chunked-vector\.hh$'' - ''^src/libutil/closure\.hh$'' - ''^src/libutil/comparator\.hh$'' + ''^src/libutil/include/nix/canon-path\.hh$'' + ''^src/libutil/include/nix/chunked-vector\.hh$'' + ''^src/libutil/include/nix/closure\.hh$'' + ''^src/libutil/include/nix/comparator\.hh$'' ''^src/libutil/compute-levels\.cc$'' - ''^src/libutil/config-impl\.hh$'' + ''^src/libutil/include/nix/config-impl\.hh$'' ''^src/libutil/config\.cc$'' - ''^src/libutil/config\.hh$'' + ''^src/libutil/include/nix/config\.hh$'' ''^src/libutil/current-process\.cc$'' - ''^src/libutil/current-process\.hh$'' + ''^src/libutil/include/nix/current-process\.hh$'' ''^src/libutil/english\.cc$'' - ''^src/libutil/english\.hh$'' + ''^src/libutil/include/nix/english\.hh$'' ''^src/libutil/error\.cc$'' - ''^src/libutil/error\.hh$'' - ''^src/libutil/exit\.hh$'' + ''^src/libutil/include/nix/error\.hh$'' + ''^src/libutil/include/nix/exit\.hh$'' ''^src/libutil/experimental-features\.cc$'' - ''^src/libutil/experimental-features\.hh$'' + ''^src/libutil/include/nix/experimental-features\.hh$'' ''^src/libutil/file-content-address\.cc$'' - ''^src/libutil/file-content-address\.hh$'' + ''^src/libutil/include/nix/file-content-address\.hh$'' ''^src/libutil/file-descriptor\.cc$'' - ''^src/libutil/file-descriptor\.hh$'' - ''^src/libutil/file-path-impl\.hh$'' - ''^src/libutil/file-path\.hh$'' + ''^src/libutil/include/nix/file-descriptor\.hh$'' + ''^src/libutil/include/nix/file-path-impl\.hh$'' + ''^src/libutil/include/nix/file-path\.hh$'' ''^src/libutil/file-system\.cc$'' - ''^src/libutil/file-system\.hh$'' - ''^src/libutil/finally\.hh$'' - ''^src/libutil/fmt\.hh$'' + ''^src/libutil/include/nix/file-system\.hh$'' + ''^src/libutil/include/nix/finally\.hh$'' + ''^src/libutil/include/nix/fmt\.hh$'' ''^src/libutil/fs-sink\.cc$'' - ''^src/libutil/fs-sink\.hh$'' + ''^src/libutil/include/nix/fs-sink\.hh$'' ''^src/libutil/git\.cc$'' - ''^src/libutil/git\.hh$'' + ''^src/libutil/include/nix/git\.hh$'' ''^src/libutil/hash\.cc$'' - ''^src/libutil/hash\.hh$'' + ''^src/libutil/include/nix/hash\.hh$'' ''^src/libutil/hilite\.cc$'' - ''^src/libutil/hilite\.hh$'' + ''^src/libutil/include/nix/hilite\.hh$'' ''^src/libutil/source-accessor\.hh$'' - ''^src/libutil/json-impls\.hh$'' + ''^src/libutil/include/nix/json-impls\.hh$'' ''^src/libutil/json-utils\.cc$'' - ''^src/libutil/json-utils\.hh$'' + ''^src/libutil/include/nix/json-utils\.hh$'' ''^src/libutil/linux/cgroup\.cc$'' ''^src/libutil/linux/namespaces\.cc$'' ''^src/libutil/logging\.cc$'' - ''^src/libutil/logging\.hh$'' - ''^src/libutil/lru-cache\.hh$'' + ''^src/libutil/include/nix/logging\.hh$'' + ''^src/libutil/include/nix/lru-cache\.hh$'' ''^src/libutil/memory-source-accessor\.cc$'' - ''^src/libutil/memory-source-accessor\.hh$'' - ''^src/libutil/pool\.hh$'' + ''^src/libutil/include/nix/memory-source-accessor\.hh$'' + ''^src/libutil/include/nix/pool\.hh$'' ''^src/libutil/position\.cc$'' - ''^src/libutil/position\.hh$'' + ''^src/libutil/include/nix/position\.hh$'' ''^src/libutil/posix-source-accessor\.cc$'' - ''^src/libutil/posix-source-accessor\.hh$'' - ''^src/libutil/processes\.hh$'' - ''^src/libutil/ref\.hh$'' + ''^src/libutil/include/nix/posix-source-accessor\.hh$'' + ''^src/libutil/include/nix/processes\.hh$'' + ''^src/libutil/include/nix/ref\.hh$'' ''^src/libutil/references\.cc$'' - ''^src/libutil/references\.hh$'' + ''^src/libutil/include/nix/references\.hh$'' ''^src/libutil/regex-combinators\.hh$'' ''^src/libutil/serialise\.cc$'' - ''^src/libutil/serialise\.hh$'' - ''^src/libutil/signals\.hh$'' + ''^src/libutil/include/nix/serialise\.hh$'' + ''^src/libutil/include/nix/signals\.hh$'' ''^src/libutil/signature/local-keys\.cc$'' - ''^src/libutil/signature/local-keys\.hh$'' + ''^src/libutil/include/nix/signature/local-keys\.hh$'' ''^src/libutil/signature/signer\.cc$'' - ''^src/libutil/signature/signer\.hh$'' + ''^src/libutil/include/nix/signature/signer\.hh$'' ''^src/libutil/source-accessor\.cc$'' - ''^src/libutil/source-accessor\.hh$'' + ''^src/libutil/include/nix/source-accessor\.hh$'' ''^src/libutil/source-path\.cc$'' - ''^src/libutil/source-path\.hh$'' - ''^src/libutil/split\.hh$'' + ''^src/libutil/include/nix/source-path\.hh$'' + ''^src/libutil/include/nix/split\.hh$'' ''^src/libutil/suggestions\.cc$'' - ''^src/libutil/suggestions\.hh$'' - ''^src/libutil/sync\.hh$'' + ''^src/libutil/include/nix/suggestions\.hh$'' + ''^src/libutil/include/nix/sync\.hh$'' ''^src/libutil/terminal\.cc$'' - ''^src/libutil/terminal\.hh$'' + ''^src/libutil/include/nix/terminal\.hh$'' ''^src/libutil/thread-pool\.cc$'' - ''^src/libutil/thread-pool\.hh$'' - ''^src/libutil/topo-sort\.hh$'' - ''^src/libutil/types\.hh$'' + ''^src/libutil/include/nix/thread-pool\.hh$'' + ''^src/libutil/include/nix/topo-sort\.hh$'' + ''^src/libutil/include/nix/types\.hh$'' ''^src/libutil/unix/file-descriptor\.cc$'' ''^src/libutil/unix/file-path\.cc$'' ''^src/libutil/unix/processes\.cc$'' - ''^src/libutil/unix/signals-impl\.hh$'' + ''^src/libutil/unix/include/nix/signals-impl\.hh$'' ''^src/libutil/unix/signals\.cc$'' ''^src/libutil/unix-domain-socket\.cc$'' ''^src/libutil/unix/users\.cc$'' - ''^src/libutil/url-parts\.hh$'' + ''^src/libutil/include/nix/url-parts\.hh$'' ''^src/libutil/url\.cc$'' - ''^src/libutil/url\.hh$'' + ''^src/libutil/include/nix/url\.hh$'' ''^src/libutil/users\.cc$'' - ''^src/libutil/users\.hh$'' + ''^src/libutil/include/nix/users\.hh$'' ''^src/libutil/util\.cc$'' - ''^src/libutil/util\.hh$'' - ''^src/libutil/variant-wrapper\.hh$'' + ''^src/libutil/include/nix/util\.hh$'' + ''^src/libutil/include/nix/variant-wrapper\.hh$'' ''^src/libutil/widecharwidth/widechar_width\.h$'' # vendored source ''^src/libutil/windows/file-descriptor\.cc$'' ''^src/libutil/windows/file-path\.cc$'' ''^src/libutil/windows/processes\.cc$'' ''^src/libutil/windows/users\.cc$'' ''^src/libutil/windows/windows-error\.cc$'' - ''^src/libutil/windows/windows-error\.hh$'' + ''^src/libutil/windows/include/nix/windows-error\.hh$'' ''^src/libutil/xml-writer\.cc$'' - ''^src/libutil/xml-writer\.hh$'' + ''^src/libutil/include/nix/xml-writer\.hh$'' ''^src/nix-build/nix-build\.cc$'' ''^src/nix-channel/nix-channel\.cc$'' ''^src/nix-collect-garbage/nix-collect-garbage\.cc$'' @@ -481,9 +481,9 @@ ''^tests/nixos/ca-fd-leak/sender\.c'' ''^tests/nixos/ca-fd-leak/smuggler\.c'' ''^tests/nixos/user-sandboxing/attacker\.c'' - ''^src/libexpr-test-support/tests/libexpr\.hh'' + ''^src/libexpr-test-support/include/nix/tests/libexpr\.hh'' ''^src/libexpr-test-support/tests/value/context\.cc'' - ''^src/libexpr-test-support/tests/value/context\.hh'' + ''^src/libexpr-test-support/include/nix/tests/value/context\.hh'' ''^src/libexpr-tests/derived-path\.cc'' ''^src/libexpr-tests/error_traces\.cc'' ''^src/libexpr-tests/eval\.cc'' @@ -498,13 +498,13 @@ ''^src/libflake-tests/flakeref\.cc'' ''^src/libflake-tests/url-name\.cc'' ''^src/libstore-test-support/tests/derived-path\.cc'' - ''^src/libstore-test-support/tests/derived-path\.hh'' - ''^src/libstore-test-support/tests/nix_api_store\.hh'' + ''^src/libstore-test-support/include/nix/tests/derived-path\.hh'' + ''^src/libstore-test-support/include/nix/tests/nix_api_store\.hh'' ''^src/libstore-test-support/tests/outputs-spec\.cc'' - ''^src/libstore-test-support/tests/outputs-spec\.hh'' - ''^src/libstore-test-support/tests/path\.cc'' - ''^src/libstore-test-support/tests/path\.hh'' - ''^src/libstore-test-support/tests/protocol\.hh'' + ''^src/libstore-test-support/include/nix/tests/outputs-spec\.hh'' + ''^src/libstore-test-support/path\.cc'' + ''^src/libstore-test-support/include/nix/tests/path\.hh'' + ''^src/libstore-test-support/include/nix/tests/protocol\.hh'' ''^src/libstore-tests/common-protocol\.cc'' ''^src/libstore-tests/content-address\.cc'' ''^src/libstore-tests/derivation\.cc'' @@ -518,9 +518,9 @@ ''^src/libstore-tests/path\.cc'' ''^src/libstore-tests/serve-protocol\.cc'' ''^src/libstore-tests/worker-protocol\.cc'' - ''^src/libutil-test-support/tests/characterization\.hh'' - ''^src/libutil-test-support/tests/hash\.cc'' - ''^src/libutil-test-support/tests/hash\.hh'' + ''^src/libutil-test-support/include/nix/tests/characterization\.hh'' + ''^src/libutil-test-support/hash\.cc'' + ''^src/libutil-test-support/include/nix/tests/hash\.hh'' ''^src/libutil-tests/args\.cc'' ''^src/libutil-tests/canon-path\.cc'' ''^src/libutil-tests/chunked-vector\.cc'' diff --git a/nix-meson-build-support/export/meson.build b/nix-meson-build-support/export/meson.build index 9f5950572..b2409de85 100644 --- a/nix-meson-build-support/export/meson.build +++ b/nix-meson-build-support/export/meson.build @@ -16,7 +16,6 @@ import('pkgconfig').generate( filebase : meson.project_name(), name : 'Nix', description : 'Nix Package Manager', - subdirs : ['nix'], extra_cflags : ['-std=c++2a'], requires : requires_public, requires_private : requires_private, diff --git a/src/build-remote/build-remote.cc b/src/build-remote/build-remote.cc index 88b704288..56eb248a5 100644 --- a/src/build-remote/build-remote.cc +++ b/src/build-remote/build-remote.cc @@ -9,19 +9,19 @@ #include #endif -#include "machines.hh" -#include "shared.hh" -#include "plugin.hh" -#include "pathlocks.hh" -#include "globals.hh" -#include "serialise.hh" -#include "build-result.hh" -#include "store-api.hh" -#include "strings.hh" -#include "derivations.hh" -#include "local-store.hh" -#include "legacy.hh" -#include "experimental-features.hh" +#include "nix/machines.hh" +#include "nix/shared.hh" +#include "nix/plugin.hh" +#include "nix/pathlocks.hh" +#include "nix/globals.hh" +#include "nix/serialise.hh" +#include "nix/build-result.hh" +#include "nix/store-api.hh" +#include "nix/strings.hh" +#include "nix/derivations.hh" +#include "nix/local-store.hh" +#include "nix/legacy.hh" +#include "nix/experimental-features.hh" using namespace nix; using std::cin; diff --git a/src/libcmd/built-path.cc b/src/libcmd/built-path.cc index 905e70f32..21b52cea5 100644 --- a/src/libcmd/built-path.cc +++ b/src/libcmd/built-path.cc @@ -1,7 +1,7 @@ -#include "built-path.hh" -#include "derivations.hh" -#include "store-api.hh" -#include "comparator.hh" +#include "nix/built-path.hh" +#include "nix/derivations.hh" +#include "nix/store-api.hh" +#include "nix/comparator.hh" #include diff --git a/src/libcmd/command-installable-value.cc b/src/libcmd/command-installable-value.cc index 7e0c15eb8..52fa61091 100644 --- a/src/libcmd/command-installable-value.cc +++ b/src/libcmd/command-installable-value.cc @@ -1,4 +1,4 @@ -#include "command-installable-value.hh" +#include "nix/command-installable-value.hh" namespace nix { diff --git a/src/libcmd/command.cc b/src/libcmd/command.cc index 86d13fab7..efcdb799d 100644 --- a/src/libcmd/command.cc +++ b/src/libcmd/command.cc @@ -1,16 +1,16 @@ #include #include -#include "command.hh" -#include "markdown.hh" -#include "store-api.hh" -#include "local-fs-store.hh" -#include "derivations.hh" -#include "nixexpr.hh" -#include "profiles.hh" -#include "repl.hh" -#include "strings.hh" -#include "environment-variables.hh" +#include "nix/command.hh" +#include "nix/markdown.hh" +#include "nix/store-api.hh" +#include "nix/local-fs-store.hh" +#include "nix/derivations.hh" +#include "nix/nixexpr.hh" +#include "nix/profiles.hh" +#include "nix/repl.hh" +#include "nix/strings.hh" +#include "nix/environment-variables.hh" namespace nix { diff --git a/src/libcmd/common-eval-args.cc b/src/libcmd/common-eval-args.cc index 57e1774be..805701749 100644 --- a/src/libcmd/common-eval-args.cc +++ b/src/libcmd/common-eval-args.cc @@ -1,20 +1,20 @@ -#include "fetch-settings.hh" -#include "eval-settings.hh" -#include "common-eval-args.hh" -#include "shared.hh" -#include "config-global.hh" -#include "filetransfer.hh" -#include "eval.hh" -#include "fetchers.hh" -#include "registry.hh" -#include "flake/flakeref.hh" -#include "flake/settings.hh" -#include "store-api.hh" -#include "command.hh" -#include "tarball.hh" -#include "fetch-to-store.hh" -#include "compatibility-settings.hh" -#include "eval-settings.hh" +#include "nix/fetch-settings.hh" +#include "nix/eval-settings.hh" +#include "nix/common-eval-args.hh" +#include "nix/shared.hh" +#include "nix/config-global.hh" +#include "nix/filetransfer.hh" +#include "nix/eval.hh" +#include "nix/fetchers.hh" +#include "nix/registry.hh" +#include "nix/flake/flakeref.hh" +#include "nix/flake/settings.hh" +#include "nix/store-api.hh" +#include "nix/command.hh" +#include "nix/tarball.hh" +#include "nix/fetch-to-store.hh" +#include "nix/compatibility-settings.hh" +#include "nix/eval-settings.hh" namespace nix { diff --git a/src/libcmd/editor-for.cc b/src/libcmd/editor-for.cc index 6bf36bd64..b82f41d2b 100644 --- a/src/libcmd/editor-for.cc +++ b/src/libcmd/editor-for.cc @@ -1,6 +1,6 @@ -#include "editor-for.hh" -#include "environment-variables.hh" -#include "source-path.hh" +#include "nix/editor-for.hh" +#include "nix/environment-variables.hh" +#include "nix/source-path.hh" namespace nix { diff --git a/src/libcmd/built-path.hh b/src/libcmd/include/nix/built-path.hh similarity index 98% rename from src/libcmd/built-path.hh rename to src/libcmd/include/nix/built-path.hh index dc78d3e59..bd8f685e0 100644 --- a/src/libcmd/built-path.hh +++ b/src/libcmd/include/nix/built-path.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "derived-path.hh" -#include "realisation.hh" +#include "nix/derived-path.hh" +#include "nix/realisation.hh" namespace nix { diff --git a/src/libcmd/command-installable-value.hh b/src/libcmd/include/nix/command-installable-value.hh similarity index 87% rename from src/libcmd/command-installable-value.hh rename to src/libcmd/include/nix/command-installable-value.hh index 7880d4119..5ce352a63 100644 --- a/src/libcmd/command-installable-value.hh +++ b/src/libcmd/include/nix/command-installable-value.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "installable-value.hh" -#include "command.hh" +#include "nix/installable-value.hh" +#include "nix/command.hh" namespace nix { diff --git a/src/libcmd/command.hh b/src/libcmd/include/nix/command.hh similarity index 98% rename from src/libcmd/command.hh rename to src/libcmd/include/nix/command.hh index 9570ce3e7..9d3c8e343 100644 --- a/src/libcmd/command.hh +++ b/src/libcmd/include/nix/command.hh @@ -1,11 +1,11 @@ #pragma once ///@file -#include "installable-value.hh" -#include "args.hh" -#include "common-eval-args.hh" -#include "path.hh" -#include "flake/lockfile.hh" +#include "nix/installable-value.hh" +#include "nix/args.hh" +#include "nix/common-eval-args.hh" +#include "nix/path.hh" +#include "nix/flake/lockfile.hh" #include diff --git a/src/libcmd/common-eval-args.hh b/src/libcmd/include/nix/common-eval-args.hh similarity index 92% rename from src/libcmd/common-eval-args.hh rename to src/libcmd/include/nix/common-eval-args.hh index c62365b32..e72175891 100644 --- a/src/libcmd/common-eval-args.hh +++ b/src/libcmd/include/nix/common-eval-args.hh @@ -1,10 +1,10 @@ #pragma once ///@file -#include "args.hh" -#include "canon-path.hh" -#include "common-args.hh" -#include "search-path.hh" +#include "nix/args.hh" +#include "nix/canon-path.hh" +#include "nix/common-args.hh" +#include "nix/search-path.hh" #include diff --git a/src/libcmd/compatibility-settings.hh b/src/libcmd/include/nix/compatibility-settings.hh similarity index 98% rename from src/libcmd/compatibility-settings.hh rename to src/libcmd/include/nix/compatibility-settings.hh index a129a957a..18319c1f2 100644 --- a/src/libcmd/compatibility-settings.hh +++ b/src/libcmd/include/nix/compatibility-settings.hh @@ -1,5 +1,5 @@ #pragma once -#include "config.hh" +#include "nix/config.hh" namespace nix { struct CompatibilitySettings : public Config diff --git a/src/libcmd/editor-for.hh b/src/libcmd/include/nix/editor-for.hh similarity index 77% rename from src/libcmd/editor-for.hh rename to src/libcmd/include/nix/editor-for.hh index 8acd7011e..0a8aa48bc 100644 --- a/src/libcmd/editor-for.hh +++ b/src/libcmd/include/nix/editor-for.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "types.hh" -#include "source-path.hh" +#include "nix/types.hh" +#include "nix/source-path.hh" namespace nix { diff --git a/src/libcmd/installable-attr-path.hh b/src/libcmd/include/nix/installable-attr-path.hh similarity index 65% rename from src/libcmd/installable-attr-path.hh rename to src/libcmd/include/nix/installable-attr-path.hh index 86c2f8219..ceb2eca61 100644 --- a/src/libcmd/installable-attr-path.hh +++ b/src/libcmd/include/nix/installable-attr-path.hh @@ -1,22 +1,22 @@ #pragma once ///@file -#include "globals.hh" -#include "installable-value.hh" -#include "outputs-spec.hh" -#include "command.hh" -#include "attr-path.hh" -#include "common-eval-args.hh" -#include "derivations.hh" -#include "eval-inline.hh" -#include "eval.hh" -#include "get-drvs.hh" -#include "store-api.hh" -#include "shared.hh" -#include "eval-cache.hh" -#include "url.hh" -#include "registry.hh" -#include "build-result.hh" +#include "nix/globals.hh" +#include "nix/installable-value.hh" +#include "nix/outputs-spec.hh" +#include "nix/command.hh" +#include "nix/attr-path.hh" +#include "nix/common-eval-args.hh" +#include "nix/derivations.hh" +#include "nix/eval-inline.hh" +#include "nix/eval.hh" +#include "nix/get-drvs.hh" +#include "nix/store-api.hh" +#include "nix/shared.hh" +#include "nix/eval-cache.hh" +#include "nix/url.hh" +#include "nix/registry.hh" +#include "nix/build-result.hh" #include #include diff --git a/src/libcmd/installable-derived-path.hh b/src/libcmd/include/nix/installable-derived-path.hh similarity index 94% rename from src/libcmd/installable-derived-path.hh rename to src/libcmd/include/nix/installable-derived-path.hh index e0b4f18b3..8f86e6c4c 100644 --- a/src/libcmd/installable-derived-path.hh +++ b/src/libcmd/include/nix/installable-derived-path.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "installables.hh" +#include "nix/installables.hh" namespace nix { diff --git a/src/libcmd/installable-flake.hh b/src/libcmd/include/nix/installable-flake.hh similarity index 97% rename from src/libcmd/installable-flake.hh rename to src/libcmd/include/nix/installable-flake.hh index 212403dd4..5bbe4beb5 100644 --- a/src/libcmd/installable-flake.hh +++ b/src/libcmd/include/nix/installable-flake.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "common-eval-args.hh" -#include "installable-value.hh" +#include "nix/common-eval-args.hh" +#include "nix/installable-value.hh" namespace nix { diff --git a/src/libcmd/installable-value.hh b/src/libcmd/include/nix/installable-value.hh similarity index 98% rename from src/libcmd/installable-value.hh rename to src/libcmd/include/nix/installable-value.hh index 4b6dbd306..f8840103f 100644 --- a/src/libcmd/installable-value.hh +++ b/src/libcmd/include/nix/installable-value.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "installables.hh" -#include "flake/flake.hh" +#include "nix/installables.hh" +#include "nix/flake/flake.hh" namespace nix { diff --git a/src/libcmd/installables.hh b/src/libcmd/include/nix/installables.hh similarity index 96% rename from src/libcmd/installables.hh rename to src/libcmd/include/nix/installables.hh index c995c3019..2393cbcff 100644 --- a/src/libcmd/installables.hh +++ b/src/libcmd/include/nix/installables.hh @@ -1,12 +1,12 @@ #pragma once ///@file -#include "path.hh" -#include "outputs-spec.hh" -#include "derived-path.hh" -#include "built-path.hh" -#include "store-api.hh" -#include "build-result.hh" +#include "nix/path.hh" +#include "nix/outputs-spec.hh" +#include "nix/derived-path.hh" +#include "nix/built-path.hh" +#include "nix/store-api.hh" +#include "nix/build-result.hh" #include diff --git a/src/libcmd/legacy.hh b/src/libcmd/include/nix/legacy.hh similarity index 100% rename from src/libcmd/legacy.hh rename to src/libcmd/include/nix/legacy.hh diff --git a/src/libcmd/markdown.hh b/src/libcmd/include/nix/markdown.hh similarity index 100% rename from src/libcmd/markdown.hh rename to src/libcmd/include/nix/markdown.hh diff --git a/src/libcmd/include/nix/meson.build b/src/libcmd/include/nix/meson.build new file mode 100644 index 000000000..debe4a605 --- /dev/null +++ b/src/libcmd/include/nix/meson.build @@ -0,0 +1,23 @@ +# Public headers directory + +include_dirs = [include_directories('..')] + +headers = files( + 'built-path.hh', + 'command-installable-value.hh', + 'command.hh', + 'common-eval-args.hh', + 'compatibility-settings.hh', + 'editor-for.hh', + 'installable-attr-path.hh', + 'installable-derived-path.hh', + 'installable-flake.hh', + 'installable-value.hh', + 'installables.hh', + 'legacy.hh', + 'markdown.hh', + 'misc-store-flags.hh', + 'network-proxy.hh', + 'repl-interacter.hh', + 'repl.hh', +) diff --git a/src/libcmd/misc-store-flags.hh b/src/libcmd/include/nix/misc-store-flags.hh similarity index 92% rename from src/libcmd/misc-store-flags.hh rename to src/libcmd/include/nix/misc-store-flags.hh index 124372af7..b8579e90f 100644 --- a/src/libcmd/misc-store-flags.hh +++ b/src/libcmd/include/nix/misc-store-flags.hh @@ -1,5 +1,5 @@ -#include "args.hh" -#include "content-address.hh" +#include "nix/args.hh" +#include "nix/content-address.hh" namespace nix::flag { diff --git a/src/libcmd/network-proxy.hh b/src/libcmd/include/nix/network-proxy.hh similarity index 94% rename from src/libcmd/network-proxy.hh rename to src/libcmd/include/nix/network-proxy.hh index 0b6856acb..ca797f465 100644 --- a/src/libcmd/network-proxy.hh +++ b/src/libcmd/include/nix/network-proxy.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "types.hh" +#include "nix/types.hh" namespace nix { diff --git a/src/libcmd/repl-interacter.hh b/src/libcmd/include/nix/repl-interacter.hh similarity index 95% rename from src/libcmd/repl-interacter.hh rename to src/libcmd/include/nix/repl-interacter.hh index cc70efd07..463ba6818 100644 --- a/src/libcmd/repl-interacter.hh +++ b/src/libcmd/include/nix/repl-interacter.hh @@ -1,8 +1,8 @@ #pragma once /// @file -#include "finally.hh" -#include "types.hh" +#include "nix/finally.hh" +#include "nix/types.hh" #include #include diff --git a/src/libcmd/repl.hh b/src/libcmd/include/nix/repl.hh similarity index 97% rename from src/libcmd/repl.hh rename to src/libcmd/include/nix/repl.hh index 11d1820f5..b22fb9438 100644 --- a/src/libcmd/repl.hh +++ b/src/libcmd/include/nix/repl.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "eval.hh" +#include "nix/eval.hh" namespace nix { diff --git a/src/libcmd/installable-attr-path.cc b/src/libcmd/installable-attr-path.cc index 8917e7a01..dfd7bdd65 100644 --- a/src/libcmd/installable-attr-path.cc +++ b/src/libcmd/installable-attr-path.cc @@ -1,21 +1,21 @@ -#include "globals.hh" -#include "installable-attr-path.hh" -#include "outputs-spec.hh" -#include "util.hh" -#include "command.hh" -#include "attr-path.hh" -#include "common-eval-args.hh" -#include "derivations.hh" -#include "eval-inline.hh" -#include "eval.hh" -#include "get-drvs.hh" -#include "store-api.hh" -#include "shared.hh" -#include "flake/flake.hh" -#include "eval-cache.hh" -#include "url.hh" -#include "registry.hh" -#include "build-result.hh" +#include "nix/globals.hh" +#include "nix/installable-attr-path.hh" +#include "nix/outputs-spec.hh" +#include "nix/util.hh" +#include "nix/command.hh" +#include "nix/attr-path.hh" +#include "nix/common-eval-args.hh" +#include "nix/derivations.hh" +#include "nix/eval-inline.hh" +#include "nix/eval.hh" +#include "nix/get-drvs.hh" +#include "nix/store-api.hh" +#include "nix/shared.hh" +#include "nix/flake/flake.hh" +#include "nix/eval-cache.hh" +#include "nix/url.hh" +#include "nix/registry.hh" +#include "nix/build-result.hh" #include #include diff --git a/src/libcmd/installable-derived-path.cc b/src/libcmd/installable-derived-path.cc index abacd7350..2e53f6198 100644 --- a/src/libcmd/installable-derived-path.cc +++ b/src/libcmd/installable-derived-path.cc @@ -1,5 +1,5 @@ -#include "installable-derived-path.hh" -#include "derivations.hh" +#include "nix/installable-derived-path.hh" +#include "nix/derivations.hh" namespace nix { diff --git a/src/libcmd/installable-flake.cc b/src/libcmd/installable-flake.cc index 6c9ee6748..f4c272515 100644 --- a/src/libcmd/installable-flake.cc +++ b/src/libcmd/installable-flake.cc @@ -1,22 +1,22 @@ -#include "globals.hh" -#include "installable-flake.hh" -#include "installable-derived-path.hh" -#include "outputs-spec.hh" -#include "util.hh" -#include "command.hh" -#include "attr-path.hh" -#include "common-eval-args.hh" -#include "derivations.hh" -#include "eval-inline.hh" -#include "eval.hh" -#include "get-drvs.hh" -#include "store-api.hh" -#include "shared.hh" -#include "flake/flake.hh" -#include "eval-cache.hh" -#include "url.hh" -#include "registry.hh" -#include "build-result.hh" +#include "nix/globals.hh" +#include "nix/installable-flake.hh" +#include "nix/installable-derived-path.hh" +#include "nix/outputs-spec.hh" +#include "nix/util.hh" +#include "nix/command.hh" +#include "nix/attr-path.hh" +#include "nix/common-eval-args.hh" +#include "nix/derivations.hh" +#include "nix/eval-inline.hh" +#include "nix/eval.hh" +#include "nix/get-drvs.hh" +#include "nix/store-api.hh" +#include "nix/shared.hh" +#include "nix/flake/flake.hh" +#include "nix/eval-cache.hh" +#include "nix/url.hh" +#include "nix/registry.hh" +#include "nix/build-result.hh" #include #include diff --git a/src/libcmd/installable-value.cc b/src/libcmd/installable-value.cc index 1aa2e65c1..ac2da0ed2 100644 --- a/src/libcmd/installable-value.cc +++ b/src/libcmd/installable-value.cc @@ -1,6 +1,6 @@ -#include "installable-value.hh" -#include "eval-cache.hh" -#include "fetch-to-store.hh" +#include "nix/installable-value.hh" +#include "nix/eval-cache.hh" +#include "nix/fetch-to-store.hh" namespace nix { diff --git a/src/libcmd/installables.cc b/src/libcmd/installables.cc index 81eb883da..f1eaa71e9 100644 --- a/src/libcmd/installables.cc +++ b/src/libcmd/installables.cc @@ -1,33 +1,33 @@ -#include "globals.hh" -#include "installables.hh" -#include "installable-derived-path.hh" -#include "installable-attr-path.hh" -#include "installable-flake.hh" -#include "outputs-spec.hh" -#include "users.hh" -#include "util.hh" -#include "command.hh" -#include "attr-path.hh" -#include "common-eval-args.hh" -#include "derivations.hh" -#include "eval-inline.hh" -#include "eval.hh" -#include "eval-settings.hh" -#include "get-drvs.hh" -#include "store-api.hh" -#include "shared.hh" -#include "flake/flake.hh" -#include "eval-cache.hh" -#include "url.hh" -#include "registry.hh" -#include "build-result.hh" +#include "nix/globals.hh" +#include "nix/installables.hh" +#include "nix/installable-derived-path.hh" +#include "nix/installable-attr-path.hh" +#include "nix/installable-flake.hh" +#include "nix/outputs-spec.hh" +#include "nix/users.hh" +#include "nix/util.hh" +#include "nix/command.hh" +#include "nix/attr-path.hh" +#include "nix/common-eval-args.hh" +#include "nix/derivations.hh" +#include "nix/eval-inline.hh" +#include "nix/eval.hh" +#include "nix/eval-settings.hh" +#include "nix/get-drvs.hh" +#include "nix/store-api.hh" +#include "nix/shared.hh" +#include "nix/flake/flake.hh" +#include "nix/eval-cache.hh" +#include "nix/url.hh" +#include "nix/registry.hh" +#include "nix/build-result.hh" #include #include #include -#include "strings-inline.hh" +#include "nix/strings-inline.hh" namespace nix { diff --git a/src/libcmd/legacy.cc b/src/libcmd/legacy.cc index 6df09ee37..25da75d3f 100644 --- a/src/libcmd/legacy.cc +++ b/src/libcmd/legacy.cc @@ -1,4 +1,4 @@ -#include "legacy.hh" +#include "nix/legacy.hh" namespace nix { diff --git a/src/libcmd/markdown.cc b/src/libcmd/markdown.cc index faf4c6610..5670b590b 100644 --- a/src/libcmd/markdown.cc +++ b/src/libcmd/markdown.cc @@ -1,8 +1,8 @@ -#include "markdown.hh" -#include "environment-variables.hh" -#include "error.hh" -#include "finally.hh" -#include "terminal.hh" +#include "nix/markdown.hh" +#include "nix/environment-variables.hh" +#include "nix/error.hh" +#include "nix/finally.hh" +#include "nix/terminal.hh" #include "cmd-config-private.hh" diff --git a/src/libcmd/meson.build b/src/libcmd/meson.build index 70d3b95da..727f4e14d 100644 --- a/src/libcmd/meson.build +++ b/src/libcmd/meson.build @@ -61,9 +61,9 @@ config_h = configure_file( add_project_arguments( # TODO(Qyriad): Yes this is how the autoconf+Make system did it. # It would be nice for our headers to be idempotent instead. - '-include', 'config-util.hh', - '-include', 'config-store.hh', - '-include', 'config-expr.hh', + '-include', 'nix/config-util.hh', + '-include', 'nix/config-store.hh', + '-include', 'nix/config-expr.hh', language : 'cpp', ) @@ -88,27 +88,7 @@ sources = files( 'repl.cc', ) -include_dirs = [include_directories('.')] - -headers = files( - 'built-path.hh', - 'command-installable-value.hh', - 'command.hh', - 'common-eval-args.hh', - 'compatibility-settings.hh', - 'editor-for.hh', - 'installable-attr-path.hh', - 'installable-derived-path.hh', - 'installable-flake.hh', - 'installable-value.hh', - 'installables.hh', - 'legacy.hh', - 'markdown.hh', - 'misc-store-flags.hh', - 'network-proxy.hh', - 'repl-interacter.hh', - 'repl.hh', -) +subdir('include/nix') subdir('nix-meson-build-support/export-all-symbols') subdir('nix-meson-build-support/windows-version') diff --git a/src/libcmd/misc-store-flags.cc b/src/libcmd/misc-store-flags.cc index 4e29e8981..70933648f 100644 --- a/src/libcmd/misc-store-flags.cc +++ b/src/libcmd/misc-store-flags.cc @@ -1,4 +1,4 @@ -#include "misc-store-flags.hh" +#include "nix/misc-store-flags.hh" namespace nix::flag { diff --git a/src/libcmd/network-proxy.cc b/src/libcmd/network-proxy.cc index 738bf6147..31e9eb8dd 100644 --- a/src/libcmd/network-proxy.cc +++ b/src/libcmd/network-proxy.cc @@ -1,8 +1,8 @@ -#include "network-proxy.hh" +#include "nix/network-proxy.hh" #include -#include "environment-variables.hh" +#include "nix/environment-variables.hh" namespace nix { diff --git a/src/libcmd/package.nix b/src/libcmd/package.nix index d459d1c20..5cfe550a3 100644 --- a/src/libcmd/package.nix +++ b/src/libcmd/package.nix @@ -46,6 +46,7 @@ mkMesonLibrary (finalAttrs: { ./.version ./meson.build ./meson.options + ./include/nix/meson.build (fileset.fileFilter (file: file.hasExt "cc") ./.) (fileset.fileFilter (file: file.hasExt "hh") ./.) ]; diff --git a/src/libcmd/repl-interacter.cc b/src/libcmd/repl-interacter.cc index d8c8dd99d..773e111b2 100644 --- a/src/libcmd/repl-interacter.cc +++ b/src/libcmd/repl-interacter.cc @@ -16,12 +16,12 @@ extern "C" { } #endif -#include "signals.hh" -#include "finally.hh" -#include "repl-interacter.hh" -#include "file-system.hh" -#include "repl.hh" -#include "environment-variables.hh" +#include "nix/signals.hh" +#include "nix/finally.hh" +#include "nix/repl-interacter.hh" +#include "nix/file-system.hh" +#include "nix/repl.hh" +#include "nix/environment-variables.hh" namespace nix { diff --git a/src/libcmd/repl.cc b/src/libcmd/repl.cc index 38b219643..8bd5417d7 100644 --- a/src/libcmd/repl.cc +++ b/src/libcmd/repl.cc @@ -2,34 +2,34 @@ #include #include -#include "error.hh" -#include "repl-interacter.hh" -#include "repl.hh" +#include "nix/error.hh" +#include "nix/repl-interacter.hh" +#include "nix/repl.hh" -#include "ansicolor.hh" -#include "shared.hh" -#include "eval.hh" -#include "eval-settings.hh" -#include "attr-path.hh" -#include "signals.hh" -#include "store-api.hh" -#include "log-store.hh" -#include "common-eval-args.hh" -#include "get-drvs.hh" -#include "derivations.hh" -#include "globals.hh" -#include "flake/flake.hh" -#include "flake/lockfile.hh" -#include "users.hh" -#include "editor-for.hh" -#include "finally.hh" -#include "markdown.hh" -#include "local-fs-store.hh" -#include "print.hh" -#include "ref.hh" -#include "value.hh" +#include "nix/ansicolor.hh" +#include "nix/shared.hh" +#include "nix/eval.hh" +#include "nix/eval-settings.hh" +#include "nix/attr-path.hh" +#include "nix/signals.hh" +#include "nix/store-api.hh" +#include "nix/log-store.hh" +#include "nix/common-eval-args.hh" +#include "nix/get-drvs.hh" +#include "nix/derivations.hh" +#include "nix/globals.hh" +#include "nix/flake/flake.hh" +#include "nix/flake/lockfile.hh" +#include "nix/users.hh" +#include "nix/editor-for.hh" +#include "nix/finally.hh" +#include "nix/markdown.hh" +#include "nix/local-fs-store.hh" +#include "nix/print.hh" +#include "nix/ref.hh" +#include "nix/value.hh" -#include "strings.hh" +#include "nix/strings.hh" namespace nix { diff --git a/src/libexpr-c/meson.build b/src/libexpr-c/meson.build index 8405525ca..8b00b8d70 100644 --- a/src/libexpr-c/meson.build +++ b/src/libexpr-c/meson.build @@ -30,9 +30,9 @@ add_project_arguments( # It would be nice for our headers to be idempotent instead. # From C++ libraries, only for internals - '-include', 'config-util.hh', - '-include', 'config-store.hh', - '-include', 'config-expr.hh', + '-include', 'nix/config-util.hh', + '-include', 'nix/config-store.hh', + '-include', 'nix/config-expr.hh', language : 'cpp', ) @@ -69,7 +69,7 @@ this_library = library( install : true, ) -install_headers(headers, subdir : 'nix', preserve_path : true) +install_headers(headers, preserve_path : true) libraries_private = [] diff --git a/src/libexpr-c/nix_api_expr.cc b/src/libexpr-c/nix_api_expr.cc index a024248cd..b5d2c6199 100644 --- a/src/libexpr-c/nix_api_expr.cc +++ b/src/libexpr-c/nix_api_expr.cc @@ -2,11 +2,11 @@ #include #include -#include "eval.hh" -#include "eval-gc.hh" -#include "globals.hh" -#include "eval-settings.hh" -#include "ref.hh" +#include "nix/eval.hh" +#include "nix/eval-gc.hh" +#include "nix/globals.hh" +#include "nix/eval-settings.hh" +#include "nix/ref.hh" #include "nix_api_expr.h" #include "nix_api_expr_internal.h" diff --git a/src/libexpr-c/nix_api_expr_internal.h b/src/libexpr-c/nix_api_expr_internal.h index f59664011..205a2ee62 100644 --- a/src/libexpr-c/nix_api_expr_internal.h +++ b/src/libexpr-c/nix_api_expr_internal.h @@ -1,12 +1,12 @@ #ifndef NIX_API_EXPR_INTERNAL_H #define NIX_API_EXPR_INTERNAL_H -#include "fetch-settings.hh" -#include "eval.hh" -#include "eval-settings.hh" -#include "attr-set.hh" +#include "nix/fetch-settings.hh" +#include "nix/eval.hh" +#include "nix/eval-settings.hh" +#include "nix/attr-set.hh" #include "nix_api_value.h" -#include "search-path.hh" +#include "nix/search-path.hh" struct nix_eval_state_builder { diff --git a/src/libexpr-c/nix_api_external.cc b/src/libexpr-c/nix_api_external.cc index d673bcb0b..7f4cd6a8c 100644 --- a/src/libexpr-c/nix_api_external.cc +++ b/src/libexpr-c/nix_api_external.cc @@ -1,8 +1,8 @@ -#include "attr-set.hh" -#include "config.hh" -#include "eval.hh" -#include "globals.hh" -#include "value.hh" +#include "nix/attr-set.hh" +#include "nix/config.hh" +#include "nix/eval.hh" +#include "nix/globals.hh" +#include "nix/value.hh" #include "nix_api_expr.h" #include "nix_api_expr_internal.h" @@ -10,7 +10,7 @@ #include "nix_api_util.h" #include "nix_api_util_internal.h" #include "nix_api_value.h" -#include "value/context.hh" +#include "nix/value/context.hh" #include diff --git a/src/libexpr-c/nix_api_external.h b/src/libexpr-c/nix_api_external.h index 6c524b975..f4a327281 100644 --- a/src/libexpr-c/nix_api_external.h +++ b/src/libexpr-c/nix_api_external.h @@ -12,9 +12,10 @@ #include "nix_api_expr.h" #include "nix_api_util.h" #include "nix_api_value.h" -#include "stdbool.h" -#include "stddef.h" -#include "stdint.h" + +#include +#include +#include #ifdef __cplusplus extern "C" { diff --git a/src/libexpr-c/nix_api_value.cc b/src/libexpr-c/nix_api_value.cc index 448f4a58a..3116cb59f 100644 --- a/src/libexpr-c/nix_api_value.cc +++ b/src/libexpr-c/nix_api_value.cc @@ -1,10 +1,10 @@ -#include "attr-set.hh" -#include "config.hh" -#include "eval.hh" -#include "globals.hh" -#include "path.hh" -#include "primops.hh" -#include "value.hh" +#include "nix/attr-set.hh" +#include "nix/config.hh" +#include "nix/eval.hh" +#include "nix/globals.hh" +#include "nix/path.hh" +#include "nix/primops.hh" +#include "nix/value.hh" #include "nix_api_expr.h" #include "nix_api_expr_internal.h" @@ -12,7 +12,7 @@ #include "nix_api_util_internal.h" #include "nix_api_store_internal.h" #include "nix_api_value.h" -#include "value/context.hh" +#include "nix/value/context.hh" // Internal helper functions to check [in] and [out] `Value *` parameters static const nix::Value & check_value_not_null(const nix_value * value) diff --git a/src/libexpr-c/nix_api_value.h b/src/libexpr-c/nix_api_value.h index 711b0adbc..7cd6ad180 100644 --- a/src/libexpr-c/nix_api_value.h +++ b/src/libexpr-c/nix_api_value.h @@ -10,9 +10,10 @@ #include "nix_api_util.h" #include "nix_api_store.h" -#include "stdbool.h" -#include "stddef.h" -#include "stdint.h" + +#include +#include +#include #ifdef __cplusplus extern "C" { diff --git a/src/libexpr-test-support/include/nix/meson.build b/src/libexpr-test-support/include/nix/meson.build new file mode 100644 index 000000000..9e517c7f6 --- /dev/null +++ b/src/libexpr-test-support/include/nix/meson.build @@ -0,0 +1,9 @@ +# Public headers directory + +include_dirs = [include_directories('..')] + +headers = files( + 'tests/libexpr.hh', + 'tests/nix_api_expr.hh', + 'tests/value/context.hh', +) diff --git a/src/libexpr-test-support/tests/libexpr.hh b/src/libexpr-test-support/include/nix/tests/libexpr.hh similarity index 94% rename from src/libexpr-test-support/tests/libexpr.hh rename to src/libexpr-test-support/include/nix/tests/libexpr.hh index 095ea1d0e..dfd5fbd3d 100644 --- a/src/libexpr-test-support/tests/libexpr.hh +++ b/src/libexpr-test-support/include/nix/tests/libexpr.hh @@ -4,16 +4,16 @@ #include #include -#include "fetch-settings.hh" -#include "value.hh" -#include "nixexpr.hh" -#include "nixexpr.hh" -#include "eval.hh" -#include "eval-gc.hh" -#include "eval-inline.hh" -#include "eval-settings.hh" +#include "nix/fetch-settings.hh" +#include "nix/value.hh" +#include "nix/nixexpr.hh" +#include "nix/nixexpr.hh" +#include "nix/eval.hh" +#include "nix/eval-gc.hh" +#include "nix/eval-inline.hh" +#include "nix/eval-settings.hh" -#include "tests/libstore.hh" +#include "nix/tests/libstore.hh" namespace nix { class LibExprTest : public LibStoreTest { diff --git a/src/libexpr-test-support/tests/nix_api_expr.hh b/src/libexpr-test-support/include/nix/tests/nix_api_expr.hh similarity index 93% rename from src/libexpr-test-support/tests/nix_api_expr.hh rename to src/libexpr-test-support/include/nix/tests/nix_api_expr.hh index 6ddca0d14..e5960b177 100644 --- a/src/libexpr-test-support/tests/nix_api_expr.hh +++ b/src/libexpr-test-support/include/nix/tests/nix_api_expr.hh @@ -2,7 +2,7 @@ ///@file #include "nix_api_expr.h" #include "nix_api_value.h" -#include "tests/nix_api_store.hh" +#include "nix/tests/nix_api_store.hh" #include diff --git a/src/libexpr-test-support/tests/value/context.hh b/src/libexpr-test-support/include/nix/tests/value/context.hh similarity index 94% rename from src/libexpr-test-support/tests/value/context.hh rename to src/libexpr-test-support/include/nix/tests/value/context.hh index 8c68c78bb..d98e72242 100644 --- a/src/libexpr-test-support/tests/value/context.hh +++ b/src/libexpr-test-support/include/nix/tests/value/context.hh @@ -3,7 +3,7 @@ #include -#include "value/context.hh" +#include "nix/value/context.hh" namespace rc { using namespace nix; diff --git a/src/libexpr-test-support/meson.build b/src/libexpr-test-support/meson.build index 56e814cd1..b68adb2c2 100644 --- a/src/libexpr-test-support/meson.build +++ b/src/libexpr-test-support/meson.build @@ -32,9 +32,9 @@ deps_public += rapidcheck add_project_arguments( # TODO(Qyriad): Yes this is how the autoconf+Make system did it. # It would be nice for our headers to be idempotent instead. - '-include', 'config-util.hh', - '-include', 'config-store.hh', - '-include', 'config-expr.hh', + '-include', 'nix/config-util.hh', + '-include', 'nix/config-store.hh', + '-include', 'nix/config-expr.hh', language : 'cpp', ) @@ -44,13 +44,7 @@ sources = files( 'tests/value/context.cc', ) -include_dirs = [include_directories('.')] - -headers = files( - 'tests/libexpr.hh', - 'tests/nix_api_expr.hh', - 'tests/value/context.hh', -) +subdir('include/nix') subdir('nix-meson-build-support/export-all-symbols') subdir('nix-meson-build-support/windows-version') diff --git a/src/libexpr-test-support/package.nix b/src/libexpr-test-support/package.nix index 44b0ff386..5d4af1088 100644 --- a/src/libexpr-test-support/package.nix +++ b/src/libexpr-test-support/package.nix @@ -29,6 +29,7 @@ mkMesonLibrary (finalAttrs: { ./.version ./meson.build # ./meson.options + ./include/nix/meson.build (fileset.fileFilter (file: file.hasExt "cc") ./.) (fileset.fileFilter (file: file.hasExt "hh") ./.) ]; diff --git a/src/libexpr-test-support/tests/value/context.cc b/src/libexpr-test-support/tests/value/context.cc index 36837cd6a..7b2d60269 100644 --- a/src/libexpr-test-support/tests/value/context.cc +++ b/src/libexpr-test-support/tests/value/context.cc @@ -1,7 +1,7 @@ #include -#include "tests/path.hh" -#include "tests/value/context.hh" +#include "nix/tests/path.hh" +#include "nix/tests/value/context.hh" namespace rc { using namespace nix; diff --git a/src/libexpr-tests/derived-path.cc b/src/libexpr-tests/derived-path.cc index 634f9bf69..1e427ffa5 100644 --- a/src/libexpr-tests/derived-path.cc +++ b/src/libexpr-tests/derived-path.cc @@ -2,8 +2,8 @@ #include #include -#include "tests/derived-path.hh" -#include "tests/libexpr.hh" +#include "nix/tests/derived-path.hh" +#include "nix/tests/libexpr.hh" namespace nix { diff --git a/src/libexpr-tests/error_traces.cc b/src/libexpr-tests/error_traces.cc index 53013a34a..abba15db8 100644 --- a/src/libexpr-tests/error_traces.cc +++ b/src/libexpr-tests/error_traces.cc @@ -1,7 +1,7 @@ #include #include -#include "tests/libexpr.hh" +#include "nix/tests/libexpr.hh" namespace nix { diff --git a/src/libexpr-tests/eval.cc b/src/libexpr-tests/eval.cc index 61f6be0db..3bc672746 100644 --- a/src/libexpr-tests/eval.cc +++ b/src/libexpr-tests/eval.cc @@ -1,8 +1,8 @@ #include #include -#include "eval.hh" -#include "tests/libexpr.hh" +#include "nix/eval.hh" +#include "nix/tests/libexpr.hh" namespace nix { diff --git a/src/libexpr-tests/json.cc b/src/libexpr-tests/json.cc index f4cc118d6..67fdcf209 100644 --- a/src/libexpr-tests/json.cc +++ b/src/libexpr-tests/json.cc @@ -1,5 +1,5 @@ -#include "tests/libexpr.hh" -#include "value-to-json.hh" +#include "nix/tests/libexpr.hh" +#include "nix/value-to-json.hh" namespace nix { // Testing the conversion to JSON diff --git a/src/libexpr-tests/main.cc b/src/libexpr-tests/main.cc index e3412d9ef..719b5a727 100644 --- a/src/libexpr-tests/main.cc +++ b/src/libexpr-tests/main.cc @@ -1,7 +1,7 @@ #include #include -#include "globals.hh" -#include "logging.hh" +#include "nix/globals.hh" +#include "nix/logging.hh" using namespace nix; diff --git a/src/libexpr-tests/meson.build b/src/libexpr-tests/meson.build index 9f6edb9b3..3fc726cb2 100644 --- a/src/libexpr-tests/meson.build +++ b/src/libexpr-tests/meson.build @@ -38,9 +38,9 @@ deps_private += gtest add_project_arguments( # TODO(Qyriad): Yes this is how the autoconf+Make system did it. # It would be nice for our headers to be idempotent instead. - '-include', 'config-util.hh', - '-include', 'config-store.hh', - '-include', 'config-expr.hh', + '-include', 'nix/config-util.hh', + '-include', 'nix/config-store.hh', + '-include', 'nix/config-expr.hh', language : 'cpp', ) diff --git a/src/libexpr-tests/nix_api_expr.cc b/src/libexpr-tests/nix_api_expr.cc index 633224ae6..903c7a239 100644 --- a/src/libexpr-tests/nix_api_expr.cc +++ b/src/libexpr-tests/nix_api_expr.cc @@ -5,9 +5,9 @@ #include "nix_api_expr.h" #include "nix_api_value.h" -#include "tests/nix_api_expr.hh" -#include "tests/string_callback.hh" -#include "file-system.hh" +#include "nix/tests/nix_api_expr.hh" +#include "nix/tests/string_callback.hh" +#include "nix/file-system.hh" #include #include diff --git a/src/libexpr-tests/nix_api_external.cc b/src/libexpr-tests/nix_api_external.cc index 81ff285a4..f3f4771c7 100644 --- a/src/libexpr-tests/nix_api_external.cc +++ b/src/libexpr-tests/nix_api_external.cc @@ -7,8 +7,8 @@ #include "nix_api_value.h" #include "nix_api_external.h" -#include "tests/nix_api_expr.hh" -#include "tests/string_callback.hh" +#include "nix/tests/nix_api_expr.hh" +#include "nix/tests/string_callback.hh" #include diff --git a/src/libexpr-tests/nix_api_value.cc b/src/libexpr-tests/nix_api_value.cc index 7fc8b4f64..0f86ba650 100644 --- a/src/libexpr-tests/nix_api_value.cc +++ b/src/libexpr-tests/nix_api_value.cc @@ -6,10 +6,10 @@ #include "nix_api_value.h" #include "nix_api_expr_internal.h" -#include "tests/nix_api_expr.hh" -#include "tests/string_callback.hh" +#include "nix/tests/nix_api_expr.hh" +#include "nix/tests/string_callback.hh" -#include "gmock/gmock.h" +#include #include #include #include diff --git a/src/libexpr-tests/primops.cc b/src/libexpr-tests/primops.cc index 2bf726477..4114f08f6 100644 --- a/src/libexpr-tests/primops.cc +++ b/src/libexpr-tests/primops.cc @@ -1,10 +1,10 @@ #include #include -#include "eval-settings.hh" -#include "memory-source-accessor.hh" +#include "nix/eval-settings.hh" +#include "nix/memory-source-accessor.hh" -#include "tests/libexpr.hh" +#include "nix/tests/libexpr.hh" namespace nix { class CaptureLogger : public Logger diff --git a/src/libexpr-tests/search-path.cc b/src/libexpr-tests/search-path.cc index 080679355..72f233597 100644 --- a/src/libexpr-tests/search-path.cc +++ b/src/libexpr-tests/search-path.cc @@ -1,7 +1,7 @@ #include #include -#include "search-path.hh" +#include "nix/search-path.hh" namespace nix { diff --git a/src/libexpr-tests/trivial.cc b/src/libexpr-tests/trivial.cc index d77b4d53b..4ddd24d12 100644 --- a/src/libexpr-tests/trivial.cc +++ b/src/libexpr-tests/trivial.cc @@ -1,4 +1,4 @@ -#include "tests/libexpr.hh" +#include "nix/tests/libexpr.hh" namespace nix { // Testing of trivial expressions diff --git a/src/libexpr-tests/value/context.cc b/src/libexpr-tests/value/context.cc index c8d62772f..bf3b501f4 100644 --- a/src/libexpr-tests/value/context.cc +++ b/src/libexpr-tests/value/context.cc @@ -2,9 +2,9 @@ #include #include -#include "tests/path.hh" -#include "tests/libexpr.hh" -#include "tests/value/context.hh" +#include "nix/tests/path.hh" +#include "nix/tests/libexpr.hh" +#include "nix/tests/value/context.hh" namespace nix { diff --git a/src/libexpr-tests/value/print.cc b/src/libexpr-tests/value/print.cc index 43b545035..8590f9aac 100644 --- a/src/libexpr-tests/value/print.cc +++ b/src/libexpr-tests/value/print.cc @@ -1,7 +1,7 @@ -#include "tests/libexpr.hh" +#include "nix/tests/libexpr.hh" -#include "value.hh" -#include "print.hh" +#include "nix/value.hh" +#include "nix/print.hh" namespace nix { diff --git a/src/libexpr-tests/value/value.cc b/src/libexpr-tests/value/value.cc index 5762d5891..9f91f8ff5 100644 --- a/src/libexpr-tests/value/value.cc +++ b/src/libexpr-tests/value/value.cc @@ -1,6 +1,6 @@ -#include "value.hh" +#include "nix/value.hh" -#include "tests/libstore.hh" +#include "nix/tests/libstore.hh" namespace nix { diff --git a/src/libexpr/attr-path.cc b/src/libexpr/attr-path.cc index 822ec7620..8dde64790 100644 --- a/src/libexpr/attr-path.cc +++ b/src/libexpr/attr-path.cc @@ -1,5 +1,5 @@ -#include "attr-path.hh" -#include "eval-inline.hh" +#include "nix/attr-path.hh" +#include "nix/eval-inline.hh" namespace nix { diff --git a/src/libexpr/attr-set.cc b/src/libexpr/attr-set.cc index 866ef817a..c6fc9f32a 100644 --- a/src/libexpr/attr-set.cc +++ b/src/libexpr/attr-set.cc @@ -1,5 +1,5 @@ -#include "attr-set.hh" -#include "eval-inline.hh" +#include "nix/attr-set.hh" +#include "nix/eval-inline.hh" #include diff --git a/src/libexpr/eval-cache.cc b/src/libexpr/eval-cache.cc index ea3319f99..f35c332c9 100644 --- a/src/libexpr/eval-cache.cc +++ b/src/libexpr/eval-cache.cc @@ -1,11 +1,11 @@ -#include "users.hh" -#include "eval-cache.hh" -#include "sqlite.hh" -#include "eval.hh" -#include "eval-inline.hh" -#include "store-api.hh" +#include "nix/users.hh" +#include "nix/eval-cache.hh" +#include "nix/sqlite.hh" +#include "nix/eval.hh" +#include "nix/eval-inline.hh" +#include "nix/store-api.hh" // Need specialization involving `SymbolStr` just in this one module. -#include "strings-inline.hh" +#include "nix/strings-inline.hh" namespace nix::eval_cache { diff --git a/src/libexpr/eval-error.cc b/src/libexpr/eval-error.cc index b9742d3ea..f983107a3 100644 --- a/src/libexpr/eval-error.cc +++ b/src/libexpr/eval-error.cc @@ -1,6 +1,6 @@ -#include "eval-error.hh" -#include "eval.hh" -#include "value.hh" +#include "nix/eval-error.hh" +#include "nix/eval.hh" +#include "nix/value.hh" namespace nix { diff --git a/src/libexpr/eval-gc.cc b/src/libexpr/eval-gc.cc index 07ce05a2c..defa4e9d2 100644 --- a/src/libexpr/eval-gc.cc +++ b/src/libexpr/eval-gc.cc @@ -1,9 +1,9 @@ -#include "error.hh" -#include "environment-variables.hh" -#include "eval-settings.hh" -#include "config-global.hh" -#include "serialise.hh" -#include "eval-gc.hh" +#include "nix/error.hh" +#include "nix/environment-variables.hh" +#include "nix/eval-settings.hh" +#include "nix/config-global.hh" +#include "nix/serialise.hh" +#include "nix/eval-gc.hh" #if HAVE_BOEHMGC diff --git a/src/libexpr/eval-settings.cc b/src/libexpr/eval-settings.cc index b54afdce1..458507db8 100644 --- a/src/libexpr/eval-settings.cc +++ b/src/libexpr/eval-settings.cc @@ -1,8 +1,8 @@ -#include "users.hh" -#include "globals.hh" -#include "profiles.hh" -#include "eval.hh" -#include "eval-settings.hh" +#include "nix/users.hh" +#include "nix/globals.hh" +#include "nix/profiles.hh" +#include "nix/eval.hh" +#include "nix/eval-settings.hh" namespace nix { diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index 2dcee49d9..f534cc494 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -1,24 +1,25 @@ -#include "eval.hh" -#include "eval-settings.hh" -#include "primops.hh" -#include "print-options.hh" -#include "exit.hh" -#include "types.hh" -#include "util.hh" -#include "store-api.hh" -#include "derivations.hh" -#include "downstream-placeholder.hh" -#include "eval-inline.hh" -#include "filetransfer.hh" -#include "function-trace.hh" -#include "profiles.hh" -#include "print.hh" -#include "filtering-source-accessor.hh" -#include "memory-source-accessor.hh" -#include "gc-small-vector.hh" -#include "url.hh" -#include "fetch-to-store.hh" -#include "tarball.hh" +#include "nix/eval.hh" +#include "nix/eval-settings.hh" +#include "nix/primops.hh" +#include "nix/print-options.hh" +#include "nix/exit.hh" +#include "nix/types.hh" +#include "nix/util.hh" +#include "nix/store-api.hh" +#include "nix/derivations.hh" +#include "nix/downstream-placeholder.hh" +#include "nix/eval-inline.hh" +#include "nix/filetransfer.hh" +#include "nix/function-trace.hh" +#include "nix/profiles.hh" +#include "nix/print.hh" +#include "nix/filtering-source-accessor.hh" +#include "nix/memory-source-accessor.hh" +#include "nix/gc-small-vector.hh" +#include "nix/url.hh" +#include "nix/fetch-to-store.hh" +#include "nix/tarball.hh" + #include "parser-tab.hh" #include @@ -38,7 +39,7 @@ # include #endif -#include "strings-inline.hh" +#include "nix/strings-inline.hh" using json = nlohmann::json; diff --git a/src/libexpr/function-trace.cc b/src/libexpr/function-trace.cc index c6057b384..9c6e54e4b 100644 --- a/src/libexpr/function-trace.cc +++ b/src/libexpr/function-trace.cc @@ -1,5 +1,5 @@ -#include "function-trace.hh" -#include "logging.hh" +#include "nix/function-trace.hh" +#include "nix/logging.hh" namespace nix { diff --git a/src/libexpr/get-drvs.cc b/src/libexpr/get-drvs.cc index 1ac13fcd2..61b44aa17 100644 --- a/src/libexpr/get-drvs.cc +++ b/src/libexpr/get-drvs.cc @@ -1,8 +1,8 @@ -#include "get-drvs.hh" -#include "eval-inline.hh" -#include "derivations.hh" -#include "store-api.hh" -#include "path-with-outputs.hh" +#include "nix/get-drvs.hh" +#include "nix/eval-inline.hh" +#include "nix/derivations.hh" +#include "nix/store-api.hh" +#include "nix/path-with-outputs.hh" #include #include diff --git a/src/libexpr/attr-path.hh b/src/libexpr/include/nix/attr-path.hh similarity index 95% rename from src/libexpr/attr-path.hh rename to src/libexpr/include/nix/attr-path.hh index eb00ffb93..06d00efc2 100644 --- a/src/libexpr/attr-path.hh +++ b/src/libexpr/include/nix/attr-path.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "eval.hh" +#include "nix/eval.hh" #include #include diff --git a/src/libexpr/attr-set.hh b/src/libexpr/include/nix/attr-set.hh similarity index 98% rename from src/libexpr/attr-set.hh rename to src/libexpr/include/nix/attr-set.hh index 4df9a1acd..93360e4e3 100644 --- a/src/libexpr/attr-set.hh +++ b/src/libexpr/include/nix/attr-set.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "nixexpr.hh" -#include "symbol-table.hh" +#include "nix/nixexpr.hh" +#include "nix/symbol-table.hh" #include diff --git a/src/libexpr/eval-cache.hh b/src/libexpr/include/nix/eval-cache.hh similarity index 97% rename from src/libexpr/eval-cache.hh rename to src/libexpr/include/nix/eval-cache.hh index b1911e3a4..899ae715b 100644 --- a/src/libexpr/eval-cache.hh +++ b/src/libexpr/include/nix/eval-cache.hh @@ -1,9 +1,9 @@ #pragma once ///@file -#include "sync.hh" -#include "hash.hh" -#include "eval.hh" +#include "nix/sync.hh" +#include "nix/hash.hh" +#include "nix/eval.hh" #include #include diff --git a/src/libexpr/eval-error.hh b/src/libexpr/include/nix/eval-error.hh similarity index 98% rename from src/libexpr/eval-error.hh rename to src/libexpr/include/nix/eval-error.hh index ed004eb53..3dee88fa4 100644 --- a/src/libexpr/eval-error.hh +++ b/src/libexpr/include/nix/eval-error.hh @@ -1,7 +1,7 @@ #pragma once -#include "error.hh" -#include "pos-idx.hh" +#include "nix/error.hh" +#include "nix/pos-idx.hh" namespace nix { diff --git a/src/libexpr/eval-gc.hh b/src/libexpr/include/nix/eval-gc.hh similarity index 100% rename from src/libexpr/eval-gc.hh rename to src/libexpr/include/nix/eval-gc.hh diff --git a/src/libexpr/eval-inline.hh b/src/libexpr/include/nix/eval-inline.hh similarity index 97% rename from src/libexpr/eval-inline.hh rename to src/libexpr/include/nix/eval-inline.hh index 5d1a0c4d6..c00b06006 100644 --- a/src/libexpr/eval-inline.hh +++ b/src/libexpr/include/nix/eval-inline.hh @@ -1,10 +1,10 @@ #pragma once ///@file -#include "print.hh" -#include "eval.hh" -#include "eval-error.hh" -#include "eval-settings.hh" +#include "nix/print.hh" +#include "nix/eval.hh" +#include "nix/eval-error.hh" +#include "nix/eval-settings.hh" namespace nix { diff --git a/src/libexpr/eval-settings.hh b/src/libexpr/include/nix/eval-settings.hh similarity index 99% rename from src/libexpr/eval-settings.hh rename to src/libexpr/include/nix/eval-settings.hh index d16fd4035..48d8a544b 100644 --- a/src/libexpr/eval-settings.hh +++ b/src/libexpr/include/nix/eval-settings.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "config.hh" -#include "source-path.hh" +#include "nix/config.hh" +#include "nix/source-path.hh" namespace nix { diff --git a/src/libexpr/eval.hh b/src/libexpr/include/nix/eval.hh similarity index 98% rename from src/libexpr/eval.hh rename to src/libexpr/include/nix/eval.hh index 8bb8bbd32..42091b9ba 100644 --- a/src/libexpr/eval.hh +++ b/src/libexpr/include/nix/eval.hh @@ -1,20 +1,20 @@ #pragma once ///@file -#include "attr-set.hh" -#include "eval-error.hh" -#include "types.hh" -#include "value.hh" -#include "nixexpr.hh" -#include "symbol-table.hh" -#include "config.hh" -#include "experimental-features.hh" -#include "position.hh" -#include "pos-table.hh" -#include "source-accessor.hh" -#include "search-path.hh" -#include "repl-exit-status.hh" -#include "ref.hh" +#include "nix/attr-set.hh" +#include "nix/eval-error.hh" +#include "nix/types.hh" +#include "nix/value.hh" +#include "nix/nixexpr.hh" +#include "nix/symbol-table.hh" +#include "nix/config.hh" +#include "nix/experimental-features.hh" +#include "nix/position.hh" +#include "nix/pos-table.hh" +#include "nix/source-accessor.hh" +#include "nix/search-path.hh" +#include "nix/repl-exit-status.hh" +#include "nix/ref.hh" #include #include @@ -944,4 +944,4 @@ bool isAllowedURI(std::string_view uri, const Strings & allowedPaths); } -#include "eval-inline.hh" +#include "nix/eval-inline.hh" diff --git a/src/libexpr/function-trace.hh b/src/libexpr/include/nix/function-trace.hh similarity index 88% rename from src/libexpr/function-trace.hh rename to src/libexpr/include/nix/function-trace.hh index 91439b0aa..59743fe79 100644 --- a/src/libexpr/function-trace.hh +++ b/src/libexpr/include/nix/function-trace.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "eval.hh" +#include "nix/eval.hh" #include diff --git a/src/libexpr/gc-small-vector.hh b/src/libexpr/include/nix/gc-small-vector.hh similarity index 96% rename from src/libexpr/gc-small-vector.hh rename to src/libexpr/include/nix/gc-small-vector.hh index 8330dd2dc..2becffe7c 100644 --- a/src/libexpr/gc-small-vector.hh +++ b/src/libexpr/include/nix/gc-small-vector.hh @@ -2,7 +2,7 @@ #include -#include "value.hh" +#include "nix/value.hh" namespace nix { diff --git a/src/libexpr/get-drvs.hh b/src/libexpr/include/nix/get-drvs.hh similarity index 98% rename from src/libexpr/get-drvs.hh rename to src/libexpr/include/nix/get-drvs.hh index e4e277af8..aeb70c79e 100644 --- a/src/libexpr/get-drvs.hh +++ b/src/libexpr/include/nix/get-drvs.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "eval.hh" -#include "path.hh" +#include "nix/eval.hh" +#include "nix/path.hh" #include #include diff --git a/src/libexpr/json-to-value.hh b/src/libexpr/include/nix/json-to-value.hh similarity index 89% rename from src/libexpr/json-to-value.hh rename to src/libexpr/include/nix/json-to-value.hh index 3c8fa5cc0..a2e0d303d 100644 --- a/src/libexpr/json-to-value.hh +++ b/src/libexpr/include/nix/json-to-value.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "error.hh" +#include "nix/error.hh" #include diff --git a/src/libexpr/lexer-helpers.hh b/src/libexpr/include/nix/lexer-helpers.hh similarity index 100% rename from src/libexpr/lexer-helpers.hh rename to src/libexpr/include/nix/lexer-helpers.hh diff --git a/src/libexpr/include/nix/meson.build b/src/libexpr/include/nix/meson.build new file mode 100644 index 000000000..d712cc798 --- /dev/null +++ b/src/libexpr/include/nix/meson.build @@ -0,0 +1,37 @@ +# Public headers directory + +include_dirs = [include_directories('..')] + +config_h = configure_file( + configuration : configdata, + output : 'config-expr.hh', +) + +headers = [config_h] + files( + 'attr-path.hh', + 'attr-set.hh', + 'eval-cache.hh', + 'eval-error.hh', + 'eval-gc.hh', + 'eval-inline.hh', + 'eval-settings.hh', + 'eval.hh', + 'function-trace.hh', + 'gc-small-vector.hh', + 'get-drvs.hh', + 'json-to-value.hh', + # internal: 'lexer-helpers.hh', + 'nixexpr.hh', + 'parser-state.hh', + 'primops.hh', + 'print-ambiguous.hh', + 'print-options.hh', + 'print.hh', + 'repl-exit-status.hh', + 'search-path.hh', + 'symbol-table.hh', + 'value-to-json.hh', + 'value-to-xml.hh', + 'value.hh', + 'value/context.hh', +) diff --git a/src/libexpr/nixexpr.hh b/src/libexpr/include/nix/nixexpr.hh similarity index 99% rename from src/libexpr/nixexpr.hh rename to src/libexpr/include/nix/nixexpr.hh index 88ebc80f8..deb26dd29 100644 --- a/src/libexpr/nixexpr.hh +++ b/src/libexpr/include/nix/nixexpr.hh @@ -4,10 +4,10 @@ #include #include -#include "value.hh" -#include "symbol-table.hh" -#include "eval-error.hh" -#include "pos-idx.hh" +#include "nix/value.hh" +#include "nix/symbol-table.hh" +#include "nix/eval-error.hh" +#include "nix/pos-idx.hh" namespace nix { diff --git a/src/libexpr/parser-state.hh b/src/libexpr/include/nix/parser-state.hh similarity index 99% rename from src/libexpr/parser-state.hh rename to src/libexpr/include/nix/parser-state.hh index 21a880e8e..aa3c2455d 100644 --- a/src/libexpr/parser-state.hh +++ b/src/libexpr/include/nix/parser-state.hh @@ -3,7 +3,7 @@ #include -#include "eval.hh" +#include "nix/eval.hh" namespace nix { diff --git a/src/libexpr/primops.hh b/src/libexpr/include/nix/primops.hh similarity index 98% rename from src/libexpr/primops.hh rename to src/libexpr/include/nix/primops.hh index 9f76975db..75c6f0d46 100644 --- a/src/libexpr/primops.hh +++ b/src/libexpr/include/nix/primops.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "eval.hh" +#include "nix/eval.hh" #include #include diff --git a/src/libexpr/print-ambiguous.hh b/src/libexpr/include/nix/print-ambiguous.hh similarity index 95% rename from src/libexpr/print-ambiguous.hh rename to src/libexpr/include/nix/print-ambiguous.hh index 50c260a9b..06f4e805c 100644 --- a/src/libexpr/print-ambiguous.hh +++ b/src/libexpr/include/nix/print-ambiguous.hh @@ -1,6 +1,6 @@ #pragma once -#include "value.hh" +#include "nix/value.hh" namespace nix { diff --git a/src/libexpr/print-options.hh b/src/libexpr/include/nix/print-options.hh similarity index 100% rename from src/libexpr/print-options.hh rename to src/libexpr/include/nix/print-options.hh diff --git a/src/libexpr/print.hh b/src/libexpr/include/nix/print.hh similarity index 97% rename from src/libexpr/print.hh rename to src/libexpr/include/nix/print.hh index 7ddda81b8..09405e8f0 100644 --- a/src/libexpr/print.hh +++ b/src/libexpr/include/nix/print.hh @@ -9,8 +9,8 @@ #include -#include "fmt.hh" -#include "print-options.hh" +#include "nix/fmt.hh" +#include "nix/print-options.hh" namespace nix { diff --git a/src/libexpr/repl-exit-status.hh b/src/libexpr/include/nix/repl-exit-status.hh similarity index 100% rename from src/libexpr/repl-exit-status.hh rename to src/libexpr/include/nix/repl-exit-status.hh diff --git a/src/libexpr/search-path.hh b/src/libexpr/include/nix/search-path.hh similarity index 98% rename from src/libexpr/search-path.hh rename to src/libexpr/include/nix/search-path.hh index acd843638..22a97b5f3 100644 --- a/src/libexpr/search-path.hh +++ b/src/libexpr/include/nix/search-path.hh @@ -3,8 +3,8 @@ #include -#include "types.hh" -#include "comparator.hh" +#include "nix/types.hh" +#include "nix/comparator.hh" namespace nix { diff --git a/src/libexpr/symbol-table.hh b/src/libexpr/include/nix/symbol-table.hh similarity index 97% rename from src/libexpr/symbol-table.hh rename to src/libexpr/include/nix/symbol-table.hh index be12f6248..b55674b12 100644 --- a/src/libexpr/symbol-table.hh +++ b/src/libexpr/include/nix/symbol-table.hh @@ -5,9 +5,9 @@ #include #include -#include "types.hh" -#include "chunked-vector.hh" -#include "error.hh" +#include "nix/types.hh" +#include "nix/chunked-vector.hh" +#include "nix/error.hh" namespace nix { diff --git a/src/libexpr/value-to-json.hh b/src/libexpr/include/nix/value-to-json.hh similarity index 90% rename from src/libexpr/value-to-json.hh rename to src/libexpr/include/nix/value-to-json.hh index 867c4e3a8..9875c83c6 100644 --- a/src/libexpr/value-to-json.hh +++ b/src/libexpr/include/nix/value-to-json.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "nixexpr.hh" -#include "eval.hh" +#include "nix/nixexpr.hh" +#include "nix/eval.hh" #include #include diff --git a/src/libexpr/value-to-xml.hh b/src/libexpr/include/nix/value-to-xml.hh similarity index 82% rename from src/libexpr/value-to-xml.hh rename to src/libexpr/include/nix/value-to-xml.hh index 6d702c0f2..3e9dce4d6 100644 --- a/src/libexpr/value-to-xml.hh +++ b/src/libexpr/include/nix/value-to-xml.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "nixexpr.hh" -#include "eval.hh" +#include "nix/nixexpr.hh" +#include "nix/eval.hh" #include #include diff --git a/src/libexpr/value.hh b/src/libexpr/include/nix/value.hh similarity index 98% rename from src/libexpr/value.hh rename to src/libexpr/include/nix/value.hh index 8925693e3..45155b3d4 100644 --- a/src/libexpr/value.hh +++ b/src/libexpr/include/nix/value.hh @@ -4,12 +4,12 @@ #include #include -#include "eval-gc.hh" -#include "symbol-table.hh" -#include "value/context.hh" -#include "source-path.hh" -#include "print-options.hh" -#include "checked-arithmetic.hh" +#include "nix/eval-gc.hh" +#include "nix/symbol-table.hh" +#include "nix/value/context.hh" +#include "nix/source-path.hh" +#include "nix/print-options.hh" +#include "nix/checked-arithmetic.hh" #include diff --git a/src/libexpr/value/context.hh b/src/libexpr/include/nix/value/context.hh similarity index 95% rename from src/libexpr/value/context.hh rename to src/libexpr/include/nix/value/context.hh index d6791c6e4..f996cce42 100644 --- a/src/libexpr/value/context.hh +++ b/src/libexpr/include/nix/value/context.hh @@ -1,9 +1,9 @@ #pragma once ///@file -#include "comparator.hh" -#include "derived-path.hh" -#include "variant-wrapper.hh" +#include "nix/comparator.hh" +#include "nix/derived-path.hh" +#include "nix/variant-wrapper.hh" #include diff --git a/src/libexpr/json-to-value.cc b/src/libexpr/json-to-value.cc index 17cab7ad5..d5da3f2b1 100644 --- a/src/libexpr/json-to-value.cc +++ b/src/libexpr/json-to-value.cc @@ -1,6 +1,6 @@ -#include "json-to-value.hh" -#include "value.hh" -#include "eval.hh" +#include "nix/json-to-value.hh" +#include "nix/value.hh" +#include "nix/eval.hh" #include #include diff --git a/src/libexpr/lexer-helpers.cc b/src/libexpr/lexer-helpers.cc index d9eeb73e2..9eb4502fc 100644 --- a/src/libexpr/lexer-helpers.cc +++ b/src/libexpr/lexer-helpers.cc @@ -1,7 +1,8 @@ #include "lexer-tab.hh" -#include "lexer-helpers.hh" #include "parser-tab.hh" +#include "nix/lexer-helpers.hh" + void nix::lexer::internal::initLoc(YYLTYPE * loc) { loc->beginOffset = loc->endOffset = 0; diff --git a/src/libexpr/lexer.l b/src/libexpr/lexer.l index 067f86e01..c8a5ec9fd 100644 --- a/src/libexpr/lexer.l +++ b/src/libexpr/lexer.l @@ -16,7 +16,7 @@ %top { #include "parser-tab.hh" // YYSTYPE -#include "parser-state.hh" +#include "nix/parser-state.hh" } %{ @@ -24,9 +24,9 @@ #pragma clang diagnostic ignored "-Wunneeded-internal-declaration" #endif -#include "nixexpr.hh" +#include "nix/nixexpr.hh" #include "parser-tab.hh" -#include "lexer-helpers.hh" +#include "nix/lexer-helpers.hh" namespace nix { struct LexerState; diff --git a/src/libexpr/meson.build b/src/libexpr/meson.build index 040da3dbc..3fd4dca7f 100644 --- a/src/libexpr/meson.build +++ b/src/libexpr/meson.build @@ -61,18 +61,13 @@ toml11 = dependency( ) deps_other += toml11 -config_h = configure_file( - configuration : configdata, - output : 'config-expr.hh', -) - add_project_arguments( # TODO(Qyriad): Yes this is how the autoconf+Make system did it. # It would be nice for our headers to be idempotent instead. - '-include', 'config-util.hh', - '-include', 'config-store.hh', - # '-include', 'config-fetchers.h', - '-include', 'config-expr.hh', + '-include', 'nix/config-util.hh', + '-include', 'nix/config-store.hh', + # '-include', 'nix_api_fetchers_config.h', + '-include', 'nix/config-expr.hh', language : 'cpp', ) @@ -153,36 +148,7 @@ sources = files( 'value/context.cc', ) -include_dirs = [include_directories('.')] - -headers = [config_h] + files( - 'attr-path.hh', - 'attr-set.hh', - 'eval-cache.hh', - 'eval-error.hh', - 'eval-gc.hh', - 'eval-inline.hh', - 'eval-settings.hh', - 'eval.hh', - 'function-trace.hh', - 'gc-small-vector.hh', - 'get-drvs.hh', - 'json-to-value.hh', - # internal: 'lexer-helpers.hh', - 'nixexpr.hh', - 'parser-state.hh', - 'primops.hh', - 'print-ambiguous.hh', - 'print-options.hh', - 'print.hh', - 'repl-exit-status.hh', - 'search-path.hh', - 'symbol-table.hh', - 'value-to-json.hh', - 'value-to-xml.hh', - 'value.hh', - 'value/context.hh', -) +subdir('include/nix') subdir('primops') diff --git a/src/libexpr/nixexpr.cc b/src/libexpr/nixexpr.cc index f17226728..e5289de6a 100644 --- a/src/libexpr/nixexpr.cc +++ b/src/libexpr/nixexpr.cc @@ -1,13 +1,13 @@ -#include "nixexpr.hh" -#include "eval.hh" -#include "symbol-table.hh" -#include "util.hh" -#include "print.hh" +#include "nix/nixexpr.hh" +#include "nix/eval.hh" +#include "nix/symbol-table.hh" +#include "nix/util.hh" +#include "nix/print.hh" #include #include -#include "strings-inline.hh" +#include "nix/strings-inline.hh" namespace nix { diff --git a/src/libexpr/package.nix b/src/libexpr/package.nix index 141b77fac..8f309b14e 100644 --- a/src/libexpr/package.nix +++ b/src/libexpr/package.nix @@ -48,6 +48,7 @@ mkMesonLibrary (finalAttrs: { ./meson.build ./meson.options ./primops/meson.build + ./include/nix/meson.build (fileset.fileFilter (file: file.hasExt "cc") ./.) (fileset.fileFilter (file: file.hasExt "hh") ./.) ./lexer.l diff --git a/src/libexpr/parser.y b/src/libexpr/parser.y index bde721401..c90bafa05 100644 --- a/src/libexpr/parser.y +++ b/src/libexpr/parser.y @@ -17,14 +17,14 @@ #include -#include "finally.hh" -#include "util.hh" -#include "users.hh" +#include "nix/finally.hh" +#include "nix/util.hh" +#include "nix/users.hh" -#include "nixexpr.hh" -#include "eval.hh" -#include "eval-settings.hh" -#include "parser-state.hh" +#include "nix/nixexpr.hh" +#include "nix/eval.hh" +#include "nix/eval-settings.hh" +#include "nix/parser-state.hh" // Bison seems to have difficulty growing the parser stack when using C++ with // a custom location type. This undocumented macro tells Bison that our @@ -514,7 +514,7 @@ formal %% -#include "eval.hh" +#include "nix/eval.hh" namespace nix { diff --git a/src/libexpr/paths.cc b/src/libexpr/paths.cc index 3d602ae2d..5aae69f9d 100644 --- a/src/libexpr/paths.cc +++ b/src/libexpr/paths.cc @@ -1,5 +1,5 @@ -#include "store-api.hh" -#include "eval.hh" +#include "nix/store-api.hh" +#include "nix/eval.hh" namespace nix { diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index b078592e7..a790076fe 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -1,19 +1,19 @@ -#include "derivations.hh" -#include "downstream-placeholder.hh" -#include "eval-inline.hh" -#include "eval.hh" -#include "eval-settings.hh" -#include "gc-small-vector.hh" -#include "json-to-value.hh" -#include "names.hh" -#include "path-references.hh" -#include "store-api.hh" -#include "util.hh" -#include "processes.hh" -#include "value-to-json.hh" -#include "value-to-xml.hh" -#include "primops.hh" -#include "fetch-to-store.hh" +#include "nix/derivations.hh" +#include "nix/downstream-placeholder.hh" +#include "nix/eval-inline.hh" +#include "nix/eval.hh" +#include "nix/eval-settings.hh" +#include "nix/gc-small-vector.hh" +#include "nix/json-to-value.hh" +#include "nix/names.hh" +#include "nix/path-references.hh" +#include "nix/store-api.hh" +#include "nix/util.hh" +#include "nix/processes.hh" +#include "nix/value-to-json.hh" +#include "nix/value-to-xml.hh" +#include "nix/primops.hh" +#include "nix/fetch-to-store.hh" #include #include diff --git a/src/libexpr/primops/context.cc b/src/libexpr/primops/context.cc index ede7d97ba..832d17cbb 100644 --- a/src/libexpr/primops/context.cc +++ b/src/libexpr/primops/context.cc @@ -1,7 +1,7 @@ -#include "primops.hh" -#include "eval-inline.hh" -#include "derivations.hh" -#include "store-api.hh" +#include "nix/primops.hh" +#include "nix/eval-inline.hh" +#include "nix/derivations.hh" +#include "nix/store-api.hh" namespace nix { diff --git a/src/libexpr/primops/fetchClosure.cc b/src/libexpr/primops/fetchClosure.cc index 04b8d0595..fc48c54ee 100644 --- a/src/libexpr/primops/fetchClosure.cc +++ b/src/libexpr/primops/fetchClosure.cc @@ -1,8 +1,8 @@ -#include "primops.hh" -#include "store-api.hh" -#include "realisation.hh" -#include "make-content-addressed.hh" -#include "url.hh" +#include "nix/primops.hh" +#include "nix/store-api.hh" +#include "nix/realisation.hh" +#include "nix/make-content-addressed.hh" +#include "nix/url.hh" namespace nix { diff --git a/src/libexpr/primops/fetchMercurial.cc b/src/libexpr/primops/fetchMercurial.cc index 64e3abf2d..59698552e 100644 --- a/src/libexpr/primops/fetchMercurial.cc +++ b/src/libexpr/primops/fetchMercurial.cc @@ -1,10 +1,10 @@ -#include "primops.hh" -#include "eval-inline.hh" -#include "eval-settings.hh" -#include "store-api.hh" -#include "fetchers.hh" -#include "url.hh" -#include "url-parts.hh" +#include "nix/primops.hh" +#include "nix/eval-inline.hh" +#include "nix/eval-settings.hh" +#include "nix/store-api.hh" +#include "nix/fetchers.hh" +#include "nix/url.hh" +#include "nix/url-parts.hh" namespace nix { diff --git a/src/libexpr/primops/fetchTree.cc b/src/libexpr/primops/fetchTree.cc index bd013eab2..b14d54113 100644 --- a/src/libexpr/primops/fetchTree.cc +++ b/src/libexpr/primops/fetchTree.cc @@ -1,15 +1,15 @@ -#include "attrs.hh" -#include "primops.hh" -#include "eval-inline.hh" -#include "eval-settings.hh" -#include "store-api.hh" -#include "fetchers.hh" -#include "filetransfer.hh" -#include "registry.hh" -#include "tarball.hh" -#include "url.hh" -#include "value-to-json.hh" -#include "fetch-to-store.hh" +#include "nix/attrs.hh" +#include "nix/primops.hh" +#include "nix/eval-inline.hh" +#include "nix/eval-settings.hh" +#include "nix/store-api.hh" +#include "nix/fetchers.hh" +#include "nix/filetransfer.hh" +#include "nix/registry.hh" +#include "nix/tarball.hh" +#include "nix/url.hh" +#include "nix/value-to-json.hh" +#include "nix/fetch-to-store.hh" #include diff --git a/src/libexpr/primops/fromTOML.cc b/src/libexpr/primops/fromTOML.cc index 404425054..05fe2e7bd 100644 --- a/src/libexpr/primops/fromTOML.cc +++ b/src/libexpr/primops/fromTOML.cc @@ -1,5 +1,5 @@ -#include "primops.hh" -#include "eval-inline.hh" +#include "nix/primops.hh" +#include "nix/eval-inline.hh" #include diff --git a/src/libexpr/print-ambiguous.cc b/src/libexpr/print-ambiguous.cc index a40c98643..b275e1e5c 100644 --- a/src/libexpr/print-ambiguous.cc +++ b/src/libexpr/print-ambiguous.cc @@ -1,7 +1,7 @@ -#include "print-ambiguous.hh" -#include "print.hh" -#include "signals.hh" -#include "eval.hh" +#include "nix/print-ambiguous.hh" +#include "nix/print.hh" +#include "nix/signals.hh" +#include "nix/eval.hh" namespace nix { diff --git a/src/libexpr/print.cc b/src/libexpr/print.cc index d62aaf25f..39f97e68b 100644 --- a/src/libexpr/print.cc +++ b/src/libexpr/print.cc @@ -2,13 +2,13 @@ #include #include -#include "print.hh" -#include "ansicolor.hh" -#include "signals.hh" -#include "store-api.hh" -#include "terminal.hh" -#include "english.hh" -#include "eval.hh" +#include "nix/print.hh" +#include "nix/ansicolor.hh" +#include "nix/signals.hh" +#include "nix/store-api.hh" +#include "nix/terminal.hh" +#include "nix/english.hh" +#include "nix/eval.hh" namespace nix { diff --git a/src/libexpr/search-path.cc b/src/libexpr/search-path.cc index 657744e74..8c33430f1 100644 --- a/src/libexpr/search-path.cc +++ b/src/libexpr/search-path.cc @@ -1,4 +1,4 @@ -#include "search-path.hh" +#include "nix/search-path.hh" namespace nix { diff --git a/src/libexpr/value-to-json.cc b/src/libexpr/value-to-json.cc index 5aa4fe4fd..846776aed 100644 --- a/src/libexpr/value-to-json.cc +++ b/src/libexpr/value-to-json.cc @@ -1,7 +1,7 @@ -#include "value-to-json.hh" -#include "eval-inline.hh" -#include "store-api.hh" -#include "signals.hh" +#include "nix/value-to-json.hh" +#include "nix/eval-inline.hh" +#include "nix/store-api.hh" +#include "nix/signals.hh" #include #include diff --git a/src/libexpr/value-to-xml.cc b/src/libexpr/value-to-xml.cc index 9734ebec4..e4df226a4 100644 --- a/src/libexpr/value-to-xml.cc +++ b/src/libexpr/value-to-xml.cc @@ -1,7 +1,7 @@ -#include "value-to-xml.hh" -#include "xml-writer.hh" -#include "eval-inline.hh" -#include "signals.hh" +#include "nix/value-to-xml.hh" +#include "nix/xml-writer.hh" +#include "nix/eval-inline.hh" +#include "nix/signals.hh" #include diff --git a/src/libexpr/value/context.cc b/src/libexpr/value/context.cc index 6d9633268..2052e193a 100644 --- a/src/libexpr/value/context.cc +++ b/src/libexpr/value/context.cc @@ -1,5 +1,5 @@ -#include "util.hh" -#include "value/context.hh" +#include "nix/util.hh" +#include "nix/value/context.hh" #include diff --git a/src/libfetchers-tests/access-tokens.cc b/src/libfetchers-tests/access-tokens.cc index 5f4ceedaa..25c3e6b5f 100644 --- a/src/libfetchers-tests/access-tokens.cc +++ b/src/libfetchers-tests/access-tokens.cc @@ -1,9 +1,10 @@ -#include -#include "fetchers.hh" -#include "fetch-settings.hh" -#include "json-utils.hh" #include -#include "tests/characterization.hh" +#include + +#include "nix/fetchers.hh" +#include "nix/fetch-settings.hh" +#include "nix/json-utils.hh" +#include "nix/tests/characterization.hh" namespace nix::fetchers { diff --git a/src/libfetchers-tests/git-utils.cc b/src/libfetchers-tests/git-utils.cc index ee6ef1734..e41db0b5b 100644 --- a/src/libfetchers-tests/git-utils.cc +++ b/src/libfetchers-tests/git-utils.cc @@ -1,13 +1,13 @@ -#include "git-utils.hh" -#include "file-system.hh" -#include "gmock/gmock.h" +#include "nix/git-utils.hh" +#include "nix/file-system.hh" +#include #include #include #include #include -#include "fs-sink.hh" -#include "serialise.hh" -#include "git-lfs-fetch.hh" +#include "nix/fs-sink.hh" +#include "nix/serialise.hh" +#include "nix/git-lfs-fetch.hh" namespace nix { diff --git a/src/libfetchers-tests/meson.build b/src/libfetchers-tests/meson.build index b60ff5675..80f99c859 100644 --- a/src/libfetchers-tests/meson.build +++ b/src/libfetchers-tests/meson.build @@ -37,9 +37,9 @@ deps_private += libgit2 add_project_arguments( # TODO(Qyriad): Yes this is how the autoconf+Make system did it. # It would be nice for our headers to be idempotent instead. - '-include', 'config-util.hh', - '-include', 'config-store.hh', - # '-include', 'config-fetchers.h', + '-include', 'nix/config-util.hh', + '-include', 'nix/config-store.hh', + # '-include', 'nix_api_fetchers_config.h', language : 'cpp', ) diff --git a/src/libfetchers-tests/public-key.cc b/src/libfetchers-tests/public-key.cc index 80796bd0f..98965cf79 100644 --- a/src/libfetchers-tests/public-key.cc +++ b/src/libfetchers-tests/public-key.cc @@ -1,8 +1,8 @@ #include -#include "fetchers.hh" -#include "json-utils.hh" +#include "nix/fetchers.hh" +#include "nix/json-utils.hh" #include -#include "tests/characterization.hh" +#include "nix/tests/characterization.hh" namespace nix { diff --git a/src/libfetchers/attrs.cc b/src/libfetchers/attrs.cc index 25d04cdc9..68e5e932b 100644 --- a/src/libfetchers/attrs.cc +++ b/src/libfetchers/attrs.cc @@ -1,5 +1,5 @@ -#include "attrs.hh" -#include "fetchers.hh" +#include "nix/attrs.hh" +#include "nix/fetchers.hh" #include diff --git a/src/libfetchers/cache.cc b/src/libfetchers/cache.cc index 6c2241f3a..089c8d6f3 100644 --- a/src/libfetchers/cache.cc +++ b/src/libfetchers/cache.cc @@ -1,8 +1,8 @@ -#include "cache.hh" -#include "users.hh" -#include "sqlite.hh" -#include "sync.hh" -#include "store-api.hh" +#include "nix/cache.hh" +#include "nix/users.hh" +#include "nix/sqlite.hh" +#include "nix/sync.hh" +#include "nix/store-api.hh" #include diff --git a/src/libfetchers/fetch-settings.cc b/src/libfetchers/fetch-settings.cc index c7ed4c7af..bdd095538 100644 --- a/src/libfetchers/fetch-settings.cc +++ b/src/libfetchers/fetch-settings.cc @@ -1,4 +1,4 @@ -#include "fetch-settings.hh" +#include "nix/fetch-settings.hh" namespace nix::fetchers { diff --git a/src/libfetchers/fetch-to-store.cc b/src/libfetchers/fetch-to-store.cc index fe347a59d..2be08feaf 100644 --- a/src/libfetchers/fetch-to-store.cc +++ b/src/libfetchers/fetch-to-store.cc @@ -1,6 +1,6 @@ -#include "fetch-to-store.hh" -#include "fetchers.hh" -#include "cache.hh" +#include "nix/fetch-to-store.hh" +#include "nix/fetchers.hh" +#include "nix/cache.hh" namespace nix { diff --git a/src/libfetchers/fetchers.cc b/src/libfetchers/fetchers.cc index abf021554..068a6722f 100644 --- a/src/libfetchers/fetchers.cc +++ b/src/libfetchers/fetchers.cc @@ -1,10 +1,10 @@ -#include "fetchers.hh" -#include "store-api.hh" -#include "source-path.hh" -#include "fetch-to-store.hh" -#include "json-utils.hh" -#include "store-path-accessor.hh" -#include "fetch-settings.hh" +#include "nix/fetchers.hh" +#include "nix/store-api.hh" +#include "nix/source-path.hh" +#include "nix/fetch-to-store.hh" +#include "nix/json-utils.hh" +#include "nix/store-path-accessor.hh" +#include "nix/fetch-settings.hh" #include diff --git a/src/libfetchers/filtering-source-accessor.cc b/src/libfetchers/filtering-source-accessor.cc index d4557b6d4..1a9c8ae6b 100644 --- a/src/libfetchers/filtering-source-accessor.cc +++ b/src/libfetchers/filtering-source-accessor.cc @@ -1,4 +1,4 @@ -#include "filtering-source-accessor.hh" +#include "nix/filtering-source-accessor.hh" namespace nix { diff --git a/src/libfetchers/git-lfs-fetch.cc b/src/libfetchers/git-lfs-fetch.cc index bd6c01435..9f48d1e98 100644 --- a/src/libfetchers/git-lfs-fetch.cc +++ b/src/libfetchers/git-lfs-fetch.cc @@ -1,10 +1,10 @@ -#include "git-lfs-fetch.hh" -#include "git-utils.hh" -#include "filetransfer.hh" -#include "processes.hh" -#include "url.hh" -#include "users.hh" -#include "hash.hh" +#include "nix/git-lfs-fetch.hh" +#include "nix/git-utils.hh" +#include "nix/filetransfer.hh" +#include "nix/processes.hh" +#include "nix/url.hh" +#include "nix/users.hh" +#include "nix/hash.hh" #include #include diff --git a/src/libfetchers/git-utils.cc b/src/libfetchers/git-utils.cc index a2761a543..ad8a6e89c 100644 --- a/src/libfetchers/git-utils.cc +++ b/src/libfetchers/git-utils.cc @@ -1,12 +1,12 @@ -#include "git-utils.hh" -#include "git-lfs-fetch.hh" -#include "cache.hh" -#include "finally.hh" -#include "processes.hh" -#include "signals.hh" -#include "users.hh" -#include "fs-sink.hh" -#include "sync.hh" +#include "nix/git-utils.hh" +#include "nix/git-lfs-fetch.hh" +#include "nix/cache.hh" +#include "nix/finally.hh" +#include "nix/processes.hh" +#include "nix/signals.hh" +#include "nix/users.hh" +#include "nix/fs-sink.hh" +#include "nix/sync.hh" #include #include diff --git a/src/libfetchers/git.cc b/src/libfetchers/git.cc index f46334d30..fa310c370 100644 --- a/src/libfetchers/git.cc +++ b/src/libfetchers/git.cc @@ -1,20 +1,20 @@ -#include "error.hh" -#include "fetchers.hh" -#include "users.hh" -#include "cache.hh" -#include "globals.hh" -#include "tarfile.hh" -#include "store-api.hh" -#include "url-parts.hh" -#include "pathlocks.hh" -#include "processes.hh" -#include "git.hh" -#include "git-utils.hh" -#include "logging.hh" -#include "finally.hh" -#include "fetch-settings.hh" -#include "json-utils.hh" -#include "archive.hh" +#include "nix/error.hh" +#include "nix/fetchers.hh" +#include "nix/users.hh" +#include "nix/cache.hh" +#include "nix/globals.hh" +#include "nix/tarfile.hh" +#include "nix/store-api.hh" +#include "nix/url-parts.hh" +#include "nix/pathlocks.hh" +#include "nix/processes.hh" +#include "nix/git.hh" +#include "nix/git-utils.hh" +#include "nix/logging.hh" +#include "nix/finally.hh" +#include "nix/fetch-settings.hh" +#include "nix/json-utils.hh" +#include "nix/archive.hh" #include #include diff --git a/src/libfetchers/github.cc b/src/libfetchers/github.cc index 9cddd8571..3459c0b3d 100644 --- a/src/libfetchers/github.cc +++ b/src/libfetchers/github.cc @@ -1,15 +1,15 @@ -#include "filetransfer.hh" -#include "cache.hh" -#include "globals.hh" -#include "store-api.hh" -#include "types.hh" -#include "url-parts.hh" -#include "git.hh" -#include "fetchers.hh" -#include "fetch-settings.hh" -#include "tarball.hh" -#include "tarfile.hh" -#include "git-utils.hh" +#include "nix/filetransfer.hh" +#include "nix/cache.hh" +#include "nix/globals.hh" +#include "nix/store-api.hh" +#include "nix/types.hh" +#include "nix/url-parts.hh" +#include "nix/git.hh" +#include "nix/fetchers.hh" +#include "nix/fetch-settings.hh" +#include "nix/tarball.hh" +#include "nix/tarfile.hh" +#include "nix/git-utils.hh" #include #include diff --git a/src/libfetchers/attrs.hh b/src/libfetchers/include/nix/attrs.hh similarity index 96% rename from src/libfetchers/attrs.hh rename to src/libfetchers/include/nix/attrs.hh index 97a74bce0..f1fdee35f 100644 --- a/src/libfetchers/attrs.hh +++ b/src/libfetchers/include/nix/attrs.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "types.hh" -#include "hash.hh" +#include "nix/types.hh" +#include "nix/hash.hh" #include diff --git a/src/libfetchers/cache.hh b/src/libfetchers/include/nix/cache.hh similarity index 97% rename from src/libfetchers/cache.hh rename to src/libfetchers/include/nix/cache.hh index 4d834fe0c..592401785 100644 --- a/src/libfetchers/cache.hh +++ b/src/libfetchers/include/nix/cache.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "fetchers.hh" -#include "path.hh" +#include "nix/fetchers.hh" +#include "nix/path.hh" namespace nix::fetchers { diff --git a/src/libfetchers/fetch-settings.hh b/src/libfetchers/include/nix/fetch-settings.hh similarity index 98% rename from src/libfetchers/fetch-settings.hh rename to src/libfetchers/include/nix/fetch-settings.hh index c6c3ca7a7..811e27b30 100644 --- a/src/libfetchers/fetch-settings.hh +++ b/src/libfetchers/include/nix/fetch-settings.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "types.hh" -#include "config.hh" +#include "nix/types.hh" +#include "nix/config.hh" #include #include diff --git a/src/libfetchers/fetch-to-store.hh b/src/libfetchers/include/nix/fetch-to-store.hh similarity index 71% rename from src/libfetchers/fetch-to-store.hh rename to src/libfetchers/include/nix/fetch-to-store.hh index c762629f3..7ef809c1c 100644 --- a/src/libfetchers/fetch-to-store.hh +++ b/src/libfetchers/include/nix/fetch-to-store.hh @@ -1,10 +1,10 @@ #pragma once -#include "source-path.hh" -#include "store-api.hh" -#include "file-system.hh" -#include "repair-flag.hh" -#include "file-content-address.hh" +#include "nix/source-path.hh" +#include "nix/store-api.hh" +#include "nix/file-system.hh" +#include "nix/repair-flag.hh" +#include "nix/file-content-address.hh" namespace nix { diff --git a/src/libfetchers/fetchers.hh b/src/libfetchers/include/nix/fetchers.hh similarity index 97% rename from src/libfetchers/fetchers.hh rename to src/libfetchers/include/nix/fetchers.hh index 01354a6e3..07a9adfbe 100644 --- a/src/libfetchers/fetchers.hh +++ b/src/libfetchers/include/nix/fetchers.hh @@ -1,17 +1,17 @@ #pragma once ///@file -#include "types.hh" -#include "hash.hh" -#include "canon-path.hh" -#include "json-impls.hh" -#include "attrs.hh" -#include "url.hh" +#include "nix/types.hh" +#include "nix/hash.hh" +#include "nix/canon-path.hh" +#include "nix/json-impls.hh" +#include "nix/attrs.hh" +#include "nix/url.hh" #include #include -#include "ref.hh" +#include "nix/ref.hh" namespace nix { class Store; class StorePath; struct SourceAccessor; } diff --git a/src/libfetchers/filtering-source-accessor.hh b/src/libfetchers/include/nix/filtering-source-accessor.hh similarity index 98% rename from src/libfetchers/filtering-source-accessor.hh rename to src/libfetchers/include/nix/filtering-source-accessor.hh index 1f8d84e53..04855c070 100644 --- a/src/libfetchers/filtering-source-accessor.hh +++ b/src/libfetchers/include/nix/filtering-source-accessor.hh @@ -1,6 +1,6 @@ #pragma once -#include "source-path.hh" +#include "nix/source-path.hh" namespace nix { diff --git a/src/libfetchers/git-lfs-fetch.hh b/src/libfetchers/include/nix/git-lfs-fetch.hh similarity index 92% rename from src/libfetchers/git-lfs-fetch.hh rename to src/libfetchers/include/nix/git-lfs-fetch.hh index 36df91962..cd7c86a82 100644 --- a/src/libfetchers/git-lfs-fetch.hh +++ b/src/libfetchers/include/nix/git-lfs-fetch.hh @@ -1,6 +1,6 @@ -#include "canon-path.hh" -#include "serialise.hh" -#include "url.hh" +#include "nix/canon-path.hh" +#include "nix/serialise.hh" +#include "nix/url.hh" #include diff --git a/src/libfetchers/git-utils.hh b/src/libfetchers/include/nix/git-utils.hh similarity index 98% rename from src/libfetchers/git-utils.hh rename to src/libfetchers/include/nix/git-utils.hh index c683bd058..65c86a7c4 100644 --- a/src/libfetchers/git-utils.hh +++ b/src/libfetchers/include/nix/git-utils.hh @@ -1,7 +1,7 @@ #pragma once -#include "filtering-source-accessor.hh" -#include "fs-sink.hh" +#include "nix/filtering-source-accessor.hh" +#include "nix/fs-sink.hh" namespace nix { diff --git a/src/libfetchers/include/nix/meson.build b/src/libfetchers/include/nix/meson.build new file mode 100644 index 000000000..eb02be43c --- /dev/null +++ b/src/libfetchers/include/nix/meson.build @@ -0,0 +1,15 @@ +include_dirs = [include_directories('..')] + +headers = files( + 'attrs.hh', + 'cache.hh', + 'fetch-settings.hh', + 'fetch-to-store.hh', + 'fetchers.hh', + 'filtering-source-accessor.hh', + 'git-lfs-fetch.hh', + 'git-utils.hh', + 'registry.hh', + 'store-path-accessor.hh', + 'tarball.hh', +) diff --git a/src/libfetchers/registry.hh b/src/libfetchers/include/nix/registry.hh similarity index 96% rename from src/libfetchers/registry.hh rename to src/libfetchers/include/nix/registry.hh index 8f47e1590..7c091ea12 100644 --- a/src/libfetchers/registry.hh +++ b/src/libfetchers/include/nix/registry.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "types.hh" -#include "fetchers.hh" +#include "nix/types.hh" +#include "nix/fetchers.hh" namespace nix { class Store; } diff --git a/src/libfetchers/store-path-accessor.hh b/src/libfetchers/include/nix/store-path-accessor.hh similarity index 87% rename from src/libfetchers/store-path-accessor.hh rename to src/libfetchers/include/nix/store-path-accessor.hh index 989cf3fa2..8e65fda11 100644 --- a/src/libfetchers/store-path-accessor.hh +++ b/src/libfetchers/include/nix/store-path-accessor.hh @@ -1,6 +1,6 @@ #pragma once -#include "source-path.hh" +#include "nix/source-path.hh" namespace nix { diff --git a/src/libfetchers/tarball.hh b/src/libfetchers/include/nix/tarball.hh similarity index 90% rename from src/libfetchers/tarball.hh rename to src/libfetchers/include/nix/tarball.hh index 2042041d5..63a217124 100644 --- a/src/libfetchers/tarball.hh +++ b/src/libfetchers/include/nix/tarball.hh @@ -2,10 +2,10 @@ #include -#include "hash.hh" -#include "path.hh" -#include "ref.hh" -#include "types.hh" +#include "nix/hash.hh" +#include "nix/path.hh" +#include "nix/ref.hh" +#include "nix/types.hh" namespace nix { class Store; diff --git a/src/libfetchers/indirect.cc b/src/libfetchers/indirect.cc index 0e1b86711..7e5eb0be3 100644 --- a/src/libfetchers/indirect.cc +++ b/src/libfetchers/indirect.cc @@ -1,6 +1,6 @@ -#include "fetchers.hh" -#include "url-parts.hh" -#include "path.hh" +#include "nix/fetchers.hh" +#include "nix/url-parts.hh" +#include "nix/path.hh" namespace nix::fetchers { diff --git a/src/libfetchers/mercurial.cc b/src/libfetchers/mercurial.cc index 61cbca202..73e677f44 100644 --- a/src/libfetchers/mercurial.cc +++ b/src/libfetchers/mercurial.cc @@ -1,13 +1,13 @@ -#include "fetchers.hh" -#include "processes.hh" -#include "users.hh" -#include "cache.hh" -#include "globals.hh" -#include "tarfile.hh" -#include "store-api.hh" -#include "url-parts.hh" -#include "store-path-accessor.hh" -#include "fetch-settings.hh" +#include "nix/fetchers.hh" +#include "nix/processes.hh" +#include "nix/users.hh" +#include "nix/cache.hh" +#include "nix/globals.hh" +#include "nix/tarfile.hh" +#include "nix/store-api.hh" +#include "nix/url-parts.hh" +#include "nix/store-path-accessor.hh" +#include "nix/fetch-settings.hh" #include diff --git a/src/libfetchers/meson.build b/src/libfetchers/meson.build index f8efbc8d3..aaf52ff74 100644 --- a/src/libfetchers/meson.build +++ b/src/libfetchers/meson.build @@ -33,9 +33,9 @@ deps_private += libgit2 add_project_arguments( # TODO(Qyriad): Yes this is how the autoconf+Make system did it. # It would be nice for our headers to be idempotent instead. - '-include', 'config-util.hh', - '-include', 'config-store.hh', - # '-include', 'config-fetchers.h', + '-include', 'nix/config-util.hh', + '-include', 'nix/config-store.hh', + # '-include', 'nix_api_fetchers_config.h', language : 'cpp', ) @@ -60,21 +60,7 @@ sources = files( 'tarball.cc', ) -include_dirs = [include_directories('.')] - -headers = files( - 'attrs.hh', - 'cache.hh', - 'fetch-settings.hh', - 'fetch-to-store.hh', - 'fetchers.hh', - 'filtering-source-accessor.hh', - 'git-lfs-fetch.hh', - 'git-utils.hh', - 'registry.hh', - 'store-path-accessor.hh', - 'tarball.hh', -) +subdir('include/nix') subdir('nix-meson-build-support/export-all-symbols') subdir('nix-meson-build-support/windows-version') diff --git a/src/libfetchers/package.nix b/src/libfetchers/package.nix index 3f52e9878..aaeaa4b5d 100644 --- a/src/libfetchers/package.nix +++ b/src/libfetchers/package.nix @@ -27,6 +27,7 @@ mkMesonLibrary (finalAttrs: { ../../.version ./.version ./meson.build + ./include/nix/meson.build (fileset.fileFilter (file: file.hasExt "cc") ./.) (fileset.fileFilter (file: file.hasExt "hh") ./.) ]; diff --git a/src/libfetchers/path.cc b/src/libfetchers/path.cc index bdc7538e2..95bc2ce50 100644 --- a/src/libfetchers/path.cc +++ b/src/libfetchers/path.cc @@ -1,7 +1,7 @@ -#include "fetchers.hh" -#include "store-api.hh" -#include "archive.hh" -#include "store-path-accessor.hh" +#include "nix/fetchers.hh" +#include "nix/store-api.hh" +#include "nix/archive.hh" +#include "nix/store-path-accessor.hh" namespace nix::fetchers { diff --git a/src/libfetchers/registry.cc b/src/libfetchers/registry.cc index c18e12d23..ec470159b 100644 --- a/src/libfetchers/registry.cc +++ b/src/libfetchers/registry.cc @@ -1,10 +1,10 @@ -#include "fetch-settings.hh" -#include "registry.hh" -#include "tarball.hh" -#include "users.hh" -#include "globals.hh" -#include "store-api.hh" -#include "local-fs-store.hh" +#include "nix/fetch-settings.hh" +#include "nix/registry.hh" +#include "nix/tarball.hh" +#include "nix/users.hh" +#include "nix/globals.hh" +#include "nix/store-api.hh" +#include "nix/local-fs-store.hh" #include diff --git a/src/libfetchers/store-path-accessor.cc b/src/libfetchers/store-path-accessor.cc index 528bf2a4f..997582b57 100644 --- a/src/libfetchers/store-path-accessor.cc +++ b/src/libfetchers/store-path-accessor.cc @@ -1,5 +1,5 @@ -#include "store-path-accessor.hh" -#include "store-api.hh" +#include "nix/store-path-accessor.hh" +#include "nix/store-api.hh" namespace nix { diff --git a/src/libfetchers/tarball.cc b/src/libfetchers/tarball.cc index 699612e25..01bff82f7 100644 --- a/src/libfetchers/tarball.cc +++ b/src/libfetchers/tarball.cc @@ -1,14 +1,14 @@ -#include "tarball.hh" -#include "fetchers.hh" -#include "cache.hh" -#include "filetransfer.hh" -#include "store-api.hh" -#include "archive.hh" -#include "tarfile.hh" -#include "types.hh" -#include "store-path-accessor.hh" -#include "store-api.hh" -#include "git-utils.hh" +#include "nix/tarball.hh" +#include "nix/fetchers.hh" +#include "nix/cache.hh" +#include "nix/filetransfer.hh" +#include "nix/store-api.hh" +#include "nix/archive.hh" +#include "nix/tarfile.hh" +#include "nix/types.hh" +#include "nix/store-path-accessor.hh" +#include "nix/store-api.hh" +#include "nix/git-utils.hh" namespace nix::fetchers { diff --git a/src/libflake-c/meson.build b/src/libflake-c/meson.build index 469e0ade4..ec754dfaa 100644 --- a/src/libflake-c/meson.build +++ b/src/libflake-c/meson.build @@ -32,11 +32,11 @@ add_project_arguments( # It would be nice for our headers to be idempotent instead. # From C++ libraries, only for internals - '-include', 'config-util.hh', - '-include', 'config-store.hh', - '-include', 'config-expr.hh', + '-include', 'nix/config-util.hh', + '-include', 'nix/config-store.hh', + '-include', 'nix/config-expr.hh', # not generated (yet?) - # '-include', 'config-flake.hh', + # '-include', 'nix/config-flake.hh', language : 'cpp', ) @@ -69,7 +69,7 @@ this_library = library( install : true, ) -install_headers(headers, subdir : 'nix', preserve_path : true) +install_headers(headers, preserve_path : true) libraries_private = [] diff --git a/src/libflake-c/nix_api_flake.cc b/src/libflake-c/nix_api_flake.cc index 2479bf2e0..a1b586e82 100644 --- a/src/libflake-c/nix_api_flake.cc +++ b/src/libflake-c/nix_api_flake.cc @@ -3,7 +3,7 @@ #include "nix_api_util_internal.h" #include "nix_api_expr_internal.h" -#include "flake/flake.hh" +#include "nix/flake/flake.hh" nix_flake_settings * nix_flake_settings_new(nix_c_context * context) { diff --git a/src/libflake-c/nix_api_flake_internal.hh b/src/libflake-c/nix_api_flake_internal.hh index 4c154a342..4565b4f5d 100644 --- a/src/libflake-c/nix_api_flake_internal.hh +++ b/src/libflake-c/nix_api_flake_internal.hh @@ -1,7 +1,7 @@ #pragma once -#include "ref.hh" -#include "flake/settings.hh" +#include "nix/ref.hh" +#include "nix/flake/settings.hh" struct nix_flake_settings { diff --git a/src/libflake-tests/flakeref.cc b/src/libflake-tests/flakeref.cc index 2b1f5124b..f378ba6d6 100644 --- a/src/libflake-tests/flakeref.cc +++ b/src/libflake-tests/flakeref.cc @@ -1,7 +1,7 @@ #include -#include "fetch-settings.hh" -#include "flake/flakeref.hh" +#include "nix/fetch-settings.hh" +#include "nix/flake/flakeref.hh" namespace nix { diff --git a/src/libflake-tests/meson.build b/src/libflake-tests/meson.build index 1c8765f21..4012582f2 100644 --- a/src/libflake-tests/meson.build +++ b/src/libflake-tests/meson.build @@ -35,9 +35,9 @@ deps_private += gtest add_project_arguments( # TODO(Qyriad): Yes this is how the autoconf+Make system did it. # It would be nice for our headers to be idempotent instead. - '-include', 'config-util.hh', - '-include', 'config-store.hh', - '-include', 'config-expr.hh', + '-include', 'nix/config-util.hh', + '-include', 'nix/config-store.hh', + '-include', 'nix/config-expr.hh', language : 'cpp', ) diff --git a/src/libflake-tests/nix_api_flake.cc b/src/libflake-tests/nix_api_flake.cc index 834b2e681..0d9e2a91f 100644 --- a/src/libflake-tests/nix_api_flake.cc +++ b/src/libflake-tests/nix_api_flake.cc @@ -6,8 +6,8 @@ #include "nix_api_value.h" #include "nix_api_flake.h" -#include "tests/nix_api_expr.hh" -#include "tests/string_callback.hh" +#include "nix/tests/nix_api_expr.hh" +#include "nix/tests/string_callback.hh" #include #include diff --git a/src/libflake-tests/url-name.cc b/src/libflake-tests/url-name.cc index 15bc6b111..c795850f9 100644 --- a/src/libflake-tests/url-name.cc +++ b/src/libflake-tests/url-name.cc @@ -1,4 +1,4 @@ -#include "flake/url-name.hh" +#include "nix/flake/url-name.hh" #include namespace nix { diff --git a/src/libflake/flake/config.cc b/src/libflake/flake/config.cc index 4879de463..a0ddf0387 100644 --- a/src/libflake/flake/config.cc +++ b/src/libflake/flake/config.cc @@ -1,7 +1,7 @@ -#include "users.hh" -#include "config-global.hh" -#include "flake/settings.hh" -#include "flake.hh" +#include "nix/users.hh" +#include "nix/config-global.hh" +#include "nix/flake/settings.hh" +#include "nix/flake/flake.hh" #include diff --git a/src/libflake/flake/flake-primops.cc b/src/libflake/flake/flake-primops.cc index 98ebdee5f..508274dbd 100644 --- a/src/libflake/flake/flake-primops.cc +++ b/src/libflake/flake/flake-primops.cc @@ -1,8 +1,8 @@ -#include "flake-primops.hh" -#include "eval.hh" -#include "flake.hh" -#include "flakeref.hh" -#include "settings.hh" +#include "nix/flake/flake-primops.hh" +#include "nix/eval.hh" +#include "nix/flake/flake.hh" +#include "nix/flake/flakeref.hh" +#include "nix/flake/settings.hh" namespace nix::flake::primops { diff --git a/src/libflake/flake/flake.cc b/src/libflake/flake/flake.cc index b4b987027..4ff48967f 100644 --- a/src/libflake/flake/flake.cc +++ b/src/libflake/flake/flake.cc @@ -1,23 +1,22 @@ -#include "terminal.hh" -#include "flake.hh" -#include "eval.hh" -#include "eval-settings.hh" -#include "lockfile.hh" -#include "primops.hh" -#include "eval-inline.hh" -#include "store-api.hh" -#include "fetchers.hh" -#include "finally.hh" -#include "fetch-settings.hh" -#include "flake/settings.hh" -#include "value-to-json.hh" -#include "local-fs-store.hh" -#include "fetch-to-store.hh" +#include "nix/terminal.hh" +#include "nix/flake/flake.hh" +#include "nix/eval.hh" +#include "nix/eval-settings.hh" +#include "nix/flake/lockfile.hh" +#include "nix/primops.hh" +#include "nix/eval-inline.hh" +#include "nix/store-api.hh" +#include "nix/fetchers.hh" +#include "nix/finally.hh" +#include "nix/fetch-settings.hh" +#include "nix/flake/settings.hh" +#include "nix/value-to-json.hh" +#include "nix/local-fs-store.hh" +#include "nix/fetch-to-store.hh" +#include "nix/memory-source-accessor.hh" #include -#include "memory-source-accessor.hh" - namespace nix { using namespace flake; diff --git a/src/libflake/flake/flakeref.cc b/src/libflake/flake/flakeref.cc index 4fc720eb5..340fe4dc7 100644 --- a/src/libflake/flake/flakeref.cc +++ b/src/libflake/flake/flakeref.cc @@ -1,8 +1,8 @@ -#include "flakeref.hh" -#include "store-api.hh" -#include "url.hh" -#include "url-parts.hh" -#include "fetchers.hh" +#include "nix/flake/flakeref.hh" +#include "nix/store-api.hh" +#include "nix/url.hh" +#include "nix/url-parts.hh" +#include "nix/fetchers.hh" namespace nix { diff --git a/src/libflake/flake/lockfile.cc b/src/libflake/flake/lockfile.cc index b0971a696..08a384366 100644 --- a/src/libflake/flake/lockfile.cc +++ b/src/libflake/flake/lockfile.cc @@ -1,10 +1,10 @@ #include -#include "fetch-settings.hh" -#include "flake/settings.hh" -#include "lockfile.hh" -#include "store-api.hh" -#include "strings.hh" +#include "nix/fetch-settings.hh" +#include "nix/flake/settings.hh" +#include "nix/flake/lockfile.hh" +#include "nix/store-api.hh" +#include "nix/strings.hh" #include #include diff --git a/src/libflake/flake/settings.cc b/src/libflake/flake/settings.cc index cac7c4384..bab7f9439 100644 --- a/src/libflake/flake/settings.cc +++ b/src/libflake/flake/settings.cc @@ -1,5 +1,5 @@ -#include "flake/settings.hh" -#include "flake/flake-primops.hh" +#include "nix/flake/settings.hh" +#include "nix/flake/flake-primops.hh" namespace nix::flake { diff --git a/src/libflake/flake/url-name.cc b/src/libflake/flake/url-name.cc index d62b34552..3e3311cf7 100644 --- a/src/libflake/flake/url-name.cc +++ b/src/libflake/flake/url-name.cc @@ -1,4 +1,4 @@ -#include "url-name.hh" +#include "nix/flake/url-name.hh" #include #include diff --git a/src/libflake/flake/flake-primops.hh b/src/libflake/include/nix/flake/flake-primops.hh similarity index 75% rename from src/libflake/flake/flake-primops.hh rename to src/libflake/include/nix/flake/flake-primops.hh index 203060563..07be75123 100644 --- a/src/libflake/flake/flake-primops.hh +++ b/src/libflake/include/nix/flake/flake-primops.hh @@ -1,7 +1,7 @@ #pragma once -#include "eval.hh" -#include "flake/settings.hh" +#include "nix/eval.hh" +#include "nix/flake/settings.hh" namespace nix::flake::primops { @@ -13,4 +13,4 @@ nix::PrimOp getFlake(const Settings & settings); extern nix::PrimOp parseFlakeRef; extern nix::PrimOp flakeRefToString; -} // namespace nix::flake \ No newline at end of file +} // namespace nix::flake diff --git a/src/libflake/flake/flake.hh b/src/libflake/include/nix/flake/flake.hh similarity index 98% rename from src/libflake/flake/flake.hh rename to src/libflake/include/nix/flake/flake.hh index d7a151587..2fa385060 100644 --- a/src/libflake/flake/flake.hh +++ b/src/libflake/include/nix/flake/flake.hh @@ -1,10 +1,10 @@ #pragma once ///@file -#include "types.hh" -#include "flakeref.hh" -#include "lockfile.hh" -#include "value.hh" +#include "nix/types.hh" +#include "nix/flake/flakeref.hh" +#include "nix/flake/lockfile.hh" +#include "nix/value.hh" namespace nix { diff --git a/src/libflake/flake/flakeref.hh b/src/libflake/include/nix/flake/flakeref.hh similarity index 97% rename from src/libflake/flake/flakeref.hh rename to src/libflake/include/nix/flake/flakeref.hh index d3c15018e..93ebaa497 100644 --- a/src/libflake/flake/flakeref.hh +++ b/src/libflake/include/nix/flake/flakeref.hh @@ -3,10 +3,10 @@ #include -#include "types.hh" -#include "fetchers.hh" -#include "outputs-spec.hh" -#include "registry.hh" +#include "nix/types.hh" +#include "nix/fetchers.hh" +#include "nix/outputs-spec.hh" +#include "nix/registry.hh" namespace nix { diff --git a/src/libflake/flake/lockfile.hh b/src/libflake/include/nix/flake/lockfile.hh similarity index 98% rename from src/libflake/flake/lockfile.hh rename to src/libflake/include/nix/flake/lockfile.hh index cbc6d01eb..97bd7a495 100644 --- a/src/libflake/flake/lockfile.hh +++ b/src/libflake/include/nix/flake/lockfile.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "flakeref.hh" +#include "nix/flake/flakeref.hh" #include diff --git a/src/libflake/flake/settings.hh b/src/libflake/include/nix/flake/settings.hh similarity index 97% rename from src/libflake/flake/settings.hh rename to src/libflake/include/nix/flake/settings.hh index 5f0d9fb21..54f501e11 100644 --- a/src/libflake/flake/settings.hh +++ b/src/libflake/include/nix/flake/settings.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "config.hh" +#include "nix/config.hh" #include diff --git a/src/libflake/flake/url-name.hh b/src/libflake/include/nix/flake/url-name.hh similarity index 85% rename from src/libflake/flake/url-name.hh rename to src/libflake/include/nix/flake/url-name.hh index 6f32754d2..4577e8f38 100644 --- a/src/libflake/flake/url-name.hh +++ b/src/libflake/include/nix/flake/url-name.hh @@ -1,7 +1,7 @@ -#include "url.hh" -#include "url-parts.hh" -#include "util.hh" -#include "split.hh" +#include "nix/url.hh" +#include "nix/url-parts.hh" +#include "nix/util.hh" +#include "nix/split.hh" namespace nix { diff --git a/src/libflake/include/nix/meson.build b/src/libflake/include/nix/meson.build new file mode 100644 index 000000000..023bd64bd --- /dev/null +++ b/src/libflake/include/nix/meson.build @@ -0,0 +1,11 @@ +# Public headers directory + +include_dirs = [include_directories('..')] + +headers = files( + 'flake/flake.hh', + 'flake/flakeref.hh', + 'flake/lockfile.hh', + 'flake/settings.hh', + 'flake/url-name.hh', +) diff --git a/src/libflake/meson.build b/src/libflake/meson.build index b780722de..e231de9c1 100644 --- a/src/libflake/meson.build +++ b/src/libflake/meson.build @@ -30,10 +30,10 @@ deps_public += nlohmann_json add_project_arguments( # TODO(Qyriad): Yes this is how the autoconf+Make system did it. # It would be nice for our headers to be idempotent instead. - '-include', 'config-util.hh', - '-include', 'config-store.hh', - # '-include', 'config-fetchers.h', - '-include', 'config-expr.hh', + '-include', 'nix/config-util.hh', + '-include', 'nix/config-store.hh', + # '-include', 'nix_api_fetchers_config.h', + '-include', 'nix/config-expr.hh', language : 'cpp', ) @@ -58,15 +58,7 @@ sources = files( 'flake/url-name.cc', ) -include_dirs = [include_directories('.')] - -headers = files( - 'flake/flake.hh', - 'flake/flakeref.hh', - 'flake/lockfile.hh', - 'flake/settings.hh', - 'flake/url-name.hh', -) +subdir('include/nix') subdir('nix-meson-build-support/export-all-symbols') subdir('nix-meson-build-support/windows-version') diff --git a/src/libflake/package.nix b/src/libflake/package.nix index d7250c252..683880b20 100644 --- a/src/libflake/package.nix +++ b/src/libflake/package.nix @@ -28,6 +28,7 @@ mkMesonLibrary (finalAttrs: { ../../.version ./.version ./meson.build + ./include/nix/meson.build ./call-flake.nix (fileset.fileFilter (file: file.hasExt "cc") ./.) (fileset.fileFilter (file: file.hasExt "hh") ./.) diff --git a/src/libmain-c/meson.build b/src/libmain-c/meson.build index 0e9380a12..0229ef86b 100644 --- a/src/libmain-c/meson.build +++ b/src/libmain-c/meson.build @@ -30,8 +30,8 @@ add_project_arguments( # It would be nice for our headers to be idempotent instead. # From C++ libraries, only for internals - '-include', 'config-util.hh', - '-include', 'config-store.hh', + '-include', 'nix/config-util.hh', + '-include', 'nix/config-store.hh', language : 'cpp', ) @@ -61,7 +61,7 @@ this_library = library( install : true, ) -install_headers(headers, subdir : 'nix', preserve_path : true) +install_headers(headers, preserve_path : true) libraries_private = [] diff --git a/src/libmain-c/nix_api_main.cc b/src/libmain-c/nix_api_main.cc index 692d53f47..61dbceff8 100644 --- a/src/libmain-c/nix_api_main.cc +++ b/src/libmain-c/nix_api_main.cc @@ -3,7 +3,7 @@ #include "nix_api_util.h" #include "nix_api_util_internal.h" -#include "plugin.hh" +#include "nix/plugin.hh" nix_err nix_init_plugins(nix_c_context * context) { diff --git a/src/libmain/common-args.cc b/src/libmain/common-args.cc index 13d358623..8d531bbcb 100644 --- a/src/libmain/common-args.cc +++ b/src/libmain/common-args.cc @@ -1,11 +1,11 @@ -#include "common-args.hh" -#include "args/root.hh" -#include "config-global.hh" -#include "globals.hh" -#include "logging.hh" -#include "loggers.hh" -#include "util.hh" -#include "plugin.hh" +#include "nix/common-args.hh" +#include "nix/args/root.hh" +#include "nix/config-global.hh" +#include "nix/globals.hh" +#include "nix/logging.hh" +#include "nix/loggers.hh" +#include "nix/util.hh" +#include "nix/plugin.hh" namespace nix { diff --git a/src/libmain/common-args.hh b/src/libmain/include/nix/common-args.hh similarity index 96% rename from src/libmain/common-args.hh rename to src/libmain/include/nix/common-args.hh index c35406c3b..5622115b8 100644 --- a/src/libmain/common-args.hh +++ b/src/libmain/include/nix/common-args.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "args.hh" -#include "repair-flag.hh" +#include "nix/args.hh" +#include "nix/repair-flag.hh" namespace nix { diff --git a/src/libmain/loggers.hh b/src/libmain/include/nix/loggers.hh similarity index 90% rename from src/libmain/loggers.hh rename to src/libmain/include/nix/loggers.hh index 98b287fa7..dabdae83c 100644 --- a/src/libmain/loggers.hh +++ b/src/libmain/include/nix/loggers.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "types.hh" +#include "nix/types.hh" namespace nix { diff --git a/src/libmain/include/nix/meson.build b/src/libmain/include/nix/meson.build new file mode 100644 index 000000000..8584b9042 --- /dev/null +++ b/src/libmain/include/nix/meson.build @@ -0,0 +1,16 @@ +# Public headers directory + +include_dirs = [include_directories('..')] + +config_h = configure_file( + configuration : configdata, + output : 'config-main.hh', +) + +headers = [config_h] + files( + 'common-args.hh', + 'loggers.hh', + 'plugin.hh', + 'progress-bar.hh', + 'shared.hh', +) diff --git a/src/libmain/plugin.hh b/src/libmain/include/nix/plugin.hh similarity index 100% rename from src/libmain/plugin.hh rename to src/libmain/include/nix/plugin.hh diff --git a/src/libmain/progress-bar.hh b/src/libmain/include/nix/progress-bar.hh similarity index 76% rename from src/libmain/progress-bar.hh rename to src/libmain/include/nix/progress-bar.hh index fc1b0fe78..195c5ceee 100644 --- a/src/libmain/progress-bar.hh +++ b/src/libmain/include/nix/progress-bar.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "logging.hh" +#include "nix/logging.hh" namespace nix { diff --git a/src/libmain/shared.hh b/src/libmain/include/nix/shared.hh similarity index 94% rename from src/libmain/shared.hh rename to src/libmain/include/nix/shared.hh index a6a18ceb0..8144ad845 100644 --- a/src/libmain/shared.hh +++ b/src/libmain/include/nix/shared.hh @@ -1,13 +1,13 @@ #pragma once ///@file -#include "file-descriptor.hh" -#include "processes.hh" -#include "args.hh" -#include "args/root.hh" -#include "common-args.hh" -#include "path.hh" -#include "derived-path.hh" +#include "nix/file-descriptor.hh" +#include "nix/processes.hh" +#include "nix/args.hh" +#include "nix/args/root.hh" +#include "nix/common-args.hh" +#include "nix/path.hh" +#include "nix/derived-path.hh" #include diff --git a/src/libmain/loggers.cc b/src/libmain/loggers.cc index 07d83a960..1cf7c6dcf 100644 --- a/src/libmain/loggers.cc +++ b/src/libmain/loggers.cc @@ -1,6 +1,6 @@ -#include "loggers.hh" -#include "environment-variables.hh" -#include "progress-bar.hh" +#include "nix/loggers.hh" +#include "nix/environment-variables.hh" +#include "nix/progress-bar.hh" namespace nix { diff --git a/src/libmain/meson.build b/src/libmain/meson.build index 7c24abb29..08b0bdb4f 100644 --- a/src/libmain/meson.build +++ b/src/libmain/meson.build @@ -42,17 +42,12 @@ configdata.set( description: 'Optionally used for buffering on standard error' ) -config_h = configure_file( - configuration : configdata, - output : 'config-main.hh', -) - add_project_arguments( # TODO(Qyriad): Yes this is how the autoconf+Make system did it. # It would be nice for our headers to be idempotent instead. - '-include', 'config-util.hh', - '-include', 'config-store.hh', - '-include', 'config-main.hh', + '-include', 'nix/config-util.hh', + '-include', 'nix/config-store.hh', + '-include', 'nix/config-main.hh', language : 'cpp', ) @@ -72,15 +67,7 @@ if host_machine.system() != 'windows' ) endif -include_dirs = [include_directories('.')] - -headers = files( - 'common-args.hh', - 'loggers.hh', - 'plugin.hh', - 'progress-bar.hh', - 'shared.hh', -) +subdir('include/nix') subdir('nix-meson-build-support/export-all-symbols') subdir('nix-meson-build-support/windows-version') diff --git a/src/libmain/package.nix b/src/libmain/package.nix index c03697c48..31b36dbcf 100644 --- a/src/libmain/package.nix +++ b/src/libmain/package.nix @@ -27,6 +27,7 @@ mkMesonLibrary (finalAttrs: { ../../.version ./.version ./meson.build + ./include/nix/meson.build (fileset.fileFilter (file: file.hasExt "cc") ./.) (fileset.fileFilter (file: file.hasExt "hh") ./.) ]; diff --git a/src/libmain/plugin.cc b/src/libmain/plugin.cc index ccfd7f900..db1067c1a 100644 --- a/src/libmain/plugin.cc +++ b/src/libmain/plugin.cc @@ -4,8 +4,8 @@ #include -#include "config-global.hh" -#include "signals.hh" +#include "nix/config-global.hh" +#include "nix/signals.hh" namespace nix { diff --git a/src/libmain/progress-bar.cc b/src/libmain/progress-bar.cc index 2d4d901db..eb4db83e6 100644 --- a/src/libmain/progress-bar.cc +++ b/src/libmain/progress-bar.cc @@ -1,8 +1,8 @@ -#include "progress-bar.hh" -#include "terminal.hh" -#include "sync.hh" -#include "store-api.hh" -#include "names.hh" +#include "nix/progress-bar.hh" +#include "nix/terminal.hh" +#include "nix/sync.hh" +#include "nix/store-api.hh" +#include "nix/names.hh" #include #include diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc index bc2ffc9ba..639977efc 100644 --- a/src/libmain/shared.cc +++ b/src/libmain/shared.cc @@ -1,11 +1,11 @@ -#include "globals.hh" -#include "current-process.hh" -#include "shared.hh" -#include "store-api.hh" -#include "gc-store.hh" -#include "loggers.hh" -#include "progress-bar.hh" -#include "signals.hh" +#include "nix/globals.hh" +#include "nix/current-process.hh" +#include "nix/shared.hh" +#include "nix/store-api.hh" +#include "nix/gc-store.hh" +#include "nix/loggers.hh" +#include "nix/progress-bar.hh" +#include "nix/signals.hh" #include #include @@ -22,8 +22,8 @@ #include -#include "exit.hh" -#include "strings.hh" +#include "nix/exit.hh" +#include "nix/strings.hh" namespace nix { diff --git a/src/libmain/unix/stack.cc b/src/libmain/unix/stack.cc index 10f71c1dc..b4ec5967e 100644 --- a/src/libmain/unix/stack.cc +++ b/src/libmain/unix/stack.cc @@ -1,5 +1,5 @@ -#include "error.hh" -#include "shared.hh" +#include "nix/error.hh" +#include "nix/shared.hh" #include #include diff --git a/src/libstore-c/meson.build b/src/libstore-c/meson.build index 2e2275fee..f7e192f3a 100644 --- a/src/libstore-c/meson.build +++ b/src/libstore-c/meson.build @@ -28,8 +28,8 @@ add_project_arguments( # It would be nice for our headers to be idempotent instead. # From C++ libraries, only for internals - '-include', 'config-util.hh', - '-include', 'config-store.hh', + '-include', 'nix/config-util.hh', + '-include', 'nix/config-store.hh', language : 'cpp', ) @@ -62,7 +62,7 @@ this_library = library( install : true, ) -install_headers(headers, subdir : 'nix', preserve_path : true) +install_headers(headers, preserve_path : true) libraries_private = [] diff --git a/src/libstore-c/nix_api_store.cc b/src/libstore-c/nix_api_store.cc index bc306e0d0..ab0af1f52 100644 --- a/src/libstore-c/nix_api_store.cc +++ b/src/libstore-c/nix_api_store.cc @@ -3,11 +3,11 @@ #include "nix_api_util.h" #include "nix_api_util_internal.h" -#include "path.hh" -#include "store-api.hh" -#include "build-result.hh" +#include "nix/path.hh" +#include "nix/store-api.hh" +#include "nix/build-result.hh" -#include "globals.hh" +#include "nix/globals.hh" nix_err nix_libstore_init(nix_c_context * context) { diff --git a/src/libstore-c/nix_api_store_internal.h b/src/libstore-c/nix_api_store_internal.h index 13db0c07c..e32cdfcca 100644 --- a/src/libstore-c/nix_api_store_internal.h +++ b/src/libstore-c/nix_api_store_internal.h @@ -1,6 +1,6 @@ #ifndef NIX_API_STORE_INTERNAL_H #define NIX_API_STORE_INTERNAL_H -#include "store-api.hh" +#include "nix/store-api.hh" struct Store { diff --git a/src/libstore-test-support/tests/derived-path.cc b/src/libstore-test-support/derived-path.cc similarity index 98% rename from src/libstore-test-support/tests/derived-path.cc rename to src/libstore-test-support/derived-path.cc index b9f6a3171..4c04facce 100644 --- a/src/libstore-test-support/tests/derived-path.cc +++ b/src/libstore-test-support/derived-path.cc @@ -2,7 +2,7 @@ #include -#include "tests/derived-path.hh" +#include "nix/tests/derived-path.hh" namespace rc { using namespace nix; diff --git a/src/libstore-test-support/include/nix/meson.build b/src/libstore-test-support/include/nix/meson.build new file mode 100644 index 000000000..ed3e4f2ff --- /dev/null +++ b/src/libstore-test-support/include/nix/meson.build @@ -0,0 +1,12 @@ +# Public headers directory + +include_dirs = [include_directories('..')] + +headers = files( + 'tests/derived-path.hh', + 'tests/libstore.hh', + 'tests/nix_api_store.hh', + 'tests/outputs-spec.hh', + 'tests/path.hh', + 'tests/protocol.hh', +) diff --git a/src/libstore-test-support/tests/derived-path.hh b/src/libstore-test-support/include/nix/tests/derived-path.hh similarity index 86% rename from src/libstore-test-support/tests/derived-path.hh rename to src/libstore-test-support/include/nix/tests/derived-path.hh index 98d61f228..57cad487c 100644 --- a/src/libstore-test-support/tests/derived-path.hh +++ b/src/libstore-test-support/include/nix/tests/derived-path.hh @@ -3,10 +3,10 @@ #include -#include +#include "nix/derived-path.hh" -#include "tests/path.hh" -#include "tests/outputs-spec.hh" +#include "nix/tests/path.hh" +#include "nix/tests/outputs-spec.hh" namespace rc { using namespace nix; diff --git a/src/libstore-test-support/tests/libstore.hh b/src/libstore-test-support/include/nix/tests/libstore.hh similarity index 94% rename from src/libstore-test-support/tests/libstore.hh rename to src/libstore-test-support/include/nix/tests/libstore.hh index 699ba957e..02e818f97 100644 --- a/src/libstore-test-support/tests/libstore.hh +++ b/src/libstore-test-support/include/nix/tests/libstore.hh @@ -4,7 +4,7 @@ #include #include -#include "store-api.hh" +#include "nix/store-api.hh" namespace nix { diff --git a/src/libstore-test-support/tests/nix_api_store.hh b/src/libstore-test-support/include/nix/tests/nix_api_store.hh similarity index 96% rename from src/libstore-test-support/tests/nix_api_store.hh rename to src/libstore-test-support/include/nix/tests/nix_api_store.hh index b7d5c2c33..f418b563d 100644 --- a/src/libstore-test-support/tests/nix_api_store.hh +++ b/src/libstore-test-support/include/nix/tests/nix_api_store.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "tests/nix_api_util.hh" +#include "nix/tests/nix_api_util.hh" -#include "file-system.hh" +#include "nix/file-system.hh" #include #include "nix_api_store.h" diff --git a/src/libstore-test-support/tests/outputs-spec.hh b/src/libstore-test-support/include/nix/tests/outputs-spec.hh similarity index 76% rename from src/libstore-test-support/tests/outputs-spec.hh rename to src/libstore-test-support/include/nix/tests/outputs-spec.hh index f5bf9042d..14a74d2e4 100644 --- a/src/libstore-test-support/tests/outputs-spec.hh +++ b/src/libstore-test-support/include/nix/tests/outputs-spec.hh @@ -3,9 +3,9 @@ #include -#include +#include "nix/outputs-spec.hh" -#include "tests/path.hh" +#include "nix/tests/path.hh" namespace rc { using namespace nix; diff --git a/src/libstore-test-support/tests/path.hh b/src/libstore-test-support/include/nix/tests/path.hh similarity index 94% rename from src/libstore-test-support/tests/path.hh rename to src/libstore-test-support/include/nix/tests/path.hh index 4751b3373..eebcda28e 100644 --- a/src/libstore-test-support/tests/path.hh +++ b/src/libstore-test-support/include/nix/tests/path.hh @@ -3,7 +3,7 @@ #include -#include +#include "nix/path.hh" namespace nix { diff --git a/src/libstore-test-support/tests/protocol.hh b/src/libstore-test-support/include/nix/tests/protocol.hh similarity index 96% rename from src/libstore-test-support/tests/protocol.hh rename to src/libstore-test-support/include/nix/tests/protocol.hh index 3f6799d1c..6c7d69adb 100644 --- a/src/libstore-test-support/tests/protocol.hh +++ b/src/libstore-test-support/include/nix/tests/protocol.hh @@ -4,8 +4,8 @@ #include #include -#include "tests/libstore.hh" -#include "tests/characterization.hh" +#include "nix/tests/libstore.hh" +#include "nix/tests/characterization.hh" namespace nix { diff --git a/src/libstore-test-support/meson.build b/src/libstore-test-support/meson.build index 59d649889..c7d9689bf 100644 --- a/src/libstore-test-support/meson.build +++ b/src/libstore-test-support/meson.build @@ -30,29 +30,20 @@ deps_public += rapidcheck add_project_arguments( # TODO(Qyriad): Yes this is how the autoconf+Make system did it. # It would be nice for our headers to be idempotent instead. - '-include', 'config-util.hh', - '-include', 'config-store.hh', + '-include', 'nix/config-util.hh', + '-include', 'nix/config-store.hh', language : 'cpp', ) subdir('nix-meson-build-support/common') sources = files( - 'tests/derived-path.cc', - 'tests/outputs-spec.cc', - 'tests/path.cc', + 'derived-path.cc', + 'outputs-spec.cc', + 'path.cc', ) -include_dirs = [include_directories('.')] - -headers = files( - 'tests/derived-path.hh', - 'tests/libstore.hh', - 'tests/nix_api_store.hh', - 'tests/outputs-spec.hh', - 'tests/path.hh', - 'tests/protocol.hh', -) +subdir('include/nix') subdir('nix-meson-build-support/export-all-symbols') subdir('nix-meson-build-support/windows-version') diff --git a/src/libstore-test-support/tests/outputs-spec.cc b/src/libstore-test-support/outputs-spec.cc similarity index 95% rename from src/libstore-test-support/tests/outputs-spec.cc rename to src/libstore-test-support/outputs-spec.cc index 1a3020f17..e1b987720 100644 --- a/src/libstore-test-support/tests/outputs-spec.cc +++ b/src/libstore-test-support/outputs-spec.cc @@ -1,4 +1,4 @@ -#include "tests/outputs-spec.hh" +#include "nix/tests/outputs-spec.hh" #include diff --git a/src/libstore-test-support/package.nix b/src/libstore-test-support/package.nix index ccac25ee1..c223ad116 100644 --- a/src/libstore-test-support/package.nix +++ b/src/libstore-test-support/package.nix @@ -29,6 +29,7 @@ mkMesonLibrary (finalAttrs: { ./.version ./meson.build # ./meson.options + ./include/nix/meson.build (fileset.fileFilter (file: file.hasExt "cc") ./.) (fileset.fileFilter (file: file.hasExt "hh") ./.) ]; diff --git a/src/libstore-test-support/tests/path.cc b/src/libstore-test-support/path.cc similarity index 93% rename from src/libstore-test-support/tests/path.cc rename to src/libstore-test-support/path.cc index 8ddda8027..945230187 100644 --- a/src/libstore-test-support/tests/path.cc +++ b/src/libstore-test-support/path.cc @@ -3,11 +3,11 @@ #include -#include "path-regex.hh" -#include "store-api.hh" +#include "nix/path-regex.hh" +#include "nix/store-api.hh" -#include "tests/hash.hh" -#include "tests/path.hh" +#include "nix/tests/hash.hh" +#include "nix/tests/path.hh" namespace nix { diff --git a/src/libstore-tests/common-protocol.cc b/src/libstore-tests/common-protocol.cc index c8f6dd002..39293b0c0 100644 --- a/src/libstore-tests/common-protocol.cc +++ b/src/libstore-tests/common-protocol.cc @@ -3,11 +3,11 @@ #include #include -#include "common-protocol.hh" -#include "common-protocol-impl.hh" -#include "build-result.hh" -#include "tests/protocol.hh" -#include "tests/characterization.hh" +#include "nix/common-protocol.hh" +#include "nix/common-protocol-impl.hh" +#include "nix/build-result.hh" +#include "nix/tests/protocol.hh" +#include "nix/tests/characterization.hh" namespace nix { diff --git a/src/libstore-tests/content-address.cc b/src/libstore-tests/content-address.cc index 72eb84fec..428ebcd76 100644 --- a/src/libstore-tests/content-address.cc +++ b/src/libstore-tests/content-address.cc @@ -1,6 +1,6 @@ #include -#include "content-address.hh" +#include "nix/content-address.hh" namespace nix { diff --git a/src/libstore-tests/derivation-advanced-attrs.cc b/src/libstore-tests/derivation-advanced-attrs.cc index 107cf13e3..d8f9642ab 100644 --- a/src/libstore-tests/derivation-advanced-attrs.cc +++ b/src/libstore-tests/derivation-advanced-attrs.cc @@ -1,16 +1,16 @@ #include #include -#include "experimental-features.hh" -#include "derivations.hh" -#include "derivations.hh" -#include "derivation-options.hh" -#include "parsed-derivations.hh" -#include "types.hh" -#include "json-utils.hh" +#include "nix/experimental-features.hh" +#include "nix/derivations.hh" +#include "nix/derivations.hh" +#include "nix/derivation-options.hh" +#include "nix/parsed-derivations.hh" +#include "nix/types.hh" +#include "nix/json-utils.hh" -#include "tests/libstore.hh" -#include "tests/characterization.hh" +#include "nix/tests/libstore.hh" +#include "nix/tests/characterization.hh" namespace nix { diff --git a/src/libstore-tests/derivation.cc b/src/libstore-tests/derivation.cc index 14652921a..5ef1c0094 100644 --- a/src/libstore-tests/derivation.cc +++ b/src/libstore-tests/derivation.cc @@ -1,11 +1,11 @@ #include #include -#include "experimental-features.hh" -#include "derivations.hh" +#include "nix/experimental-features.hh" +#include "nix/derivations.hh" -#include "tests/libstore.hh" -#include "tests/characterization.hh" +#include "nix/tests/libstore.hh" +#include "nix/tests/characterization.hh" namespace nix { diff --git a/src/libstore-tests/derived-path.cc b/src/libstore-tests/derived-path.cc index 97ded5183..e6a2fcace 100644 --- a/src/libstore-tests/derived-path.cc +++ b/src/libstore-tests/derived-path.cc @@ -3,8 +3,8 @@ #include #include -#include "tests/derived-path.hh" -#include "tests/libstore.hh" +#include "nix/tests/derived-path.hh" +#include "nix/tests/libstore.hh" namespace nix { diff --git a/src/libstore-tests/downstream-placeholder.cc b/src/libstore-tests/downstream-placeholder.cc index fd29530ac..76c6410ad 100644 --- a/src/libstore-tests/downstream-placeholder.cc +++ b/src/libstore-tests/downstream-placeholder.cc @@ -1,6 +1,6 @@ #include -#include "downstream-placeholder.hh" +#include "nix/downstream-placeholder.hh" namespace nix { diff --git a/src/libstore-tests/http-binary-cache-store.cc b/src/libstore-tests/http-binary-cache-store.cc index 1e415f625..bc4e52936 100644 --- a/src/libstore-tests/http-binary-cache-store.cc +++ b/src/libstore-tests/http-binary-cache-store.cc @@ -1,6 +1,6 @@ #include -#include "http-binary-cache-store.hh" +#include "nix/http-binary-cache-store.hh" namespace nix { diff --git a/src/libstore-tests/legacy-ssh-store.cc b/src/libstore-tests/legacy-ssh-store.cc index eb31a2408..5a23cf5b2 100644 --- a/src/libstore-tests/legacy-ssh-store.cc +++ b/src/libstore-tests/legacy-ssh-store.cc @@ -1,6 +1,6 @@ #include -#include "legacy-ssh-store.hh" +#include "nix/legacy-ssh-store.hh" namespace nix { diff --git a/src/libstore-tests/local-binary-cache-store.cc b/src/libstore-tests/local-binary-cache-store.cc index 2e840228d..8adc22202 100644 --- a/src/libstore-tests/local-binary-cache-store.cc +++ b/src/libstore-tests/local-binary-cache-store.cc @@ -1,6 +1,6 @@ #include -#include "local-binary-cache-store.hh" +#include "nix/local-binary-cache-store.hh" namespace nix { diff --git a/src/libstore-tests/local-overlay-store.cc b/src/libstore-tests/local-overlay-store.cc index b34ca9237..8e9d25bc3 100644 --- a/src/libstore-tests/local-overlay-store.cc +++ b/src/libstore-tests/local-overlay-store.cc @@ -3,7 +3,7 @@ #if 0 # include -# include "local-overlay-store.hh" +# include "nix/local-overlay-store.hh" namespace nix { diff --git a/src/libstore-tests/local-store.cc b/src/libstore-tests/local-store.cc index abc3ea796..8977234a3 100644 --- a/src/libstore-tests/local-store.cc +++ b/src/libstore-tests/local-store.cc @@ -3,13 +3,13 @@ #if 0 # include -# include "local-store.hh" +# include "nix/local-store.hh" // Needed for template specialisations. This is not good! When we // overhaul how store configs work, this should be fixed. -# include "args.hh" -# include "config-impl.hh" -# include "abstract-setting-to-json.hh" +# include "nix/args.hh" +# include "nix/config-impl.hh" +# include "nix/abstract-setting-to-json.hh" namespace nix { diff --git a/src/libstore-tests/machines.cc b/src/libstore-tests/machines.cc index 2d66e9534..219494f16 100644 --- a/src/libstore-tests/machines.cc +++ b/src/libstore-tests/machines.cc @@ -1,8 +1,8 @@ -#include "machines.hh" -#include "file-system.hh" -#include "util.hh" +#include "nix/machines.hh" +#include "nix/file-system.hh" +#include "nix/util.hh" -#include "tests/characterization.hh" +#include "nix/tests/characterization.hh" #include #include diff --git a/src/libstore-tests/meson.build b/src/libstore-tests/meson.build index 9f3d8e1d4..0dcfeaacd 100644 --- a/src/libstore-tests/meson.build +++ b/src/libstore-tests/meson.build @@ -43,8 +43,8 @@ deps_private += gtest add_project_arguments( # TODO(Qyriad): Yes this is how the autoconf+Make system did it. # It would be nice for our headers to be idempotent instead. - '-include', 'config-util.hh', - '-include', 'config-store.hh', + '-include', 'nix/config-util.hh', + '-include', 'nix/config-store.hh', language : 'cpp', ) diff --git a/src/libstore-tests/nar-info-disk-cache.cc b/src/libstore-tests/nar-info-disk-cache.cc index b4bdb8329..b15ee351a 100644 --- a/src/libstore-tests/nar-info-disk-cache.cc +++ b/src/libstore-tests/nar-info-disk-cache.cc @@ -1,8 +1,8 @@ -#include "nar-info-disk-cache.hh" +#include "nix/nar-info-disk-cache.hh" #include #include -#include "sqlite.hh" +#include "nix/sqlite.hh" #include diff --git a/src/libstore-tests/nar-info.cc b/src/libstore-tests/nar-info.cc index 0d155743d..544680914 100644 --- a/src/libstore-tests/nar-info.cc +++ b/src/libstore-tests/nar-info.cc @@ -1,11 +1,11 @@ #include #include -#include "path-info.hh" -#include "nar-info.hh" +#include "nix/path-info.hh" +#include "nix/nar-info.hh" -#include "tests/characterization.hh" -#include "tests/libstore.hh" +#include "nix/tests/characterization.hh" +#include "nix/tests/libstore.hh" namespace nix { diff --git a/src/libstore-tests/nix_api_store.cc b/src/libstore-tests/nix_api_store.cc index a8b7b8e5f..b7d9860fb 100644 --- a/src/libstore-tests/nix_api_store.cc +++ b/src/libstore-tests/nix_api_store.cc @@ -3,8 +3,8 @@ #include "nix_api_store.h" #include "nix_api_store_internal.h" -#include "tests/nix_api_store.hh" -#include "tests/string_callback.hh" +#include "nix/tests/nix_api_store.hh" +#include "nix/tests/string_callback.hh" namespace nixC { diff --git a/src/libstore-tests/outputs-spec.cc b/src/libstore-tests/outputs-spec.cc index 63cde681b..007e5a935 100644 --- a/src/libstore-tests/outputs-spec.cc +++ b/src/libstore-tests/outputs-spec.cc @@ -1,4 +1,4 @@ -#include "tests/outputs-spec.hh" +#include "nix/tests/outputs-spec.hh" #include #include diff --git a/src/libstore-tests/path-info.cc b/src/libstore-tests/path-info.cc index d6c4c2a7f..df3b60f13 100644 --- a/src/libstore-tests/path-info.cc +++ b/src/libstore-tests/path-info.cc @@ -1,10 +1,10 @@ #include #include -#include "path-info.hh" +#include "nix/path-info.hh" -#include "tests/characterization.hh" -#include "tests/libstore.hh" +#include "nix/tests/characterization.hh" +#include "nix/tests/libstore.hh" namespace nix { diff --git a/src/libstore-tests/path.cc b/src/libstore-tests/path.cc index c4c055abf..bcfce2c9f 100644 --- a/src/libstore-tests/path.cc +++ b/src/libstore-tests/path.cc @@ -4,12 +4,12 @@ #include #include -#include "path-regex.hh" -#include "store-api.hh" +#include "nix/path-regex.hh" +#include "nix/store-api.hh" -#include "tests/hash.hh" -#include "tests/libstore.hh" -#include "tests/path.hh" +#include "nix/tests/hash.hh" +#include "nix/tests/libstore.hh" +#include "nix/tests/path.hh" namespace nix { diff --git a/src/libstore-tests/references.cc b/src/libstore-tests/references.cc index d91d1cedd..da4b7af39 100644 --- a/src/libstore-tests/references.cc +++ b/src/libstore-tests/references.cc @@ -1,4 +1,4 @@ -#include "references.hh" +#include "nix/references.hh" #include diff --git a/src/libstore-tests/s3-binary-cache-store.cc b/src/libstore-tests/s3-binary-cache-store.cc index 7aa5f2f2c..99db360ce 100644 --- a/src/libstore-tests/s3-binary-cache-store.cc +++ b/src/libstore-tests/s3-binary-cache-store.cc @@ -2,7 +2,7 @@ # include -# include "s3-binary-cache-store.hh" +# include "nix/s3-binary-cache-store.hh" namespace nix { diff --git a/src/libstore-tests/serve-protocol.cc b/src/libstore-tests/serve-protocol.cc index 3dbbf3879..dd53b80d6 100644 --- a/src/libstore-tests/serve-protocol.cc +++ b/src/libstore-tests/serve-protocol.cc @@ -4,13 +4,13 @@ #include #include -#include "serve-protocol.hh" -#include "serve-protocol-impl.hh" -#include "serve-protocol-connection.hh" -#include "build-result.hh" -#include "file-descriptor.hh" -#include "tests/protocol.hh" -#include "tests/characterization.hh" +#include "nix/serve-protocol.hh" +#include "nix/serve-protocol-impl.hh" +#include "nix/serve-protocol-connection.hh" +#include "nix/build-result.hh" +#include "nix/file-descriptor.hh" +#include "nix/tests/protocol.hh" +#include "nix/tests/characterization.hh" namespace nix { diff --git a/src/libstore-tests/ssh-store.cc b/src/libstore-tests/ssh-store.cc index b853a5f1f..1c54a229e 100644 --- a/src/libstore-tests/ssh-store.cc +++ b/src/libstore-tests/ssh-store.cc @@ -3,7 +3,7 @@ #if 0 # include -# include "ssh-store.hh" +# include "nix/ssh-store.hh" namespace nix { diff --git a/src/libstore-tests/store-reference.cc b/src/libstore-tests/store-reference.cc index d4c42f0fd..f8e533fa0 100644 --- a/src/libstore-tests/store-reference.cc +++ b/src/libstore-tests/store-reference.cc @@ -1,11 +1,11 @@ #include #include -#include "file-system.hh" -#include "store-reference.hh" +#include "nix/file-system.hh" +#include "nix/store-reference.hh" -#include "tests/characterization.hh" -#include "tests/libstore.hh" +#include "nix/tests/characterization.hh" +#include "nix/tests/libstore.hh" namespace nix { diff --git a/src/libstore-tests/uds-remote-store.cc b/src/libstore-tests/uds-remote-store.cc index 5ccb20871..7157bfbfd 100644 --- a/src/libstore-tests/uds-remote-store.cc +++ b/src/libstore-tests/uds-remote-store.cc @@ -3,7 +3,7 @@ #if 0 # include -# include "uds-remote-store.hh" +# include "nix/uds-remote-store.hh" namespace nix { diff --git a/src/libstore-tests/worker-protocol.cc b/src/libstore-tests/worker-protocol.cc index 99b042d5b..0a417ed3e 100644 --- a/src/libstore-tests/worker-protocol.cc +++ b/src/libstore-tests/worker-protocol.cc @@ -4,13 +4,13 @@ #include #include -#include "worker-protocol.hh" -#include "worker-protocol-connection.hh" -#include "worker-protocol-impl.hh" -#include "derived-path.hh" -#include "build-result.hh" -#include "tests/protocol.hh" -#include "tests/characterization.hh" +#include "nix/worker-protocol.hh" +#include "nix/worker-protocol-connection.hh" +#include "nix/worker-protocol-impl.hh" +#include "nix/derived-path.hh" +#include "nix/build-result.hh" +#include "nix/tests/protocol.hh" +#include "nix/tests/characterization.hh" namespace nix { diff --git a/src/libstore/binary-cache-store.cc b/src/libstore/binary-cache-store.cc index 896779f85..48c449e79 100644 --- a/src/libstore/binary-cache-store.cc +++ b/src/libstore/binary-cache-store.cc @@ -1,18 +1,18 @@ -#include "archive.hh" -#include "binary-cache-store.hh" -#include "compression.hh" -#include "derivations.hh" -#include "source-accessor.hh" -#include "globals.hh" -#include "nar-info.hh" -#include "sync.hh" -#include "remote-fs-accessor.hh" -#include "nar-info-disk-cache.hh" -#include "nar-accessor.hh" -#include "thread-pool.hh" -#include "callback.hh" -#include "signals.hh" -#include "archive.hh" +#include "nix/archive.hh" +#include "nix/binary-cache-store.hh" +#include "nix/compression.hh" +#include "nix/derivations.hh" +#include "nix/source-accessor.hh" +#include "nix/globals.hh" +#include "nix/nar-info.hh" +#include "nix/sync.hh" +#include "nix/remote-fs-accessor.hh" +#include "nix/nar-info-disk-cache.hh" +#include "nix/nar-accessor.hh" +#include "nix/thread-pool.hh" +#include "nix/callback.hh" +#include "nix/signals.hh" +#include "nix/archive.hh" #include #include diff --git a/src/libstore/build-result.cc b/src/libstore/build-result.cc index 96cbfd62f..72ad11fae 100644 --- a/src/libstore/build-result.cc +++ b/src/libstore/build-result.cc @@ -1,4 +1,4 @@ -#include "build-result.hh" +#include "nix/build-result.hh" namespace nix { diff --git a/src/libstore/build/derivation-goal.cc b/src/libstore/build/derivation-goal.cc index 01da37df6..c2858bd34 100644 --- a/src/libstore/build/derivation-goal.cc +++ b/src/libstore/build/derivation-goal.cc @@ -1,22 +1,22 @@ -#include "derivation-goal.hh" +#include "nix/build/derivation-goal.hh" #ifndef _WIN32 // TODO enable build hook on Windows -# include "hook-instance.hh" +# include "nix/build/hook-instance.hh" #endif -#include "processes.hh" -#include "config-global.hh" -#include "worker.hh" -#include "builtins.hh" -#include "builtins/buildenv.hh" -#include "references.hh" -#include "finally.hh" -#include "util.hh" -#include "archive.hh" -#include "compression.hh" -#include "common-protocol.hh" -#include "common-protocol-impl.hh" -#include "topo-sort.hh" -#include "callback.hh" -#include "local-store.hh" // TODO remove, along with remaining downcasts +#include "nix/processes.hh" +#include "nix/config-global.hh" +#include "nix/build/worker.hh" +#include "nix/builtins.hh" +#include "nix/builtins/buildenv.hh" +#include "nix/references.hh" +#include "nix/finally.hh" +#include "nix/util.hh" +#include "nix/archive.hh" +#include "nix/compression.hh" +#include "nix/common-protocol.hh" +#include "nix/common-protocol-impl.hh" +#include "nix/topo-sort.hh" +#include "nix/callback.hh" +#include "nix/local-store.hh" // TODO remove, along with remaining downcasts #include #include @@ -32,7 +32,7 @@ #include -#include "strings.hh" +#include "nix/strings.hh" namespace nix { diff --git a/src/libstore/build/drv-output-substitution-goal.cc b/src/libstore/build/drv-output-substitution-goal.cc index f069c0d94..18853e531 100644 --- a/src/libstore/build/drv-output-substitution-goal.cc +++ b/src/libstore/build/drv-output-substitution-goal.cc @@ -1,8 +1,8 @@ -#include "drv-output-substitution-goal.hh" -#include "finally.hh" -#include "worker.hh" -#include "substitution-goal.hh" -#include "callback.hh" +#include "nix/build/drv-output-substitution-goal.hh" +#include "nix/finally.hh" +#include "nix/build/worker.hh" +#include "nix/build/substitution-goal.hh" +#include "nix/callback.hh" namespace nix { diff --git a/src/libstore/build/entry-points.cc b/src/libstore/build/entry-points.cc index 3bf22320e..70b32d3ad 100644 --- a/src/libstore/build/entry-points.cc +++ b/src/libstore/build/entry-points.cc @@ -1,10 +1,10 @@ -#include "worker.hh" -#include "substitution-goal.hh" +#include "nix/build/worker.hh" +#include "nix/build/substitution-goal.hh" #ifndef _WIN32 // TODO Enable building on Windows -# include "derivation-goal.hh" +# include "nix/build/derivation-goal.hh" #endif -#include "local-store.hh" -#include "strings.hh" +#include "nix/local-store.hh" +#include "nix/strings.hh" namespace nix { diff --git a/src/libstore/build/goal.cc b/src/libstore/build/goal.cc index 9a16da145..baee4ff16 100644 --- a/src/libstore/build/goal.cc +++ b/src/libstore/build/goal.cc @@ -1,5 +1,5 @@ -#include "goal.hh" -#include "worker.hh" +#include "nix/build/goal.hh" +#include "nix/build/worker.hh" namespace nix { diff --git a/src/libstore/build/substitution-goal.cc b/src/libstore/build/substitution-goal.cc index 983c86601..6794fe73f 100644 --- a/src/libstore/build/substitution-goal.cc +++ b/src/libstore/build/substitution-goal.cc @@ -1,8 +1,8 @@ -#include "worker.hh" -#include "substitution-goal.hh" -#include "nar-info.hh" -#include "finally.hh" -#include "signals.hh" +#include "nix/build/worker.hh" +#include "nix/build/substitution-goal.hh" +#include "nix/nar-info.hh" +#include "nix/finally.hh" +#include "nix/signals.hh" #include namespace nix { diff --git a/src/libstore/build/worker.cc b/src/libstore/build/worker.cc index dbe86f43f..38e965d35 100644 --- a/src/libstore/build/worker.cc +++ b/src/libstore/build/worker.cc @@ -1,14 +1,14 @@ -#include "local-store.hh" -#include "machines.hh" -#include "worker.hh" -#include "substitution-goal.hh" -#include "drv-output-substitution-goal.hh" -#include "derivation-goal.hh" +#include "nix/local-store.hh" +#include "nix/machines.hh" +#include "nix/build/worker.hh" +#include "nix/build/substitution-goal.hh" +#include "nix/build/drv-output-substitution-goal.hh" +#include "nix/build/derivation-goal.hh" #ifndef _WIN32 // TODO Enable building on Windows -# include "local-derivation-goal.hh" -# include "hook-instance.hh" +# include "nix/build/local-derivation-goal.hh" +# include "nix/build/hook-instance.hh" #endif -#include "signals.hh" +#include "nix/signals.hh" namespace nix { diff --git a/src/libstore/builtins/buildenv.cc b/src/libstore/builtins/buildenv.cc index 0f7bcd99b..4145593cf 100644 --- a/src/libstore/builtins/buildenv.cc +++ b/src/libstore/builtins/buildenv.cc @@ -1,6 +1,6 @@ -#include "buildenv.hh" -#include "derivations.hh" -#include "signals.hh" +#include "nix/builtins/buildenv.hh" +#include "nix/derivations.hh" +#include "nix/signals.hh" #include #include diff --git a/src/libstore/builtins/fetchurl.cc b/src/libstore/builtins/fetchurl.cc index 90e58dfdb..28af8427c 100644 --- a/src/libstore/builtins/fetchurl.cc +++ b/src/libstore/builtins/fetchurl.cc @@ -1,8 +1,8 @@ -#include "builtins.hh" -#include "filetransfer.hh" -#include "store-api.hh" -#include "archive.hh" -#include "compression.hh" +#include "nix/builtins.hh" +#include "nix/filetransfer.hh" +#include "nix/store-api.hh" +#include "nix/archive.hh" +#include "nix/compression.hh" namespace nix { diff --git a/src/libstore/builtins/unpack-channel.cc b/src/libstore/builtins/unpack-channel.cc index 43fbb62cd..9e76ee7d3 100644 --- a/src/libstore/builtins/unpack-channel.cc +++ b/src/libstore/builtins/unpack-channel.cc @@ -1,5 +1,5 @@ -#include "builtins.hh" -#include "tarfile.hh" +#include "nix/builtins.hh" +#include "nix/tarfile.hh" namespace nix { diff --git a/src/libstore/common-protocol.cc b/src/libstore/common-protocol.cc index fc2b5ac6f..4845d5873 100644 --- a/src/libstore/common-protocol.cc +++ b/src/libstore/common-protocol.cc @@ -1,11 +1,11 @@ -#include "serialise.hh" -#include "path-with-outputs.hh" -#include "store-api.hh" -#include "build-result.hh" -#include "common-protocol.hh" -#include "common-protocol-impl.hh" -#include "archive.hh" -#include "derivations.hh" +#include "nix/serialise.hh" +#include "nix/path-with-outputs.hh" +#include "nix/store-api.hh" +#include "nix/build-result.hh" +#include "nix/common-protocol.hh" +#include "nix/common-protocol-impl.hh" +#include "nix/archive.hh" +#include "nix/derivations.hh" #include diff --git a/src/libstore/common-ssh-store-config.cc b/src/libstore/common-ssh-store-config.cc index 05332b9bb..d4123e326 100644 --- a/src/libstore/common-ssh-store-config.cc +++ b/src/libstore/common-ssh-store-config.cc @@ -1,7 +1,7 @@ #include -#include "common-ssh-store-config.hh" -#include "ssh.hh" +#include "nix/common-ssh-store-config.hh" +#include "nix/ssh.hh" namespace nix { diff --git a/src/libstore/content-address.cc b/src/libstore/content-address.cc index e1cdfece6..a3745b4ef 100644 --- a/src/libstore/content-address.cc +++ b/src/libstore/content-address.cc @@ -1,6 +1,6 @@ -#include "args.hh" -#include "content-address.hh" -#include "split.hh" +#include "nix/args.hh" +#include "nix/content-address.hh" +#include "nix/split.hh" namespace nix { diff --git a/src/libstore/daemon.cc b/src/libstore/daemon.cc index 60cb64b7b..bce285141 100644 --- a/src/libstore/daemon.cc +++ b/src/libstore/daemon.cc @@ -1,23 +1,23 @@ -#include "daemon.hh" -#include "signals.hh" -#include "worker-protocol.hh" -#include "worker-protocol-connection.hh" -#include "worker-protocol-impl.hh" -#include "build-result.hh" -#include "store-api.hh" -#include "store-cast.hh" -#include "gc-store.hh" -#include "log-store.hh" -#include "indirect-root-store.hh" -#include "path-with-outputs.hh" -#include "finally.hh" -#include "archive.hh" -#include "derivations.hh" -#include "args.hh" -#include "git.hh" +#include "nix/daemon.hh" +#include "nix/signals.hh" +#include "nix/worker-protocol.hh" +#include "nix/worker-protocol-connection.hh" +#include "nix/worker-protocol-impl.hh" +#include "nix/build-result.hh" +#include "nix/store-api.hh" +#include "nix/store-cast.hh" +#include "nix/gc-store.hh" +#include "nix/log-store.hh" +#include "nix/indirect-root-store.hh" +#include "nix/path-with-outputs.hh" +#include "nix/finally.hh" +#include "nix/archive.hh" +#include "nix/derivations.hh" +#include "nix/args.hh" +#include "nix/git.hh" #ifndef _WIN32 // TODO need graceful async exit support on Windows? -# include "monitor-fd.hh" +# include "nix/monitor-fd.hh" #endif #include diff --git a/src/libstore/derivation-options.cc b/src/libstore/derivation-options.cc index 1fc1718f7..8683fd8ad 100644 --- a/src/libstore/derivation-options.cc +++ b/src/libstore/derivation-options.cc @@ -1,8 +1,8 @@ -#include "derivation-options.hh" -#include "json-utils.hh" -#include "parsed-derivations.hh" -#include "types.hh" -#include "util.hh" +#include "nix/derivation-options.hh" +#include "nix/json-utils.hh" +#include "nix/parsed-derivations.hh" +#include "nix/types.hh" +#include "nix/util.hh" #include #include #include diff --git a/src/libstore/derivations.cc b/src/libstore/derivations.cc index b54838a0a..4c027d64b 100644 --- a/src/libstore/derivations.cc +++ b/src/libstore/derivations.cc @@ -1,14 +1,14 @@ -#include "derivations.hh" -#include "downstream-placeholder.hh" -#include "store-api.hh" -#include "globals.hh" -#include "types.hh" -#include "util.hh" -#include "split.hh" -#include "common-protocol.hh" -#include "common-protocol-impl.hh" -#include "strings-inline.hh" -#include "json-utils.hh" +#include "nix/derivations.hh" +#include "nix/downstream-placeholder.hh" +#include "nix/store-api.hh" +#include "nix/globals.hh" +#include "nix/types.hh" +#include "nix/util.hh" +#include "nix/split.hh" +#include "nix/common-protocol.hh" +#include "nix/common-protocol-impl.hh" +#include "nix/strings-inline.hh" +#include "nix/json-utils.hh" #include #include diff --git a/src/libstore/derived-path-map.cc b/src/libstore/derived-path-map.cc index c97d52773..cb6d98d5a 100644 --- a/src/libstore/derived-path-map.cc +++ b/src/libstore/derived-path-map.cc @@ -1,5 +1,5 @@ -#include "derived-path-map.hh" -#include "util.hh" +#include "nix/derived-path-map.hh" +#include "nix/util.hh" namespace nix { diff --git a/src/libstore/derived-path.cc b/src/libstore/derived-path.cc index 1eef881de..94f8d93f7 100644 --- a/src/libstore/derived-path.cc +++ b/src/libstore/derived-path.cc @@ -1,7 +1,7 @@ -#include "derived-path.hh" -#include "derivations.hh" -#include "store-api.hh" -#include "comparator.hh" +#include "nix/derived-path.hh" +#include "nix/derivations.hh" +#include "nix/store-api.hh" +#include "nix/comparator.hh" #include diff --git a/src/libstore/downstream-placeholder.cc b/src/libstore/downstream-placeholder.cc index 91d47f946..52c46ddee 100644 --- a/src/libstore/downstream-placeholder.cc +++ b/src/libstore/downstream-placeholder.cc @@ -1,5 +1,5 @@ -#include "downstream-placeholder.hh" -#include "derivations.hh" +#include "nix/downstream-placeholder.hh" +#include "nix/derivations.hh" namespace nix { diff --git a/src/libstore/dummy-store.cc b/src/libstore/dummy-store.cc index c1e871e93..b922b30a6 100644 --- a/src/libstore/dummy-store.cc +++ b/src/libstore/dummy-store.cc @@ -1,5 +1,5 @@ -#include "store-api.hh" -#include "callback.hh" +#include "nix/store-api.hh" +#include "nix/callback.hh" namespace nix { diff --git a/src/libstore/export-import.cc b/src/libstore/export-import.cc index 1c62cdfad..efec2a409 100644 --- a/src/libstore/export-import.cc +++ b/src/libstore/export-import.cc @@ -1,8 +1,8 @@ -#include "serialise.hh" -#include "store-api.hh" -#include "archive.hh" -#include "common-protocol.hh" -#include "common-protocol-impl.hh" +#include "nix/serialise.hh" +#include "nix/store-api.hh" +#include "nix/archive.hh" +#include "nix/common-protocol.hh" +#include "nix/common-protocol-impl.hh" #include diff --git a/src/libstore/filetransfer.cc b/src/libstore/filetransfer.cc index 1525ef5fb..fc77b6150 100644 --- a/src/libstore/filetransfer.cc +++ b/src/libstore/filetransfer.cc @@ -1,19 +1,19 @@ -#include "filetransfer.hh" -#include "globals.hh" -#include "config-global.hh" -#include "store-api.hh" -#include "s3.hh" -#include "compression.hh" -#include "finally.hh" -#include "callback.hh" -#include "signals.hh" +#include "nix/filetransfer.hh" +#include "nix/globals.hh" +#include "nix/config-global.hh" +#include "nix/store-api.hh" +#include "nix/s3.hh" +#include "nix/compression.hh" +#include "nix/finally.hh" +#include "nix/callback.hh" +#include "nix/signals.hh" #if ENABLE_S3 #include #endif #if __linux__ -# include "namespaces.hh" +# include "nix/namespaces.hh" #endif #include diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc index ac354f3fa..81294a5b9 100644 --- a/src/libstore/gc.cc +++ b/src/libstore/gc.cc @@ -1,14 +1,14 @@ -#include "derivations.hh" -#include "globals.hh" -#include "local-store.hh" -#include "finally.hh" -#include "unix-domain-socket.hh" -#include "signals.hh" -#include "posix-fs-canonicalise.hh" +#include "nix/derivations.hh" +#include "nix/globals.hh" +#include "nix/local-store.hh" +#include "nix/finally.hh" +#include "nix/unix-domain-socket.hh" +#include "nix/signals.hh" +#include "nix/posix-fs-canonicalise.hh" #if !defined(__linux__) // For shelling out to lsof -# include "processes.hh" +# include "nix/processes.hh" #endif #include diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc index d7c000dfa..4f8c53ca8 100644 --- a/src/libstore/globals.cc +++ b/src/libstore/globals.cc @@ -1,11 +1,11 @@ -#include "globals.hh" -#include "config-global.hh" -#include "current-process.hh" -#include "archive.hh" -#include "args.hh" -#include "abstract-setting-to-json.hh" -#include "compute-levels.hh" -#include "signals.hh" +#include "nix/globals.hh" +#include "nix/config-global.hh" +#include "nix/current-process.hh" +#include "nix/archive.hh" +#include "nix/args.hh" +#include "nix/abstract-setting-to-json.hh" +#include "nix/compute-levels.hh" +#include "nix/signals.hh" #include #include @@ -26,16 +26,16 @@ #endif #if __APPLE__ -# include "processes.hh" +# include "nix/processes.hh" #endif -#include "config-impl.hh" +#include "nix/config-impl.hh" #ifdef __APPLE__ #include #endif -#include "strings.hh" +#include "nix/strings.hh" namespace nix { diff --git a/src/libstore/http-binary-cache-store.cc b/src/libstore/http-binary-cache-store.cc index f32616f94..a8d77f753 100644 --- a/src/libstore/http-binary-cache-store.cc +++ b/src/libstore/http-binary-cache-store.cc @@ -1,8 +1,8 @@ -#include "http-binary-cache-store.hh" -#include "filetransfer.hh" -#include "globals.hh" -#include "nar-info-disk-cache.hh" -#include "callback.hh" +#include "nix/http-binary-cache-store.hh" +#include "nix/filetransfer.hh" +#include "nix/globals.hh" +#include "nix/nar-info-disk-cache.hh" +#include "nix/callback.hh" namespace nix { diff --git a/src/libstore/binary-cache-store.hh b/src/libstore/include/nix/binary-cache-store.hh similarity index 97% rename from src/libstore/binary-cache-store.hh rename to src/libstore/include/nix/binary-cache-store.hh index 6bd7fd14a..ec012cda8 100644 --- a/src/libstore/binary-cache-store.hh +++ b/src/libstore/include/nix/binary-cache-store.hh @@ -1,11 +1,11 @@ #pragma once ///@file -#include "signature/local-keys.hh" -#include "store-api.hh" -#include "log-store.hh" +#include "nix/signature/local-keys.hh" +#include "nix/store-api.hh" +#include "nix/log-store.hh" -#include "pool.hh" +#include "nix/pool.hh" #include diff --git a/src/libstore/build-result.hh b/src/libstore/include/nix/build-result.hh similarity index 98% rename from src/libstore/build-result.hh rename to src/libstore/include/nix/build-result.hh index 8c66cfeb3..20d726346 100644 --- a/src/libstore/build-result.hh +++ b/src/libstore/include/nix/build-result.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "realisation.hh" -#include "derived-path.hh" +#include "nix/realisation.hh" +#include "nix/derived-path.hh" #include #include diff --git a/src/libstore/build/derivation-goal.hh b/src/libstore/include/nix/build/derivation-goal.hh similarity index 97% rename from src/libstore/build/derivation-goal.hh rename to src/libstore/include/nix/build/derivation-goal.hh index 4622cb2b1..6e51956fd 100644 --- a/src/libstore/build/derivation-goal.hh +++ b/src/libstore/include/nix/build/derivation-goal.hh @@ -1,15 +1,15 @@ #pragma once ///@file -#include "parsed-derivations.hh" -#include "derivation-options.hh" +#include "nix/parsed-derivations.hh" +#include "nix/derivation-options.hh" #ifndef _WIN32 -# include "user-lock.hh" +# include "nix/user-lock.hh" #endif -#include "outputs-spec.hh" -#include "store-api.hh" -#include "pathlocks.hh" -#include "goal.hh" +#include "nix/outputs-spec.hh" +#include "nix/store-api.hh" +#include "nix/pathlocks.hh" +#include "nix/build/goal.hh" namespace nix { diff --git a/src/libstore/build/drv-output-substitution-goal.hh b/src/libstore/include/nix/build/drv-output-substitution-goal.hh similarity index 89% rename from src/libstore/build/drv-output-substitution-goal.hh rename to src/libstore/include/nix/build/drv-output-substitution-goal.hh index 8c60d0198..94db4fbbc 100644 --- a/src/libstore/build/drv-output-substitution-goal.hh +++ b/src/libstore/include/nix/build/drv-output-substitution-goal.hh @@ -4,10 +4,10 @@ #include #include -#include "store-api.hh" -#include "goal.hh" -#include "realisation.hh" -#include "muxable-pipe.hh" +#include "nix/store-api.hh" +#include "nix/build/goal.hh" +#include "nix/realisation.hh" +#include "nix/muxable-pipe.hh" namespace nix { diff --git a/src/libstore/build/goal.hh b/src/libstore/include/nix/build/goal.hh similarity index 99% rename from src/libstore/build/goal.hh rename to src/libstore/include/nix/build/goal.hh index 1dd7ed525..53e1f4ba2 100644 --- a/src/libstore/build/goal.hh +++ b/src/libstore/include/nix/build/goal.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "store-api.hh" -#include "build-result.hh" +#include "nix/store-api.hh" +#include "nix/build-result.hh" #include diff --git a/src/libstore/build/substitution-goal.hh b/src/libstore/include/nix/build/substitution-goal.hh similarity index 94% rename from src/libstore/build/substitution-goal.hh rename to src/libstore/include/nix/build/substitution-goal.hh index f2cf797e5..c8139025c 100644 --- a/src/libstore/build/substitution-goal.hh +++ b/src/libstore/include/nix/build/substitution-goal.hh @@ -1,10 +1,10 @@ #pragma once ///@file -#include "worker.hh" -#include "store-api.hh" -#include "goal.hh" -#include "muxable-pipe.hh" +#include "nix/build/worker.hh" +#include "nix/store-api.hh" +#include "nix/build/goal.hh" +#include "nix/muxable-pipe.hh" #include #include #include diff --git a/src/libstore/build/worker.hh b/src/libstore/include/nix/build/worker.hh similarity index 98% rename from src/libstore/build/worker.hh rename to src/libstore/include/nix/build/worker.hh index f5e617208..467e258df 100644 --- a/src/libstore/build/worker.hh +++ b/src/libstore/include/nix/build/worker.hh @@ -1,11 +1,11 @@ #pragma once ///@file -#include "types.hh" -#include "store-api.hh" -#include "goal.hh" -#include "realisation.hh" -#include "muxable-pipe.hh" +#include "nix/types.hh" +#include "nix/store-api.hh" +#include "nix/build/goal.hh" +#include "nix/realisation.hh" +#include "nix/muxable-pipe.hh" #include #include diff --git a/src/libstore/builtins.hh b/src/libstore/include/nix/builtins.hh similarity index 92% rename from src/libstore/builtins.hh rename to src/libstore/include/nix/builtins.hh index 091946e01..5943ae507 100644 --- a/src/libstore/builtins.hh +++ b/src/libstore/include/nix/builtins.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "derivations.hh" +#include "nix/derivations.hh" namespace nix { diff --git a/src/libstore/builtins/buildenv.hh b/src/libstore/include/nix/builtins/buildenv.hh similarity index 97% rename from src/libstore/builtins/buildenv.hh rename to src/libstore/include/nix/builtins/buildenv.hh index 8e112e176..00fc3bf90 100644 --- a/src/libstore/builtins/buildenv.hh +++ b/src/libstore/include/nix/builtins/buildenv.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "store-api.hh" +#include "nix/store-api.hh" namespace nix { diff --git a/src/libstore/common-protocol-impl.hh b/src/libstore/include/nix/common-protocol-impl.hh similarity index 93% rename from src/libstore/common-protocol-impl.hh rename to src/libstore/include/nix/common-protocol-impl.hh index 360882c02..71d5fc015 100644 --- a/src/libstore/common-protocol-impl.hh +++ b/src/libstore/include/nix/common-protocol-impl.hh @@ -8,8 +8,8 @@ * contributing guide. */ -#include "common-protocol.hh" -#include "length-prefixed-protocol-helper.hh" +#include "nix/common-protocol.hh" +#include "nix/length-prefixed-protocol-helper.hh" namespace nix { diff --git a/src/libstore/common-protocol.hh b/src/libstore/include/nix/common-protocol.hh similarity index 99% rename from src/libstore/common-protocol.hh rename to src/libstore/include/nix/common-protocol.hh index a878e84c9..260f19256 100644 --- a/src/libstore/common-protocol.hh +++ b/src/libstore/include/nix/common-protocol.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "serialise.hh" +#include "nix/serialise.hh" namespace nix { diff --git a/src/libstore/common-ssh-store-config.hh b/src/libstore/include/nix/common-ssh-store-config.hh similarity index 98% rename from src/libstore/common-ssh-store-config.hh rename to src/libstore/include/nix/common-ssh-store-config.hh index 5deb6f4c9..54aa8cb5e 100644 --- a/src/libstore/common-ssh-store-config.hh +++ b/src/libstore/include/nix/common-ssh-store-config.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "store-api.hh" +#include "nix/store-api.hh" namespace nix { diff --git a/src/libstore/content-address.hh b/src/libstore/include/nix/content-address.hh similarity index 98% rename from src/libstore/content-address.hh rename to src/libstore/include/nix/content-address.hh index 2b5d1296a..6a2cbb1ef 100644 --- a/src/libstore/content-address.hh +++ b/src/libstore/include/nix/content-address.hh @@ -2,10 +2,10 @@ ///@file #include -#include "hash.hh" -#include "path.hh" -#include "file-content-address.hh" -#include "variant-wrapper.hh" +#include "nix/hash.hh" +#include "nix/path.hh" +#include "nix/file-content-address.hh" +#include "nix/variant-wrapper.hh" namespace nix { diff --git a/src/libstore/daemon.hh b/src/libstore/include/nix/daemon.hh similarity index 82% rename from src/libstore/daemon.hh rename to src/libstore/include/nix/daemon.hh index a8ce32d8d..38df57967 100644 --- a/src/libstore/daemon.hh +++ b/src/libstore/include/nix/daemon.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "serialise.hh" -#include "store-api.hh" +#include "nix/serialise.hh" +#include "nix/store-api.hh" namespace nix::daemon { diff --git a/src/libstore/derivation-options.hh b/src/libstore/include/nix/derivation-options.hh similarity index 98% rename from src/libstore/derivation-options.hh rename to src/libstore/include/nix/derivation-options.hh index 6e4ea5cd9..459b7de78 100644 --- a/src/libstore/derivation-options.hh +++ b/src/libstore/include/nix/derivation-options.hh @@ -6,8 +6,8 @@ #include #include -#include "types.hh" -#include "json-impls.hh" +#include "nix/types.hh" +#include "nix/json-impls.hh" namespace nix { diff --git a/src/libstore/derivations.hh b/src/libstore/include/nix/derivations.hh similarity index 98% rename from src/libstore/derivations.hh rename to src/libstore/include/nix/derivations.hh index 5b2101ed5..997cead4f 100644 --- a/src/libstore/derivations.hh +++ b/src/libstore/include/nix/derivations.hh @@ -1,14 +1,14 @@ #pragma once ///@file -#include "path.hh" -#include "types.hh" -#include "hash.hh" -#include "content-address.hh" -#include "repair-flag.hh" -#include "derived-path-map.hh" -#include "sync.hh" -#include "variant-wrapper.hh" +#include "nix/path.hh" +#include "nix/types.hh" +#include "nix/hash.hh" +#include "nix/content-address.hh" +#include "nix/repair-flag.hh" +#include "nix/derived-path-map.hh" +#include "nix/sync.hh" +#include "nix/variant-wrapper.hh" #include #include diff --git a/src/libstore/derived-path-map.hh b/src/libstore/include/nix/derived-path-map.hh similarity index 98% rename from src/libstore/derived-path-map.hh rename to src/libstore/include/nix/derived-path-map.hh index bd60fe887..24c5ca3d7 100644 --- a/src/libstore/derived-path-map.hh +++ b/src/libstore/include/nix/derived-path-map.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "types.hh" -#include "derived-path.hh" +#include "nix/types.hh" +#include "nix/derived-path.hh" namespace nix { diff --git a/src/libstore/derived-path.hh b/src/libstore/include/nix/derived-path.hh similarity index 98% rename from src/libstore/derived-path.hh rename to src/libstore/include/nix/derived-path.hh index 4ba3fb37d..719ae0350 100644 --- a/src/libstore/derived-path.hh +++ b/src/libstore/include/nix/derived-path.hh @@ -1,10 +1,10 @@ #pragma once ///@file -#include "path.hh" -#include "outputs-spec.hh" -#include "config.hh" -#include "ref.hh" +#include "nix/path.hh" +#include "nix/outputs-spec.hh" +#include "nix/config.hh" +#include "nix/ref.hh" #include diff --git a/src/libstore/downstream-placeholder.hh b/src/libstore/include/nix/downstream-placeholder.hh similarity index 97% rename from src/libstore/downstream-placeholder.hh rename to src/libstore/include/nix/downstream-placeholder.hh index c911ecea2..eb6662d3b 100644 --- a/src/libstore/downstream-placeholder.hh +++ b/src/libstore/include/nix/downstream-placeholder.hh @@ -1,9 +1,9 @@ #pragma once ///@file -#include "hash.hh" -#include "path.hh" -#include "derived-path.hh" +#include "nix/hash.hh" +#include "nix/path.hh" +#include "nix/derived-path.hh" namespace nix { diff --git a/src/libstore/filetransfer.hh b/src/libstore/include/nix/filetransfer.hh similarity index 97% rename from src/libstore/filetransfer.hh rename to src/libstore/include/nix/filetransfer.hh index 0ecc7f376..31ad1aabd 100644 --- a/src/libstore/filetransfer.hh +++ b/src/libstore/include/nix/filetransfer.hh @@ -4,11 +4,11 @@ #include #include -#include "logging.hh" -#include "types.hh" -#include "ref.hh" -#include "config.hh" -#include "serialise.hh" +#include "nix/logging.hh" +#include "nix/types.hh" +#include "nix/ref.hh" +#include "nix/config.hh" +#include "nix/serialise.hh" namespace nix { diff --git a/src/libstore/gc-store.hh b/src/libstore/include/nix/gc-store.hh similarity index 99% rename from src/libstore/gc-store.hh rename to src/libstore/include/nix/gc-store.hh index 020f770b0..f5f685540 100644 --- a/src/libstore/gc-store.hh +++ b/src/libstore/include/nix/gc-store.hh @@ -3,7 +3,7 @@ #include -#include "store-api.hh" +#include "nix/store-api.hh" namespace nix { diff --git a/src/libstore/globals.hh b/src/libstore/include/nix/globals.hh similarity index 99% rename from src/libstore/globals.hh rename to src/libstore/include/nix/globals.hh index c539ff836..bda883890 100644 --- a/src/libstore/globals.hh +++ b/src/libstore/include/nix/globals.hh @@ -1,11 +1,11 @@ #pragma once ///@file -#include "types.hh" -#include "config.hh" -#include "environment-variables.hh" -#include "experimental-features.hh" -#include "users.hh" +#include "nix/types.hh" +#include "nix/config.hh" +#include "nix/environment-variables.hh" +#include "nix/experimental-features.hh" +#include "nix/users.hh" #include #include diff --git a/src/libstore/http-binary-cache-store.hh b/src/libstore/include/nix/http-binary-cache-store.hh similarity index 94% rename from src/libstore/http-binary-cache-store.hh rename to src/libstore/include/nix/http-binary-cache-store.hh index d2fc43210..9dadda4d3 100644 --- a/src/libstore/http-binary-cache-store.hh +++ b/src/libstore/include/nix/http-binary-cache-store.hh @@ -1,4 +1,4 @@ -#include "binary-cache-store.hh" +#include "nix/binary-cache-store.hh" namespace nix { diff --git a/src/libstore/indirect-root-store.hh b/src/libstore/include/nix/indirect-root-store.hh similarity index 98% rename from src/libstore/indirect-root-store.hh rename to src/libstore/include/nix/indirect-root-store.hh index b74ebc1ee..de4de138b 100644 --- a/src/libstore/indirect-root-store.hh +++ b/src/libstore/include/nix/indirect-root-store.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "local-fs-store.hh" +#include "nix/local-fs-store.hh" namespace nix { diff --git a/src/libstore/keys.hh b/src/libstore/include/nix/keys.hh similarity index 66% rename from src/libstore/keys.hh rename to src/libstore/include/nix/keys.hh index 3da19493f..ae0fa8d02 100644 --- a/src/libstore/keys.hh +++ b/src/libstore/include/nix/keys.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "signature/local-keys.hh" +#include "nix/signature/local-keys.hh" namespace nix { diff --git a/src/libstore/legacy-ssh-store.hh b/src/libstore/include/nix/legacy-ssh-store.hh similarity index 97% rename from src/libstore/legacy-ssh-store.hh rename to src/libstore/include/nix/legacy-ssh-store.hh index 92aa4ae56..9c4a9230d 100644 --- a/src/libstore/legacy-ssh-store.hh +++ b/src/libstore/include/nix/legacy-ssh-store.hh @@ -1,12 +1,12 @@ #pragma once ///@file -#include "common-ssh-store-config.hh" -#include "store-api.hh" -#include "ssh.hh" -#include "callback.hh" -#include "pool.hh" -#include "serve-protocol.hh" +#include "nix/common-ssh-store-config.hh" +#include "nix/store-api.hh" +#include "nix/ssh.hh" +#include "nix/callback.hh" +#include "nix/pool.hh" +#include "nix/serve-protocol.hh" namespace nix { diff --git a/src/libstore/length-prefixed-protocol-helper.hh b/src/libstore/include/nix/length-prefixed-protocol-helper.hh similarity index 99% rename from src/libstore/length-prefixed-protocol-helper.hh rename to src/libstore/include/nix/length-prefixed-protocol-helper.hh index 7e977bbf1..ad7b32793 100644 --- a/src/libstore/length-prefixed-protocol-helper.hh +++ b/src/libstore/include/nix/length-prefixed-protocol-helper.hh @@ -8,7 +8,7 @@ * Used by both the Worker and Serve protocols. */ -#include "types.hh" +#include "nix/types.hh" namespace nix { diff --git a/src/libstore/local-binary-cache-store.hh b/src/libstore/include/nix/local-binary-cache-store.hh similarity index 92% rename from src/libstore/local-binary-cache-store.hh rename to src/libstore/include/nix/local-binary-cache-store.hh index 997e8ecbb..acff6621d 100644 --- a/src/libstore/local-binary-cache-store.hh +++ b/src/libstore/include/nix/local-binary-cache-store.hh @@ -1,4 +1,4 @@ -#include "binary-cache-store.hh" +#include "nix/binary-cache-store.hh" namespace nix { diff --git a/src/libstore/local-fs-store.hh b/src/libstore/include/nix/local-fs-store.hh similarity index 96% rename from src/libstore/local-fs-store.hh rename to src/libstore/include/nix/local-fs-store.hh index 9bb569f0b..2a5f6e3e7 100644 --- a/src/libstore/local-fs-store.hh +++ b/src/libstore/include/nix/local-fs-store.hh @@ -1,9 +1,9 @@ #pragma once ///@file -#include "store-api.hh" -#include "gc-store.hh" -#include "log-store.hh" +#include "nix/store-api.hh" +#include "nix/gc-store.hh" +#include "nix/log-store.hh" namespace nix { diff --git a/src/libstore/local-overlay-store.hh b/src/libstore/include/nix/local-overlay-store.hh similarity index 99% rename from src/libstore/local-overlay-store.hh rename to src/libstore/include/nix/local-overlay-store.hh index 63628abed..1cee3cc9f 100644 --- a/src/libstore/local-overlay-store.hh +++ b/src/libstore/include/nix/local-overlay-store.hh @@ -1,4 +1,4 @@ -#include "local-store.hh" +#include "nix/local-store.hh" namespace nix { diff --git a/src/libstore/local-store.hh b/src/libstore/include/nix/local-store.hh similarity index 98% rename from src/libstore/local-store.hh rename to src/libstore/include/nix/local-store.hh index 83154d651..2e1fcdfcf 100644 --- a/src/libstore/local-store.hh +++ b/src/libstore/include/nix/local-store.hh @@ -1,12 +1,12 @@ #pragma once ///@file -#include "sqlite.hh" +#include "nix/sqlite.hh" -#include "pathlocks.hh" -#include "store-api.hh" -#include "indirect-root-store.hh" -#include "sync.hh" +#include "nix/pathlocks.hh" +#include "nix/store-api.hh" +#include "nix/indirect-root-store.hh" +#include "nix/sync.hh" #include #include diff --git a/src/libstore/log-store.hh b/src/libstore/include/nix/log-store.hh similarity index 95% rename from src/libstore/log-store.hh rename to src/libstore/include/nix/log-store.hh index a84f7dbeb..5cd8a9f88 100644 --- a/src/libstore/log-store.hh +++ b/src/libstore/include/nix/log-store.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "store-api.hh" +#include "nix/store-api.hh" namespace nix { diff --git a/src/libstore/machines.hh b/src/libstore/include/nix/machines.hh similarity index 97% rename from src/libstore/machines.hh rename to src/libstore/include/nix/machines.hh index b70ab9078..6cd1853a5 100644 --- a/src/libstore/machines.hh +++ b/src/libstore/include/nix/machines.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "ref.hh" -#include "store-reference.hh" +#include "nix/ref.hh" +#include "nix/store-reference.hh" namespace nix { diff --git a/src/libstore/make-content-addressed.hh b/src/libstore/include/nix/make-content-addressed.hh similarity index 94% rename from src/libstore/make-content-addressed.hh rename to src/libstore/include/nix/make-content-addressed.hh index 60bb2b477..75fe4462f 100644 --- a/src/libstore/make-content-addressed.hh +++ b/src/libstore/include/nix/make-content-addressed.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "store-api.hh" +#include "nix/store-api.hh" namespace nix { diff --git a/src/libstore/include/nix/meson.build b/src/libstore/include/nix/meson.build new file mode 100644 index 000000000..85ea75685 --- /dev/null +++ b/src/libstore/include/nix/meson.build @@ -0,0 +1,81 @@ +# Public headers directory + +include_dirs = [ + include_directories('..'), +] + +config_h = configure_file( + configuration : configdata, + output : 'config-store.hh', +) + +headers = [config_h] + files( + 'binary-cache-store.hh', + 'build-result.hh', + 'build/derivation-goal.hh', + 'build/drv-output-substitution-goal.hh', + 'build/goal.hh', + 'build/substitution-goal.hh', + 'build/worker.hh', + 'builtins.hh', + 'builtins/buildenv.hh', + 'common-protocol-impl.hh', + 'common-protocol.hh', + 'common-ssh-store-config.hh', + 'content-address.hh', + 'daemon.hh', + 'derivations.hh', + 'derivation-options.hh', + 'derived-path-map.hh', + 'derived-path.hh', + 'downstream-placeholder.hh', + 'filetransfer.hh', + 'gc-store.hh', + 'globals.hh', + 'http-binary-cache-store.hh', + 'indirect-root-store.hh', + 'keys.hh', + 'legacy-ssh-store.hh', + 'length-prefixed-protocol-helper.hh', + 'local-binary-cache-store.hh', + 'local-fs-store.hh', + 'local-overlay-store.hh', + 'local-store.hh', + 'log-store.hh', + 'machines.hh', + 'make-content-addressed.hh', + 'names.hh', + 'nar-accessor.hh', + 'nar-info-disk-cache.hh', + 'nar-info.hh', + 'outputs-spec.hh', + 'parsed-derivations.hh', + 'path-info.hh', + 'path-references.hh', + 'path-regex.hh', + 'path-with-outputs.hh', + 'path.hh', + 'pathlocks.hh', + 'posix-fs-canonicalise.hh', + 'profiles.hh', + 'realisation.hh', + 'remote-fs-accessor.hh', + 'remote-store-connection.hh', + 'remote-store.hh', + 's3-binary-cache-store.hh', + 's3.hh', + 'ssh-store.hh', + 'serve-protocol-connection.hh', + 'serve-protocol-impl.hh', + 'serve-protocol.hh', + 'sqlite.hh', + 'ssh.hh', + 'store-api.hh', + 'store-cast.hh', + 'store-dir-config.hh', + 'store-reference.hh', + 'uds-remote-store.hh', + 'worker-protocol-connection.hh', + 'worker-protocol-impl.hh', + 'worker-protocol.hh', +) diff --git a/src/libstore/names.hh b/src/libstore/include/nix/names.hh similarity index 96% rename from src/libstore/names.hh rename to src/libstore/include/nix/names.hh index a6909d545..f11c22b1c 100644 --- a/src/libstore/names.hh +++ b/src/libstore/include/nix/names.hh @@ -3,7 +3,7 @@ #include -#include "types.hh" +#include "nix/types.hh" namespace nix { diff --git a/src/libstore/nar-accessor.hh b/src/libstore/include/nix/nar-accessor.hh similarity index 96% rename from src/libstore/nar-accessor.hh rename to src/libstore/include/nix/nar-accessor.hh index 0043897c6..b64330547 100644 --- a/src/libstore/nar-accessor.hh +++ b/src/libstore/include/nix/nar-accessor.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "source-accessor.hh" +#include "nix/source-accessor.hh" #include diff --git a/src/libstore/nar-info-disk-cache.hh b/src/libstore/include/nix/nar-info-disk-cache.hh similarity index 94% rename from src/libstore/nar-info-disk-cache.hh rename to src/libstore/include/nix/nar-info-disk-cache.hh index bbd1d05d5..3a301f7e8 100644 --- a/src/libstore/nar-info-disk-cache.hh +++ b/src/libstore/include/nix/nar-info-disk-cache.hh @@ -1,9 +1,9 @@ #pragma once ///@file -#include "ref.hh" -#include "nar-info.hh" -#include "realisation.hh" +#include "nix/ref.hh" +#include "nix/nar-info.hh" +#include "nix/realisation.hh" namespace nix { diff --git a/src/libstore/nar-info.hh b/src/libstore/include/nix/nar-info.hh similarity index 93% rename from src/libstore/nar-info.hh rename to src/libstore/include/nix/nar-info.hh index 561c9a863..117be878f 100644 --- a/src/libstore/nar-info.hh +++ b/src/libstore/include/nix/nar-info.hh @@ -1,9 +1,9 @@ #pragma once ///@file -#include "types.hh" -#include "hash.hh" -#include "path-info.hh" +#include "nix/types.hh" +#include "nix/hash.hh" +#include "nix/path-info.hh" namespace nix { diff --git a/src/libstore/outputs-spec.hh b/src/libstore/include/nix/outputs-spec.hh similarity index 98% rename from src/libstore/outputs-spec.hh rename to src/libstore/include/nix/outputs-spec.hh index 30d15311d..324d3a334 100644 --- a/src/libstore/outputs-spec.hh +++ b/src/libstore/include/nix/outputs-spec.hh @@ -6,8 +6,8 @@ #include #include -#include "json-impls.hh" -#include "variant-wrapper.hh" +#include "nix/json-impls.hh" +#include "nix/variant-wrapper.hh" namespace nix { diff --git a/src/libstore/parsed-derivations.hh b/src/libstore/include/nix/parsed-derivations.hh similarity index 95% rename from src/libstore/parsed-derivations.hh rename to src/libstore/include/nix/parsed-derivations.hh index 51992fa84..34e254e0d 100644 --- a/src/libstore/parsed-derivations.hh +++ b/src/libstore/include/nix/parsed-derivations.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "derivations.hh" -#include "store-api.hh" +#include "nix/derivations.hh" +#include "nix/store-api.hh" #include diff --git a/src/libstore/path-info.hh b/src/libstore/include/nix/path-info.hh similarity index 98% rename from src/libstore/path-info.hh rename to src/libstore/include/nix/path-info.hh index 9a4c466a8..45c411ddd 100644 --- a/src/libstore/path-info.hh +++ b/src/libstore/include/nix/path-info.hh @@ -1,10 +1,10 @@ #pragma once ///@file -#include "signature/signer.hh" -#include "path.hh" -#include "hash.hh" -#include "content-address.hh" +#include "nix/signature/signer.hh" +#include "nix/path.hh" +#include "nix/hash.hh" +#include "nix/content-address.hh" #include #include diff --git a/src/libstore/path-references.hh b/src/libstore/include/nix/path-references.hh similarity index 91% rename from src/libstore/path-references.hh rename to src/libstore/include/nix/path-references.hh index 0553003f8..0b5e42764 100644 --- a/src/libstore/path-references.hh +++ b/src/libstore/include/nix/path-references.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "references.hh" -#include "path.hh" +#include "nix/references.hh" +#include "nix/path.hh" namespace nix { diff --git a/src/libstore/path-regex.hh b/src/libstore/include/nix/path-regex.hh similarity index 100% rename from src/libstore/path-regex.hh rename to src/libstore/include/nix/path-regex.hh diff --git a/src/libstore/path-with-outputs.hh b/src/libstore/include/nix/path-with-outputs.hh similarity index 95% rename from src/libstore/path-with-outputs.hh rename to src/libstore/include/nix/path-with-outputs.hh index 5f76a583a..e2ff303f2 100644 --- a/src/libstore/path-with-outputs.hh +++ b/src/libstore/include/nix/path-with-outputs.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "path.hh" -#include "derived-path.hh" +#include "nix/path.hh" +#include "nix/derived-path.hh" namespace nix { diff --git a/src/libstore/path.hh b/src/libstore/include/nix/path.hh similarity index 98% rename from src/libstore/path.hh rename to src/libstore/include/nix/path.hh index 902262362..56cd5aeb7 100644 --- a/src/libstore/path.hh +++ b/src/libstore/include/nix/path.hh @@ -3,7 +3,7 @@ #include -#include "types.hh" +#include "nix/types.hh" namespace nix { diff --git a/src/libstore/pathlocks.hh b/src/libstore/include/nix/pathlocks.hh similarity index 97% rename from src/libstore/pathlocks.hh rename to src/libstore/include/nix/pathlocks.hh index 42a84a1a3..68f5a0262 100644 --- a/src/libstore/pathlocks.hh +++ b/src/libstore/include/nix/pathlocks.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "file-descriptor.hh" +#include "nix/file-descriptor.hh" namespace nix { diff --git a/src/libstore/posix-fs-canonicalise.hh b/src/libstore/include/nix/posix-fs-canonicalise.hh similarity index 96% rename from src/libstore/posix-fs-canonicalise.hh rename to src/libstore/include/nix/posix-fs-canonicalise.hh index 45a4f3f20..1309db098 100644 --- a/src/libstore/posix-fs-canonicalise.hh +++ b/src/libstore/include/nix/posix-fs-canonicalise.hh @@ -4,8 +4,8 @@ #include #include -#include "types.hh" -#include "error.hh" +#include "nix/types.hh" +#include "nix/error.hh" namespace nix { diff --git a/src/libstore/profiles.hh b/src/libstore/include/nix/profiles.hh similarity index 99% rename from src/libstore/profiles.hh rename to src/libstore/include/nix/profiles.hh index 33fcf04b3..85f45cb73 100644 --- a/src/libstore/profiles.hh +++ b/src/libstore/include/nix/profiles.hh @@ -7,8 +7,8 @@ * See the manual for additional information. */ -#include "types.hh" -#include "pathlocks.hh" +#include "nix/types.hh" +#include "nix/pathlocks.hh" #include #include diff --git a/src/libstore/realisation.hh b/src/libstore/include/nix/realisation.hh similarity index 96% rename from src/libstore/realisation.hh rename to src/libstore/include/nix/realisation.hh index ddb4af770..2d868980c 100644 --- a/src/libstore/realisation.hh +++ b/src/libstore/include/nix/realisation.hh @@ -3,12 +3,12 @@ #include -#include "hash.hh" -#include "path.hh" -#include "derived-path.hh" +#include "nix/hash.hh" +#include "nix/path.hh" +#include "nix/derived-path.hh" #include -#include "comparator.hh" -#include "signature/signer.hh" +#include "nix/comparator.hh" +#include "nix/signature/signer.hh" namespace nix { diff --git a/src/libstore/remote-fs-accessor.hh b/src/libstore/include/nix/remote-fs-accessor.hh similarity index 91% rename from src/libstore/remote-fs-accessor.hh rename to src/libstore/include/nix/remote-fs-accessor.hh index d09762a53..5abb195ee 100644 --- a/src/libstore/remote-fs-accessor.hh +++ b/src/libstore/include/nix/remote-fs-accessor.hh @@ -1,9 +1,9 @@ #pragma once ///@file -#include "source-accessor.hh" -#include "ref.hh" -#include "store-api.hh" +#include "nix/source-accessor.hh" +#include "nix/ref.hh" +#include "nix/store-api.hh" namespace nix { diff --git a/src/libstore/remote-store-connection.hh b/src/libstore/include/nix/remote-store-connection.hh similarity index 91% rename from src/libstore/remote-store-connection.hh rename to src/libstore/include/nix/remote-store-connection.hh index f8549d0b2..5b11a04f7 100644 --- a/src/libstore/remote-store-connection.hh +++ b/src/libstore/include/nix/remote-store-connection.hh @@ -1,10 +1,10 @@ #pragma once ///@file -#include "remote-store.hh" -#include "worker-protocol.hh" -#include "worker-protocol-connection.hh" -#include "pool.hh" +#include "nix/remote-store.hh" +#include "nix/worker-protocol.hh" +#include "nix/worker-protocol-connection.hh" +#include "nix/pool.hh" namespace nix { diff --git a/src/libstore/remote-store.hh b/src/libstore/include/nix/remote-store.hh similarity index 98% rename from src/libstore/remote-store.hh rename to src/libstore/include/nix/remote-store.hh index ea6cd471e..ebc9b2a81 100644 --- a/src/libstore/remote-store.hh +++ b/src/libstore/include/nix/remote-store.hh @@ -4,9 +4,9 @@ #include #include -#include "store-api.hh" -#include "gc-store.hh" -#include "log-store.hh" +#include "nix/store-api.hh" +#include "nix/gc-store.hh" +#include "nix/log-store.hh" namespace nix { diff --git a/src/libstore/s3-binary-cache-store.hh b/src/libstore/include/nix/s3-binary-cache-store.hh similarity index 98% rename from src/libstore/s3-binary-cache-store.hh rename to src/libstore/include/nix/s3-binary-cache-store.hh index 7d303a115..a0ca22bbb 100644 --- a/src/libstore/s3-binary-cache-store.hh +++ b/src/libstore/include/nix/s3-binary-cache-store.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "binary-cache-store.hh" +#include "nix/binary-cache-store.hh" #include diff --git a/src/libstore/s3.hh b/src/libstore/include/nix/s3.hh similarity index 97% rename from src/libstore/s3.hh rename to src/libstore/include/nix/s3.hh index 18de115ae..367c41d36 100644 --- a/src/libstore/s3.hh +++ b/src/libstore/include/nix/s3.hh @@ -3,7 +3,7 @@ #if ENABLE_S3 -#include "ref.hh" +#include "nix/ref.hh" #include #include diff --git a/src/libstore/serve-protocol-connection.hh b/src/libstore/include/nix/serve-protocol-connection.hh similarity index 98% rename from src/libstore/serve-protocol-connection.hh rename to src/libstore/include/nix/serve-protocol-connection.hh index 73bf71443..f1a9e1ede 100644 --- a/src/libstore/serve-protocol-connection.hh +++ b/src/libstore/include/nix/serve-protocol-connection.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "serve-protocol.hh" -#include "store-api.hh" +#include "nix/serve-protocol.hh" +#include "nix/store-api.hh" namespace nix { diff --git a/src/libstore/serve-protocol-impl.hh b/src/libstore/include/nix/serve-protocol-impl.hh similarity index 95% rename from src/libstore/serve-protocol-impl.hh rename to src/libstore/include/nix/serve-protocol-impl.hh index 099eade64..2621d3b42 100644 --- a/src/libstore/serve-protocol-impl.hh +++ b/src/libstore/include/nix/serve-protocol-impl.hh @@ -8,8 +8,8 @@ * contributing guide. */ -#include "serve-protocol.hh" -#include "length-prefixed-protocol-helper.hh" +#include "nix/serve-protocol.hh" +#include "nix/length-prefixed-protocol-helper.hh" namespace nix { diff --git a/src/libstore/serve-protocol.hh b/src/libstore/include/nix/serve-protocol.hh similarity index 99% rename from src/libstore/serve-protocol.hh rename to src/libstore/include/nix/serve-protocol.hh index 8c112bb74..a8587f618 100644 --- a/src/libstore/serve-protocol.hh +++ b/src/libstore/include/nix/serve-protocol.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "common-protocol.hh" +#include "nix/common-protocol.hh" namespace nix { diff --git a/src/libstore/sqlite.hh b/src/libstore/include/nix/sqlite.hh similarity index 99% rename from src/libstore/sqlite.hh rename to src/libstore/include/nix/sqlite.hh index 037380b71..4143fa8a4 100644 --- a/src/libstore/sqlite.hh +++ b/src/libstore/include/nix/sqlite.hh @@ -4,7 +4,7 @@ #include #include -#include "error.hh" +#include "nix/error.hh" struct sqlite3; struct sqlite3_stmt; diff --git a/src/libstore/ssh-store.hh b/src/libstore/include/nix/ssh-store.hh similarity index 91% rename from src/libstore/ssh-store.hh rename to src/libstore/include/nix/ssh-store.hh index 29a2a8b2c..34ec4f79e 100644 --- a/src/libstore/ssh-store.hh +++ b/src/libstore/include/nix/ssh-store.hh @@ -1,10 +1,10 @@ #pragma once ///@file -#include "common-ssh-store-config.hh" -#include "store-api.hh" -#include "local-fs-store.hh" -#include "remote-store.hh" +#include "nix/common-ssh-store-config.hh" +#include "nix/store-api.hh" +#include "nix/local-fs-store.hh" +#include "nix/remote-store.hh" namespace nix { diff --git a/src/libstore/ssh.hh b/src/libstore/include/nix/ssh.hh similarity index 95% rename from src/libstore/ssh.hh rename to src/libstore/include/nix/ssh.hh index eb05df011..fa046d6de 100644 --- a/src/libstore/ssh.hh +++ b/src/libstore/include/nix/ssh.hh @@ -1,9 +1,9 @@ #pragma once ///@file -#include "sync.hh" -#include "processes.hh" -#include "file-system.hh" +#include "nix/sync.hh" +#include "nix/processes.hh" +#include "nix/file-system.hh" namespace nix { diff --git a/src/libstore/store-api.hh b/src/libstore/include/nix/store-api.hh similarity index 98% rename from src/libstore/store-api.hh rename to src/libstore/include/nix/store-api.hh index 2eba88ea0..8e297dab2 100644 --- a/src/libstore/store-api.hh +++ b/src/libstore/include/nix/store-api.hh @@ -1,20 +1,20 @@ #pragma once ///@file -#include "path.hh" -#include "derived-path.hh" -#include "hash.hh" -#include "content-address.hh" -#include "serialise.hh" -#include "lru-cache.hh" -#include "sync.hh" -#include "globals.hh" -#include "config.hh" -#include "path-info.hh" -#include "repair-flag.hh" -#include "store-dir-config.hh" -#include "store-reference.hh" -#include "source-path.hh" +#include "nix/path.hh" +#include "nix/derived-path.hh" +#include "nix/hash.hh" +#include "nix/content-address.hh" +#include "nix/serialise.hh" +#include "nix/lru-cache.hh" +#include "nix/sync.hh" +#include "nix/globals.hh" +#include "nix/config.hh" +#include "nix/path-info.hh" +#include "nix/repair-flag.hh" +#include "nix/store-dir-config.hh" +#include "nix/store-reference.hh" +#include "nix/source-path.hh" #include #include diff --git a/src/libstore/store-cast.hh b/src/libstore/include/nix/store-cast.hh similarity index 94% rename from src/libstore/store-cast.hh rename to src/libstore/include/nix/store-cast.hh index 2473e72c5..4e6691016 100644 --- a/src/libstore/store-cast.hh +++ b/src/libstore/include/nix/store-cast.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "store-api.hh" +#include "nix/store-api.hh" namespace nix { diff --git a/src/libstore/store-dir-config.hh b/src/libstore/include/nix/store-dir-config.hh similarity index 95% rename from src/libstore/store-dir-config.hh rename to src/libstore/include/nix/store-dir-config.hh index fd4332b91..66e084a24 100644 --- a/src/libstore/store-dir-config.hh +++ b/src/libstore/include/nix/store-dir-config.hh @@ -1,10 +1,10 @@ #pragma once -#include "path.hh" -#include "hash.hh" -#include "content-address.hh" -#include "globals.hh" -#include "config.hh" +#include "nix/path.hh" +#include "nix/hash.hh" +#include "nix/content-address.hh" +#include "nix/globals.hh" +#include "nix/config.hh" #include #include diff --git a/src/libstore/store-reference.hh b/src/libstore/include/nix/store-reference.hh similarity index 98% rename from src/libstore/store-reference.hh rename to src/libstore/include/nix/store-reference.hh index 7100a1db0..922640fe0 100644 --- a/src/libstore/store-reference.hh +++ b/src/libstore/include/nix/store-reference.hh @@ -3,7 +3,7 @@ #include -#include "types.hh" +#include "nix/types.hh" namespace nix { diff --git a/src/libstore/uds-remote-store.hh b/src/libstore/include/nix/uds-remote-store.hh similarity index 95% rename from src/libstore/uds-remote-store.hh rename to src/libstore/include/nix/uds-remote-store.hh index a8e571664..0a2e3fe9f 100644 --- a/src/libstore/uds-remote-store.hh +++ b/src/libstore/include/nix/uds-remote-store.hh @@ -1,9 +1,9 @@ #pragma once ///@file -#include "remote-store.hh" -#include "remote-store-connection.hh" -#include "indirect-root-store.hh" +#include "nix/remote-store.hh" +#include "nix/remote-store-connection.hh" +#include "nix/indirect-root-store.hh" namespace nix { diff --git a/src/libstore/worker-protocol-connection.hh b/src/libstore/include/nix/worker-protocol-connection.hh similarity index 98% rename from src/libstore/worker-protocol-connection.hh rename to src/libstore/include/nix/worker-protocol-connection.hh index c2f446db1..a1a4668f2 100644 --- a/src/libstore/worker-protocol-connection.hh +++ b/src/libstore/include/nix/worker-protocol-connection.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "worker-protocol.hh" -#include "store-api.hh" +#include "nix/worker-protocol.hh" +#include "nix/store-api.hh" namespace nix { diff --git a/src/libstore/worker-protocol-impl.hh b/src/libstore/include/nix/worker-protocol-impl.hh similarity index 95% rename from src/libstore/worker-protocol-impl.hh rename to src/libstore/include/nix/worker-protocol-impl.hh index 87398df90..902d21542 100644 --- a/src/libstore/worker-protocol-impl.hh +++ b/src/libstore/include/nix/worker-protocol-impl.hh @@ -8,8 +8,8 @@ * contributing guide. */ -#include "worker-protocol.hh" -#include "length-prefixed-protocol-helper.hh" +#include "nix/worker-protocol.hh" +#include "nix/length-prefixed-protocol-helper.hh" namespace nix { diff --git a/src/libstore/worker-protocol.hh b/src/libstore/include/nix/worker-protocol.hh similarity index 99% rename from src/libstore/worker-protocol.hh rename to src/libstore/include/nix/worker-protocol.hh index c356fa1bf..175ddf01f 100644 --- a/src/libstore/worker-protocol.hh +++ b/src/libstore/include/nix/worker-protocol.hh @@ -3,7 +3,7 @@ #include -#include "common-protocol.hh" +#include "nix/common-protocol.hh" namespace nix { diff --git a/src/libstore/indirect-root-store.cc b/src/libstore/indirect-root-store.cc index 844d0d6ed..1b51cbe15 100644 --- a/src/libstore/indirect-root-store.cc +++ b/src/libstore/indirect-root-store.cc @@ -1,4 +1,4 @@ -#include "indirect-root-store.hh" +#include "nix/indirect-root-store.hh" namespace nix { diff --git a/src/libstore/keys.cc b/src/libstore/keys.cc index 668725fc7..1b2a612a2 100644 --- a/src/libstore/keys.cc +++ b/src/libstore/keys.cc @@ -1,6 +1,6 @@ -#include "file-system.hh" -#include "globals.hh" -#include "keys.hh" +#include "nix/file-system.hh" +#include "nix/globals.hh" +#include "nix/keys.hh" namespace nix { diff --git a/src/libstore/legacy-ssh-store.cc b/src/libstore/legacy-ssh-store.cc index 480f41059..bc2794499 100644 --- a/src/libstore/legacy-ssh-store.cc +++ b/src/libstore/legacy-ssh-store.cc @@ -1,17 +1,17 @@ -#include "legacy-ssh-store.hh" -#include "common-ssh-store-config.hh" -#include "archive.hh" -#include "pool.hh" -#include "remote-store.hh" -#include "serve-protocol.hh" -#include "serve-protocol-connection.hh" -#include "serve-protocol-impl.hh" -#include "build-result.hh" -#include "store-api.hh" -#include "path-with-outputs.hh" -#include "ssh.hh" -#include "derivations.hh" -#include "callback.hh" +#include "nix/legacy-ssh-store.hh" +#include "nix/common-ssh-store-config.hh" +#include "nix/archive.hh" +#include "nix/pool.hh" +#include "nix/remote-store.hh" +#include "nix/serve-protocol.hh" +#include "nix/serve-protocol-connection.hh" +#include "nix/serve-protocol-impl.hh" +#include "nix/build-result.hh" +#include "nix/store-api.hh" +#include "nix/path-with-outputs.hh" +#include "nix/ssh.hh" +#include "nix/derivations.hh" +#include "nix/callback.hh" namespace nix { diff --git a/src/libstore/linux/fchmodat2-compat.hh b/src/libstore/linux/include/nix/fchmodat2-compat.hh similarity index 100% rename from src/libstore/linux/fchmodat2-compat.hh rename to src/libstore/linux/include/nix/fchmodat2-compat.hh diff --git a/src/libstore/linux/include/nix/meson.build b/src/libstore/linux/include/nix/meson.build new file mode 100644 index 000000000..f37370c6f --- /dev/null +++ b/src/libstore/linux/include/nix/meson.build @@ -0,0 +1,6 @@ +include_dirs += include_directories('..') + +headers += files( + 'fchmodat2-compat.hh', + 'personality.hh', +) diff --git a/src/libstore/linux/personality.hh b/src/libstore/linux/include/nix/personality.hh similarity index 100% rename from src/libstore/linux/personality.hh rename to src/libstore/linux/include/nix/personality.hh diff --git a/src/libstore/linux/meson.build b/src/libstore/linux/meson.build index 0c494b5d6..b9a2aed21 100644 --- a/src/libstore/linux/meson.build +++ b/src/libstore/linux/meson.build @@ -2,9 +2,4 @@ sources += files( 'personality.cc', ) -include_dirs += include_directories('.') - -headers += files( - 'fchmodat2-compat.hh', - 'personality.hh', -) +subdir('include/nix') diff --git a/src/libstore/linux/personality.cc b/src/libstore/linux/personality.cc index 255d174a6..bbff765de 100644 --- a/src/libstore/linux/personality.cc +++ b/src/libstore/linux/personality.cc @@ -1,5 +1,5 @@ -#include "personality.hh" -#include "globals.hh" +#include "nix/personality.hh" +#include "nix/globals.hh" #include #include diff --git a/src/libstore/local-binary-cache-store.cc b/src/libstore/local-binary-cache-store.cc index dcc6affe4..90a770ab0 100644 --- a/src/libstore/local-binary-cache-store.cc +++ b/src/libstore/local-binary-cache-store.cc @@ -1,7 +1,7 @@ -#include "local-binary-cache-store.hh" -#include "globals.hh" -#include "nar-info-disk-cache.hh" -#include "signals.hh" +#include "nix/local-binary-cache-store.hh" +#include "nix/globals.hh" +#include "nix/nar-info-disk-cache.hh" +#include "nix/signals.hh" #include diff --git a/src/libstore/local-fs-store.cc b/src/libstore/local-fs-store.cc index 5449b20eb..2798899fa 100644 --- a/src/libstore/local-fs-store.cc +++ b/src/libstore/local-fs-store.cc @@ -1,10 +1,10 @@ -#include "archive.hh" -#include "posix-source-accessor.hh" -#include "store-api.hh" -#include "local-fs-store.hh" -#include "globals.hh" -#include "compression.hh" -#include "derivations.hh" +#include "nix/archive.hh" +#include "nix/posix-source-accessor.hh" +#include "nix/store-api.hh" +#include "nix/local-fs-store.hh" +#include "nix/globals.hh" +#include "nix/compression.hh" +#include "nix/derivations.hh" namespace nix { diff --git a/src/libstore/local-overlay-store.cc b/src/libstore/local-overlay-store.cc index 56ff6bef3..c2cc329b4 100644 --- a/src/libstore/local-overlay-store.cc +++ b/src/libstore/local-overlay-store.cc @@ -1,8 +1,8 @@ -#include "local-overlay-store.hh" -#include "callback.hh" -#include "realisation.hh" -#include "processes.hh" -#include "url.hh" +#include "nix/local-overlay-store.hh" +#include "nix/callback.hh" +#include "nix/realisation.hh" +#include "nix/processes.hh" +#include "nix/url.hh" #include namespace nix { diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index 1db6e0ef5..cf6644804 100644 --- a/src/libstore/local-store.cc +++ b/src/libstore/local-store.cc @@ -1,22 +1,22 @@ -#include "local-store.hh" -#include "globals.hh" -#include "git.hh" -#include "archive.hh" -#include "pathlocks.hh" -#include "worker-protocol.hh" -#include "derivations.hh" -#include "realisation.hh" -#include "nar-info.hh" -#include "references.hh" -#include "callback.hh" -#include "topo-sort.hh" -#include "finally.hh" -#include "compression.hh" -#include "signals.hh" -#include "posix-fs-canonicalise.hh" -#include "posix-source-accessor.hh" -#include "keys.hh" -#include "users.hh" +#include "nix/local-store.hh" +#include "nix/globals.hh" +#include "nix/git.hh" +#include "nix/archive.hh" +#include "nix/pathlocks.hh" +#include "nix/worker-protocol.hh" +#include "nix/derivations.hh" +#include "nix/realisation.hh" +#include "nix/nar-info.hh" +#include "nix/references.hh" +#include "nix/callback.hh" +#include "nix/topo-sort.hh" +#include "nix/finally.hh" +#include "nix/compression.hh" +#include "nix/signals.hh" +#include "nix/posix-fs-canonicalise.hh" +#include "nix/posix-source-accessor.hh" +#include "nix/keys.hh" +#include "nix/users.hh" #include #include @@ -52,7 +52,7 @@ #include -#include "strings.hh" +#include "nix/strings.hh" namespace nix { diff --git a/src/libstore/log-store.cc b/src/libstore/log-store.cc index 8a26832ab..b2c2ff16a 100644 --- a/src/libstore/log-store.cc +++ b/src/libstore/log-store.cc @@ -1,4 +1,4 @@ -#include "log-store.hh" +#include "nix/log-store.hh" namespace nix { diff --git a/src/libstore/machines.cc b/src/libstore/machines.cc index eb729b697..7710ae99b 100644 --- a/src/libstore/machines.cc +++ b/src/libstore/machines.cc @@ -1,6 +1,6 @@ -#include "machines.hh" -#include "globals.hh" -#include "store-api.hh" +#include "nix/machines.hh" +#include "nix/globals.hh" +#include "nix/store-api.hh" #include diff --git a/src/libstore/make-content-addressed.cc b/src/libstore/make-content-addressed.cc index a3130d7cc..c7d44b1a9 100644 --- a/src/libstore/make-content-addressed.cc +++ b/src/libstore/make-content-addressed.cc @@ -1,5 +1,5 @@ -#include "make-content-addressed.hh" -#include "references.hh" +#include "nix/make-content-addressed.hh" +#include "nix/references.hh" namespace nix { diff --git a/src/libstore/meson.build b/src/libstore/meson.build index a592cbf98..dd6d7b404 100644 --- a/src/libstore/meson.build +++ b/src/libstore/meson.build @@ -166,16 +166,11 @@ if get_option('embedded-sandbox-shell') generated_headers += embedded_sandbox_shell_gen endif -config_h = configure_file( - configuration : configdata, - output : 'config-store.hh', -) - add_project_arguments( # TODO(Qyriad): Yes this is how the autoconf+Make system did it. # It would be nice for our headers to be idempotent instead. - '-include', 'config-util.hh', - '-include', 'config-store.hh', + '-include', 'nix/config-util.hh', + '-include', 'nix/config-store.hh', language : 'cpp', ) @@ -249,81 +244,7 @@ sources = files( 'worker-protocol.cc', ) -include_dirs = [ - include_directories('.'), - include_directories('build'), -] - -headers = [config_h] + files( - 'binary-cache-store.hh', - 'build-result.hh', - 'build/derivation-goal.hh', - 'build/drv-output-substitution-goal.hh', - 'build/goal.hh', - 'build/substitution-goal.hh', - 'build/worker.hh', - 'builtins.hh', - 'builtins/buildenv.hh', - 'common-protocol-impl.hh', - 'common-protocol.hh', - 'common-ssh-store-config.hh', - 'content-address.hh', - 'daemon.hh', - 'derivations.hh', - 'derivation-options.hh', - 'derived-path-map.hh', - 'derived-path.hh', - 'downstream-placeholder.hh', - 'filetransfer.hh', - 'gc-store.hh', - 'globals.hh', - 'http-binary-cache-store.hh', - 'indirect-root-store.hh', - 'keys.hh', - 'legacy-ssh-store.hh', - 'length-prefixed-protocol-helper.hh', - 'local-binary-cache-store.hh', - 'local-fs-store.hh', - 'local-overlay-store.hh', - 'local-store.hh', - 'log-store.hh', - 'machines.hh', - 'make-content-addressed.hh', - 'names.hh', - 'nar-accessor.hh', - 'nar-info-disk-cache.hh', - 'nar-info.hh', - 'outputs-spec.hh', - 'parsed-derivations.hh', - 'path-info.hh', - 'path-references.hh', - 'path-regex.hh', - 'path-with-outputs.hh', - 'path.hh', - 'pathlocks.hh', - 'posix-fs-canonicalise.hh', - 'profiles.hh', - 'realisation.hh', - 'remote-fs-accessor.hh', - 'remote-store-connection.hh', - 'remote-store.hh', - 's3-binary-cache-store.hh', - 's3.hh', - 'ssh-store.hh', - 'serve-protocol-connection.hh', - 'serve-protocol-impl.hh', - 'serve-protocol.hh', - 'sqlite.hh', - 'ssh.hh', - 'store-api.hh', - 'store-cast.hh', - 'store-dir-config.hh', - 'store-reference.hh', - 'uds-remote-store.hh', - 'worker-protocol-connection.hh', - 'worker-protocol-impl.hh', - 'worker-protocol.hh', -) +subdir('include/nix') if host_machine.system() == 'linux' subdir('linux') diff --git a/src/libstore/misc.cc b/src/libstore/misc.cc index 9d3b24326..ef08f4af7 100644 --- a/src/libstore/misc.cc +++ b/src/libstore/misc.cc @@ -1,17 +1,17 @@ #include -#include "derivations.hh" -#include "parsed-derivations.hh" -#include "derivation-options.hh" -#include "globals.hh" -#include "store-api.hh" -#include "thread-pool.hh" -#include "realisation.hh" -#include "topo-sort.hh" -#include "callback.hh" -#include "closure.hh" -#include "filetransfer.hh" -#include "strings.hh" +#include "nix/derivations.hh" +#include "nix/parsed-derivations.hh" +#include "nix/derivation-options.hh" +#include "nix/globals.hh" +#include "nix/store-api.hh" +#include "nix/thread-pool.hh" +#include "nix/realisation.hh" +#include "nix/topo-sort.hh" +#include "nix/callback.hh" +#include "nix/closure.hh" +#include "nix/filetransfer.hh" +#include "nix/strings.hh" namespace nix { diff --git a/src/libstore/names.cc b/src/libstore/names.cc index c0e1b1022..2842bf3fb 100644 --- a/src/libstore/names.cc +++ b/src/libstore/names.cc @@ -1,5 +1,5 @@ -#include "names.hh" -#include "util.hh" +#include "nix/names.hh" +#include "nix/util.hh" #include diff --git a/src/libstore/nar-accessor.cc b/src/libstore/nar-accessor.cc index c4e0b137b..7fe2e7ecb 100644 --- a/src/libstore/nar-accessor.cc +++ b/src/libstore/nar-accessor.cc @@ -1,5 +1,5 @@ -#include "nar-accessor.hh" -#include "archive.hh" +#include "nix/nar-accessor.hh" +#include "nix/archive.hh" #include #include diff --git a/src/libstore/nar-info-disk-cache.cc b/src/libstore/nar-info-disk-cache.cc index 80e8d3414..acb7bd3bf 100644 --- a/src/libstore/nar-info-disk-cache.cc +++ b/src/libstore/nar-info-disk-cache.cc @@ -1,13 +1,13 @@ -#include "nar-info-disk-cache.hh" -#include "users.hh" -#include "sync.hh" -#include "sqlite.hh" -#include "globals.hh" +#include "nix/nar-info-disk-cache.hh" +#include "nix/users.hh" +#include "nix/sync.hh" +#include "nix/sqlite.hh" +#include "nix/globals.hh" #include #include -#include "strings.hh" +#include "nix/strings.hh" namespace nix { diff --git a/src/libstore/nar-info.cc b/src/libstore/nar-info.cc index 27fcc2864..176332a4a 100644 --- a/src/libstore/nar-info.cc +++ b/src/libstore/nar-info.cc @@ -1,8 +1,8 @@ -#include "globals.hh" -#include "nar-info.hh" -#include "store-api.hh" -#include "strings.hh" -#include "json-utils.hh" +#include "nix/globals.hh" +#include "nix/nar-info.hh" +#include "nix/store-api.hh" +#include "nix/strings.hh" +#include "nix/json-utils.hh" namespace nix { diff --git a/src/libstore/optimise-store.cc b/src/libstore/optimise-store.cc index aeff24c64..c2cda58e7 100644 --- a/src/libstore/optimise-store.cc +++ b/src/libstore/optimise-store.cc @@ -1,8 +1,8 @@ -#include "local-store.hh" -#include "globals.hh" -#include "signals.hh" -#include "posix-fs-canonicalise.hh" -#include "posix-source-accessor.hh" +#include "nix/local-store.hh" +#include "nix/globals.hh" +#include "nix/signals.hh" +#include "nix/posix-fs-canonicalise.hh" +#include "nix/posix-source-accessor.hh" #include #include diff --git a/src/libstore/outputs-spec.cc b/src/libstore/outputs-spec.cc index b623a975c..7d56a7afd 100644 --- a/src/libstore/outputs-spec.cc +++ b/src/libstore/outputs-spec.cc @@ -1,11 +1,11 @@ #include #include -#include "util.hh" -#include "regex-combinators.hh" -#include "outputs-spec.hh" -#include "path-regex.hh" -#include "strings-inline.hh" +#include "nix/util.hh" +#include "nix/regex-combinators.hh" +#include "nix/outputs-spec.hh" +#include "nix/path-regex.hh" +#include "nix/strings-inline.hh" namespace nix { diff --git a/src/libstore/package.nix b/src/libstore/package.nix index f992684df..553bc043e 100644 --- a/src/libstore/package.nix +++ b/src/libstore/package.nix @@ -43,8 +43,11 @@ mkMesonLibrary (finalAttrs: { ./.version ./meson.build ./meson.options + ./include/nix/meson.build ./linux/meson.build + ./linux/include/nix/meson.build ./unix/meson.build + ./unix/include/nix/meson.build ./windows/meson.build (fileset.fileFilter (file: file.hasExt "cc") ./.) (fileset.fileFilter (file: file.hasExt "hh") ./.) diff --git a/src/libstore/parsed-derivations.cc b/src/libstore/parsed-derivations.cc index b26c36efe..0e8f9ba95 100644 --- a/src/libstore/parsed-derivations.cc +++ b/src/libstore/parsed-derivations.cc @@ -1,4 +1,4 @@ -#include "parsed-derivations.hh" +#include "nix/parsed-derivations.hh" #include #include diff --git a/src/libstore/path-info.cc b/src/libstore/path-info.cc index 6e87e60f4..574ada7ac 100644 --- a/src/libstore/path-info.cc +++ b/src/libstore/path-info.cc @@ -1,10 +1,10 @@ #include -#include "path-info.hh" -#include "store-api.hh" -#include "json-utils.hh" -#include "comparator.hh" -#include "strings.hh" +#include "nix/path-info.hh" +#include "nix/store-api.hh" +#include "nix/json-utils.hh" +#include "nix/comparator.hh" +#include "nix/strings.hh" namespace nix { diff --git a/src/libstore/path-references.cc b/src/libstore/path-references.cc index 15f52ec9d..a5aa8f48f 100644 --- a/src/libstore/path-references.cc +++ b/src/libstore/path-references.cc @@ -1,6 +1,6 @@ -#include "path-references.hh" -#include "hash.hh" -#include "archive.hh" +#include "nix/path-references.hh" +#include "nix/hash.hh" +#include "nix/archive.hh" #include #include diff --git a/src/libstore/path-with-outputs.cc b/src/libstore/path-with-outputs.cc index e526b1ff6..87f7c6a72 100644 --- a/src/libstore/path-with-outputs.cc +++ b/src/libstore/path-with-outputs.cc @@ -1,8 +1,8 @@ #include -#include "path-with-outputs.hh" -#include "store-api.hh" -#include "strings.hh" +#include "nix/path-with-outputs.hh" +#include "nix/store-api.hh" +#include "nix/strings.hh" namespace nix { diff --git a/src/libstore/path.cc b/src/libstore/path.cc index 3e9d05477..d1eb02e70 100644 --- a/src/libstore/path.cc +++ b/src/libstore/path.cc @@ -1,4 +1,4 @@ -#include "store-dir-config.hh" +#include "nix/store-dir-config.hh" namespace nix { diff --git a/src/libstore/pathlocks.cc b/src/libstore/pathlocks.cc index c855e797f..36bee6741 100644 --- a/src/libstore/pathlocks.cc +++ b/src/libstore/pathlocks.cc @@ -1,7 +1,7 @@ -#include "pathlocks.hh" -#include "util.hh" -#include "sync.hh" -#include "signals.hh" +#include "nix/pathlocks.hh" +#include "nix/util.hh" +#include "nix/sync.hh" +#include "nix/signals.hh" #include #include diff --git a/src/libstore/posix-fs-canonicalise.cc b/src/libstore/posix-fs-canonicalise.cc index 46a78cc86..5fddae42f 100644 --- a/src/libstore/posix-fs-canonicalise.cc +++ b/src/libstore/posix-fs-canonicalise.cc @@ -2,12 +2,12 @@ # include #endif -#include "posix-fs-canonicalise.hh" -#include "file-system.hh" -#include "signals.hh" -#include "util.hh" -#include "globals.hh" -#include "store-api.hh" +#include "nix/posix-fs-canonicalise.hh" +#include "nix/file-system.hh" +#include "nix/signals.hh" +#include "nix/util.hh" +#include "nix/globals.hh" +#include "nix/store-api.hh" namespace nix { diff --git a/src/libstore/profiles.cc b/src/libstore/profiles.cc index 46efedfe3..19358f136 100644 --- a/src/libstore/profiles.cc +++ b/src/libstore/profiles.cc @@ -1,8 +1,8 @@ -#include "profiles.hh" -#include "signals.hh" -#include "store-api.hh" -#include "local-fs-store.hh" -#include "users.hh" +#include "nix/profiles.hh" +#include "nix/signals.hh" +#include "nix/store-api.hh" +#include "nix/local-fs-store.hh" +#include "nix/users.hh" #include #include diff --git a/src/libstore/realisation.cc b/src/libstore/realisation.cc index 86bfdd1a8..63b156b30 100644 --- a/src/libstore/realisation.cc +++ b/src/libstore/realisation.cc @@ -1,7 +1,7 @@ -#include "realisation.hh" -#include "store-api.hh" -#include "closure.hh" -#include "signature/local-keys.hh" +#include "nix/realisation.hh" +#include "nix/store-api.hh" +#include "nix/closure.hh" +#include "nix/signature/local-keys.hh" #include namespace nix { diff --git a/src/libstore/remote-fs-accessor.cc b/src/libstore/remote-fs-accessor.cc index 7e360b5fe..2b3f0675d 100644 --- a/src/libstore/remote-fs-accessor.cc +++ b/src/libstore/remote-fs-accessor.cc @@ -1,6 +1,6 @@ #include -#include "remote-fs-accessor.hh" -#include "nar-accessor.hh" +#include "nix/remote-fs-accessor.hh" +#include "nix/nar-accessor.hh" #include #include diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc index 533ea557d..bae03e5d0 100644 --- a/src/libstore/remote-store.cc +++ b/src/libstore/remote-store.cc @@ -1,23 +1,23 @@ -#include "serialise.hh" -#include "util.hh" -#include "path-with-outputs.hh" -#include "gc-store.hh" -#include "remote-fs-accessor.hh" -#include "build-result.hh" -#include "remote-store.hh" -#include "remote-store-connection.hh" -#include "worker-protocol.hh" -#include "worker-protocol-impl.hh" -#include "archive.hh" -#include "globals.hh" -#include "derivations.hh" -#include "pool.hh" -#include "finally.hh" -#include "git.hh" -#include "logging.hh" -#include "callback.hh" -#include "filetransfer.hh" -#include "signals.hh" +#include "nix/serialise.hh" +#include "nix/util.hh" +#include "nix/path-with-outputs.hh" +#include "nix/gc-store.hh" +#include "nix/remote-fs-accessor.hh" +#include "nix/build-result.hh" +#include "nix/remote-store.hh" +#include "nix/remote-store-connection.hh" +#include "nix/worker-protocol.hh" +#include "nix/worker-protocol-impl.hh" +#include "nix/archive.hh" +#include "nix/globals.hh" +#include "nix/derivations.hh" +#include "nix/pool.hh" +#include "nix/finally.hh" +#include "nix/git.hh" +#include "nix/logging.hh" +#include "nix/callback.hh" +#include "nix/filetransfer.hh" +#include "nix/signals.hh" #include diff --git a/src/libstore/s3-binary-cache-store.cc b/src/libstore/s3-binary-cache-store.cc index cfa713b00..69ebad75b 100644 --- a/src/libstore/s3-binary-cache-store.cc +++ b/src/libstore/s3-binary-cache-store.cc @@ -2,14 +2,14 @@ #include -#include "s3.hh" -#include "s3-binary-cache-store.hh" -#include "nar-info.hh" -#include "nar-info-disk-cache.hh" -#include "globals.hh" -#include "compression.hh" -#include "filetransfer.hh" -#include "signals.hh" +#include "nix/s3.hh" +#include "nix/s3-binary-cache-store.hh" +#include "nix/nar-info.hh" +#include "nix/nar-info-disk-cache.hh" +#include "nix/globals.hh" +#include "nix/compression.hh" +#include "nix/filetransfer.hh" +#include "nix/signals.hh" #include #include diff --git a/src/libstore/serve-protocol-connection.cc b/src/libstore/serve-protocol-connection.cc index 07379999b..577297af8 100644 --- a/src/libstore/serve-protocol-connection.cc +++ b/src/libstore/serve-protocol-connection.cc @@ -1,7 +1,7 @@ -#include "serve-protocol-connection.hh" -#include "serve-protocol-impl.hh" -#include "build-result.hh" -#include "derivations.hh" +#include "nix/serve-protocol-connection.hh" +#include "nix/serve-protocol-impl.hh" +#include "nix/build-result.hh" +#include "nix/derivations.hh" namespace nix { diff --git a/src/libstore/serve-protocol.cc b/src/libstore/serve-protocol.cc index 08bfad9e4..0e2a3bc9d 100644 --- a/src/libstore/serve-protocol.cc +++ b/src/libstore/serve-protocol.cc @@ -1,11 +1,11 @@ -#include "serialise.hh" -#include "path-with-outputs.hh" -#include "store-api.hh" -#include "build-result.hh" -#include "serve-protocol.hh" -#include "serve-protocol-impl.hh" -#include "archive.hh" -#include "path-info.hh" +#include "nix/serialise.hh" +#include "nix/path-with-outputs.hh" +#include "nix/store-api.hh" +#include "nix/build-result.hh" +#include "nix/serve-protocol.hh" +#include "nix/serve-protocol-impl.hh" +#include "nix/archive.hh" +#include "nix/path-info.hh" #include diff --git a/src/libstore/sqlite.cc b/src/libstore/sqlite.cc index f02e472fd..1f9622255 100644 --- a/src/libstore/sqlite.cc +++ b/src/libstore/sqlite.cc @@ -1,8 +1,8 @@ -#include "sqlite.hh" -#include "globals.hh" -#include "util.hh" -#include "url.hh" -#include "signals.hh" +#include "nix/sqlite.hh" +#include "nix/globals.hh" +#include "nix/util.hh" +#include "nix/url.hh" +#include "nix/signals.hh" #include diff --git a/src/libstore/ssh-store.cc b/src/libstore/ssh-store.cc index 954a97467..dc889cb39 100644 --- a/src/libstore/ssh-store.cc +++ b/src/libstore/ssh-store.cc @@ -1,12 +1,12 @@ -#include "ssh-store.hh" -#include "local-fs-store.hh" -#include "remote-store-connection.hh" -#include "source-accessor.hh" -#include "archive.hh" -#include "worker-protocol.hh" -#include "worker-protocol-impl.hh" -#include "pool.hh" -#include "ssh.hh" +#include "nix/ssh-store.hh" +#include "nix/local-fs-store.hh" +#include "nix/remote-store-connection.hh" +#include "nix/source-accessor.hh" +#include "nix/archive.hh" +#include "nix/worker-protocol.hh" +#include "nix/worker-protocol-impl.hh" +#include "nix/pool.hh" +#include "nix/ssh.hh" namespace nix { diff --git a/src/libstore/ssh.cc b/src/libstore/ssh.cc index 70e6d5dfe..86b6eda7c 100644 --- a/src/libstore/ssh.cc +++ b/src/libstore/ssh.cc @@ -1,9 +1,9 @@ -#include "ssh.hh" -#include "finally.hh" -#include "current-process.hh" -#include "environment-variables.hh" -#include "util.hh" -#include "exec.hh" +#include "nix/ssh.hh" +#include "nix/finally.hh" +#include "nix/current-process.hh" +#include "nix/environment-variables.hh" +#include "nix/util.hh" +#include "nix/exec.hh" namespace nix { diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc index fc3fbcc0f..52a962553 100644 --- a/src/libstore/store-api.cc +++ b/src/libstore/store-api.cc @@ -1,28 +1,28 @@ -#include "signature/local-keys.hh" -#include "source-accessor.hh" -#include "globals.hh" -#include "derived-path.hh" -#include "realisation.hh" -#include "derivations.hh" -#include "store-api.hh" -#include "util.hh" -#include "nar-info-disk-cache.hh" -#include "thread-pool.hh" -#include "references.hh" -#include "archive.hh" -#include "callback.hh" -#include "git.hh" -#include "posix-source-accessor.hh" +#include "nix/signature/local-keys.hh" +#include "nix/source-accessor.hh" +#include "nix/globals.hh" +#include "nix/derived-path.hh" +#include "nix/realisation.hh" +#include "nix/derivations.hh" +#include "nix/store-api.hh" +#include "nix/util.hh" +#include "nix/nar-info-disk-cache.hh" +#include "nix/thread-pool.hh" +#include "nix/references.hh" +#include "nix/archive.hh" +#include "nix/callback.hh" +#include "nix/git.hh" +#include "nix/posix-source-accessor.hh" // FIXME this should not be here, see TODO below on // `addMultipleToStore`. -#include "worker-protocol.hh" -#include "signals.hh" -#include "users.hh" +#include "nix/worker-protocol.hh" +#include "nix/signals.hh" +#include "nix/users.hh" #include #include -#include "strings.hh" +#include "nix/strings.hh" using json = nlohmann::json; @@ -1277,8 +1277,8 @@ Derivation Store::readInvalidDerivation(const StorePath & drvPath) } -#include "local-store.hh" -#include "uds-remote-store.hh" +#include "nix/local-store.hh" +#include "nix/uds-remote-store.hh" namespace nix { diff --git a/src/libstore/store-reference.cc b/src/libstore/store-reference.cc index b4968dfad..610e70f99 100644 --- a/src/libstore/store-reference.cc +++ b/src/libstore/store-reference.cc @@ -1,10 +1,10 @@ #include -#include "error.hh" -#include "url.hh" -#include "store-reference.hh" -#include "file-system.hh" -#include "util.hh" +#include "nix/error.hh" +#include "nix/url.hh" +#include "nix/store-reference.hh" +#include "nix/file-system.hh" +#include "nix/util.hh" namespace nix { diff --git a/src/libstore/uds-remote-store.cc b/src/libstore/uds-remote-store.cc index 3c445eb13..b41eae39c 100644 --- a/src/libstore/uds-remote-store.cc +++ b/src/libstore/uds-remote-store.cc @@ -1,6 +1,6 @@ -#include "uds-remote-store.hh" -#include "unix-domain-socket.hh" -#include "worker-protocol.hh" +#include "nix/uds-remote-store.hh" +#include "nix/unix-domain-socket.hh" +#include "nix/worker-protocol.hh" #include #include diff --git a/src/libstore/unix/build/child.cc b/src/libstore/unix/build/child.cc index aa31c3caf..c19d1e646 100644 --- a/src/libstore/unix/build/child.cc +++ b/src/libstore/unix/build/child.cc @@ -1,6 +1,6 @@ -#include "child.hh" -#include "current-process.hh" -#include "logging.hh" +#include "nix/build/child.hh" +#include "nix/current-process.hh" +#include "nix/logging.hh" #include #include diff --git a/src/libstore/unix/build/hook-instance.cc b/src/libstore/unix/build/hook-instance.cc index 79eb25a91..5407bef14 100644 --- a/src/libstore/unix/build/hook-instance.cc +++ b/src/libstore/unix/build/hook-instance.cc @@ -1,10 +1,10 @@ -#include "globals.hh" -#include "config-global.hh" -#include "hook-instance.hh" -#include "file-system.hh" -#include "child.hh" -#include "strings.hh" -#include "executable-path.hh" +#include "nix/globals.hh" +#include "nix/config-global.hh" +#include "nix/build/hook-instance.hh" +#include "nix/file-system.hh" +#include "nix/build/child.hh" +#include "nix/strings.hh" +#include "nix/executable-path.hh" namespace nix { diff --git a/src/libstore/unix/build/local-derivation-goal.cc b/src/libstore/unix/build/local-derivation-goal.cc index 0ccc4211b..74186242b 100644 --- a/src/libstore/unix/build/local-derivation-goal.cc +++ b/src/libstore/unix/build/local-derivation-goal.cc @@ -1,24 +1,24 @@ -#include "local-derivation-goal.hh" -#include "indirect-root-store.hh" -#include "hook-instance.hh" -#include "worker.hh" -#include "builtins.hh" -#include "builtins/buildenv.hh" -#include "path-references.hh" -#include "finally.hh" -#include "util.hh" -#include "archive.hh" -#include "git.hh" -#include "compression.hh" -#include "daemon.hh" -#include "topo-sort.hh" -#include "callback.hh" -#include "json-utils.hh" -#include "current-process.hh" -#include "child.hh" -#include "unix-domain-socket.hh" -#include "posix-fs-canonicalise.hh" -#include "posix-source-accessor.hh" +#include "nix/build/local-derivation-goal.hh" +#include "nix/indirect-root-store.hh" +#include "nix/build/hook-instance.hh" +#include "nix/build/worker.hh" +#include "nix/builtins.hh" +#include "nix/builtins/buildenv.hh" +#include "nix/path-references.hh" +#include "nix/finally.hh" +#include "nix/util.hh" +#include "nix/archive.hh" +#include "nix/git.hh" +#include "nix/compression.hh" +#include "nix/daemon.hh" +#include "nix/topo-sort.hh" +#include "nix/callback.hh" +#include "nix/json-utils.hh" +#include "nix/current-process.hh" +#include "nix/build/child.hh" +#include "nix/unix-domain-socket.hh" +#include "nix/posix-fs-canonicalise.hh" +#include "nix/posix-source-accessor.hh" #include #include @@ -37,7 +37,7 @@ /* Includes required for chroot support. */ #if __linux__ -# include "fchmodat2-compat.hh" +# include "nix/fchmodat2-compat.hh" # include # include # include @@ -46,13 +46,13 @@ # include # include # include -# include "namespaces.hh" +# include "nix/namespaces.hh" # if HAVE_SECCOMP # include # endif # define pivot_root(new_root, put_old) (syscall(SYS_pivot_root, new_root, put_old)) -# include "cgroup.hh" -# include "personality.hh" +# include "nix/cgroup.hh" +# include "nix/personality.hh" #endif #if __APPLE__ @@ -68,8 +68,8 @@ extern "C" int sandbox_init_with_parameters(const char *profile, uint64_t flags, #include #include -#include "strings.hh" -#include "signals.hh" +#include "nix/strings.hh" +#include "nix/signals.hh" namespace nix { diff --git a/src/libstore/unix/build/child.hh b/src/libstore/unix/include/nix/build/child.hh similarity index 100% rename from src/libstore/unix/build/child.hh rename to src/libstore/unix/include/nix/build/child.hh diff --git a/src/libstore/unix/build/hook-instance.hh b/src/libstore/unix/include/nix/build/hook-instance.hh similarity index 85% rename from src/libstore/unix/build/hook-instance.hh rename to src/libstore/unix/include/nix/build/hook-instance.hh index 61cf534f4..b82a51183 100644 --- a/src/libstore/unix/build/hook-instance.hh +++ b/src/libstore/unix/include/nix/build/hook-instance.hh @@ -1,9 +1,9 @@ #pragma once ///@file -#include "logging.hh" -#include "serialise.hh" -#include "processes.hh" +#include "nix/logging.hh" +#include "nix/serialise.hh" +#include "nix/processes.hh" namespace nix { diff --git a/src/libstore/unix/build/local-derivation-goal.hh b/src/libstore/unix/include/nix/build/local-derivation-goal.hh similarity index 98% rename from src/libstore/unix/build/local-derivation-goal.hh rename to src/libstore/unix/include/nix/build/local-derivation-goal.hh index c7a129f90..1a14211be 100644 --- a/src/libstore/unix/build/local-derivation-goal.hh +++ b/src/libstore/unix/include/nix/build/local-derivation-goal.hh @@ -1,9 +1,9 @@ #pragma once ///@file -#include "derivation-goal.hh" -#include "local-store.hh" -#include "processes.hh" +#include "nix/build/derivation-goal.hh" +#include "nix/local-store.hh" +#include "nix/processes.hh" namespace nix { diff --git a/src/libstore/unix/include/nix/meson.build b/src/libstore/unix/include/nix/meson.build new file mode 100644 index 000000000..b07787c0a --- /dev/null +++ b/src/libstore/unix/include/nix/meson.build @@ -0,0 +1,8 @@ +include_dirs += include_directories('..') + +headers += files( + 'build/child.hh', + 'build/hook-instance.hh', + 'build/local-derivation-goal.hh', + 'user-lock.hh', +) diff --git a/src/libstore/unix/user-lock.hh b/src/libstore/unix/include/nix/user-lock.hh similarity index 100% rename from src/libstore/unix/user-lock.hh rename to src/libstore/unix/include/nix/user-lock.hh diff --git a/src/libstore/unix/meson.build b/src/libstore/unix/meson.build index d9d190131..7c80aa1a1 100644 --- a/src/libstore/unix/meson.build +++ b/src/libstore/unix/meson.build @@ -6,14 +6,4 @@ sources += files( 'user-lock.cc', ) -include_dirs += include_directories( - '.', - 'build', -) - -headers += files( - 'build/child.hh', - 'build/hook-instance.hh', - 'build/local-derivation-goal.hh', - 'user-lock.hh', -) +subdir('include/nix') diff --git a/src/libstore/unix/pathlocks.cc b/src/libstore/unix/pathlocks.cc index 1ec4579ec..3cc24c859 100644 --- a/src/libstore/unix/pathlocks.cc +++ b/src/libstore/unix/pathlocks.cc @@ -1,7 +1,7 @@ -#include "pathlocks.hh" -#include "util.hh" -#include "sync.hh" -#include "signals.hh" +#include "nix/pathlocks.hh" +#include "nix/util.hh" +#include "nix/sync.hh" +#include "nix/signals.hh" #include #include diff --git a/src/libstore/unix/user-lock.cc b/src/libstore/unix/user-lock.cc index 29f4b2cb3..4426f0768 100644 --- a/src/libstore/unix/user-lock.cc +++ b/src/libstore/unix/user-lock.cc @@ -2,11 +2,11 @@ #include #include -#include "user-lock.hh" -#include "file-system.hh" -#include "globals.hh" -#include "pathlocks.hh" -#include "users.hh" +#include "nix/user-lock.hh" +#include "nix/file-system.hh" +#include "nix/globals.hh" +#include "nix/pathlocks.hh" +#include "nix/users.hh" namespace nix { diff --git a/src/libstore/windows/pathlocks.cc b/src/libstore/windows/pathlocks.cc index 29a98d8e2..0161a8c32 100644 --- a/src/libstore/windows/pathlocks.cc +++ b/src/libstore/windows/pathlocks.cc @@ -1,13 +1,13 @@ -#include "logging.hh" -#include "pathlocks.hh" -#include "signals.hh" -#include "util.hh" +#include "nix/logging.hh" +#include "nix/pathlocks.hh" +#include "nix/signals.hh" +#include "nix/util.hh" #ifdef _WIN32 # include # include # include -# include "windows-error.hh" +# include "nix/windows-error.hh" namespace nix { diff --git a/src/libstore/worker-protocol-connection.cc b/src/libstore/worker-protocol-connection.cc index 6585df4be..a30e808a7 100644 --- a/src/libstore/worker-protocol-connection.cc +++ b/src/libstore/worker-protocol-connection.cc @@ -1,7 +1,7 @@ -#include "worker-protocol-connection.hh" -#include "worker-protocol-impl.hh" -#include "build-result.hh" -#include "derivations.hh" +#include "nix/worker-protocol-connection.hh" +#include "nix/worker-protocol-impl.hh" +#include "nix/build-result.hh" +#include "nix/derivations.hh" namespace nix { diff --git a/src/libstore/worker-protocol.cc b/src/libstore/worker-protocol.cc index f06fb2893..e99723652 100644 --- a/src/libstore/worker-protocol.cc +++ b/src/libstore/worker-protocol.cc @@ -1,11 +1,11 @@ -#include "serialise.hh" -#include "path-with-outputs.hh" -#include "store-api.hh" -#include "build-result.hh" -#include "worker-protocol.hh" -#include "worker-protocol-impl.hh" -#include "archive.hh" -#include "path-info.hh" +#include "nix/serialise.hh" +#include "nix/path-with-outputs.hh" +#include "nix/store-api.hh" +#include "nix/build-result.hh" +#include "nix/worker-protocol.hh" +#include "nix/worker-protocol-impl.hh" +#include "nix/archive.hh" +#include "nix/path-info.hh" #include #include diff --git a/src/libutil-c/meson.build b/src/libutil-c/meson.build index 2733a33ba..cd53bc585 100644 --- a/src/libutil-c/meson.build +++ b/src/libutil-c/meson.build @@ -27,7 +27,7 @@ configdata.set_quoted('PACKAGE_VERSION', meson.project_version()) config_h = configure_file( configuration : configdata, - output : 'config-util.h', + output : 'nix_api_util_config.h', ) add_project_arguments( @@ -35,7 +35,7 @@ add_project_arguments( # It would be nice for our headers to be idempotent instead. # From C++ libraries, only for internals - '-include', 'config-util.hh', + '-include', 'nix/config-util.hh', language : 'cpp', ) @@ -69,7 +69,7 @@ this_library = library( install : true, ) -install_headers(headers, subdir : 'nix', preserve_path : true) +install_headers(headers, preserve_path : true) libraries_private = [] diff --git a/src/libutil-c/nix_api_util.cc b/src/libutil-c/nix_api_util.cc index 3e061d53e..483c5484a 100644 --- a/src/libutil-c/nix_api_util.cc +++ b/src/libutil-c/nix_api_util.cc @@ -1,13 +1,13 @@ #include "nix_api_util.h" -#include "config-global.hh" -#include "error.hh" +#include "nix/config-global.hh" +#include "nix/error.hh" #include "nix_api_util_internal.h" -#include "util.hh" +#include "nix/util.hh" #include #include -#include "config-util.h" +#include "nix_api_util_config.h" nix_c_context * nix_c_context_create() { diff --git a/src/libutil-c/nix_api_util_internal.h b/src/libutil-c/nix_api_util_internal.h index 7fa4252ac..362d8c59a 100644 --- a/src/libutil-c/nix_api_util_internal.h +++ b/src/libutil-c/nix_api_util_internal.h @@ -4,7 +4,7 @@ #include #include -#include "error.hh" +#include "nix/error.hh" #include "nix_api_util.h" struct nix_c_context diff --git a/src/libutil-test-support/tests/hash.cc b/src/libutil-test-support/hash.cc similarity index 91% rename from src/libutil-test-support/tests/hash.cc rename to src/libutil-test-support/hash.cc index 51b9663b4..3614b42b3 100644 --- a/src/libutil-test-support/tests/hash.cc +++ b/src/libutil-test-support/hash.cc @@ -2,9 +2,9 @@ #include -#include "hash.hh" +#include "nix/hash.hh" -#include "tests/hash.hh" +#include "nix/tests/hash.hh" namespace rc { using namespace nix; diff --git a/src/libutil-test-support/include/nix/meson.build b/src/libutil-test-support/include/nix/meson.build new file mode 100644 index 000000000..6490d19ac --- /dev/null +++ b/src/libutil-test-support/include/nix/meson.build @@ -0,0 +1,11 @@ +# Public headers directory + +include_dirs = [include_directories('..')] + +headers = files( + 'tests/characterization.hh', + 'tests/gtest-with-params.hh', + 'tests/hash.hh', + 'tests/nix_api_util.hh', + 'tests/string_callback.hh', +) diff --git a/src/libutil-test-support/tests/characterization.hh b/src/libutil-test-support/include/nix/tests/characterization.hh similarity index 96% rename from src/libutil-test-support/tests/characterization.hh rename to src/libutil-test-support/include/nix/tests/characterization.hh index 5e790e75b..f90793633 100644 --- a/src/libutil-test-support/tests/characterization.hh +++ b/src/libutil-test-support/include/nix/tests/characterization.hh @@ -3,9 +3,9 @@ #include -#include "types.hh" -#include "environment-variables.hh" -#include "file-system.hh" +#include "nix/types.hh" +#include "nix/environment-variables.hh" +#include "nix/file-system.hh" namespace nix { diff --git a/src/libutil-test-support/tests/gtest-with-params.hh b/src/libutil-test-support/include/nix/tests/gtest-with-params.hh similarity index 100% rename from src/libutil-test-support/tests/gtest-with-params.hh rename to src/libutil-test-support/include/nix/tests/gtest-with-params.hh diff --git a/src/libutil-test-support/tests/hash.hh b/src/libutil-test-support/include/nix/tests/hash.hh similarity index 88% rename from src/libutil-test-support/tests/hash.hh rename to src/libutil-test-support/include/nix/tests/hash.hh index 1f9fa59ae..b965ac1a2 100644 --- a/src/libutil-test-support/tests/hash.hh +++ b/src/libutil-test-support/include/nix/tests/hash.hh @@ -3,7 +3,7 @@ #include -#include +#include "nix/hash.hh" namespace rc { using namespace nix; diff --git a/src/libutil-test-support/tests/nix_api_util.hh b/src/libutil-test-support/include/nix/tests/nix_api_util.hh similarity index 100% rename from src/libutil-test-support/tests/nix_api_util.hh rename to src/libutil-test-support/include/nix/tests/nix_api_util.hh diff --git a/src/libutil-test-support/tests/string_callback.hh b/src/libutil-test-support/include/nix/tests/string_callback.hh similarity index 100% rename from src/libutil-test-support/tests/string_callback.hh rename to src/libutil-test-support/include/nix/tests/string_callback.hh diff --git a/src/libutil-test-support/tests/tracing-file-system-object-sink.hh b/src/libutil-test-support/include/nix/tests/tracing-file-system-object-sink.hh similarity index 97% rename from src/libutil-test-support/tests/tracing-file-system-object-sink.hh rename to src/libutil-test-support/include/nix/tests/tracing-file-system-object-sink.hh index 895ac3664..f5d38d0f8 100644 --- a/src/libutil-test-support/tests/tracing-file-system-object-sink.hh +++ b/src/libutil-test-support/include/nix/tests/tracing-file-system-object-sink.hh @@ -1,5 +1,5 @@ #pragma once -#include "fs-sink.hh" +#include "nix/fs-sink.hh" namespace nix::test { diff --git a/src/libutil-test-support/meson.build b/src/libutil-test-support/meson.build index db944cf06..f235af9eb 100644 --- a/src/libutil-test-support/meson.build +++ b/src/libutil-test-support/meson.build @@ -28,26 +28,18 @@ deps_public += rapidcheck add_project_arguments( # TODO(Qyriad): Yes this is how the autoconf+Make system did it. # It would be nice for our headers to be idempotent instead. - '-include', 'config-util.hh', + '-include', 'nix/config-util.hh', language : 'cpp', ) subdir('nix-meson-build-support/common') sources = files( - 'tests/hash.cc', - 'tests/string_callback.cc', + 'hash.cc', + 'string_callback.cc', ) -include_dirs = [include_directories('.')] - -headers = files( - 'tests/characterization.hh', - 'tests/gtest-with-params.hh', - 'tests/hash.hh', - 'tests/nix_api_util.hh', - 'tests/string_callback.hh', -) +subdir('include/nix') subdir('nix-meson-build-support/export-all-symbols') subdir('nix-meson-build-support/windows-version') diff --git a/src/libutil-test-support/package.nix b/src/libutil-test-support/package.nix index fafd47c86..033758d7b 100644 --- a/src/libutil-test-support/package.nix +++ b/src/libutil-test-support/package.nix @@ -28,6 +28,7 @@ mkMesonLibrary (finalAttrs: { ./.version ./meson.build # ./meson.options + ./include/nix/meson.build (fileset.fileFilter (file: file.hasExt "cc") ./.) (fileset.fileFilter (file: file.hasExt "hh") ./.) ]; diff --git a/src/libutil-test-support/tests/string_callback.cc b/src/libutil-test-support/string_callback.cc similarity index 85% rename from src/libutil-test-support/tests/string_callback.cc rename to src/libutil-test-support/string_callback.cc index 7a13bd4ff..25781dc60 100644 --- a/src/libutil-test-support/tests/string_callback.cc +++ b/src/libutil-test-support/string_callback.cc @@ -1,4 +1,4 @@ -#include "string_callback.hh" +#include "nix/tests/string_callback.hh" namespace nix::testing { diff --git a/src/libutil-test-support/tests/tracing-file-system-object-sink.cc b/src/libutil-test-support/tracing-file-system-object-sink.cc similarity index 95% rename from src/libutil-test-support/tests/tracing-file-system-object-sink.cc rename to src/libutil-test-support/tracing-file-system-object-sink.cc index 122a09dcb..52b081fb8 100644 --- a/src/libutil-test-support/tests/tracing-file-system-object-sink.cc +++ b/src/libutil-test-support/tracing-file-system-object-sink.cc @@ -1,5 +1,5 @@ #include -#include "tracing-file-system-object-sink.hh" +#include "nix/tracing-file-system-object-sink.hh" namespace nix::test { diff --git a/src/libutil-tests/args.cc b/src/libutil-tests/args.cc index 950224430..abcc85641 100644 --- a/src/libutil-tests/args.cc +++ b/src/libutil-tests/args.cc @@ -1,5 +1,5 @@ -#include "args.hh" -#include "fs-sink.hh" +#include "nix/args.hh" +#include "nix/fs-sink.hh" #include #include diff --git a/src/libutil-tests/canon-path.cc b/src/libutil-tests/canon-path.cc index 7f91308af..6ef6d3c99 100644 --- a/src/libutil-tests/canon-path.cc +++ b/src/libutil-tests/canon-path.cc @@ -1,4 +1,4 @@ -#include "canon-path.hh" +#include "nix/canon-path.hh" #include diff --git a/src/libutil-tests/checked-arithmetic.cc b/src/libutil-tests/checked-arithmetic.cc index 75018660d..4d98344fb 100644 --- a/src/libutil-tests/checked-arithmetic.cc +++ b/src/libutil-tests/checked-arithmetic.cc @@ -5,9 +5,9 @@ #include #include -#include +#include "nix/checked-arithmetic.hh" -#include "tests/gtest-with-params.hh" +#include "nix/tests/gtest-with-params.hh" namespace rc { using namespace nix; diff --git a/src/libutil-tests/chunked-vector.cc b/src/libutil-tests/chunked-vector.cc index 868d11f6f..16dedc63f 100644 --- a/src/libutil-tests/chunked-vector.cc +++ b/src/libutil-tests/chunked-vector.cc @@ -1,4 +1,4 @@ -#include "chunked-vector.hh" +#include "nix/chunked-vector.hh" #include diff --git a/src/libutil-tests/closure.cc b/src/libutil-tests/closure.cc index 7597e7807..b6b777bcc 100644 --- a/src/libutil-tests/closure.cc +++ b/src/libutil-tests/closure.cc @@ -1,4 +1,4 @@ -#include "closure.hh" +#include "nix/closure.hh" #include namespace nix { diff --git a/src/libutil-tests/compression.cc b/src/libutil-tests/compression.cc index bbbf3500f..7c7dfbd7b 100644 --- a/src/libutil-tests/compression.cc +++ b/src/libutil-tests/compression.cc @@ -1,4 +1,4 @@ -#include "compression.hh" +#include "nix/compression.hh" #include namespace nix { diff --git a/src/libutil-tests/config.cc b/src/libutil-tests/config.cc index 886e70da5..aae410d2b 100644 --- a/src/libutil-tests/config.cc +++ b/src/libutil-tests/config.cc @@ -1,5 +1,5 @@ -#include "config.hh" -#include "args.hh" +#include "nix/config.hh" +#include "nix/args.hh" #include #include diff --git a/src/libutil-tests/executable-path.cc b/src/libutil-tests/executable-path.cc index 8d182357d..041209882 100644 --- a/src/libutil-tests/executable-path.cc +++ b/src/libutil-tests/executable-path.cc @@ -1,6 +1,6 @@ #include -#include "executable-path.hh" +#include "nix/executable-path.hh" namespace nix { diff --git a/src/libutil-tests/file-content-address.cc b/src/libutil-tests/file-content-address.cc index 27d926a87..686114a9f 100644 --- a/src/libutil-tests/file-content-address.cc +++ b/src/libutil-tests/file-content-address.cc @@ -1,6 +1,6 @@ #include -#include "file-content-address.hh" +#include "nix/file-content-address.hh" namespace nix { diff --git a/src/libutil-tests/file-system.cc b/src/libutil-tests/file-system.cc index 2c10d4869..71e671a69 100644 --- a/src/libutil-tests/file-system.cc +++ b/src/libutil-tests/file-system.cc @@ -1,9 +1,9 @@ -#include "util.hh" -#include "types.hh" -#include "file-system.hh" -#include "processes.hh" -#include "terminal.hh" -#include "strings.hh" +#include "nix/util.hh" +#include "nix/types.hh" +#include "nix/file-system.hh" +#include "nix/processes.hh" +#include "nix/terminal.hh" +#include "nix/strings.hh" #include #include diff --git a/src/libutil-tests/git.cc b/src/libutil-tests/git.cc index 048956a58..b91d5019b 100644 --- a/src/libutil-tests/git.cc +++ b/src/libutil-tests/git.cc @@ -1,9 +1,9 @@ #include -#include "git.hh" -#include "memory-source-accessor.hh" +#include "nix/git.hh" +#include "nix/memory-source-accessor.hh" -#include "tests/characterization.hh" +#include "nix/tests/characterization.hh" namespace nix { diff --git a/src/libutil-tests/hash.cc b/src/libutil-tests/hash.cc index 3a639aef9..1ba69a573 100644 --- a/src/libutil-tests/hash.cc +++ b/src/libutil-tests/hash.cc @@ -2,7 +2,7 @@ #include -#include "hash.hh" +#include "nix/hash.hh" namespace nix { diff --git a/src/libutil-tests/hilite.cc b/src/libutil-tests/hilite.cc index 5ef581888..e571a9bf6 100644 --- a/src/libutil-tests/hilite.cc +++ b/src/libutil-tests/hilite.cc @@ -1,4 +1,4 @@ -#include "hilite.hh" +#include "nix/hilite.hh" #include diff --git a/src/libutil-tests/json-utils.cc b/src/libutil-tests/json-utils.cc index 704a4acb0..b8722bd30 100644 --- a/src/libutil-tests/json-utils.cc +++ b/src/libutil-tests/json-utils.cc @@ -3,8 +3,8 @@ #include -#include "error.hh" -#include "json-utils.hh" +#include "nix/error.hh" +#include "nix/json-utils.hh" namespace nix { diff --git a/src/libutil-tests/logging.cc b/src/libutil-tests/logging.cc index 1d7304f05..ca89ee02f 100644 --- a/src/libutil-tests/logging.cc +++ b/src/libutil-tests/logging.cc @@ -1,7 +1,7 @@ #if 0 -#include "logging.hh" -#include "nixexpr.hh" +#include "nix/logging.hh" +#include "nix/nixexpr.hh" #include #include diff --git a/src/libutil-tests/lru-cache.cc b/src/libutil-tests/lru-cache.cc index 091d3d5ed..98763588a 100644 --- a/src/libutil-tests/lru-cache.cc +++ b/src/libutil-tests/lru-cache.cc @@ -1,4 +1,4 @@ -#include "lru-cache.hh" +#include "nix/lru-cache.hh" #include namespace nix { diff --git a/src/libutil-tests/nix_api_util.cc b/src/libutil-tests/nix_api_util.cc index 7b77bd87f..f768de011 100644 --- a/src/libutil-tests/nix_api_util.cc +++ b/src/libutil-tests/nix_api_util.cc @@ -1,9 +1,9 @@ -#include "config-global.hh" -#include "args.hh" +#include "nix/config-global.hh" +#include "nix/args.hh" #include "nix_api_util.h" #include "nix_api_util_internal.h" -#include "tests/nix_api_util.hh" -#include "tests/string_callback.hh" +#include "nix/tests/nix_api_util.hh" +#include "nix/tests/string_callback.hh" #include diff --git a/src/libutil-tests/pool.cc b/src/libutil-tests/pool.cc index 127e42dda..8402768d3 100644 --- a/src/libutil-tests/pool.cc +++ b/src/libutil-tests/pool.cc @@ -1,4 +1,4 @@ -#include "pool.hh" +#include "nix/pool.hh" #include namespace nix { diff --git a/src/libutil-tests/position.cc b/src/libutil-tests/position.cc index 484ecc247..0726b89c0 100644 --- a/src/libutil-tests/position.cc +++ b/src/libutil-tests/position.cc @@ -1,6 +1,6 @@ #include -#include "position.hh" +#include "nix/position.hh" namespace nix { diff --git a/src/libutil-tests/processes.cc b/src/libutil-tests/processes.cc index 9033595e8..5d1435e3a 100644 --- a/src/libutil-tests/processes.cc +++ b/src/libutil-tests/processes.cc @@ -1,4 +1,4 @@ -#include "processes.hh" +#include "nix/processes.hh" #include diff --git a/src/libutil-tests/references.cc b/src/libutil-tests/references.cc index c3efa6d51..362629b55 100644 --- a/src/libutil-tests/references.cc +++ b/src/libutil-tests/references.cc @@ -1,4 +1,4 @@ -#include "references.hh" +#include "nix/references.hh" #include namespace nix { diff --git a/src/libutil-tests/spawn.cc b/src/libutil-tests/spawn.cc index c617acae0..502d4e90b 100644 --- a/src/libutil-tests/spawn.cc +++ b/src/libutil-tests/spawn.cc @@ -1,6 +1,6 @@ #include -#include "processes.hh" +#include "nix/processes.hh" namespace nix { diff --git a/src/libutil-tests/strings.cc b/src/libutil-tests/strings.cc index 33a1fae9b..26b99263b 100644 --- a/src/libutil-tests/strings.cc +++ b/src/libutil-tests/strings.cc @@ -1,8 +1,8 @@ #include #include -#include "strings.hh" -#include "error.hh" +#include "nix/strings.hh" +#include "nix/error.hh" namespace nix { diff --git a/src/libutil-tests/suggestions.cc b/src/libutil-tests/suggestions.cc index 279994abc..36d0b7169 100644 --- a/src/libutil-tests/suggestions.cc +++ b/src/libutil-tests/suggestions.cc @@ -1,4 +1,4 @@ -#include "suggestions.hh" +#include "nix/suggestions.hh" #include namespace nix { diff --git a/src/libutil-tests/terminal.cc b/src/libutil-tests/terminal.cc index f4fc6e770..3d3296cc3 100644 --- a/src/libutil-tests/terminal.cc +++ b/src/libutil-tests/terminal.cc @@ -1,7 +1,7 @@ -#include "util.hh" -#include "types.hh" -#include "terminal.hh" -#include "strings.hh" +#include "nix/util.hh" +#include "nix/types.hh" +#include "nix/terminal.hh" +#include "nix/strings.hh" #include #include diff --git a/src/libutil-tests/url.cc b/src/libutil-tests/url.cc index 7e1d2aa15..89a461c2c 100644 --- a/src/libutil-tests/url.cc +++ b/src/libutil-tests/url.cc @@ -1,4 +1,4 @@ -#include "url.hh" +#include "nix/url.hh" #include namespace nix { diff --git a/src/libutil-tests/util.cc b/src/libutil-tests/util.cc index a3f7c720a..53b7cd208 100644 --- a/src/libutil-tests/util.cc +++ b/src/libutil-tests/util.cc @@ -1,8 +1,8 @@ -#include "util.hh" -#include "types.hh" -#include "file-system.hh" -#include "terminal.hh" -#include "strings.hh" +#include "nix/util.hh" +#include "nix/types.hh" +#include "nix/file-system.hh" +#include "nix/terminal.hh" +#include "nix/strings.hh" #include #include diff --git a/src/libutil-tests/xml-writer.cc b/src/libutil-tests/xml-writer.cc index adcde25c9..7fc1f3154 100644 --- a/src/libutil-tests/xml-writer.cc +++ b/src/libutil-tests/xml-writer.cc @@ -1,4 +1,4 @@ -#include "xml-writer.hh" +#include "nix/xml-writer.hh" #include #include diff --git a/src/libutil/archive.cc b/src/libutil/archive.cc index 20d8a1e09..2c7c91dd0 100644 --- a/src/libutil/archive.cc +++ b/src/libutil/archive.cc @@ -5,12 +5,12 @@ #include // for strcasecmp -#include "archive.hh" -#include "config-global.hh" -#include "posix-source-accessor.hh" -#include "source-path.hh" -#include "file-system.hh" -#include "signals.hh" +#include "nix/archive.hh" +#include "nix/config-global.hh" +#include "nix/posix-source-accessor.hh" +#include "nix/source-path.hh" +#include "nix/file-system.hh" +#include "nix/signals.hh" namespace nix { diff --git a/src/libutil/args.cc b/src/libutil/args.cc index 05ecf724e..184318cc4 100644 --- a/src/libutil/args.cc +++ b/src/libutil/args.cc @@ -1,10 +1,10 @@ -#include "args.hh" -#include "args/root.hh" -#include "hash.hh" -#include "environment-variables.hh" -#include "signals.hh" -#include "users.hh" -#include "json-utils.hh" +#include "nix/args.hh" +#include "nix/args/root.hh" +#include "nix/hash.hh" +#include "nix/environment-variables.hh" +#include "nix/signals.hh" +#include "nix/users.hh" +#include "nix/json-utils.hh" #include #include diff --git a/src/libutil/canon-path.cc b/src/libutil/canon-path.cc index 03db6378a..c6f48ac32 100644 --- a/src/libutil/canon-path.cc +++ b/src/libutil/canon-path.cc @@ -1,7 +1,7 @@ -#include "canon-path.hh" -#include "util.hh" -#include "file-path-impl.hh" -#include "strings-inline.hh" +#include "nix/canon-path.hh" +#include "nix/util.hh" +#include "nix/file-path-impl.hh" +#include "nix/strings-inline.hh" namespace nix { diff --git a/src/libutil/compression.cc b/src/libutil/compression.cc index d27028565..788ad7109 100644 --- a/src/libutil/compression.cc +++ b/src/libutil/compression.cc @@ -1,8 +1,8 @@ -#include "compression.hh" -#include "signals.hh" -#include "tarfile.hh" -#include "finally.hh" -#include "logging.hh" +#include "nix/compression.hh" +#include "nix/signals.hh" +#include "nix/tarfile.hh" +#include "nix/finally.hh" +#include "nix/logging.hh" #include #include diff --git a/src/libutil/compute-levels.cc b/src/libutil/compute-levels.cc index 19eaedfa8..8cc3def18 100644 --- a/src/libutil/compute-levels.cc +++ b/src/libutil/compute-levels.cc @@ -1,4 +1,4 @@ -#include "types.hh" +#include "nix/types.hh" #if HAVE_LIBCPUID #include diff --git a/src/libutil/config-global.cc b/src/libutil/config-global.cc index 3ed1dd1d3..b325d09e7 100644 --- a/src/libutil/config-global.cc +++ b/src/libutil/config-global.cc @@ -1,4 +1,4 @@ -#include "config-global.hh" +#include "nix/config-global.hh" #include diff --git a/src/libutil/config.cc b/src/libutil/config.cc index ca8480304..b108dd58a 100644 --- a/src/libutil/config.cc +++ b/src/libutil/config.cc @@ -1,16 +1,16 @@ -#include "config.hh" -#include "args.hh" -#include "abstract-setting-to-json.hh" -#include "environment-variables.hh" -#include "experimental-features.hh" -#include "util.hh" -#include "file-system.hh" +#include "nix/config.hh" +#include "nix/args.hh" +#include "nix/abstract-setting-to-json.hh" +#include "nix/environment-variables.hh" +#include "nix/experimental-features.hh" +#include "nix/util.hh" +#include "nix/file-system.hh" -#include "config-impl.hh" +#include "nix/config-impl.hh" #include -#include "strings.hh" +#include "nix/strings.hh" namespace nix { diff --git a/src/libutil/current-process.cc b/src/libutil/current-process.cc index 255ae2cf5..11655c55c 100644 --- a/src/libutil/current-process.cc +++ b/src/libutil/current-process.cc @@ -1,12 +1,12 @@ #include #include -#include "current-process.hh" -#include "util.hh" -#include "finally.hh" -#include "file-system.hh" -#include "processes.hh" -#include "signals.hh" +#include "nix/current-process.hh" +#include "nix/util.hh" +#include "nix/finally.hh" +#include "nix/file-system.hh" +#include "nix/processes.hh" +#include "nix/signals.hh" #include #ifdef __APPLE__ @@ -15,8 +15,8 @@ #if __linux__ # include -# include "cgroup.hh" -# include "namespaces.hh" +# include "nix/cgroup.hh" +# include "nix/namespaces.hh" #endif namespace nix { diff --git a/src/libutil/english.cc b/src/libutil/english.cc index 8c93c9156..9ccc7ed3b 100644 --- a/src/libutil/english.cc +++ b/src/libutil/english.cc @@ -1,4 +1,4 @@ -#include "english.hh" +#include "nix/english.hh" namespace nix { diff --git a/src/libutil/environment-variables.cc b/src/libutil/environment-variables.cc index 5947cf742..f2948807a 100644 --- a/src/libutil/environment-variables.cc +++ b/src/libutil/environment-variables.cc @@ -1,5 +1,5 @@ -#include "util.hh" -#include "environment-variables.hh" +#include "nix/util.hh" +#include "nix/environment-variables.hh" extern char ** environ __attribute__((weak)); diff --git a/src/libutil/error.cc b/src/libutil/error.cc index ccd008c7c..bd0baaeff 100644 --- a/src/libutil/error.cc +++ b/src/libutil/error.cc @@ -1,14 +1,14 @@ #include -#include "error.hh" -#include "environment-variables.hh" -#include "signals.hh" -#include "terminal.hh" -#include "position.hh" +#include "nix/error.hh" +#include "nix/environment-variables.hh" +#include "nix/signals.hh" +#include "nix/terminal.hh" +#include "nix/position.hh" #include #include -#include "serialise.hh" +#include "nix/serialise.hh" #include namespace nix { diff --git a/src/libutil/executable-path.cc b/src/libutil/executable-path.cc index 8d665c7df..24e3484f2 100644 --- a/src/libutil/executable-path.cc +++ b/src/libutil/executable-path.cc @@ -1,8 +1,8 @@ -#include "environment-variables.hh" -#include "executable-path.hh" -#include "strings-inline.hh" -#include "util.hh" -#include "file-path-impl.hh" +#include "nix/environment-variables.hh" +#include "nix/executable-path.hh" +#include "nix/strings-inline.hh" +#include "nix/util.hh" +#include "nix/file-path-impl.hh" namespace nix { diff --git a/src/libutil/exit.cc b/src/libutil/exit.cc index 73cd8b04e..e177cfa31 100644 --- a/src/libutil/exit.cc +++ b/src/libutil/exit.cc @@ -1,4 +1,4 @@ -#include "exit.hh" +#include "nix/exit.hh" namespace nix { diff --git a/src/libutil/experimental-features.cc b/src/libutil/experimental-features.cc index 158e202d1..c05c3e9ec 100644 --- a/src/libutil/experimental-features.cc +++ b/src/libutil/experimental-features.cc @@ -1,8 +1,8 @@ -#include "experimental-features.hh" -#include "fmt.hh" -#include "util.hh" +#include "nix/experimental-features.hh" +#include "nix/fmt.hh" +#include "nix/util.hh" -#include "nlohmann/json.hpp" +#include namespace nix { diff --git a/src/libutil/file-content-address.cc b/src/libutil/file-content-address.cc index 69301d9c8..71eb34611 100644 --- a/src/libutil/file-content-address.cc +++ b/src/libutil/file-content-address.cc @@ -1,7 +1,7 @@ -#include "file-content-address.hh" -#include "archive.hh" -#include "git.hh" -#include "source-path.hh" +#include "nix/file-content-address.hh" +#include "nix/archive.hh" +#include "nix/git.hh" +#include "nix/source-path.hh" namespace nix { diff --git a/src/libutil/file-descriptor.cc b/src/libutil/file-descriptor.cc index 707c0f882..2af1364b1 100644 --- a/src/libutil/file-descriptor.cc +++ b/src/libutil/file-descriptor.cc @@ -1,12 +1,12 @@ -#include "serialise.hh" -#include "util.hh" +#include "nix/serialise.hh" +#include "nix/util.hh" #include #include #ifdef _WIN32 # include # include -# include "windows-error.hh" +# include "nix/windows-error.hh" #endif namespace nix { diff --git a/src/libutil/file-system.cc b/src/libutil/file-system.cc index 0adafc0e4..6a63e0242 100644 --- a/src/libutil/file-system.cc +++ b/src/libutil/file-system.cc @@ -1,11 +1,11 @@ -#include "environment-variables.hh" -#include "file-system.hh" -#include "file-path.hh" -#include "file-path-impl.hh" -#include "signals.hh" -#include "finally.hh" -#include "serialise.hh" -#include "util.hh" +#include "nix/environment-variables.hh" +#include "nix/file-system.hh" +#include "nix/file-path.hh" +#include "nix/file-path-impl.hh" +#include "nix/signals.hh" +#include "nix/finally.hh" +#include "nix/serialise.hh" +#include "nix/util.hh" #include #include @@ -25,7 +25,7 @@ # include #endif -#include "strings-inline.hh" +#include "nix/strings-inline.hh" namespace nix { diff --git a/src/libutil/fs-sink.cc b/src/libutil/fs-sink.cc index fadba5972..5e7c2e9fd 100644 --- a/src/libutil/fs-sink.cc +++ b/src/libutil/fs-sink.cc @@ -1,13 +1,13 @@ #include -#include "error.hh" -#include "config-global.hh" -#include "fs-sink.hh" +#include "nix/error.hh" +#include "nix/config-global.hh" +#include "nix/fs-sink.hh" #if _WIN32 # include -# include "file-path.hh" -# include "windows-error.hh" +# include "nix/file-path.hh" +# include "nix/windows-error.hh" #endif namespace nix { diff --git a/src/libutil/git.cc b/src/libutil/git.cc index 3303dbc32..696f86d0b 100644 --- a/src/libutil/git.cc +++ b/src/libutil/git.cc @@ -5,12 +5,12 @@ #include #include // for strcasecmp -#include "signals.hh" -#include "config.hh" -#include "hash.hh" +#include "nix/signals.hh" +#include "nix/config.hh" +#include "nix/hash.hh" -#include "git.hh" -#include "serialise.hh" +#include "nix/git.hh" +#include "nix/serialise.hh" namespace nix::git { diff --git a/src/libutil/hash.cc b/src/libutil/hash.cc index 6a7a8b092..22eca6014 100644 --- a/src/libutil/hash.cc +++ b/src/libutil/hash.cc @@ -6,11 +6,11 @@ #include #include -#include "args.hh" -#include "hash.hh" -#include "archive.hh" -#include "config.hh" -#include "split.hh" +#include "nix/args.hh" +#include "nix/hash.hh" +#include "nix/archive.hh" +#include "nix/config.hh" +#include "nix/split.hh" #include #include diff --git a/src/libutil/hilite.cc b/src/libutil/hilite.cc index e5088230d..6d843e091 100644 --- a/src/libutil/hilite.cc +++ b/src/libutil/hilite.cc @@ -1,4 +1,4 @@ -#include "hilite.hh" +#include "nix/hilite.hh" namespace nix { diff --git a/src/libutil/abstract-setting-to-json.hh b/src/libutil/include/nix/abstract-setting-to-json.hh similarity index 87% rename from src/libutil/abstract-setting-to-json.hh rename to src/libutil/include/nix/abstract-setting-to-json.hh index eea687d8a..313b18faf 100644 --- a/src/libutil/abstract-setting-to-json.hh +++ b/src/libutil/include/nix/abstract-setting-to-json.hh @@ -2,8 +2,8 @@ ///@file #include -#include "config.hh" -#include "json-utils.hh" +#include "nix/config.hh" +#include "nix/json-utils.hh" namespace nix { template diff --git a/src/libutil/ansicolor.hh b/src/libutil/include/nix/ansicolor.hh similarity index 100% rename from src/libutil/ansicolor.hh rename to src/libutil/include/nix/ansicolor.hh diff --git a/src/libutil/archive.hh b/src/libutil/include/nix/archive.hh similarity index 96% rename from src/libutil/archive.hh rename to src/libutil/include/nix/archive.hh index c38fa8a46..9131f49fa 100644 --- a/src/libutil/archive.hh +++ b/src/libutil/include/nix/archive.hh @@ -1,9 +1,9 @@ #pragma once ///@file -#include "types.hh" -#include "serialise.hh" -#include "fs-sink.hh" +#include "nix/types.hh" +#include "nix/serialise.hh" +#include "nix/fs-sink.hh" namespace nix { diff --git a/src/libutil/args.hh b/src/libutil/include/nix/args.hh similarity index 99% rename from src/libutil/args.hh rename to src/libutil/include/nix/args.hh index c30d6cef8..987d14f9e 100644 --- a/src/libutil/args.hh +++ b/src/libutil/include/nix/args.hh @@ -9,9 +9,9 @@ #include -#include "types.hh" -#include "experimental-features.hh" -#include "ref.hh" +#include "nix/types.hh" +#include "nix/experimental-features.hh" +#include "nix/ref.hh" namespace nix { diff --git a/src/libutil/args/root.hh b/src/libutil/include/nix/args/root.hh similarity index 98% rename from src/libutil/args/root.hh rename to src/libutil/include/nix/args/root.hh index 34a43b538..bb83b85a5 100644 --- a/src/libutil/args/root.hh +++ b/src/libutil/include/nix/args/root.hh @@ -1,6 +1,6 @@ #pragma once -#include "args.hh" +#include "nix/args.hh" namespace nix { diff --git a/src/libutil/callback.hh b/src/libutil/include/nix/callback.hh similarity index 100% rename from src/libutil/callback.hh rename to src/libutil/include/nix/callback.hh diff --git a/src/libutil/canon-path.hh b/src/libutil/include/nix/canon-path.hh similarity index 100% rename from src/libutil/canon-path.hh rename to src/libutil/include/nix/canon-path.hh diff --git a/src/libutil/checked-arithmetic.hh b/src/libutil/include/nix/checked-arithmetic.hh similarity index 100% rename from src/libutil/checked-arithmetic.hh rename to src/libutil/include/nix/checked-arithmetic.hh diff --git a/src/libutil/chunked-vector.hh b/src/libutil/include/nix/chunked-vector.hh similarity index 98% rename from src/libutil/chunked-vector.hh rename to src/libutil/include/nix/chunked-vector.hh index 4709679a6..34d5bbb1d 100644 --- a/src/libutil/chunked-vector.hh +++ b/src/libutil/include/nix/chunked-vector.hh @@ -6,7 +6,7 @@ #include #include -#include "error.hh" +#include "nix/error.hh" namespace nix { diff --git a/src/libutil/closure.hh b/src/libutil/include/nix/closure.hh similarity index 98% rename from src/libutil/closure.hh rename to src/libutil/include/nix/closure.hh index 16e3b93e4..c8fc7c9a4 100644 --- a/src/libutil/closure.hh +++ b/src/libutil/include/nix/closure.hh @@ -3,7 +3,7 @@ #include #include -#include "sync.hh" +#include "nix/sync.hh" using std::set; diff --git a/src/libutil/comparator.hh b/src/libutil/include/nix/comparator.hh similarity index 100% rename from src/libutil/comparator.hh rename to src/libutil/include/nix/comparator.hh diff --git a/src/libutil/compression.hh b/src/libutil/include/nix/compression.hh similarity index 90% rename from src/libutil/compression.hh rename to src/libutil/include/nix/compression.hh index e0c531b1f..25f479e48 100644 --- a/src/libutil/compression.hh +++ b/src/libutil/include/nix/compression.hh @@ -1,9 +1,9 @@ #pragma once ///@file -#include "ref.hh" -#include "types.hh" -#include "serialise.hh" +#include "nix/ref.hh" +#include "nix/types.hh" +#include "nix/serialise.hh" #include diff --git a/src/libutil/compute-levels.hh b/src/libutil/include/nix/compute-levels.hh similarity index 74% rename from src/libutil/compute-levels.hh rename to src/libutil/include/nix/compute-levels.hh index 093e7a915..d77eece93 100644 --- a/src/libutil/compute-levels.hh +++ b/src/libutil/include/nix/compute-levels.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "types.hh" +#include "nix/types.hh" namespace nix { diff --git a/src/libutil/config-global.hh b/src/libutil/include/nix/config-global.hh similarity index 96% rename from src/libutil/config-global.hh rename to src/libutil/include/nix/config-global.hh index 2caf51524..b0e8ad2ce 100644 --- a/src/libutil/config-global.hh +++ b/src/libutil/include/nix/config-global.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "config.hh" +#include "nix/config.hh" namespace nix { diff --git a/src/libutil/config-impl.hh b/src/libutil/include/nix/config-impl.hh similarity index 98% rename from src/libutil/config-impl.hh rename to src/libutil/include/nix/config-impl.hh index 94c2cb2e4..b02e27f50 100644 --- a/src/libutil/config-impl.hh +++ b/src/libutil/include/nix/config-impl.hh @@ -12,8 +12,8 @@ * instantiation. */ -#include "config.hh" -#include "args.hh" +#include "nix/config.hh" +#include "nix/args.hh" namespace nix { diff --git a/src/libutil/config.hh b/src/libutil/include/nix/config.hh similarity index 99% rename from src/libutil/config.hh rename to src/libutil/include/nix/config.hh index 502d2823e..f4135af64 100644 --- a/src/libutil/config.hh +++ b/src/libutil/include/nix/config.hh @@ -7,8 +7,8 @@ #include -#include "types.hh" -#include "experimental-features.hh" +#include "nix/types.hh" +#include "nix/experimental-features.hh" namespace nix { diff --git a/src/libutil/current-process.hh b/src/libutil/include/nix/current-process.hh similarity index 97% rename from src/libutil/current-process.hh rename to src/libutil/include/nix/current-process.hh index 660dcfe0b..d98f4e752 100644 --- a/src/libutil/current-process.hh +++ b/src/libutil/include/nix/current-process.hh @@ -7,7 +7,7 @@ # include #endif -#include "types.hh" +#include "nix/types.hh" namespace nix { diff --git a/src/libutil/english.hh b/src/libutil/include/nix/english.hh similarity index 100% rename from src/libutil/english.hh rename to src/libutil/include/nix/english.hh diff --git a/src/libutil/environment-variables.hh b/src/libutil/include/nix/environment-variables.hh similarity index 96% rename from src/libutil/environment-variables.hh rename to src/libutil/include/nix/environment-variables.hh index 1a95f5c97..9a5f364a3 100644 --- a/src/libutil/environment-variables.hh +++ b/src/libutil/include/nix/environment-variables.hh @@ -8,8 +8,8 @@ #include -#include "types.hh" -#include "file-path.hh" +#include "nix/types.hh" +#include "nix/file-path.hh" namespace nix { diff --git a/src/libutil/error.hh b/src/libutil/include/nix/error.hh similarity index 99% rename from src/libutil/error.hh rename to src/libutil/include/nix/error.hh index 04fa18e35..6ac4497cb 100644 --- a/src/libutil/error.hh +++ b/src/libutil/include/nix/error.hh @@ -15,8 +15,8 @@ * See libutil/tests/logging.cc for usage examples. */ -#include "suggestions.hh" -#include "fmt.hh" +#include "nix/suggestions.hh" +#include "nix/fmt.hh" #include #include diff --git a/src/libutil/exec.hh b/src/libutil/include/nix/exec.hh similarity index 91% rename from src/libutil/exec.hh rename to src/libutil/include/nix/exec.hh index cbbe80c4e..dc14691e2 100644 --- a/src/libutil/exec.hh +++ b/src/libutil/include/nix/exec.hh @@ -1,6 +1,6 @@ #pragma once -#include "os-string.hh" +#include "nix/os-string.hh" namespace nix { diff --git a/src/libutil/executable-path.hh b/src/libutil/include/nix/executable-path.hh similarity index 98% rename from src/libutil/executable-path.hh rename to src/libutil/include/nix/executable-path.hh index c5cfa1c39..3af4a24cf 100644 --- a/src/libutil/executable-path.hh +++ b/src/libutil/include/nix/executable-path.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "file-system.hh" +#include "nix/file-system.hh" namespace nix { diff --git a/src/libutil/exit.hh b/src/libutil/include/nix/exit.hh similarity index 100% rename from src/libutil/exit.hh rename to src/libutil/include/nix/exit.hh diff --git a/src/libutil/experimental-features.hh b/src/libutil/include/nix/experimental-features.hh similarity index 98% rename from src/libutil/experimental-features.hh rename to src/libutil/include/nix/experimental-features.hh index 1d02ba94d..946bb65b3 100644 --- a/src/libutil/experimental-features.hh +++ b/src/libutil/include/nix/experimental-features.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "error.hh" -#include "types.hh" +#include "nix/error.hh" +#include "nix/types.hh" #include diff --git a/src/libutil/file-content-address.hh b/src/libutil/include/nix/file-content-address.hh similarity index 99% rename from src/libutil/file-content-address.hh rename to src/libutil/include/nix/file-content-address.hh index 226068387..c56debd2b 100644 --- a/src/libutil/file-content-address.hh +++ b/src/libutil/include/nix/file-content-address.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "source-accessor.hh" +#include "nix/source-accessor.hh" namespace nix { diff --git a/src/libutil/file-descriptor.hh b/src/libutil/include/nix/file-descriptor.hh similarity index 98% rename from src/libutil/file-descriptor.hh rename to src/libutil/include/nix/file-descriptor.hh index fde362999..785756a0f 100644 --- a/src/libutil/file-descriptor.hh +++ b/src/libutil/include/nix/file-descriptor.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "types.hh" -#include "error.hh" +#include "nix/types.hh" +#include "nix/error.hh" #ifdef _WIN32 # define WIN32_LEAN_AND_MEAN diff --git a/src/libutil/file-path-impl.hh b/src/libutil/include/nix/file-path-impl.hh similarity index 100% rename from src/libutil/file-path-impl.hh rename to src/libutil/include/nix/file-path-impl.hh diff --git a/src/libutil/file-path.hh b/src/libutil/include/nix/file-path.hh similarity index 94% rename from src/libutil/file-path.hh rename to src/libutil/include/nix/file-path.hh index 8e4a88b9d..15bceac13 100644 --- a/src/libutil/file-path.hh +++ b/src/libutil/include/nix/file-path.hh @@ -3,8 +3,8 @@ #include -#include "types.hh" -#include "os-string.hh" +#include "nix/types.hh" +#include "nix/os-string.hh" namespace nix { diff --git a/src/libutil/file-system.hh b/src/libutil/include/nix/file-system.hh similarity index 98% rename from src/libutil/file-system.hh rename to src/libutil/include/nix/file-system.hh index 49d120cb7..1981d8d4d 100644 --- a/src/libutil/file-system.hh +++ b/src/libutil/include/nix/file-system.hh @@ -5,11 +5,11 @@ * Utiltities for working with the file sytem and file paths. */ -#include "types.hh" -#include "error.hh" -#include "logging.hh" -#include "file-descriptor.hh" -#include "file-path.hh" +#include "nix/types.hh" +#include "nix/error.hh" +#include "nix/logging.hh" +#include "nix/file-descriptor.hh" +#include "nix/file-path.hh" #include #include diff --git a/src/libutil/finally.hh b/src/libutil/include/nix/finally.hh similarity index 100% rename from src/libutil/finally.hh rename to src/libutil/include/nix/finally.hh diff --git a/src/libutil/fmt.hh b/src/libutil/include/nix/fmt.hh similarity index 99% rename from src/libutil/fmt.hh rename to src/libutil/include/nix/fmt.hh index 850b7162d..45d9f43b7 100644 --- a/src/libutil/fmt.hh +++ b/src/libutil/include/nix/fmt.hh @@ -3,7 +3,7 @@ #include #include -#include "ansicolor.hh" +#include "nix/ansicolor.hh" namespace nix { diff --git a/src/libutil/fs-sink.hh b/src/libutil/include/nix/fs-sink.hh similarity index 97% rename from src/libutil/fs-sink.hh rename to src/libutil/include/nix/fs-sink.hh index 5c5073731..30803e63e 100644 --- a/src/libutil/fs-sink.hh +++ b/src/libutil/include/nix/fs-sink.hh @@ -1,9 +1,9 @@ #pragma once ///@file -#include "serialise.hh" -#include "source-accessor.hh" -#include "file-system.hh" +#include "nix/serialise.hh" +#include "nix/source-accessor.hh" +#include "nix/file-system.hh" namespace nix { diff --git a/src/libutil/git.hh b/src/libutil/include/nix/git.hh similarity index 97% rename from src/libutil/git.hh rename to src/libutil/include/nix/git.hh index 1a6a7c333..2dc1bb796 100644 --- a/src/libutil/git.hh +++ b/src/libutil/include/nix/git.hh @@ -5,11 +5,11 @@ #include #include -#include "types.hh" -#include "serialise.hh" -#include "hash.hh" -#include "source-path.hh" -#include "fs-sink.hh" +#include "nix/types.hh" +#include "nix/serialise.hh" +#include "nix/hash.hh" +#include "nix/source-path.hh" +#include "nix/fs-sink.hh" namespace nix::git { diff --git a/src/libutil/hash.hh b/src/libutil/include/nix/hash.hh similarity index 98% rename from src/libutil/hash.hh rename to src/libutil/include/nix/hash.hh index 13d526f42..3c9adebac 100644 --- a/src/libutil/hash.hh +++ b/src/libutil/include/nix/hash.hh @@ -1,10 +1,10 @@ #pragma once ///@file -#include "config.hh" -#include "types.hh" -#include "serialise.hh" -#include "file-system.hh" +#include "nix/config.hh" +#include "nix/types.hh" +#include "nix/serialise.hh" +#include "nix/file-system.hh" namespace nix { diff --git a/src/libutil/hilite.hh b/src/libutil/include/nix/hilite.hh similarity index 100% rename from src/libutil/hilite.hh rename to src/libutil/include/nix/hilite.hh diff --git a/src/libutil/json-impls.hh b/src/libutil/include/nix/json-impls.hh similarity index 95% rename from src/libutil/json-impls.hh rename to src/libutil/include/nix/json-impls.hh index b26163a04..9dd344c50 100644 --- a/src/libutil/json-impls.hh +++ b/src/libutil/include/nix/json-impls.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "nlohmann/json_fwd.hpp" +#include // Following https://github.com/nlohmann/json#how-can-i-use-get-for-non-default-constructiblenon-copyable-types #define JSON_IMPL(TYPE) \ diff --git a/src/libutil/json-utils.hh b/src/libutil/include/nix/json-utils.hh similarity index 99% rename from src/libutil/json-utils.hh rename to src/libutil/include/nix/json-utils.hh index 1afc5d796..96ffcd3c0 100644 --- a/src/libutil/json-utils.hh +++ b/src/libutil/include/nix/json-utils.hh @@ -4,7 +4,7 @@ #include #include -#include "types.hh" +#include "nix/types.hh" namespace nix { diff --git a/src/libutil/logging.hh b/src/libutil/include/nix/logging.hh similarity index 98% rename from src/libutil/logging.hh rename to src/libutil/include/nix/logging.hh index e5a7a833f..c83ad2316 100644 --- a/src/libutil/logging.hh +++ b/src/libutil/include/nix/logging.hh @@ -1,10 +1,10 @@ #pragma once ///@file -#include "error.hh" -#include "config.hh" -#include "file-descriptor.hh" -#include "finally.hh" +#include "nix/error.hh" +#include "nix/config.hh" +#include "nix/file-descriptor.hh" +#include "nix/finally.hh" #include diff --git a/src/libutil/lru-cache.hh b/src/libutil/include/nix/lru-cache.hh similarity index 100% rename from src/libutil/lru-cache.hh rename to src/libutil/include/nix/lru-cache.hh diff --git a/src/libutil/memory-source-accessor.hh b/src/libutil/include/nix/memory-source-accessor.hh similarity index 97% rename from src/libutil/memory-source-accessor.hh rename to src/libutil/include/nix/memory-source-accessor.hh index 012a388c0..08ab3f2d4 100644 --- a/src/libutil/memory-source-accessor.hh +++ b/src/libutil/include/nix/memory-source-accessor.hh @@ -1,6 +1,6 @@ -#include "source-path.hh" -#include "fs-sink.hh" -#include "variant-wrapper.hh" +#include "nix/source-path.hh" +#include "nix/fs-sink.hh" +#include "nix/variant-wrapper.hh" namespace nix { diff --git a/src/libutil/include/nix/meson.build b/src/libutil/include/nix/meson.build new file mode 100644 index 000000000..798d49828 --- /dev/null +++ b/src/libutil/include/nix/meson.build @@ -0,0 +1,87 @@ +# Public headers directory + +include_dirs = [include_directories('..')] + +config_h = configure_file( + configuration : configdata, + output : 'config-util.hh', +) + +headers = [config_h] + files( + 'abstract-setting-to-json.hh', + 'ansicolor.hh', + 'archive.hh', + 'args.hh', + 'args/root.hh', + 'callback.hh', + 'canon-path.hh', + 'checked-arithmetic.hh', + 'chunked-vector.hh', + 'closure.hh', + 'comparator.hh', + 'compression.hh', + 'compute-levels.hh', + 'config-global.hh', + 'config-impl.hh', + 'config.hh', + 'current-process.hh', + 'english.hh', + 'environment-variables.hh', + 'error.hh', + 'exec.hh', + 'executable-path.hh', + 'exit.hh', + 'experimental-features.hh', + 'file-content-address.hh', + 'file-descriptor.hh', + 'file-path-impl.hh', + 'file-path.hh', + 'file-system.hh', + 'finally.hh', + 'fmt.hh', + 'fs-sink.hh', + 'git.hh', + 'hash.hh', + 'hilite.hh', + 'json-impls.hh', + 'json-utils.hh', + 'logging.hh', + 'lru-cache.hh', + 'memory-source-accessor.hh', + 'muxable-pipe.hh', + 'os-string.hh', + 'pool.hh', + 'pos-idx.hh', + 'pos-table.hh', + 'position.hh', + 'posix-source-accessor.hh', + 'processes.hh', + 'ref.hh', + 'references.hh', + 'regex-combinators.hh', + 'repair-flag.hh', + 'serialise.hh', + 'signals.hh', + 'signature/local-keys.hh', + 'signature/signer.hh', + 'source-accessor.hh', + 'source-path.hh', + 'split.hh', + 'std-hash.hh', + 'strings.hh', + 'strings-inline.hh', + 'suggestions.hh', + 'sync.hh', + 'tarfile.hh', + 'terminal.hh', + 'thread-pool.hh', + 'topo-sort.hh', + 'types.hh', + 'unix-domain-socket.hh', + 'url-parts.hh', + 'url.hh', + 'users.hh', + 'util.hh', + 'variant-wrapper.hh', + 'xml-writer.hh', +) diff --git a/src/libutil/muxable-pipe.hh b/src/libutil/include/nix/muxable-pipe.hh similarity index 94% rename from src/libutil/muxable-pipe.hh rename to src/libutil/include/nix/muxable-pipe.hh index 53ac39170..e4d6a74a3 100644 --- a/src/libutil/muxable-pipe.hh +++ b/src/libutil/include/nix/muxable-pipe.hh @@ -1,16 +1,16 @@ #pragma once ///@file -#include "file-descriptor.hh" +#include "nix/file-descriptor.hh" #ifdef _WIN32 -# include "windows-async-pipe.hh" +# include "nix/windows-async-pipe.hh" #endif #ifndef _WIN32 # include #else # include -# include "windows-error.hh" +# include "nix/windows-error.hh" #endif namespace nix { diff --git a/src/libutil/os-string.hh b/src/libutil/include/nix/os-string.hh similarity index 100% rename from src/libutil/os-string.hh rename to src/libutil/include/nix/os-string.hh diff --git a/src/libutil/pool.hh b/src/libutil/include/nix/pool.hh similarity index 99% rename from src/libutil/pool.hh rename to src/libutil/include/nix/pool.hh index b2ceb7143..65b789ba0 100644 --- a/src/libutil/pool.hh +++ b/src/libutil/include/nix/pool.hh @@ -7,8 +7,8 @@ #include #include -#include "sync.hh" -#include "ref.hh" +#include "nix/sync.hh" +#include "nix/ref.hh" namespace nix { diff --git a/src/libutil/pos-idx.hh b/src/libutil/include/nix/pos-idx.hh similarity index 100% rename from src/libutil/pos-idx.hh rename to src/libutil/include/nix/pos-idx.hh diff --git a/src/libutil/pos-table.hh b/src/libutil/include/nix/pos-table.hh similarity index 97% rename from src/libutil/pos-table.hh rename to src/libutil/include/nix/pos-table.hh index a6fe09d79..9f4ff2e0b 100644 --- a/src/libutil/pos-table.hh +++ b/src/libutil/include/nix/pos-table.hh @@ -4,9 +4,9 @@ #include #include -#include "pos-idx.hh" -#include "position.hh" -#include "sync.hh" +#include "nix/pos-idx.hh" +#include "nix/position.hh" +#include "nix/sync.hh" namespace nix { diff --git a/src/libutil/position.hh b/src/libutil/include/nix/position.hh similarity index 99% rename from src/libutil/position.hh rename to src/libutil/include/nix/position.hh index 07e261c4c..34457a824 100644 --- a/src/libutil/position.hh +++ b/src/libutil/include/nix/position.hh @@ -9,7 +9,7 @@ #include #include -#include "source-path.hh" +#include "nix/source-path.hh" namespace nix { diff --git a/src/libutil/posix-source-accessor.hh b/src/libutil/include/nix/posix-source-accessor.hh similarity index 98% rename from src/libutil/posix-source-accessor.hh rename to src/libutil/include/nix/posix-source-accessor.hh index 5d491e633..d81e9246c 100644 --- a/src/libutil/posix-source-accessor.hh +++ b/src/libutil/include/nix/posix-source-accessor.hh @@ -1,6 +1,6 @@ #pragma once -#include "source-accessor.hh" +#include "nix/source-accessor.hh" namespace nix { diff --git a/src/libutil/processes.hh b/src/libutil/include/nix/processes.hh similarity index 95% rename from src/libutil/processes.hh rename to src/libutil/include/nix/processes.hh index bbbe7dcab..80ea14223 100644 --- a/src/libutil/processes.hh +++ b/src/libutil/include/nix/processes.hh @@ -1,11 +1,11 @@ #pragma once ///@file -#include "types.hh" -#include "error.hh" -#include "file-descriptor.hh" -#include "logging.hh" -#include "ansicolor.hh" +#include "nix/types.hh" +#include "nix/error.hh" +#include "nix/file-descriptor.hh" +#include "nix/logging.hh" +#include "nix/ansicolor.hh" #include #include diff --git a/src/libutil/ref.hh b/src/libutil/include/nix/ref.hh similarity index 100% rename from src/libutil/ref.hh rename to src/libutil/include/nix/ref.hh diff --git a/src/libutil/references.hh b/src/libutil/include/nix/references.hh similarity index 97% rename from src/libutil/references.hh rename to src/libutil/include/nix/references.hh index 8bc9f7ec9..b608f7015 100644 --- a/src/libutil/references.hh +++ b/src/libutil/include/nix/references.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "hash.hh" +#include "nix/hash.hh" namespace nix { diff --git a/src/libutil/regex-combinators.hh b/src/libutil/include/nix/regex-combinators.hh similarity index 100% rename from src/libutil/regex-combinators.hh rename to src/libutil/include/nix/regex-combinators.hh diff --git a/src/libutil/repair-flag.hh b/src/libutil/include/nix/repair-flag.hh similarity index 100% rename from src/libutil/repair-flag.hh rename to src/libutil/include/nix/repair-flag.hh diff --git a/src/libutil/serialise.hh b/src/libutil/include/nix/serialise.hh similarity index 99% rename from src/libutil/serialise.hh rename to src/libutil/include/nix/serialise.hh index 14721d069..ef49a43b6 100644 --- a/src/libutil/serialise.hh +++ b/src/libutil/include/nix/serialise.hh @@ -4,9 +4,9 @@ #include #include -#include "types.hh" -#include "util.hh" -#include "file-descriptor.hh" +#include "nix/types.hh" +#include "nix/util.hh" +#include "nix/file-descriptor.hh" namespace boost::context { struct stack_context; } diff --git a/src/libutil/signals.hh b/src/libutil/include/nix/signals.hh similarity index 90% rename from src/libutil/signals.hh rename to src/libutil/include/nix/signals.hh index 8bff345c3..b4953525e 100644 --- a/src/libutil/signals.hh +++ b/src/libutil/include/nix/signals.hh @@ -1,9 +1,9 @@ #pragma once ///@file -#include "types.hh" -#include "error.hh" -#include "logging.hh" +#include "nix/types.hh" +#include "nix/error.hh" +#include "nix/logging.hh" #include @@ -62,4 +62,4 @@ struct ReceiveInterrupts; } -#include "signals-impl.hh" +#include "nix/signals-impl.hh" diff --git a/src/libutil/signature/local-keys.hh b/src/libutil/include/nix/signature/local-keys.hh similarity index 99% rename from src/libutil/signature/local-keys.hh rename to src/libutil/include/nix/signature/local-keys.hh index 9977f0dac..368976b11 100644 --- a/src/libutil/signature/local-keys.hh +++ b/src/libutil/include/nix/signature/local-keys.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "types.hh" +#include "nix/types.hh" #include diff --git a/src/libutil/signature/signer.hh b/src/libutil/include/nix/signature/signer.hh similarity index 94% rename from src/libutil/signature/signer.hh rename to src/libutil/include/nix/signature/signer.hh index e50170fe2..3eeb75608 100644 --- a/src/libutil/signature/signer.hh +++ b/src/libutil/include/nix/signature/signer.hh @@ -1,7 +1,7 @@ #pragma once -#include "types.hh" -#include "signature/local-keys.hh" +#include "nix/types.hh" +#include "nix/signature/local-keys.hh" #include #include diff --git a/src/libutil/source-accessor.hh b/src/libutil/include/nix/source-accessor.hh similarity index 98% rename from src/libutil/source-accessor.hh rename to src/libutil/include/nix/source-accessor.hh index 79ae092ac..5efc177fc 100644 --- a/src/libutil/source-accessor.hh +++ b/src/libutil/include/nix/source-accessor.hh @@ -2,9 +2,9 @@ #include -#include "canon-path.hh" -#include "hash.hh" -#include "ref.hh" +#include "nix/canon-path.hh" +#include "nix/hash.hh" +#include "nix/ref.hh" namespace nix { diff --git a/src/libutil/source-path.hh b/src/libutil/include/nix/source-path.hh similarity index 96% rename from src/libutil/source-path.hh rename to src/libutil/include/nix/source-path.hh index fc2288f74..119a67016 100644 --- a/src/libutil/source-path.hh +++ b/src/libutil/include/nix/source-path.hh @@ -5,10 +5,10 @@ * @brief SourcePath */ -#include "ref.hh" -#include "canon-path.hh" -#include "source-accessor.hh" -#include "std-hash.hh" +#include "nix/ref.hh" +#include "nix/canon-path.hh" +#include "nix/source-accessor.hh" +#include "nix/std-hash.hh" namespace nix { diff --git a/src/libutil/split.hh b/src/libutil/include/nix/split.hh similarity index 97% rename from src/libutil/split.hh rename to src/libutil/include/nix/split.hh index 3b9b2b83b..2d7c490b1 100644 --- a/src/libutil/split.hh +++ b/src/libutil/include/nix/split.hh @@ -4,7 +4,7 @@ #include #include -#include "util.hh" +#include "nix/util.hh" namespace nix { diff --git a/src/libutil/std-hash.hh b/src/libutil/include/nix/std-hash.hh similarity index 100% rename from src/libutil/std-hash.hh rename to src/libutil/include/nix/std-hash.hh diff --git a/src/libutil/strings-inline.hh b/src/libutil/include/nix/strings-inline.hh similarity index 99% rename from src/libutil/strings-inline.hh rename to src/libutil/include/nix/strings-inline.hh index 25b8e0ff6..38cf285e0 100644 --- a/src/libutil/strings-inline.hh +++ b/src/libutil/include/nix/strings-inline.hh @@ -1,6 +1,6 @@ #pragma once -#include "strings.hh" +#include "nix/strings.hh" namespace nix { diff --git a/src/libutil/strings.hh b/src/libutil/include/nix/strings.hh similarity index 100% rename from src/libutil/strings.hh rename to src/libutil/include/nix/strings.hh diff --git a/src/libutil/suggestions.hh b/src/libutil/include/nix/suggestions.hh similarity index 98% rename from src/libutil/suggestions.hh rename to src/libutil/include/nix/suggestions.hh index e39ab400c..5517c20a6 100644 --- a/src/libutil/suggestions.hh +++ b/src/libutil/include/nix/suggestions.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "types.hh" +#include "nix/types.hh" #include namespace nix { diff --git a/src/libutil/sync.hh b/src/libutil/include/nix/sync.hh similarity index 99% rename from src/libutil/sync.hh rename to src/libutil/include/nix/sync.hh index d340f3d97..25c062ac8 100644 --- a/src/libutil/sync.hh +++ b/src/libutil/include/nix/sync.hh @@ -7,7 +7,7 @@ #include #include -#include "error.hh" +#include "nix/error.hh" namespace nix { diff --git a/src/libutil/tarfile.hh b/src/libutil/include/nix/tarfile.hh similarity index 96% rename from src/libutil/tarfile.hh rename to src/libutil/include/nix/tarfile.hh index 5e29c6bba..aea91f90e 100644 --- a/src/libutil/tarfile.hh +++ b/src/libutil/include/nix/tarfile.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "serialise.hh" -#include "fs-sink.hh" +#include "nix/serialise.hh" +#include "nix/fs-sink.hh" #include namespace nix { diff --git a/src/libutil/terminal.hh b/src/libutil/include/nix/terminal.hh similarity index 100% rename from src/libutil/terminal.hh rename to src/libutil/include/nix/terminal.hh diff --git a/src/libutil/thread-pool.hh b/src/libutil/include/nix/thread-pool.hh similarity index 98% rename from src/libutil/thread-pool.hh rename to src/libutil/include/nix/thread-pool.hh index 4adc48657..e3b2a29b9 100644 --- a/src/libutil/thread-pool.hh +++ b/src/libutil/include/nix/thread-pool.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "error.hh" -#include "sync.hh" +#include "nix/error.hh" +#include "nix/sync.hh" #include #include diff --git a/src/libutil/topo-sort.hh b/src/libutil/include/nix/topo-sort.hh similarity index 97% rename from src/libutil/topo-sort.hh rename to src/libutil/include/nix/topo-sort.hh index a52811fbf..ed37ca01e 100644 --- a/src/libutil/topo-sort.hh +++ b/src/libutil/include/nix/topo-sort.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "error.hh" +#include "nix/error.hh" namespace nix { diff --git a/src/libutil/types.hh b/src/libutil/include/nix/types.hh similarity index 100% rename from src/libutil/types.hh rename to src/libutil/include/nix/types.hh diff --git a/src/libutil/unix-domain-socket.hh b/src/libutil/include/nix/unix-domain-socket.hh similarity index 95% rename from src/libutil/unix-domain-socket.hh rename to src/libutil/include/nix/unix-domain-socket.hh index ba2baeb13..87508f9e4 100644 --- a/src/libutil/unix-domain-socket.hh +++ b/src/libutil/include/nix/unix-domain-socket.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "types.hh" -#include "file-descriptor.hh" +#include "nix/types.hh" +#include "nix/file-descriptor.hh" #ifdef _WIN32 # include diff --git a/src/libutil/url-parts.hh b/src/libutil/include/nix/url-parts.hh similarity index 100% rename from src/libutil/url-parts.hh rename to src/libutil/include/nix/url-parts.hh diff --git a/src/libutil/url.hh b/src/libutil/include/nix/url.hh similarity index 98% rename from src/libutil/url.hh rename to src/libutil/include/nix/url.hh index 2b12f5af2..071d5092f 100644 --- a/src/libutil/url.hh +++ b/src/libutil/include/nix/url.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "error.hh" +#include "nix/error.hh" namespace nix { diff --git a/src/libutil/users.hh b/src/libutil/include/nix/users.hh similarity index 98% rename from src/libutil/users.hh rename to src/libutil/include/nix/users.hh index d22c3311d..d48b8b9bf 100644 --- a/src/libutil/users.hh +++ b/src/libutil/include/nix/users.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "types.hh" +#include "nix/types.hh" #ifndef _WIN32 # include diff --git a/src/libutil/util.hh b/src/libutil/include/nix/util.hh similarity index 98% rename from src/libutil/util.hh rename to src/libutil/include/nix/util.hh index 0d55cf93b..7ece2bd7b 100644 --- a/src/libutil/util.hh +++ b/src/libutil/include/nix/util.hh @@ -1,9 +1,9 @@ #pragma once ///@file -#include "types.hh" -#include "error.hh" -#include "logging.hh" +#include "nix/types.hh" +#include "nix/error.hh" +#include "nix/logging.hh" #include @@ -11,7 +11,7 @@ #include #include -#include "strings.hh" +#include "nix/strings.hh" namespace nix { diff --git a/src/libutil/variant-wrapper.hh b/src/libutil/include/nix/variant-wrapper.hh similarity index 100% rename from src/libutil/variant-wrapper.hh rename to src/libutil/include/nix/variant-wrapper.hh diff --git a/src/libutil/xml-writer.hh b/src/libutil/include/nix/xml-writer.hh similarity index 100% rename from src/libutil/xml-writer.hh rename to src/libutil/include/nix/xml-writer.hh diff --git a/src/libutil/json-utils.cc b/src/libutil/json-utils.cc index f67811e21..aff8abb9a 100644 --- a/src/libutil/json-utils.cc +++ b/src/libutil/json-utils.cc @@ -1,6 +1,6 @@ -#include "json-utils.hh" -#include "error.hh" -#include "types.hh" +#include "nix/json-utils.hh" +#include "nix/error.hh" +#include "nix/types.hh" #include #include #include diff --git a/src/libutil/linux/cgroup.cc b/src/libutil/linux/cgroup.cc index ad3e8a017..7b3c3fa3b 100644 --- a/src/libutil/linux/cgroup.cc +++ b/src/libutil/linux/cgroup.cc @@ -1,8 +1,8 @@ -#include "cgroup.hh" -#include "signals.hh" -#include "util.hh" -#include "file-system.hh" -#include "finally.hh" +#include "nix/cgroup.hh" +#include "nix/signals.hh" +#include "nix/util.hh" +#include "nix/file-system.hh" +#include "nix/finally.hh" #include #include diff --git a/src/libutil/linux/cgroup.hh b/src/libutil/linux/include/nix/cgroup.hh similarity index 97% rename from src/libutil/linux/cgroup.hh rename to src/libutil/linux/include/nix/cgroup.hh index 87d135ba6..91c7de9d1 100644 --- a/src/libutil/linux/cgroup.hh +++ b/src/libutil/linux/include/nix/cgroup.hh @@ -4,7 +4,7 @@ #include #include -#include "types.hh" +#include "nix/types.hh" namespace nix { diff --git a/src/libutil/linux/include/nix/meson.build b/src/libutil/linux/include/nix/meson.build new file mode 100644 index 000000000..285c1489b --- /dev/null +++ b/src/libutil/linux/include/nix/meson.build @@ -0,0 +1,8 @@ +# Public headers directory + +include_dirs += include_directories('..') + +headers += files( + 'cgroup.hh', + 'namespaces.hh', +) diff --git a/src/libutil/linux/namespaces.hh b/src/libutil/linux/include/nix/namespaces.hh similarity index 96% rename from src/libutil/linux/namespaces.hh rename to src/libutil/linux/include/nix/namespaces.hh index 208920b80..3eb5f6a14 100644 --- a/src/libutil/linux/namespaces.hh +++ b/src/libutil/linux/include/nix/namespaces.hh @@ -3,7 +3,7 @@ #include -#include "types.hh" +#include "nix/types.hh" namespace nix { diff --git a/src/libutil/linux/meson.build b/src/libutil/linux/meson.build index a1ded76ca..40907ed0d 100644 --- a/src/libutil/linux/meson.build +++ b/src/libutil/linux/meson.build @@ -3,9 +3,4 @@ sources += files( 'namespaces.cc', ) -include_dirs += include_directories('.') - -headers += files( - 'cgroup.hh', - 'namespaces.hh', -) +subdir('include/nix') diff --git a/src/libutil/linux/namespaces.cc b/src/libutil/linux/namespaces.cc index c5e21dffc..a53734a2f 100644 --- a/src/libutil/linux/namespaces.cc +++ b/src/libutil/linux/namespaces.cc @@ -1,13 +1,13 @@ -#include "current-process.hh" -#include "util.hh" -#include "finally.hh" -#include "file-system.hh" -#include "processes.hh" -#include "signals.hh" +#include "nix/current-process.hh" +#include "nix/util.hh" +#include "nix/finally.hh" +#include "nix/file-system.hh" +#include "nix/processes.hh" +#include "nix/signals.hh" #include #include -#include "cgroup.hh" +#include "nix/cgroup.hh" #include diff --git a/src/libutil/logging.cc b/src/libutil/logging.cc index 406452738..39cacc22a 100644 --- a/src/libutil/logging.cc +++ b/src/libutil/logging.cc @@ -1,11 +1,11 @@ -#include "logging.hh" -#include "file-descriptor.hh" -#include "environment-variables.hh" -#include "terminal.hh" -#include "util.hh" -#include "config-global.hh" -#include "source-path.hh" -#include "position.hh" +#include "nix/logging.hh" +#include "nix/file-descriptor.hh" +#include "nix/environment-variables.hh" +#include "nix/terminal.hh" +#include "nix/util.hh" +#include "nix/config-global.hh" +#include "nix/source-path.hh" +#include "nix/position.hh" #include #include diff --git a/src/libutil/memory-source-accessor.cc b/src/libutil/memory-source-accessor.cc index c4eee1031..7c8414fb0 100644 --- a/src/libutil/memory-source-accessor.cc +++ b/src/libutil/memory-source-accessor.cc @@ -1,4 +1,4 @@ -#include "memory-source-accessor.hh" +#include "nix/memory-source-accessor.hh" namespace nix { diff --git a/src/libutil/meson.build b/src/libutil/meson.build index 8af3272a8..e34bce0d5 100644 --- a/src/libutil/meson.build +++ b/src/libutil/meson.build @@ -116,15 +116,10 @@ deps_public += nlohmann_json cxx = meson.get_compiler('cpp') -config_h = configure_file( - configuration : configdata, - output : 'config-util.hh', -) - add_project_arguments( # TODO(Qyriad): Yes this is how the autoconf+Make system did it. # It would be nice for our headers to be idempotent instead. - '-include', 'config-util.hh', + '-include', 'nix/config-util.hh', language : 'cpp', ) @@ -178,91 +173,13 @@ sources = files( 'xml-writer.cc', ) -include_dirs = [include_directories('.')] +subdir('include/nix') + if not cxx.has_header('widechar_width.h', required : false) # use vendored widechar_width.h include_dirs += include_directories('./widecharwidth') endif -headers = [config_h] + files( - 'abstract-setting-to-json.hh', - 'ansicolor.hh', - 'archive.hh', - 'args.hh', - 'args/root.hh', - 'callback.hh', - 'canon-path.hh', - 'checked-arithmetic.hh', - 'chunked-vector.hh', - 'closure.hh', - 'comparator.hh', - 'compression.hh', - 'compute-levels.hh', - 'config-global.hh', - 'config-impl.hh', - 'config.hh', - 'current-process.hh', - 'english.hh', - 'environment-variables.hh', - 'error.hh', - 'exec.hh', - 'executable-path.hh', - 'exit.hh', - 'experimental-features.hh', - 'file-content-address.hh', - 'file-descriptor.hh', - 'file-path-impl.hh', - 'file-path.hh', - 'file-system.hh', - 'finally.hh', - 'fmt.hh', - 'fs-sink.hh', - 'git.hh', - 'hash.hh', - 'hilite.hh', - 'json-impls.hh', - 'json-utils.hh', - 'logging.hh', - 'lru-cache.hh', - 'memory-source-accessor.hh', - 'muxable-pipe.hh', - 'os-string.hh', - 'pool.hh', - 'pos-idx.hh', - 'pos-table.hh', - 'position.hh', - 'posix-source-accessor.hh', - 'processes.hh', - 'ref.hh', - 'references.hh', - 'regex-combinators.hh', - 'repair-flag.hh', - 'serialise.hh', - 'signals.hh', - 'signature/local-keys.hh', - 'signature/signer.hh', - 'source-accessor.hh', - 'source-path.hh', - 'split.hh', - 'std-hash.hh', - 'strings.hh', - 'strings-inline.hh', - 'suggestions.hh', - 'sync.hh', - 'tarfile.hh', - 'terminal.hh', - 'thread-pool.hh', - 'topo-sort.hh', - 'types.hh', - 'unix-domain-socket.hh', - 'url-parts.hh', - 'url.hh', - 'users.hh', - 'util.hh', - 'variant-wrapper.hh', - 'xml-writer.hh', -) - if host_machine.system() == 'linux' subdir('linux') endif diff --git a/src/libutil/mounted-source-accessor.cc b/src/libutil/mounted-source-accessor.cc index 79223d155..aa00cbd8e 100644 --- a/src/libutil/mounted-source-accessor.cc +++ b/src/libutil/mounted-source-accessor.cc @@ -1,4 +1,4 @@ -#include "source-accessor.hh" +#include "nix/source-accessor.hh" namespace nix { diff --git a/src/libutil/package.nix b/src/libutil/package.nix index 8114dd645..0c410dfab 100644 --- a/src/libutil/package.nix +++ b/src/libutil/package.nix @@ -34,9 +34,13 @@ mkMesonLibrary (finalAttrs: { ./widecharwidth ./meson.build ./meson.options + ./include/nix/meson.build ./linux/meson.build + ./linux/include/nix/meson.build ./unix/meson.build + ./unix/include/nix/meson.build ./windows/meson.build + ./windows/include/nix/meson.build (fileset.fileFilter (file: file.hasExt "cc") ./.) (fileset.fileFilter (file: file.hasExt "hh") ./.) ]; diff --git a/src/libutil/pos-table.cc b/src/libutil/pos-table.cc index 8178beb90..59234e3fc 100644 --- a/src/libutil/pos-table.cc +++ b/src/libutil/pos-table.cc @@ -1,4 +1,4 @@ -#include "pos-table.hh" +#include "nix/pos-table.hh" #include diff --git a/src/libutil/position.cc b/src/libutil/position.cc index 275985c8c..515be245b 100644 --- a/src/libutil/position.cc +++ b/src/libutil/position.cc @@ -1,4 +1,4 @@ -#include "position.hh" +#include "nix/position.hh" namespace nix { diff --git a/src/libutil/posix-source-accessor.cc b/src/libutil/posix-source-accessor.cc index 70ad6474f..5da9fa623 100644 --- a/src/libutil/posix-source-accessor.cc +++ b/src/libutil/posix-source-accessor.cc @@ -1,7 +1,7 @@ -#include "posix-source-accessor.hh" -#include "source-path.hh" -#include "signals.hh" -#include "sync.hh" +#include "nix/posix-source-accessor.hh" +#include "nix/source-path.hh" +#include "nix/signals.hh" +#include "nix/sync.hh" #include diff --git a/src/libutil/references.cc b/src/libutil/references.cc index b30e62c7b..46c22c09c 100644 --- a/src/libutil/references.cc +++ b/src/libutil/references.cc @@ -1,6 +1,6 @@ -#include "references.hh" -#include "hash.hh" -#include "archive.hh" +#include "nix/references.hh" +#include "nix/hash.hh" +#include "nix/archive.hh" #include #include diff --git a/src/libutil/serialise.cc b/src/libutil/serialise.cc index d612c11b2..415ccf3a0 100644 --- a/src/libutil/serialise.cc +++ b/src/libutil/serialise.cc @@ -1,6 +1,6 @@ -#include "serialise.hh" -#include "signals.hh" -#include "util.hh" +#include "nix/serialise.hh" +#include "nix/signals.hh" +#include "nix/util.hh" #include #include @@ -11,7 +11,7 @@ #ifdef _WIN32 # include # include -# include "windows-error.hh" +# include "nix/windows-error.hh" #else # include #endif diff --git a/src/libutil/signature/local-keys.cc b/src/libutil/signature/local-keys.cc index 70bcb5f33..86d3dfe3c 100644 --- a/src/libutil/signature/local-keys.cc +++ b/src/libutil/signature/local-keys.cc @@ -1,7 +1,7 @@ -#include "signature/local-keys.hh" +#include "nix/signature/local-keys.hh" -#include "file-system.hh" -#include "util.hh" +#include "nix/file-system.hh" +#include "nix/util.hh" #include namespace nix { diff --git a/src/libutil/signature/signer.cc b/src/libutil/signature/signer.cc index 0d26867b5..4a61b67eb 100644 --- a/src/libutil/signature/signer.cc +++ b/src/libutil/signature/signer.cc @@ -1,5 +1,5 @@ -#include "signature/signer.hh" -#include "error.hh" +#include "nix/signature/signer.hh" +#include "nix/error.hh" #include diff --git a/src/libutil/source-accessor.cc b/src/libutil/source-accessor.cc index 78f038cf3..738d7f2f1 100644 --- a/src/libutil/source-accessor.cc +++ b/src/libutil/source-accessor.cc @@ -1,5 +1,5 @@ -#include "source-accessor.hh" -#include "archive.hh" +#include "nix/source-accessor.hh" +#include "nix/archive.hh" namespace nix { diff --git a/src/libutil/source-path.cc b/src/libutil/source-path.cc index 759d3c355..12150c223 100644 --- a/src/libutil/source-path.cc +++ b/src/libutil/source-path.cc @@ -1,4 +1,4 @@ -#include "source-path.hh" +#include "nix/source-path.hh" namespace nix { diff --git a/src/libutil/strings.cc b/src/libutil/strings.cc index 1635321bb..43c9a0815 100644 --- a/src/libutil/strings.cc +++ b/src/libutil/strings.cc @@ -2,9 +2,9 @@ #include #include -#include "strings-inline.hh" -#include "os-string.hh" -#include "error.hh" +#include "nix/strings-inline.hh" +#include "nix/os-string.hh" +#include "nix/error.hh" namespace nix { diff --git a/src/libutil/suggestions.cc b/src/libutil/suggestions.cc index 84c8e296f..0f593ada0 100644 --- a/src/libutil/suggestions.cc +++ b/src/libutil/suggestions.cc @@ -1,6 +1,6 @@ -#include "suggestions.hh" -#include "ansicolor.hh" -#include "terminal.hh" +#include "nix/suggestions.hh" +#include "nix/ansicolor.hh" +#include "nix/terminal.hh" #include #include diff --git a/src/libutil/tarfile.cc b/src/libutil/tarfile.cc index 9e54c9be2..aec05e092 100644 --- a/src/libutil/tarfile.cc +++ b/src/libutil/tarfile.cc @@ -1,10 +1,10 @@ #include #include -#include "finally.hh" -#include "serialise.hh" -#include "tarfile.hh" -#include "file-system.hh" +#include "nix/finally.hh" +#include "nix/serialise.hh" +#include "nix/tarfile.hh" +#include "nix/file-system.hh" namespace nix { diff --git a/src/libutil/terminal.cc b/src/libutil/terminal.cc index 8a8373f1b..233edabb4 100644 --- a/src/libutil/terminal.cc +++ b/src/libutil/terminal.cc @@ -1,6 +1,6 @@ -#include "terminal.hh" -#include "environment-variables.hh" -#include "sync.hh" +#include "nix/terminal.hh" +#include "nix/environment-variables.hh" +#include "nix/sync.hh" #if _WIN32 # include diff --git a/src/libutil/thread-pool.cc b/src/libutil/thread-pool.cc index 0725c1926..6b7f2d017 100644 --- a/src/libutil/thread-pool.cc +++ b/src/libutil/thread-pool.cc @@ -1,6 +1,6 @@ -#include "thread-pool.hh" -#include "signals.hh" -#include "util.hh" +#include "nix/thread-pool.hh" +#include "nix/signals.hh" +#include "nix/util.hh" namespace nix { diff --git a/src/libutil/union-source-accessor.cc b/src/libutil/union-source-accessor.cc index eec0850c2..e24d6f2bd 100644 --- a/src/libutil/union-source-accessor.cc +++ b/src/libutil/union-source-accessor.cc @@ -1,4 +1,4 @@ -#include "source-accessor.hh" +#include "nix/source-accessor.hh" namespace nix { diff --git a/src/libutil/unix-domain-socket.cc b/src/libutil/unix-domain-socket.cc index 1707fdb75..831dd666c 100644 --- a/src/libutil/unix-domain-socket.cc +++ b/src/libutil/unix-domain-socket.cc @@ -1,6 +1,6 @@ -#include "file-system.hh" -#include "unix-domain-socket.hh" -#include "util.hh" +#include "nix/file-system.hh" +#include "nix/unix-domain-socket.hh" +#include "nix/util.hh" #ifdef _WIN32 # include @@ -8,7 +8,7 @@ #else # include # include -# include "processes.hh" +# include "nix/processes.hh" #endif #include diff --git a/src/libutil/unix/environment-variables.cc b/src/libutil/unix/environment-variables.cc index cd7c8f5e5..9814cbcc2 100644 --- a/src/libutil/unix/environment-variables.cc +++ b/src/libutil/unix/environment-variables.cc @@ -1,6 +1,6 @@ #include -#include "environment-variables.hh" +#include "nix/environment-variables.hh" namespace nix { diff --git a/src/libutil/unix/file-descriptor.cc b/src/libutil/unix/file-descriptor.cc index a02a53b1e..566675349 100644 --- a/src/libutil/unix/file-descriptor.cc +++ b/src/libutil/unix/file-descriptor.cc @@ -1,7 +1,7 @@ -#include "file-system.hh" -#include "signals.hh" -#include "finally.hh" -#include "serialise.hh" +#include "nix/file-system.hh" +#include "nix/signals.hh" +#include "nix/finally.hh" +#include "nix/serialise.hh" #include #include diff --git a/src/libutil/unix/file-path.cc b/src/libutil/unix/file-path.cc index cccee86a1..3dd613972 100644 --- a/src/libutil/unix/file-path.cc +++ b/src/libutil/unix/file-path.cc @@ -3,8 +3,8 @@ #include #include -#include "file-path.hh" -#include "util.hh" +#include "nix/file-path.hh" +#include "nix/util.hh" namespace nix { diff --git a/src/libutil/unix/file-system.cc b/src/libutil/unix/file-system.cc index bbbbfa559..119e8a277 100644 --- a/src/libutil/unix/file-system.cc +++ b/src/libutil/unix/file-system.cc @@ -1,4 +1,4 @@ -#include "file-system.hh" +#include "nix/file-system.hh" namespace nix { diff --git a/src/libutil/unix/include/nix/meson.build b/src/libutil/unix/include/nix/meson.build new file mode 100644 index 000000000..5f3095ab1 --- /dev/null +++ b/src/libutil/unix/include/nix/meson.build @@ -0,0 +1,8 @@ +# Public headers directory + +include_dirs += include_directories('..') + +headers += files( + 'monitor-fd.hh', + 'signals-impl.hh', +) diff --git a/src/libutil/unix/monitor-fd.hh b/src/libutil/unix/include/nix/monitor-fd.hh similarity index 99% rename from src/libutil/unix/monitor-fd.hh rename to src/libutil/unix/include/nix/monitor-fd.hh index c1f8705eb..720cbb937 100644 --- a/src/libutil/unix/monitor-fd.hh +++ b/src/libutil/unix/include/nix/monitor-fd.hh @@ -10,7 +10,7 @@ #include #include -#include "signals.hh" +#include "nix/signals.hh" namespace nix { diff --git a/src/libutil/unix/signals-impl.hh b/src/libutil/unix/include/nix/signals-impl.hh similarity index 95% rename from src/libutil/unix/signals-impl.hh rename to src/libutil/unix/include/nix/signals-impl.hh index 037416e7d..a63e03725 100644 --- a/src/libutil/unix/signals-impl.hh +++ b/src/libutil/unix/include/nix/signals-impl.hh @@ -10,11 +10,11 @@ * downstream code.) */ -#include "types.hh" -#include "error.hh" -#include "logging.hh" -#include "ansicolor.hh" -#include "signals.hh" +#include "nix/types.hh" +#include "nix/error.hh" +#include "nix/logging.hh" +#include "nix/ansicolor.hh" +#include "nix/signals.hh" #include #include diff --git a/src/libutil/unix/meson.build b/src/libutil/unix/meson.build index 1c5bf27fb..1373ed17a 100644 --- a/src/libutil/unix/meson.build +++ b/src/libutil/unix/meson.build @@ -10,9 +10,4 @@ sources += files( 'users.cc', ) -include_dirs += include_directories('.') - -headers += files( - 'monitor-fd.hh', - 'signals-impl.hh', -) +subdir('include/nix') diff --git a/src/libutil/unix/muxable-pipe.cc b/src/libutil/unix/muxable-pipe.cc index 0104663c3..e81f47bc0 100644 --- a/src/libutil/unix/muxable-pipe.cc +++ b/src/libutil/unix/muxable-pipe.cc @@ -1,8 +1,8 @@ #include -#include "logging.hh" -#include "util.hh" -#include "muxable-pipe.hh" +#include "nix/logging.hh" +#include "nix/util.hh" +#include "nix/muxable-pipe.hh" namespace nix { diff --git a/src/libutil/unix/os-string.cc b/src/libutil/unix/os-string.cc index 8378afde2..e97308a4a 100644 --- a/src/libutil/unix/os-string.cc +++ b/src/libutil/unix/os-string.cc @@ -3,8 +3,8 @@ #include #include -#include "file-path.hh" -#include "util.hh" +#include "nix/file-path.hh" +#include "nix/util.hh" namespace nix { diff --git a/src/libutil/unix/processes.cc b/src/libutil/unix/processes.cc index da198bed4..032992a2f 100644 --- a/src/libutil/unix/processes.cc +++ b/src/libutil/unix/processes.cc @@ -1,10 +1,10 @@ -#include "current-process.hh" -#include "environment-variables.hh" -#include "executable-path.hh" -#include "signals.hh" -#include "processes.hh" -#include "finally.hh" -#include "serialise.hh" +#include "nix/current-process.hh" +#include "nix/environment-variables.hh" +#include "nix/executable-path.hh" +#include "nix/signals.hh" +#include "nix/processes.hh" +#include "nix/finally.hh" +#include "nix/serialise.hh" #include #include diff --git a/src/libutil/unix/signals.cc b/src/libutil/unix/signals.cc index d0608dace..168b33bfb 100644 --- a/src/libutil/unix/signals.cc +++ b/src/libutil/unix/signals.cc @@ -1,8 +1,8 @@ -#include "signals.hh" -#include "util.hh" -#include "error.hh" -#include "sync.hh" -#include "terminal.hh" +#include "nix/signals.hh" +#include "nix/util.hh" +#include "nix/error.hh" +#include "nix/sync.hh" +#include "nix/terminal.hh" #include diff --git a/src/libutil/unix/users.cc b/src/libutil/unix/users.cc index 107a6e04f..1ba194d71 100644 --- a/src/libutil/unix/users.cc +++ b/src/libutil/unix/users.cc @@ -1,7 +1,7 @@ -#include "util.hh" -#include "users.hh" -#include "environment-variables.hh" -#include "file-system.hh" +#include "nix/util.hh" +#include "nix/users.hh" +#include "nix/environment-variables.hh" +#include "nix/file-system.hh" #include #include diff --git a/src/libutil/url.cc b/src/libutil/url.cc index 8fb1eecfb..f042d3b0f 100644 --- a/src/libutil/url.cc +++ b/src/libutil/url.cc @@ -1,8 +1,8 @@ -#include "url.hh" -#include "url-parts.hh" -#include "util.hh" -#include "split.hh" -#include "canon-path.hh" +#include "nix/url.hh" +#include "nix/url-parts.hh" +#include "nix/util.hh" +#include "nix/split.hh" +#include "nix/canon-path.hh" namespace nix { diff --git a/src/libutil/users.cc b/src/libutil/users.cc index b4bc67cbc..d4fb08ab5 100644 --- a/src/libutil/users.cc +++ b/src/libutil/users.cc @@ -1,7 +1,7 @@ -#include "util.hh" -#include "users.hh" -#include "environment-variables.hh" -#include "file-system.hh" +#include "nix/util.hh" +#include "nix/users.hh" +#include "nix/environment-variables.hh" +#include "nix/file-system.hh" namespace nix { diff --git a/src/libutil/util.cc b/src/libutil/util.cc index ed5c7e4f1..37f30d91f 100644 --- a/src/libutil/util.cc +++ b/src/libutil/util.cc @@ -1,7 +1,7 @@ -#include "util.hh" -#include "fmt.hh" -#include "file-path.hh" -#include "signals.hh" +#include "nix/util.hh" +#include "nix/fmt.hh" +#include "nix/file-path.hh" +#include "nix/signals.hh" #include #include diff --git a/src/libutil/windows/environment-variables.cc b/src/libutil/windows/environment-variables.cc index d1093597c..a6fadc627 100644 --- a/src/libutil/windows/environment-variables.cc +++ b/src/libutil/windows/environment-variables.cc @@ -1,4 +1,4 @@ -#include "environment-variables.hh" +#include "nix/environment-variables.hh" #ifdef _WIN32 # include "processenv.h" diff --git a/src/libutil/windows/file-descriptor.cc b/src/libutil/windows/file-descriptor.cc index e2a473a7c..7f77cae89 100644 --- a/src/libutil/windows/file-descriptor.cc +++ b/src/libutil/windows/file-descriptor.cc @@ -1,9 +1,9 @@ -#include "file-system.hh" -#include "signals.hh" -#include "finally.hh" -#include "serialise.hh" -#include "windows-error.hh" -#include "file-path.hh" +#include "nix/file-system.hh" +#include "nix/signals.hh" +#include "nix/finally.hh" +#include "nix/serialise.hh" +#include "nix/windows-error.hh" +#include "nix/file-path.hh" #ifdef _WIN32 #include diff --git a/src/libutil/windows/file-path.cc b/src/libutil/windows/file-path.cc index 7405c426b..5079bcbcd 100644 --- a/src/libutil/windows/file-path.cc +++ b/src/libutil/windows/file-path.cc @@ -3,9 +3,9 @@ #include #include -#include "file-path.hh" -#include "file-path-impl.hh" -#include "util.hh" +#include "nix/file-path.hh" +#include "nix/file-path-impl.hh" +#include "nix/util.hh" namespace nix { diff --git a/src/libutil/windows/file-system.cc b/src/libutil/windows/file-system.cc index 7ed1c04a6..22f1f89ab 100644 --- a/src/libutil/windows/file-system.cc +++ b/src/libutil/windows/file-system.cc @@ -1,4 +1,4 @@ -#include "file-system.hh" +#include "nix/file-system.hh" #ifdef _WIN32 namespace nix { diff --git a/src/libutil/windows/include/nix/meson.build b/src/libutil/windows/include/nix/meson.build new file mode 100644 index 000000000..898b7db89 --- /dev/null +++ b/src/libutil/windows/include/nix/meson.build @@ -0,0 +1,9 @@ +# Public headers directory + +include_dirs += include_directories('..') + +headers += files( + 'signals-impl.hh', + 'windows-async-pipe.hh', + 'windows-error.hh', +) diff --git a/src/libutil/windows/signals-impl.hh b/src/libutil/windows/include/nix/signals-impl.hh similarity index 95% rename from src/libutil/windows/signals-impl.hh rename to src/libutil/windows/include/nix/signals-impl.hh index 26d2600bf..fcdf18276 100644 --- a/src/libutil/windows/signals-impl.hh +++ b/src/libutil/windows/include/nix/signals-impl.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "types.hh" +#include "nix/types.hh" namespace nix { diff --git a/src/libutil/windows/windows-async-pipe.hh b/src/libutil/windows/include/nix/windows-async-pipe.hh similarity index 93% rename from src/libutil/windows/windows-async-pipe.hh rename to src/libutil/windows/include/nix/windows-async-pipe.hh index 53715e260..55f6ea31d 100644 --- a/src/libutil/windows/windows-async-pipe.hh +++ b/src/libutil/windows/include/nix/windows-async-pipe.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "file-descriptor.hh" +#include "nix/file-descriptor.hh" #ifdef _WIN32 namespace nix::windows { diff --git a/src/libutil/windows/windows-error.hh b/src/libutil/windows/include/nix/windows-error.hh similarity index 97% rename from src/libutil/windows/windows-error.hh rename to src/libutil/windows/include/nix/windows-error.hh index 66c67b43a..c07d61609 100644 --- a/src/libutil/windows/windows-error.hh +++ b/src/libutil/windows/include/nix/windows-error.hh @@ -4,7 +4,7 @@ #ifdef _WIN32 #include -#include "error.hh" +#include "nix/error.hh" namespace nix::windows { diff --git a/src/libutil/windows/meson.build b/src/libutil/windows/meson.build index 1c645fe05..2423c77ea 100644 --- a/src/libutil/windows/meson.build +++ b/src/libutil/windows/meson.build @@ -11,10 +11,4 @@ sources += files( 'windows-error.cc', ) -include_dirs += include_directories('.') - -headers += files( - 'signals-impl.hh', - 'windows-async-pipe.hh', - 'windows-error.hh', -) +subdir('include/nix') diff --git a/src/libutil/windows/muxable-pipe.cc b/src/libutil/windows/muxable-pipe.cc index ac2882120..d9a3e2ca5 100644 --- a/src/libutil/windows/muxable-pipe.cc +++ b/src/libutil/windows/muxable-pipe.cc @@ -1,10 +1,10 @@ #ifdef _WIN32 # include -# include "windows-error.hh" +# include "nix/windows-error.hh" -# include "logging.hh" -# include "util.hh" -# include "muxable-pipe.hh" +# include "nix/logging.hh" +# include "nix/util.hh" +# include "nix/muxable-pipe.hh" namespace nix { diff --git a/src/libutil/windows/os-string.cc b/src/libutil/windows/os-string.cc index b09ef8b90..b9aff210b 100644 --- a/src/libutil/windows/os-string.cc +++ b/src/libutil/windows/os-string.cc @@ -3,9 +3,9 @@ #include #include -#include "file-path.hh" -#include "file-path-impl.hh" -#include "util.hh" +#include "nix/file-path.hh" +#include "nix/file-path-impl.hh" +#include "nix/util.hh" #ifdef _WIN32 diff --git a/src/libutil/windows/processes.cc b/src/libutil/windows/processes.cc index 90cb1f5f5..cdb659a79 100644 --- a/src/libutil/windows/processes.cc +++ b/src/libutil/windows/processes.cc @@ -1,16 +1,16 @@ -#include "current-process.hh" -#include "environment-variables.hh" -#include "error.hh" -#include "executable-path.hh" -#include "file-descriptor.hh" -#include "file-path.hh" -#include "signals.hh" -#include "processes.hh" -#include "finally.hh" -#include "serialise.hh" -#include "file-system.hh" -#include "util.hh" -#include "windows-error.hh" +#include "nix/current-process.hh" +#include "nix/environment-variables.hh" +#include "nix/error.hh" +#include "nix/executable-path.hh" +#include "nix/file-descriptor.hh" +#include "nix/file-path.hh" +#include "nix/signals.hh" +#include "nix/processes.hh" +#include "nix/finally.hh" +#include "nix/serialise.hh" +#include "nix/file-system.hh" +#include "nix/util.hh" +#include "nix/windows-error.hh" #include #include diff --git a/src/libutil/windows/users.cc b/src/libutil/windows/users.cc index 438c4221c..1d49e667b 100644 --- a/src/libutil/windows/users.cc +++ b/src/libutil/windows/users.cc @@ -1,8 +1,8 @@ -#include "util.hh" -#include "users.hh" -#include "environment-variables.hh" -#include "file-system.hh" -#include "windows-error.hh" +#include "nix/util.hh" +#include "nix/users.hh" +#include "nix/environment-variables.hh" +#include "nix/file-system.hh" +#include "nix/windows-error.hh" #ifdef _WIN32 #define WIN32_LEAN_AND_MEAN diff --git a/src/libutil/windows/windows-async-pipe.cc b/src/libutil/windows/windows-async-pipe.cc index 4e139d5cf..77ccd9e3f 100644 --- a/src/libutil/windows/windows-async-pipe.cc +++ b/src/libutil/windows/windows-async-pipe.cc @@ -1,5 +1,5 @@ -#include "windows-async-pipe.hh" -#include "windows-error.hh" +#include "nix/windows-async-pipe.hh" +#include "nix/windows-error.hh" #ifdef _WIN32 diff --git a/src/libutil/windows/windows-error.cc b/src/libutil/windows/windows-error.cc index b92f9155f..8c523e403 100644 --- a/src/libutil/windows/windows-error.cc +++ b/src/libutil/windows/windows-error.cc @@ -1,4 +1,4 @@ -#include "windows-error.hh" +#include "nix/windows-error.hh" #ifdef _WIN32 #include diff --git a/src/libutil/xml-writer.cc b/src/libutil/xml-writer.cc index 7993bee9a..78a40ef64 100644 --- a/src/libutil/xml-writer.cc +++ b/src/libutil/xml-writer.cc @@ -1,6 +1,6 @@ #include -#include "xml-writer.hh" +#include "nix/xml-writer.hh" namespace nix { diff --git a/src/nix-build/nix-build.cc b/src/nix-build/nix-build.cc index a5ae12a12..065a3b3e8 100644 --- a/src/nix-build/nix-build.cc +++ b/src/nix-build/nix-build.cc @@ -9,25 +9,25 @@ #include -#include "current-process.hh" -#include "parsed-derivations.hh" -#include "derivation-options.hh" -#include "store-api.hh" -#include "local-fs-store.hh" -#include "globals.hh" -#include "realisation.hh" -#include "derivations.hh" -#include "shared.hh" -#include "path-with-outputs.hh" -#include "eval.hh" -#include "eval-inline.hh" -#include "get-drvs.hh" -#include "common-eval-args.hh" -#include "attr-path.hh" -#include "legacy.hh" -#include "users.hh" -#include "network-proxy.hh" -#include "compatibility-settings.hh" +#include "nix/current-process.hh" +#include "nix/parsed-derivations.hh" +#include "nix/derivation-options.hh" +#include "nix/store-api.hh" +#include "nix/local-fs-store.hh" +#include "nix/globals.hh" +#include "nix/realisation.hh" +#include "nix/derivations.hh" +#include "nix/shared.hh" +#include "nix/path-with-outputs.hh" +#include "nix/eval.hh" +#include "nix/eval-inline.hh" +#include "nix/get-drvs.hh" +#include "nix/common-eval-args.hh" +#include "nix/attr-path.hh" +#include "nix/legacy.hh" +#include "nix/users.hh" +#include "nix/network-proxy.hh" +#include "nix/compatibility-settings.hh" #include "man-pages.hh" using namespace nix; diff --git a/src/nix-channel/nix-channel.cc b/src/nix-channel/nix-channel.cc index ee61db994..33efb8918 100644 --- a/src/nix-channel/nix-channel.cc +++ b/src/nix-channel/nix-channel.cc @@ -1,12 +1,12 @@ -#include "profiles.hh" -#include "shared.hh" -#include "globals.hh" -#include "filetransfer.hh" -#include "store-api.hh" -#include "legacy.hh" -#include "eval-settings.hh" // for defexpr -#include "users.hh" -#include "tarball.hh" +#include "nix/profiles.hh" +#include "nix/shared.hh" +#include "nix/globals.hh" +#include "nix/filetransfer.hh" +#include "nix/store-api.hh" +#include "nix/legacy.hh" +#include "nix/eval-settings.hh" // for defexpr +#include "nix/users.hh" +#include "nix/tarball.hh" #include "self-exe.hh" #include "man-pages.hh" diff --git a/src/nix-collect-garbage/nix-collect-garbage.cc b/src/nix-collect-garbage/nix-collect-garbage.cc index a060a01fd..c6f996f20 100644 --- a/src/nix-collect-garbage/nix-collect-garbage.cc +++ b/src/nix-collect-garbage/nix-collect-garbage.cc @@ -1,12 +1,12 @@ -#include "file-system.hh" -#include "signals.hh" -#include "store-api.hh" -#include "store-cast.hh" -#include "gc-store.hh" -#include "profiles.hh" -#include "shared.hh" -#include "globals.hh" -#include "legacy.hh" +#include "nix/file-system.hh" +#include "nix/signals.hh" +#include "nix/store-api.hh" +#include "nix/store-cast.hh" +#include "nix/gc-store.hh" +#include "nix/profiles.hh" +#include "nix/shared.hh" +#include "nix/globals.hh" +#include "nix/legacy.hh" #include "man-pages.hh" #include diff --git a/src/nix-copy-closure/nix-copy-closure.cc b/src/nix-copy-closure/nix-copy-closure.cc index 15bff0a0a..8094925dc 100644 --- a/src/nix-copy-closure/nix-copy-closure.cc +++ b/src/nix-copy-closure/nix-copy-closure.cc @@ -1,7 +1,7 @@ -#include "shared.hh" -#include "realisation.hh" -#include "store-api.hh" -#include "legacy.hh" +#include "nix/shared.hh" +#include "nix/realisation.hh" +#include "nix/store-api.hh" +#include "nix/legacy.hh" #include "man-pages.hh" using namespace nix; diff --git a/src/nix-env/nix-env.cc b/src/nix-env/nix-env.cc index aa1edb4c8..c02c27d36 100644 --- a/src/nix-env/nix-env.cc +++ b/src/nix-env/nix-env.cc @@ -1,22 +1,22 @@ -#include "users.hh" -#include "attr-path.hh" -#include "common-eval-args.hh" -#include "derivations.hh" -#include "eval.hh" -#include "get-drvs.hh" -#include "globals.hh" -#include "names.hh" -#include "profiles.hh" -#include "path-with-outputs.hh" -#include "shared.hh" -#include "store-api.hh" -#include "local-fs-store.hh" +#include "nix/users.hh" +#include "nix/attr-path.hh" +#include "nix/common-eval-args.hh" +#include "nix/derivations.hh" +#include "nix/eval.hh" +#include "nix/get-drvs.hh" +#include "nix/globals.hh" +#include "nix/names.hh" +#include "nix/profiles.hh" +#include "nix/path-with-outputs.hh" +#include "nix/shared.hh" +#include "nix/store-api.hh" +#include "nix/local-fs-store.hh" #include "user-env.hh" -#include "value-to-json.hh" -#include "xml-writer.hh" -#include "legacy.hh" -#include "eval-settings.hh" // for defexpr -#include "terminal.hh" +#include "nix/value-to-json.hh" +#include "nix/xml-writer.hh" +#include "nix/legacy.hh" +#include "nix/eval-settings.hh" // for defexpr +#include "nix/terminal.hh" #include "man-pages.hh" #include diff --git a/src/nix-env/user-env.cc b/src/nix-env/user-env.cc index ee62077c0..81abefc2f 100644 --- a/src/nix-env/user-env.cc +++ b/src/nix-env/user-env.cc @@ -1,14 +1,14 @@ #include "user-env.hh" -#include "derivations.hh" -#include "store-api.hh" -#include "path-with-outputs.hh" -#include "local-fs-store.hh" -#include "globals.hh" -#include "shared.hh" -#include "eval.hh" -#include "eval-inline.hh" -#include "profiles.hh" -#include "print-ambiguous.hh" +#include "nix/derivations.hh" +#include "nix/store-api.hh" +#include "nix/path-with-outputs.hh" +#include "nix/local-fs-store.hh" +#include "nix/globals.hh" +#include "nix/shared.hh" +#include "nix/eval.hh" +#include "nix/eval-inline.hh" +#include "nix/profiles.hh" +#include "nix/print-ambiguous.hh" #include #include diff --git a/src/nix-env/user-env.hh b/src/nix-env/user-env.hh index 15da3fcb3..8ec124d07 100644 --- a/src/nix-env/user-env.hh +++ b/src/nix-env/user-env.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "get-drvs.hh" +#include "nix/get-drvs.hh" namespace nix { diff --git a/src/nix-instantiate/nix-instantiate.cc b/src/nix-instantiate/nix-instantiate.cc index 0cf926369..d4765952b 100644 --- a/src/nix-instantiate/nix-instantiate.cc +++ b/src/nix-instantiate/nix-instantiate.cc @@ -1,17 +1,17 @@ -#include "globals.hh" -#include "print-ambiguous.hh" -#include "shared.hh" -#include "eval.hh" -#include "eval-inline.hh" -#include "get-drvs.hh" -#include "attr-path.hh" -#include "signals.hh" -#include "value-to-xml.hh" -#include "value-to-json.hh" -#include "store-api.hh" -#include "local-fs-store.hh" -#include "common-eval-args.hh" -#include "legacy.hh" +#include "nix/globals.hh" +#include "nix/print-ambiguous.hh" +#include "nix/shared.hh" +#include "nix/eval.hh" +#include "nix/eval-inline.hh" +#include "nix/get-drvs.hh" +#include "nix/attr-path.hh" +#include "nix/signals.hh" +#include "nix/value-to-xml.hh" +#include "nix/value-to-json.hh" +#include "nix/store-api.hh" +#include "nix/local-fs-store.hh" +#include "nix/common-eval-args.hh" +#include "nix/legacy.hh" #include "man-pages.hh" #include diff --git a/src/nix-store/dotgraph.cc b/src/nix-store/dotgraph.cc index 2c530999b..0cab46656 100644 --- a/src/nix-store/dotgraph.cc +++ b/src/nix-store/dotgraph.cc @@ -1,5 +1,5 @@ #include "dotgraph.hh" -#include "store-api.hh" +#include "nix/store-api.hh" #include diff --git a/src/nix-store/dotgraph.hh b/src/nix-store/dotgraph.hh index 4fd944080..cb4041f8e 100644 --- a/src/nix-store/dotgraph.hh +++ b/src/nix-store/dotgraph.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "store-api.hh" +#include "nix/store-api.hh" namespace nix { diff --git a/src/nix-store/graphml.cc b/src/nix-store/graphml.cc index 3e789a2d8..1eb2ccdf6 100644 --- a/src/nix-store/graphml.cc +++ b/src/nix-store/graphml.cc @@ -1,6 +1,6 @@ #include "graphml.hh" -#include "store-api.hh" -#include "derivations.hh" +#include "nix/store-api.hh" +#include "nix/derivations.hh" #include diff --git a/src/nix-store/graphml.hh b/src/nix-store/graphml.hh index bd3a4a37c..2989733d7 100644 --- a/src/nix-store/graphml.hh +++ b/src/nix-store/graphml.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "store-api.hh" +#include "nix/store-api.hh" namespace nix { diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc index d182b1eee..7bdf3b1a3 100644 --- a/src/nix-store/nix-store.cc +++ b/src/nix-store/nix-store.cc @@ -1,23 +1,23 @@ -#include "archive.hh" -#include "derivations.hh" +#include "nix/archive.hh" +#include "nix/derivations.hh" #include "dotgraph.hh" -#include "globals.hh" -#include "store-cast.hh" -#include "local-fs-store.hh" -#include "log-store.hh" -#include "serve-protocol.hh" -#include "serve-protocol-connection.hh" -#include "shared.hh" +#include "nix/globals.hh" +#include "nix/store-cast.hh" +#include "nix/local-fs-store.hh" +#include "nix/log-store.hh" +#include "nix/serve-protocol.hh" +#include "nix/serve-protocol-connection.hh" +#include "nix/shared.hh" #include "graphml.hh" -#include "legacy.hh" -#include "posix-source-accessor.hh" -#include "path-with-outputs.hh" +#include "nix/legacy.hh" +#include "nix/posix-source-accessor.hh" +#include "nix/path-with-outputs.hh" #include "man-pages.hh" #ifndef _WIN32 // TODO implement on Windows or provide allowed-to-noop interface -# include "local-store.hh" -# include "monitor-fd.hh" -# include "posix-fs-canonicalise.hh" +# include "nix/local-store.hh" +# include "nix/monitor-fd.hh" +# include "nix/posix-fs-canonicalise.hh" #endif #include @@ -27,9 +27,9 @@ #include #include -#include "build-result.hh" -#include "exit.hh" -#include "serve-protocol-impl.hh" +#include "nix/build-result.hh" +#include "nix/exit.hh" +#include "nix/serve-protocol-impl.hh" namespace nix_store { diff --git a/src/nix/add-to-store.cc b/src/nix/add-to-store.cc index 7f15de374..6c71dc69f 100644 --- a/src/nix/add-to-store.cc +++ b/src/nix/add-to-store.cc @@ -1,10 +1,10 @@ -#include "command.hh" -#include "common-args.hh" -#include "store-api.hh" -#include "archive.hh" -#include "git.hh" -#include "posix-source-accessor.hh" -#include "misc-store-flags.hh" +#include "nix/command.hh" +#include "nix/common-args.hh" +#include "nix/store-api.hh" +#include "nix/archive.hh" +#include "nix/git.hh" +#include "nix/posix-source-accessor.hh" +#include "nix/misc-store-flags.hh" using namespace nix; diff --git a/src/nix/app.cc b/src/nix/app.cc index 935ed18ec..2b6c22269 100644 --- a/src/nix/app.cc +++ b/src/nix/app.cc @@ -1,13 +1,13 @@ -#include "installables.hh" -#include "installable-derived-path.hh" -#include "installable-value.hh" -#include "store-api.hh" -#include "eval-inline.hh" -#include "eval-cache.hh" -#include "names.hh" -#include "command.hh" -#include "derivations.hh" -#include "downstream-placeholder.hh" +#include "nix/installables.hh" +#include "nix/installable-derived-path.hh" +#include "nix/installable-value.hh" +#include "nix/store-api.hh" +#include "nix/eval-inline.hh" +#include "nix/eval-cache.hh" +#include "nix/names.hh" +#include "nix/command.hh" +#include "nix/derivations.hh" +#include "nix/downstream-placeholder.hh" namespace nix { diff --git a/src/nix/build.cc b/src/nix/build.cc index 4ba6241ec..9a99832b4 100644 --- a/src/nix/build.cc +++ b/src/nix/build.cc @@ -1,8 +1,8 @@ -#include "command.hh" -#include "common-args.hh" -#include "shared.hh" -#include "store-api.hh" -#include "local-fs-store.hh" +#include "nix/command.hh" +#include "nix/common-args.hh" +#include "nix/shared.hh" +#include "nix/store-api.hh" +#include "nix/local-fs-store.hh" #include diff --git a/src/nix/bundle.cc b/src/nix/bundle.cc index 5b7862c4e..613383939 100644 --- a/src/nix/bundle.cc +++ b/src/nix/bundle.cc @@ -1,10 +1,10 @@ -#include "installable-flake.hh" -#include "command-installable-value.hh" -#include "common-args.hh" -#include "shared.hh" -#include "store-api.hh" -#include "local-fs-store.hh" -#include "eval-inline.hh" +#include "nix/installable-flake.hh" +#include "nix/command-installable-value.hh" +#include "nix/common-args.hh" +#include "nix/shared.hh" +#include "nix/store-api.hh" +#include "nix/local-fs-store.hh" +#include "nix/eval-inline.hh" namespace nix::fs { using namespace std::filesystem; } diff --git a/src/nix/cat.cc b/src/nix/cat.cc index 214d256e9..11de32b40 100644 --- a/src/nix/cat.cc +++ b/src/nix/cat.cc @@ -1,6 +1,6 @@ -#include "command.hh" -#include "store-api.hh" -#include "nar-accessor.hh" +#include "nix/command.hh" +#include "nix/store-api.hh" +#include "nix/nar-accessor.hh" using namespace nix; diff --git a/src/nix/config-check.cc b/src/nix/config-check.cc index a72b06542..bc23fd7be 100644 --- a/src/nix/config-check.cc +++ b/src/nix/config-check.cc @@ -1,14 +1,14 @@ #include -#include "command.hh" -#include "exit.hh" -#include "logging.hh" -#include "serve-protocol.hh" -#include "shared.hh" -#include "store-api.hh" -#include "local-fs-store.hh" -#include "worker-protocol.hh" -#include "executable-path.hh" +#include "nix/command.hh" +#include "nix/exit.hh" +#include "nix/logging.hh" +#include "nix/serve-protocol.hh" +#include "nix/shared.hh" +#include "nix/store-api.hh" +#include "nix/local-fs-store.hh" +#include "nix/worker-protocol.hh" +#include "nix/executable-path.hh" namespace nix::fs { using namespace std::filesystem; } diff --git a/src/nix/config.cc b/src/nix/config.cc index 07f975a00..5d9330f03 100644 --- a/src/nix/config.cc +++ b/src/nix/config.cc @@ -1,8 +1,8 @@ -#include "command.hh" -#include "common-args.hh" -#include "shared.hh" -#include "store-api.hh" -#include "config-global.hh" +#include "nix/command.hh" +#include "nix/common-args.hh" +#include "nix/shared.hh" +#include "nix/store-api.hh" +#include "nix/config-global.hh" #include diff --git a/src/nix/copy.cc b/src/nix/copy.cc index 399a6c0fd..0ed99df53 100644 --- a/src/nix/copy.cc +++ b/src/nix/copy.cc @@ -1,7 +1,7 @@ -#include "command.hh" -#include "shared.hh" -#include "store-api.hh" -#include "local-fs-store.hh" +#include "nix/command.hh" +#include "nix/shared.hh" +#include "nix/store-api.hh" +#include "nix/local-fs-store.hh" using namespace nix; diff --git a/src/nix/crash-handler.cc b/src/nix/crash-handler.cc index 8ffd436ac..65687f79e 100644 --- a/src/nix/crash-handler.cc +++ b/src/nix/crash-handler.cc @@ -1,6 +1,7 @@ #include "crash-handler.hh" -#include "fmt.hh" -#include "logging.hh" + +#include "nix/fmt.hh" +#include "nix/logging.hh" #include #include diff --git a/src/nix/derivation-add.cc b/src/nix/derivation-add.cc index 4d91d4538..da52ac14c 100644 --- a/src/nix/derivation-add.cc +++ b/src/nix/derivation-add.cc @@ -1,10 +1,10 @@ // FIXME: rename to 'nix plan add' or 'nix derivation add'? -#include "command.hh" -#include "common-args.hh" -#include "store-api.hh" -#include "archive.hh" -#include "derivations.hh" +#include "nix/command.hh" +#include "nix/common-args.hh" +#include "nix/store-api.hh" +#include "nix/archive.hh" +#include "nix/derivations.hh" #include using namespace nix; diff --git a/src/nix/derivation-show.cc b/src/nix/derivation-show.cc index 5a07f58e6..daabdb4d6 100644 --- a/src/nix/derivation-show.cc +++ b/src/nix/derivation-show.cc @@ -1,11 +1,11 @@ // FIXME: integrate this with `nix path-info`? // FIXME: rename to 'nix store derivation show'? -#include "command.hh" -#include "common-args.hh" -#include "store-api.hh" -#include "archive.hh" -#include "derivations.hh" +#include "nix/command.hh" +#include "nix/common-args.hh" +#include "nix/store-api.hh" +#include "nix/archive.hh" +#include "nix/derivations.hh" #include using namespace nix; diff --git a/src/nix/derivation.cc b/src/nix/derivation.cc index 59a78d378..6e0d28d9a 100644 --- a/src/nix/derivation.cc +++ b/src/nix/derivation.cc @@ -1,4 +1,4 @@ -#include "command.hh" +#include "nix/command.hh" using namespace nix; diff --git a/src/nix/develop.cc b/src/nix/develop.cc index 961962ebd..7a1e75107 100644 --- a/src/nix/develop.cc +++ b/src/nix/develop.cc @@ -1,12 +1,12 @@ -#include "config-global.hh" -#include "eval.hh" -#include "installable-flake.hh" -#include "command-installable-value.hh" -#include "common-args.hh" -#include "shared.hh" -#include "store-api.hh" -#include "outputs-spec.hh" -#include "derivations.hh" +#include "nix/config-global.hh" +#include "nix/eval.hh" +#include "nix/installable-flake.hh" +#include "nix/command-installable-value.hh" +#include "nix/common-args.hh" +#include "nix/shared.hh" +#include "nix/store-api.hh" +#include "nix/outputs-spec.hh" +#include "nix/derivations.hh" #ifndef _WIN32 // TODO re-enable on Windows # include "run.hh" @@ -18,7 +18,7 @@ #include #include -#include "strings.hh" +#include "nix/strings.hh" namespace nix::fs { using namespace std::filesystem; } diff --git a/src/nix/diff-closures.cc b/src/nix/diff-closures.cc index 2bc7fe82b..042da8d3a 100644 --- a/src/nix/diff-closures.cc +++ b/src/nix/diff-closures.cc @@ -1,12 +1,12 @@ -#include "command.hh" -#include "shared.hh" -#include "store-api.hh" -#include "common-args.hh" -#include "names.hh" +#include "nix/command.hh" +#include "nix/shared.hh" +#include "nix/store-api.hh" +#include "nix/common-args.hh" +#include "nix/names.hh" #include -#include "strings.hh" +#include "nix/strings.hh" namespace nix { diff --git a/src/nix/dump-path.cc b/src/nix/dump-path.cc index 98a059fa1..bf82de846 100644 --- a/src/nix/dump-path.cc +++ b/src/nix/dump-path.cc @@ -1,6 +1,6 @@ -#include "command.hh" -#include "store-api.hh" -#include "archive.hh" +#include "nix/command.hh" +#include "nix/store-api.hh" +#include "nix/archive.hh" using namespace nix; diff --git a/src/nix/edit.cc b/src/nix/edit.cc index 49807da9e..770bbfc71 100644 --- a/src/nix/edit.cc +++ b/src/nix/edit.cc @@ -1,9 +1,9 @@ -#include "current-process.hh" -#include "command-installable-value.hh" -#include "shared.hh" -#include "eval.hh" -#include "attr-path.hh" -#include "editor-for.hh" +#include "nix/current-process.hh" +#include "nix/command-installable-value.hh" +#include "nix/shared.hh" +#include "nix/eval.hh" +#include "nix/attr-path.hh" +#include "nix/editor-for.hh" #include diff --git a/src/nix/env.cc b/src/nix/env.cc index 832320320..982120252 100644 --- a/src/nix/env.cc +++ b/src/nix/env.cc @@ -1,11 +1,11 @@ #include #include -#include "command.hh" -#include "eval.hh" +#include "nix/command.hh" +#include "nix/eval.hh" #include "run.hh" -#include "strings.hh" -#include "executable-path.hh" +#include "nix/strings.hh" +#include "nix/executable-path.hh" using namespace nix; diff --git a/src/nix/eval.cc b/src/nix/eval.cc index e038d75c3..8d48ddbeb 100644 --- a/src/nix/eval.cc +++ b/src/nix/eval.cc @@ -1,10 +1,10 @@ -#include "command-installable-value.hh" -#include "common-args.hh" -#include "shared.hh" -#include "store-api.hh" -#include "eval.hh" -#include "eval-inline.hh" -#include "value-to-json.hh" +#include "nix/command-installable-value.hh" +#include "nix/common-args.hh" +#include "nix/shared.hh" +#include "nix/store-api.hh" +#include "nix/eval.hh" +#include "nix/eval-inline.hh" +#include "nix/value-to-json.hh" #include diff --git a/src/nix/flake.cc b/src/nix/flake.cc index 7c9951c4c..f86b0c4a1 100644 --- a/src/nix/flake.cc +++ b/src/nix/flake.cc @@ -1,30 +1,30 @@ -#include "command.hh" -#include "installable-flake.hh" -#include "common-args.hh" -#include "shared.hh" -#include "eval.hh" -#include "eval-inline.hh" -#include "eval-settings.hh" -#include "flake/flake.hh" -#include "get-drvs.hh" -#include "signals.hh" -#include "store-api.hh" -#include "derivations.hh" -#include "outputs-spec.hh" -#include "attr-path.hh" -#include "fetchers.hh" -#include "registry.hh" -#include "eval-cache.hh" -#include "markdown.hh" -#include "users.hh" -#include "fetch-to-store.hh" -#include "local-fs-store.hh" +#include "nix/command.hh" +#include "nix/installable-flake.hh" +#include "nix/common-args.hh" +#include "nix/shared.hh" +#include "nix/eval.hh" +#include "nix/eval-inline.hh" +#include "nix/eval-settings.hh" +#include "nix/flake/flake.hh" +#include "nix/get-drvs.hh" +#include "nix/signals.hh" +#include "nix/store-api.hh" +#include "nix/derivations.hh" +#include "nix/outputs-spec.hh" +#include "nix/attr-path.hh" +#include "nix/fetchers.hh" +#include "nix/registry.hh" +#include "nix/eval-cache.hh" +#include "nix/markdown.hh" +#include "nix/users.hh" +#include "nix/fetch-to-store.hh" +#include "nix/local-fs-store.hh" #include #include #include -#include "strings-inline.hh" +#include "nix/strings-inline.hh" namespace nix::fs { using namespace std::filesystem; } diff --git a/src/nix/fmt.cc b/src/nix/fmt.cc index f444d6add..e49f76084 100644 --- a/src/nix/fmt.cc +++ b/src/nix/fmt.cc @@ -1,6 +1,6 @@ -#include "command.hh" -#include "installable-value.hh" -#include "eval.hh" +#include "nix/command.hh" +#include "nix/installable-value.hh" +#include "nix/eval.hh" #include "run.hh" using namespace nix; diff --git a/src/nix/hash.cc b/src/nix/hash.cc index 91bba47f4..db937283a 100644 --- a/src/nix/hash.cc +++ b/src/nix/hash.cc @@ -1,13 +1,13 @@ -#include "command.hh" -#include "hash.hh" -#include "content-address.hh" -#include "legacy.hh" -#include "shared.hh" -#include "references.hh" -#include "archive.hh" -#include "git.hh" -#include "posix-source-accessor.hh" -#include "misc-store-flags.hh" +#include "nix/command.hh" +#include "nix/hash.hh" +#include "nix/content-address.hh" +#include "nix/legacy.hh" +#include "nix/shared.hh" +#include "nix/references.hh" +#include "nix/archive.hh" +#include "nix/git.hh" +#include "nix/posix-source-accessor.hh" +#include "nix/misc-store-flags.hh" #include "man-pages.hh" using namespace nix; diff --git a/src/nix/log.cc b/src/nix/log.cc index 2c35ed803..e43f32829 100644 --- a/src/nix/log.cc +++ b/src/nix/log.cc @@ -1,8 +1,8 @@ -#include "command.hh" -#include "common-args.hh" -#include "shared.hh" -#include "store-api.hh" -#include "log-store.hh" +#include "nix/command.hh" +#include "nix/common-args.hh" +#include "nix/shared.hh" +#include "nix/store-api.hh" +#include "nix/log-store.hh" using namespace nix; diff --git a/src/nix/ls.cc b/src/nix/ls.cc index 63f97f2d3..c5a1c4504 100644 --- a/src/nix/ls.cc +++ b/src/nix/ls.cc @@ -1,7 +1,7 @@ -#include "command.hh" -#include "store-api.hh" -#include "nar-accessor.hh" -#include "common-args.hh" +#include "nix/command.hh" +#include "nix/store-api.hh" +#include "nix/nar-accessor.hh" +#include "nix/common-args.hh" #include using namespace nix; diff --git a/src/nix/main.cc b/src/nix/main.cc index 188d424bc..3d57263df 100644 --- a/src/nix/main.cc +++ b/src/nix/main.cc @@ -1,26 +1,27 @@ -#include "args/root.hh" -#include "current-process.hh" -#include "command.hh" -#include "common-args.hh" -#include "eval.hh" -#include "eval-settings.hh" -#include "globals.hh" -#include "legacy.hh" -#include "shared.hh" -#include "store-api.hh" -#include "filetransfer.hh" -#include "finally.hh" -#include "loggers.hh" -#include "markdown.hh" -#include "memory-source-accessor.hh" -#include "terminal.hh" -#include "users.hh" -#include "network-proxy.hh" -#include "eval-cache.hh" -#include "flake/flake.hh" -#include "flake/settings.hh" +#include "nix/args/root.hh" +#include "nix/current-process.hh" +#include "nix/command.hh" +#include "nix/common-args.hh" +#include "nix/eval.hh" +#include "nix/eval-settings.hh" +#include "nix/globals.hh" +#include "nix/legacy.hh" +#include "nix/shared.hh" +#include "nix/store-api.hh" +#include "nix/filetransfer.hh" +#include "nix/finally.hh" +#include "nix/loggers.hh" +#include "nix/markdown.hh" +#include "nix/memory-source-accessor.hh" +#include "nix/terminal.hh" +#include "nix/users.hh" +#include "nix/network-proxy.hh" +#include "nix/eval-cache.hh" +#include "nix/flake/flake.hh" +#include "nix/flake/settings.hh" +#include "nix/json-utils.hh" + #include "self-exe.hh" -#include "json-utils.hh" #include "crash-handler.hh" #include @@ -35,7 +36,7 @@ #endif #if __linux__ -# include "namespaces.hh" +# include "nix/namespaces.hh" #endif #ifndef _WIN32 @@ -44,7 +45,7 @@ extern std::string chrootHelperName; void chrootHelper(int argc, char * * argv); #endif -#include "strings.hh" +#include "nix/strings.hh" namespace nix { diff --git a/src/nix/make-content-addressed.cc b/src/nix/make-content-addressed.cc index d9c988a9f..0426dd5d6 100644 --- a/src/nix/make-content-addressed.cc +++ b/src/nix/make-content-addressed.cc @@ -1,7 +1,7 @@ -#include "command.hh" -#include "store-api.hh" -#include "make-content-addressed.hh" -#include "common-args.hh" +#include "nix/command.hh" +#include "nix/store-api.hh" +#include "nix/make-content-addressed.hh" +#include "nix/common-args.hh" #include diff --git a/src/nix/man-pages.cc b/src/nix/man-pages.cc index e9e89bb62..993ef28e1 100644 --- a/src/nix/man-pages.cc +++ b/src/nix/man-pages.cc @@ -1,7 +1,7 @@ #include "man-pages.hh" -#include "file-system.hh" -#include "current-process.hh" -#include "environment-variables.hh" +#include "nix/file-system.hh" +#include "nix/current-process.hh" +#include "nix/environment-variables.hh" namespace nix { diff --git a/src/nix/meson.build b/src/nix/meson.build index 1ad53c807..adcf80a25 100644 --- a/src/nix/meson.build +++ b/src/nix/meson.build @@ -54,9 +54,9 @@ config_h = configure_file( add_project_arguments( # TODO(Qyriad): Yes this is how the autoconf+Make system did it. # It would be nice for our headers to be idempotent instead. - '-include', 'config-util.hh', - '-include', 'config-store.hh', - '-include', 'config-expr.hh', + '-include', 'nix/config-util.hh', + '-include', 'nix/config-store.hh', + '-include', 'nix/config-expr.hh', '-include', 'config-nix-cli.hh', language : 'cpp', ) diff --git a/src/nix/nar.cc b/src/nix/nar.cc index 8ad4f92a7..ba815551d 100644 --- a/src/nix/nar.cc +++ b/src/nix/nar.cc @@ -1,4 +1,4 @@ -#include "command.hh" +#include "nix/command.hh" using namespace nix; diff --git a/src/nix/optimise-store.cc b/src/nix/optimise-store.cc index 985006e5a..ac1b03f60 100644 --- a/src/nix/optimise-store.cc +++ b/src/nix/optimise-store.cc @@ -1,6 +1,6 @@ -#include "command.hh" -#include "shared.hh" -#include "store-api.hh" +#include "nix/command.hh" +#include "nix/shared.hh" +#include "nix/store-api.hh" #include diff --git a/src/nix/path-from-hash-part.cc b/src/nix/path-from-hash-part.cc index 7f7cda8d3..060231d02 100644 --- a/src/nix/path-from-hash-part.cc +++ b/src/nix/path-from-hash-part.cc @@ -1,5 +1,5 @@ -#include "command.hh" -#include "store-api.hh" +#include "nix/command.hh" +#include "nix/store-api.hh" using namespace nix; diff --git a/src/nix/path-info.cc b/src/nix/path-info.cc index 8e3d0406d..994c7e7dc 100644 --- a/src/nix/path-info.cc +++ b/src/nix/path-info.cc @@ -1,15 +1,15 @@ -#include "command.hh" -#include "shared.hh" -#include "store-api.hh" -#include "common-args.hh" -#include "nar-info.hh" +#include "nix/command.hh" +#include "nix/shared.hh" +#include "nix/store-api.hh" +#include "nix/common-args.hh" +#include "nix/nar-info.hh" #include #include #include -#include "strings.hh" +#include "nix/strings.hh" using namespace nix; using nlohmann::json; diff --git a/src/nix/prefetch.cc b/src/nix/prefetch.cc index ba2fd39d8..f7acd6017 100644 --- a/src/nix/prefetch.cc +++ b/src/nix/prefetch.cc @@ -1,17 +1,18 @@ -#include "command.hh" -#include "common-args.hh" -#include "shared.hh" -#include "store-api.hh" -#include "filetransfer.hh" -#include "finally.hh" -#include "loggers.hh" -#include "tarfile.hh" -#include "attr-path.hh" -#include "eval-inline.hh" -#include "legacy.hh" -#include "posix-source-accessor.hh" -#include "misc-store-flags.hh" -#include "terminal.hh" +#include "nix/command.hh" +#include "nix/common-args.hh" +#include "nix/shared.hh" +#include "nix/store-api.hh" +#include "nix/filetransfer.hh" +#include "nix/finally.hh" +#include "nix/loggers.hh" +#include "nix/tarfile.hh" +#include "nix/attr-path.hh" +#include "nix/eval-inline.hh" +#include "nix/legacy.hh" +#include "nix/posix-source-accessor.hh" +#include "nix/misc-store-flags.hh" +#include "nix/terminal.hh" + #include "man-pages.hh" #include diff --git a/src/nix/profile.cc b/src/nix/profile.cc index 324fd6330..2ba3a8268 100644 --- a/src/nix/profile.cc +++ b/src/nix/profile.cc @@ -1,23 +1,23 @@ -#include "command.hh" -#include "installable-flake.hh" -#include "common-args.hh" -#include "shared.hh" -#include "store-api.hh" -#include "derivations.hh" -#include "archive.hh" -#include "builtins/buildenv.hh" -#include "flake/flakeref.hh" +#include "nix/command.hh" +#include "nix/installable-flake.hh" +#include "nix/common-args.hh" +#include "nix/shared.hh" +#include "nix/store-api.hh" +#include "nix/derivations.hh" +#include "nix/archive.hh" +#include "nix/builtins/buildenv.hh" +#include "nix/flake/flakeref.hh" #include "../nix-env/user-env.hh" -#include "profiles.hh" -#include "names.hh" -#include "url.hh" -#include "flake/url-name.hh" +#include "nix/profiles.hh" +#include "nix/names.hh" +#include "nix/url.hh" +#include "nix/flake/url-name.hh" #include #include #include -#include "strings.hh" +#include "nix/strings.hh" using namespace nix; diff --git a/src/nix/realisation.cc b/src/nix/realisation.cc index a386d98ea..32e544265 100644 --- a/src/nix/realisation.cc +++ b/src/nix/realisation.cc @@ -1,5 +1,5 @@ -#include "command.hh" -#include "common-args.hh" +#include "nix/command.hh" +#include "nix/common-args.hh" #include diff --git a/src/nix/registry.cc b/src/nix/registry.cc index ee4516230..f464ab02f 100644 --- a/src/nix/registry.cc +++ b/src/nix/registry.cc @@ -1,11 +1,11 @@ -#include "command.hh" -#include "common-args.hh" -#include "shared.hh" -#include "eval.hh" -#include "flake/flake.hh" -#include "store-api.hh" -#include "fetchers.hh" -#include "registry.hh" +#include "nix/command.hh" +#include "nix/common-args.hh" +#include "nix/shared.hh" +#include "nix/eval.hh" +#include "nix/flake/flake.hh" +#include "nix/store-api.hh" +#include "nix/fetchers.hh" +#include "nix/registry.hh" using namespace nix; using namespace nix::flake; diff --git a/src/nix/repl.cc b/src/nix/repl.cc index 5a570749f..fb8954455 100644 --- a/src/nix/repl.cc +++ b/src/nix/repl.cc @@ -1,11 +1,11 @@ -#include "eval.hh" -#include "eval-settings.hh" -#include "config-global.hh" -#include "globals.hh" -#include "command.hh" -#include "installable-value.hh" -#include "repl.hh" -#include "processes.hh" +#include "nix/eval.hh" +#include "nix/eval-settings.hh" +#include "nix/config-global.hh" +#include "nix/globals.hh" +#include "nix/command.hh" +#include "nix/installable-value.hh" +#include "nix/repl.hh" +#include "nix/processes.hh" #include "self-exe.hh" namespace nix { diff --git a/src/nix/run.cc b/src/nix/run.cc index 897824d68..0345fab9a 100644 --- a/src/nix/run.cc +++ b/src/nix/run.cc @@ -1,20 +1,20 @@ -#include "current-process.hh" +#include "nix/current-process.hh" #include "run.hh" -#include "command-installable-value.hh" -#include "common-args.hh" -#include "shared.hh" -#include "signals.hh" -#include "store-api.hh" -#include "derivations.hh" -#include "local-fs-store.hh" -#include "finally.hh" -#include "source-accessor.hh" -#include "eval.hh" +#include "nix/command-installable-value.hh" +#include "nix/common-args.hh" +#include "nix/shared.hh" +#include "nix/signals.hh" +#include "nix/store-api.hh" +#include "nix/derivations.hh" +#include "nix/local-fs-store.hh" +#include "nix/finally.hh" +#include "nix/source-accessor.hh" +#include "nix/eval.hh" #include #if __linux__ # include -# include "personality.hh" +# include "nix/personality.hh" #endif #include diff --git a/src/nix/run.hh b/src/nix/run.hh index 51517fdc9..eb670319c 100644 --- a/src/nix/run.hh +++ b/src/nix/run.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "store-api.hh" +#include "nix/store-api.hh" namespace nix { diff --git a/src/nix/search.cc b/src/nix/search.cc index 30b96c500..6a2ee1aa6 100644 --- a/src/nix/search.cc +++ b/src/nix/search.cc @@ -1,22 +1,22 @@ -#include "command-installable-value.hh" -#include "globals.hh" -#include "eval.hh" -#include "eval-inline.hh" -#include "eval-settings.hh" -#include "names.hh" -#include "get-drvs.hh" -#include "common-args.hh" -#include "shared.hh" -#include "eval-cache.hh" -#include "attr-path.hh" -#include "hilite.hh" -#include "strings-inline.hh" +#include "nix/command-installable-value.hh" +#include "nix/globals.hh" +#include "nix/eval.hh" +#include "nix/eval-inline.hh" +#include "nix/eval-settings.hh" +#include "nix/names.hh" +#include "nix/get-drvs.hh" +#include "nix/common-args.hh" +#include "nix/shared.hh" +#include "nix/eval-cache.hh" +#include "nix/attr-path.hh" +#include "nix/hilite.hh" +#include "nix/strings-inline.hh" #include #include #include -#include "strings.hh" +#include "nix/strings.hh" using namespace nix; using json = nlohmann::json; diff --git a/src/nix/self-exe.cc b/src/nix/self-exe.cc index 77d20a835..c9ab566ce 100644 --- a/src/nix/self-exe.cc +++ b/src/nix/self-exe.cc @@ -1,6 +1,6 @@ -#include "current-process.hh" -#include "file-system.hh" -#include "globals.hh" +#include "nix/current-process.hh" +#include "nix/file-system.hh" +#include "nix/globals.hh" #include "self-exe.hh" namespace nix { diff --git a/src/nix/sigs.cc b/src/nix/sigs.cc index 10b99b452..bbdc33002 100644 --- a/src/nix/sigs.cc +++ b/src/nix/sigs.cc @@ -1,8 +1,8 @@ -#include "signals.hh" -#include "command.hh" -#include "shared.hh" -#include "store-api.hh" -#include "thread-pool.hh" +#include "nix/signals.hh" +#include "nix/command.hh" +#include "nix/shared.hh" +#include "nix/store-api.hh" +#include "nix/thread-pool.hh" #include diff --git a/src/nix/store-copy-log.cc b/src/nix/store-copy-log.cc index a6e8aeff7..7dde15dfa 100644 --- a/src/nix/store-copy-log.cc +++ b/src/nix/store-copy-log.cc @@ -1,10 +1,10 @@ -#include "command.hh" -#include "shared.hh" -#include "store-api.hh" -#include "store-cast.hh" -#include "log-store.hh" -#include "sync.hh" -#include "thread-pool.hh" +#include "nix/command.hh" +#include "nix/shared.hh" +#include "nix/store-api.hh" +#include "nix/store-cast.hh" +#include "nix/log-store.hh" +#include "nix/sync.hh" +#include "nix/thread-pool.hh" #include diff --git a/src/nix/store-delete.cc b/src/nix/store-delete.cc index 6719227df..3d73b7b9a 100644 --- a/src/nix/store-delete.cc +++ b/src/nix/store-delete.cc @@ -1,9 +1,9 @@ -#include "command.hh" -#include "common-args.hh" -#include "shared.hh" -#include "store-api.hh" -#include "store-cast.hh" -#include "gc-store.hh" +#include "nix/command.hh" +#include "nix/common-args.hh" +#include "nix/shared.hh" +#include "nix/store-api.hh" +#include "nix/store-cast.hh" +#include "nix/gc-store.hh" using namespace nix; diff --git a/src/nix/store-gc.cc b/src/nix/store-gc.cc index 8b9b5d164..a8ea3f2fa 100644 --- a/src/nix/store-gc.cc +++ b/src/nix/store-gc.cc @@ -1,9 +1,9 @@ -#include "command.hh" -#include "common-args.hh" -#include "shared.hh" -#include "store-api.hh" -#include "store-cast.hh" -#include "gc-store.hh" +#include "nix/command.hh" +#include "nix/common-args.hh" +#include "nix/shared.hh" +#include "nix/store-api.hh" +#include "nix/store-cast.hh" +#include "nix/gc-store.hh" using namespace nix; diff --git a/src/nix/store-info.cc b/src/nix/store-info.cc index a7c595761..656be0d41 100644 --- a/src/nix/store-info.cc +++ b/src/nix/store-info.cc @@ -1,7 +1,7 @@ -#include "command.hh" -#include "shared.hh" -#include "store-api.hh" -#include "finally.hh" +#include "nix/command.hh" +#include "nix/shared.hh" +#include "nix/store-api.hh" +#include "nix/finally.hh" #include diff --git a/src/nix/store-repair.cc b/src/nix/store-repair.cc index 895e39685..cd63a836a 100644 --- a/src/nix/store-repair.cc +++ b/src/nix/store-repair.cc @@ -1,5 +1,5 @@ -#include "command.hh" -#include "store-api.hh" +#include "nix/command.hh" +#include "nix/store-api.hh" using namespace nix; diff --git a/src/nix/store.cc b/src/nix/store.cc index 79b41e096..ccf02c22e 100644 --- a/src/nix/store.cc +++ b/src/nix/store.cc @@ -1,4 +1,4 @@ -#include "command.hh" +#include "nix/command.hh" using namespace nix; diff --git a/src/nix/unix/daemon.cc b/src/nix/unix/daemon.cc index fd572ce30..5da068a70 100644 --- a/src/nix/unix/daemon.cc +++ b/src/nix/unix/daemon.cc @@ -1,20 +1,20 @@ ///@file -#include "signals.hh" -#include "unix-domain-socket.hh" -#include "command.hh" -#include "shared.hh" -#include "local-store.hh" -#include "remote-store.hh" -#include "remote-store-connection.hh" -#include "serialise.hh" -#include "archive.hh" -#include "globals.hh" -#include "config-global.hh" -#include "derivations.hh" -#include "finally.hh" -#include "legacy.hh" -#include "daemon.hh" +#include "nix/signals.hh" +#include "nix/unix-domain-socket.hh" +#include "nix/command.hh" +#include "nix/shared.hh" +#include "nix/local-store.hh" +#include "nix/remote-store.hh" +#include "nix/remote-store-connection.hh" +#include "nix/serialise.hh" +#include "nix/archive.hh" +#include "nix/globals.hh" +#include "nix/config-global.hh" +#include "nix/derivations.hh" +#include "nix/finally.hh" +#include "nix/legacy.hh" +#include "nix/daemon.hh" #include "man-pages.hh" #include @@ -35,7 +35,7 @@ #include #if __linux__ -#include "cgroup.hh" +#include "nix/cgroup.hh" #endif #if __APPLE__ || __FreeBSD__ diff --git a/src/nix/upgrade-nix.cc b/src/nix/upgrade-nix.cc index 398e533ce..285285856 100644 --- a/src/nix/upgrade-nix.cc +++ b/src/nix/upgrade-nix.cc @@ -1,13 +1,13 @@ -#include "processes.hh" -#include "command.hh" -#include "common-args.hh" -#include "store-api.hh" -#include "filetransfer.hh" -#include "eval.hh" -#include "eval-settings.hh" -#include "attr-path.hh" -#include "names.hh" -#include "executable-path.hh" +#include "nix/processes.hh" +#include "nix/command.hh" +#include "nix/common-args.hh" +#include "nix/store-api.hh" +#include "nix/filetransfer.hh" +#include "nix/eval.hh" +#include "nix/eval-settings.hh" +#include "nix/attr-path.hh" +#include "nix/names.hh" +#include "nix/executable-path.hh" #include "self-exe.hh" using namespace nix; diff --git a/src/nix/verify.cc b/src/nix/verify.cc index 52585fe08..0adfec895 100644 --- a/src/nix/verify.cc +++ b/src/nix/verify.cc @@ -1,13 +1,13 @@ -#include "command.hh" -#include "shared.hh" -#include "store-api.hh" -#include "thread-pool.hh" -#include "signals.hh" -#include "keys.hh" +#include "nix/command.hh" +#include "nix/shared.hh" +#include "nix/store-api.hh" +#include "nix/thread-pool.hh" +#include "nix/signals.hh" +#include "nix/keys.hh" #include -#include "exit.hh" +#include "nix/exit.hh" using namespace nix; diff --git a/src/nix/why-depends.cc b/src/nix/why-depends.cc index ae5c45ae3..fe8f3ecc3 100644 --- a/src/nix/why-depends.cc +++ b/src/nix/why-depends.cc @@ -1,7 +1,7 @@ -#include "command.hh" -#include "store-api.hh" -#include "source-accessor.hh" -#include "shared.hh" +#include "nix/command.hh" +#include "nix/store-api.hh" +#include "nix/source-accessor.hh" +#include "nix/shared.hh" #include diff --git a/src/perl/lib/Nix/Store.xs b/src/perl/lib/Nix/Store.xs index cfc3ac034..f368a2e42 100644 --- a/src/perl/lib/Nix/Store.xs +++ b/src/perl/lib/Nix/Store.xs @@ -1,5 +1,5 @@ -#include "config-util.hh" -#include "config-store.hh" +#include "nix/config-util.hh" +#include "nix/config-store.hh" #include "EXTERN.h" #include "perl.h" @@ -9,11 +9,11 @@ #undef do_open #undef do_close -#include "derivations.hh" -#include "realisation.hh" -#include "globals.hh" -#include "store-api.hh" -#include "posix-source-accessor.hh" +#include "nix/derivations.hh" +#include "nix/realisation.hh" +#include "nix/globals.hh" +#include "nix/store-api.hh" +#include "nix/posix-source-accessor.hh" #include #include diff --git a/tests/functional/plugins/meson.build b/tests/functional/plugins/meson.build index 13acdbbc5..cee43f0b5 100644 --- a/tests/functional/plugins/meson.build +++ b/tests/functional/plugins/meson.build @@ -4,9 +4,9 @@ libplugintest = shared_module( cpp_args : [ # TODO(Qyriad): Yes this is how the autoconf+Make system did it. # It would be nice for our headers to be idempotent instead. - '-include', 'config-util.hh', - '-include', 'config-store.hh', - '-include', 'config-expr.hh', + '-include', 'nix/config-util.hh', + '-include', 'nix/config-store.hh', + '-include', 'nix/config-expr.hh', ], dependencies : [ dependency('nix-expr'), diff --git a/tests/functional/plugins/plugintest.cc b/tests/functional/plugins/plugintest.cc index 7433ad190..e3343bcbc 100644 --- a/tests/functional/plugins/plugintest.cc +++ b/tests/functional/plugins/plugintest.cc @@ -1,5 +1,5 @@ -#include "config-global.hh" -#include "primops.hh" +#include "nix/config-global.hh" +#include "nix/primops.hh" using namespace nix; diff --git a/tests/functional/test-libstoreconsumer/main.cc b/tests/functional/test-libstoreconsumer/main.cc index c61489af6..7cb0da944 100644 --- a/tests/functional/test-libstoreconsumer/main.cc +++ b/tests/functional/test-libstoreconsumer/main.cc @@ -1,6 +1,6 @@ -#include "globals.hh" -#include "store-api.hh" -#include "build-result.hh" +#include "nix/globals.hh" +#include "nix/store-api.hh" +#include "nix/build-result.hh" #include using namespace nix; diff --git a/tests/functional/test-libstoreconsumer/meson.build b/tests/functional/test-libstoreconsumer/meson.build index 7076127f7..13a7f6d6f 100644 --- a/tests/functional/test-libstoreconsumer/meson.build +++ b/tests/functional/test-libstoreconsumer/meson.build @@ -4,8 +4,8 @@ libstoreconsumer_tester = executable( cpp_args : [ # TODO(Qyriad): Yes this is how the autoconf+Make system did it. # It would be nice for our headers to be idempotent instead. - '-include', 'config-util.hh', - '-include', 'config-store.hh', + '-include', 'nix/config-util.hh', + '-include', 'nix/config-store.hh', ], dependencies : [ dependency('nix-store'), From 0fe8358396a8d9fea7067edc3293559ac0d2252c Mon Sep 17 00:00:00 2001 From: John Ericson Date: Wed, 26 Mar 2025 23:36:08 -0400 Subject: [PATCH 39/84] Create script to symlink headers to old location See comments on the script; this is supposed to avoid breaking muscle memory without complicating the build system (which proved harder than I thought too) or not doing the header hygiene change at all. link-headers: use pathlib consistenly and fix type errors (cherry picked from commit c6a176be62737ccc481d972891a73fd5829d633d) --- maintainers/link-headers | 83 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100755 maintainers/link-headers diff --git a/maintainers/link-headers b/maintainers/link-headers new file mode 100755 index 000000000..2457a2dc8 --- /dev/null +++ b/maintainers/link-headers @@ -0,0 +1,83 @@ +#!/usr/bin/env python3 + +# This script must be run from the root of the Nix repository. +# +# For include path hygiene, we need to put headers in a separate +# directory than sources. But during development, it is nice to paths +# that are similar for headers and source files, e.g. +# `foo/bar/baz.{cc,hh}`, e.g. for less typing when opening one file, and +# then opening the other file. +# +# This script symlinks the headers next to the source files to +# facilitate such a development workflows. It also updates +# `.git/info/exclude` so that the symlinks are not accidentally committed +# by mistake. + +from pathlib import Path +import subprocess +import os + + +def main() -> None: + # Path to the source directory + GIT_TOPLEVEL = Path( + subprocess.run( + ["git", "rev-parse", "--show-toplevel"], + text=True, + stdout=subprocess.PIPE, + check=True, + ).stdout.strip() + ) + + # Get header files from git + result = subprocess.run( + ["git", "-C", str(GIT_TOPLEVEL), "ls-files", "*/include/nix/**.hh"], + text=True, + stdout=subprocess.PIPE, + check=True, + ) + header_files = result.stdout.strip().split("\n") + header_files.sort() + + links = [] + for file_str in header_files: + project_str, header_str = file_str.split("/include/nix/", 1) + project = Path(project_str) + header = Path(header_str) + + # Reconstruct the full path (relative to SRC_DIR) to the header file. + file = project / "include" / "nix" / header + + # The symlink should be created at "project/header", i.e. next to the project's sources. + link = project / header + + # Compute a relative path from the symlink's parent directory to the actual header file. + relative_source = os.path.relpath( + GIT_TOPLEVEL / file, GIT_TOPLEVEL / link.parent + ) + + # Create the symbolic link. + full_link_path = GIT_TOPLEVEL / link + full_link_path.parent.mkdir(parents=True, exist_ok=True) + if full_link_path.is_symlink(): + full_link_path.unlink() + full_link_path.symlink_to(relative_source) + links.append(link) + + # Generate .gitignore file + gitignore_path = GIT_TOPLEVEL / ".git" / "info" / "exclude" + gitignore_path.parent.mkdir(parents=True, exist_ok=True) + with gitignore_path.open("w") as gitignore: + gitignore.write("# DO NOT EDIT! Autogenerated\n") + gitignore.write( + "# Symlinks for headers to be next to sources for development\n" + ) + gitignore.write('# Run "maintainers/link-headers" to regenerate\n\n') + gitignore.write('# Run "maintainers/link-headers" to regenerate\n\n') + + for link in links: + gitignore.write(f"/{link}\n") + + +if __name__ == "__main__": + main() From 410ea6f7cf4729941cdae46eb31c8dd64f8ab8d3 Mon Sep 17 00:00:00 2001 From: Thomas Miedema Date: Sat, 29 Mar 2025 20:13:21 +0100 Subject: [PATCH 40/84] nix-daemon: source nix-profile-daemon.sh only once On my system (Ubuntu 24.04 with nix installed using https://zero-to-nix.com/), I noticed that my PATH contained multiple times the following entries: /home/thomas/.nix-profile/bin /nix/var/nix/profiles/default/bin Fix it by inserting a missing `export`, to make sure `nix-daemon.sh` is really only executed once. (cherry picked from commit 2b4e3fa1443c8d56ead43865adf037efa92c3fd7) --- scripts/nix-profile-daemon.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/nix-profile-daemon.sh.in b/scripts/nix-profile-daemon.sh.in index 59c00d491..ed74c242a 100644 --- a/scripts/nix-profile-daemon.sh.in +++ b/scripts/nix-profile-daemon.sh.in @@ -1,7 +1,7 @@ # Only execute this file once per shell. # This file is tested by tests/installer/default.nix. if [ -n "${__ETC_PROFILE_NIX_SOURCED:-}" ]; then return; fi -__ETC_PROFILE_NIX_SOURCED=1 +export __ETC_PROFILE_NIX_SOURCED=1 NIX_LINK=$HOME/.nix-profile if [ -n "${XDG_STATE_HOME-}" ]; then From 6a1a3fa1cbb03200ffe9e0d20f1795a26cb65751 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Fri, 28 Mar 2025 13:24:50 -0400 Subject: [PATCH 41/84] Cleanup config headers There are two big changes: 1. Public and private config is now separated. Configuration variables that are only used internally do not go in a header which is installed. (Additionally, libutil has a unix-specific private config header, which should only be used in unix-specific code. This keeps things a bit more organized, in a purely private implementation-internal way.) 2. Secondly, there is no more `-include`. There are very few config items that need to be publically exposed, so now it is feasible to just make the headers that need them just including the (public) configuration header. And there are also a few more small cleanups on top of those: - The configuration files have better names. - The few CPP variables that remain exposed in the public headers are now also renamed to always start with `NIX_`. This ensures they should not conflict with variables defined elsewhere. - We now always use `#if` and not `#ifdef`/`#ifndef` for our configuration variables, which helps avoid bugs by requiring that variables must be defined in all cases. (cherry picked from commit c204e307acc60b9a50115f22882473fc45972650) --- src/libcmd/meson.build | 25 +++----- src/libcmd/repl-interacter.cc | 10 +-- src/libexpr-c/meson.build | 12 ---- src/libexpr-c/nix_api_expr.cc | 6 +- src/libexpr-c/nix_api_external.cc | 2 +- src/libexpr-c/nix_api_value.cc | 10 +-- src/libexpr-test-support/meson.build | 9 --- src/libexpr-tests/meson.build | 14 ++--- src/libexpr-tests/nix_api_expr.cc | 2 + src/libexpr/eval-gc.cc | 8 ++- src/libexpr/eval.cc | 12 ++-- src/libexpr/include/nix/eval-gc.hh | 7 ++- src/libexpr/include/nix/eval-inline.hh | 9 ++- src/libexpr/include/nix/eval.hh | 7 ++- src/libexpr/include/nix/meson.build | 8 +-- src/libexpr/meson.build | 33 ++++++---- src/libfetchers-tests/meson.build | 9 --- src/libfetchers/meson.build | 9 --- src/libflake-c/meson.build | 14 ----- src/libflake-tests/meson.build | 9 --- src/libflake/meson.build | 10 --- src/libmain-c/meson.build | 11 ---- src/libmain/include/nix/meson.build | 7 +-- src/libmain/meson.build | 12 ++-- src/libmain/shared.cc | 4 +- src/libstore-c/meson.build | 11 ---- src/libstore-test-support/meson.build | 8 --- src/libstore-tests/meson.build | 17 ++--- src/libstore-tests/nix_api_store.cc | 2 + src/libstore/gc.cc | 2 + src/libstore/globals.cc | 8 ++- src/libstore/include/nix/globals.hh | 14 +++-- src/libstore/include/nix/meson.build | 8 +-- .../linux/include/nix/fchmodat2-compat.hh | 2 + src/libstore/linux/personality.cc | 2 +- src/libstore/local-store.cc | 2 + src/libstore/meson.build | 46 ++++++++------ src/libstore/posix-fs-canonicalise.cc | 13 ++-- .../unix/build/local-derivation-goal.cc | 5 +- src/libutil-c/meson.build | 14 +---- src/libutil-test-support/meson.build | 7 --- src/libutil-tests/meson.build | 11 +--- src/libutil-tests/nix_api_util.cc | 2 + src/libutil/compute-levels.cc | 2 + src/libutil/file-system.cc | 58 +---------------- src/libutil/fs-sink.cc | 2 + src/libutil/include/nix/meson.build | 7 +-- src/libutil/meson.build | 44 ++++--------- src/libutil/unix/file-descriptor.cc | 3 + src/libutil/unix/file-system.cc | 62 +++++++++++++++++++ src/libutil/unix/meson.build | 50 +++++++++++++++ src/libutil/unix/processes.cc | 3 + src/libutil/windows/file-system.cc | 15 +++++ src/nix/main.cc | 1 + src/nix/meson.build | 16 +---- src/nix/self-exe.cc | 2 + src/perl/lib/Nix/Store.xs | 3 - tests/functional/plugins/meson.build | 7 --- .../test-libstoreconsumer/meson.build | 6 -- 59 files changed, 331 insertions(+), 383 deletions(-) diff --git a/src/libcmd/meson.build b/src/libcmd/meson.build index 727f4e14d..07747e0a3 100644 --- a/src/libcmd/meson.build +++ b/src/libcmd/meson.build @@ -44,27 +44,18 @@ if readline_flavor == 'editline' elif readline_flavor == 'readline' readline = dependency('readline') deps_private += readline - configdata.set( - 'USE_READLINE', - 1, - description: 'Use readline instead of editline', - ) else error('illegal editline flavor', readline_flavor) endif - -config_h = configure_file( - configuration : configdata, - output : 'cmd-config-private.hh', +configdata.set( + 'USE_READLINE', + (readline_flavor == 'readline').to_int(), + description: 'Use readline instead of editline', ) -add_project_arguments( - # TODO(Qyriad): Yes this is how the autoconf+Make system did it. - # It would be nice for our headers to be idempotent instead. - '-include', 'nix/config-util.hh', - '-include', 'nix/config-store.hh', - '-include', 'nix/config-expr.hh', - language : 'cpp', +config_priv_h = configure_file( + configuration : configdata, + output : 'cmd-config-private.hh', ) subdir('nix-meson-build-support/common') @@ -96,7 +87,7 @@ subdir('nix-meson-build-support/windows-version') this_library = library( 'nixcmd', sources, - config_h, + config_priv_h, dependencies : deps_public + deps_private + deps_other, include_directories : include_dirs, link_args: linker_export_flags, diff --git a/src/libcmd/repl-interacter.cc b/src/libcmd/repl-interacter.cc index 773e111b2..093cc2b29 100644 --- a/src/libcmd/repl-interacter.cc +++ b/src/libcmd/repl-interacter.cc @@ -2,7 +2,7 @@ #include -#ifdef USE_READLINE +#if USE_READLINE #include #include #else @@ -37,7 +37,7 @@ void sigintHandler(int signo) static detail::ReplCompleterMixin * curRepl; // ugly -#ifndef USE_READLINE +#if !USE_READLINE static char * completionCallback(char * s, int * match) { auto possible = curRepl->completePrefix(s); @@ -115,14 +115,14 @@ ReadlineLikeInteracter::Guard ReadlineLikeInteracter::init(detail::ReplCompleter } catch (SystemError & e) { logWarning(e.info()); } -#ifndef USE_READLINE +#if !USE_READLINE el_hist_size = 1000; #endif read_history(historyFile.c_str()); auto oldRepl = curRepl; curRepl = repl; Guard restoreRepl([oldRepl] { curRepl = oldRepl; }); -#ifndef USE_READLINE +#if !USE_READLINE rl_set_complete_func(completionCallback); rl_set_list_possib_func(listPossibleCallback); #endif @@ -185,7 +185,7 @@ bool ReadlineLikeInteracter::getLine(std::string & input, ReplPromptType promptT // quite useful for reading the test output, so we add it here. if (auto e = getEnv("_NIX_TEST_REPL_ECHO"); s && e && *e == "1") { -#ifndef USE_READLINE +#if !USE_READLINE // This is probably not right for multi-line input, but we don't use that // in the characterisation tests, so it's fine. std::cout << promptForType(promptType) << s << std::endl; diff --git a/src/libexpr-c/meson.build b/src/libexpr-c/meson.build index 8b00b8d70..7c11ca9cb 100644 --- a/src/libexpr-c/meson.build +++ b/src/libexpr-c/meson.build @@ -25,18 +25,6 @@ deps_public_maybe_subproject = [ ] subdir('nix-meson-build-support/subprojects') -add_project_arguments( - # TODO(Qyriad): Yes this is how the autoconf+Make system did it. - # It would be nice for our headers to be idempotent instead. - - # From C++ libraries, only for internals - '-include', 'nix/config-util.hh', - '-include', 'nix/config-store.hh', - '-include', 'nix/config-expr.hh', - - language : 'cpp', -) - subdir('nix-meson-build-support/common') sources = files( diff --git a/src/libexpr-c/nix_api_expr.cc b/src/libexpr-c/nix_api_expr.cc index b5d2c6199..47eca4e65 100644 --- a/src/libexpr-c/nix_api_expr.cc +++ b/src/libexpr-c/nix_api_expr.cc @@ -15,7 +15,7 @@ #include "nix_api_util.h" #include "nix_api_util_internal.h" -#if HAVE_BOEHMGC +#if NIX_USE_BOEHMGC # include #endif @@ -207,7 +207,7 @@ void nix_state_free(EvalState * state) delete state; } -#if HAVE_BOEHMGC +#if NIX_USE_BOEHMGC std::unordered_map< const void *, unsigned int, @@ -283,7 +283,7 @@ nix_err nix_value_decref(nix_c_context * context, nix_value *x) void nix_gc_register_finalizer(void * obj, void * cd, void (*finalizer)(void * obj, void * cd)) { -#if HAVE_BOEHMGC +#if NIX_USE_BOEHMGC GC_REGISTER_FINALIZER(obj, finalizer, cd, 0, 0); #endif } diff --git a/src/libexpr-c/nix_api_external.cc b/src/libexpr-c/nix_api_external.cc index 7f4cd6a8c..ab124b73b 100644 --- a/src/libexpr-c/nix_api_external.cc +++ b/src/libexpr-c/nix_api_external.cc @@ -168,7 +168,7 @@ ExternalValue * nix_create_external_value(nix_c_context * context, NixCExternalV context->last_err_code = NIX_OK; try { auto ret = new -#if HAVE_BOEHMGC +#if NIX_USE_BOEHMGC (GC) #endif NixCExternalValue(*desc, v); diff --git a/src/libexpr-c/nix_api_value.cc b/src/libexpr-c/nix_api_value.cc index 3116cb59f..4c2fdee42 100644 --- a/src/libexpr-c/nix_api_value.cc +++ b/src/libexpr-c/nix_api_value.cc @@ -125,7 +125,7 @@ PrimOp * nix_alloc_primop( try { using namespace std::placeholders; auto p = new -#if HAVE_BOEHMGC +#if NIX_USE_BOEHMGC (GC) #endif nix::PrimOp{ @@ -497,7 +497,7 @@ ListBuilder * nix_make_list_builder(nix_c_context * context, EvalState * state, try { auto builder = state->state.buildList(capacity); return new -#if HAVE_BOEHMGC +#if NIX_USE_BOEHMGC (NoGC) #endif ListBuilder{std::move(builder)}; @@ -519,7 +519,7 @@ nix_list_builder_insert(nix_c_context * context, ListBuilder * list_builder, uns void nix_list_builder_free(ListBuilder * list_builder) { -#if HAVE_BOEHMGC +#if NIX_USE_BOEHMGC GC_FREE(list_builder); #else delete list_builder; @@ -578,7 +578,7 @@ BindingsBuilder * nix_make_bindings_builder(nix_c_context * context, EvalState * try { auto bb = state->state.buildBindings(capacity); return new -#if HAVE_BOEHMGC +#if NIX_USE_BOEHMGC (NoGC) #endif BindingsBuilder{std::move(bb)}; @@ -600,7 +600,7 @@ nix_err nix_bindings_builder_insert(nix_c_context * context, BindingsBuilder * b void nix_bindings_builder_free(BindingsBuilder * bb) { -#if HAVE_BOEHMGC +#if NIX_USE_BOEHMGC GC_FREE((nix::BindingsBuilder *) bb); #else delete (nix::BindingsBuilder *) bb; diff --git a/src/libexpr-test-support/meson.build b/src/libexpr-test-support/meson.build index b68adb2c2..3409dbf20 100644 --- a/src/libexpr-test-support/meson.build +++ b/src/libexpr-test-support/meson.build @@ -29,15 +29,6 @@ subdir('nix-meson-build-support/subprojects') rapidcheck = dependency('rapidcheck') deps_public += rapidcheck -add_project_arguments( - # TODO(Qyriad): Yes this is how the autoconf+Make system did it. - # It would be nice for our headers to be idempotent instead. - '-include', 'nix/config-util.hh', - '-include', 'nix/config-store.hh', - '-include', 'nix/config-expr.hh', - language : 'cpp', -) - subdir('nix-meson-build-support/common') sources = files( diff --git a/src/libexpr-tests/meson.build b/src/libexpr-tests/meson.build index 3fc726cb2..f7822edfd 100644 --- a/src/libexpr-tests/meson.build +++ b/src/libexpr-tests/meson.build @@ -35,13 +35,12 @@ deps_private += gtest gtest = dependency('gmock') deps_private += gtest -add_project_arguments( - # TODO(Qyriad): Yes this is how the autoconf+Make system did it. - # It would be nice for our headers to be idempotent instead. - '-include', 'nix/config-util.hh', - '-include', 'nix/config-store.hh', - '-include', 'nix/config-expr.hh', - language : 'cpp', +configdata = configuration_data() +configdata.set_quoted('PACKAGE_VERSION', meson.project_version()) + +config_priv_h = configure_file( + configuration : configdata, + output : 'expr-tests-config.hh', ) subdir('nix-meson-build-support/common') @@ -69,6 +68,7 @@ include_dirs = [include_directories('.')] this_exe = executable( meson.project_name(), sources, + config_priv_h, dependencies : deps_private_subproject + deps_private + deps_other, include_directories : include_dirs, # TODO: -lrapidcheck, see ../libutil-support/build.meson diff --git a/src/libexpr-tests/nix_api_expr.cc b/src/libexpr-tests/nix_api_expr.cc index 903c7a239..55893488f 100644 --- a/src/libexpr-tests/nix_api_expr.cc +++ b/src/libexpr-tests/nix_api_expr.cc @@ -12,6 +12,8 @@ #include #include +#include "expr-tests-config.hh" + namespace nixC { TEST_F(nix_api_store_test, nix_eval_state_lookup_path) diff --git a/src/libexpr/eval-gc.cc b/src/libexpr/eval-gc.cc index defa4e9d2..1166548f6 100644 --- a/src/libexpr/eval-gc.cc +++ b/src/libexpr/eval-gc.cc @@ -5,7 +5,9 @@ #include "nix/serialise.hh" #include "nix/eval-gc.hh" -#if HAVE_BOEHMGC +#include "expr-config-private.hh" + +#if NIX_USE_BOEHMGC # include # if __FreeBSD__ @@ -24,7 +26,7 @@ namespace nix { -#if HAVE_BOEHMGC +#if NIX_USE_BOEHMGC /* Called when the Boehm GC runs out of memory. */ static void * oomHandler(size_t requested) { @@ -94,7 +96,7 @@ void initGC() if (gcInitialised) return; -#if HAVE_BOEHMGC +#if NIX_USE_BOEHMGC initGCReal(); gcCyclesAfterInit = GC_get_gc_no(); diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index f534cc494..41b64a90a 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -295,7 +295,7 @@ EvalState::EvalState( , debugStop(false) , trylevel(0) , regexCache(makeRegexCache()) -#if HAVE_BOEHMGC +#if NIX_USE_BOEHMGC , valueAllocCache(std::allocate_shared(traceable_allocator(), nullptr)) , env1AllocCache(std::allocate_shared(traceable_allocator(), nullptr)) , baseEnvP(std::allocate_shared(traceable_allocator(), &allocEnv(BASE_ENV_SIZE))) @@ -2812,7 +2812,7 @@ bool EvalState::eqValues(Value & v1, Value & v2, const PosIdx pos, std::string_v } bool EvalState::fullGC() { -#if HAVE_BOEHMGC +#if NIX_USE_BOEHMGC GC_gcollect(); // Check that it ran. We might replace this with a version that uses more // of the boehm API to get this reliably, at a maintenance cost. @@ -2831,7 +2831,7 @@ void EvalState::maybePrintStats() if (showStats) { // Make the final heap size more deterministic. -#if HAVE_BOEHMGC +#if NIX_USE_BOEHMGC if (!fullGC()) { warn("failed to perform a full GC before reporting stats"); } @@ -2853,7 +2853,7 @@ void EvalState::printStatistics() uint64_t bValues = nrValues * sizeof(Value); uint64_t bAttrsets = nrAttrsets * sizeof(Bindings) + nrAttrsInAttrsets * sizeof(Attr); -#if HAVE_BOEHMGC +#if NIX_USE_BOEHMGC GC_word heapSize, totalBytes; GC_get_heap_usage_safe(&heapSize, 0, 0, 0, &totalBytes); double gcFullOnlyTime = ({ @@ -2875,7 +2875,7 @@ void EvalState::printStatistics() #ifndef _WIN32 // TODO implement {"cpu", cpuTime}, #endif -#if HAVE_BOEHMGC +#if NIX_USE_BOEHMGC {GC_is_incremental_mode() ? "gcNonIncremental" : "gc", gcFullOnlyTime}, #ifndef _WIN32 // TODO implement {GC_is_incremental_mode() ? "gcNonIncrementalFraction" : "gcFraction", gcFullOnlyTime / cpuTime}, @@ -2919,7 +2919,7 @@ void EvalState::printStatistics() topObj["nrLookups"] = nrLookups; topObj["nrPrimOpCalls"] = nrPrimOpCalls; topObj["nrFunctionCalls"] = nrFunctionCalls; -#if HAVE_BOEHMGC +#if NIX_USE_BOEHMGC topObj["gc"] = { {"heapSize", heapSize}, {"totalBytes", totalBytes}, diff --git a/src/libexpr/include/nix/eval-gc.hh b/src/libexpr/include/nix/eval-gc.hh index f3b699b54..8f28fe0e2 100644 --- a/src/libexpr/include/nix/eval-gc.hh +++ b/src/libexpr/include/nix/eval-gc.hh @@ -3,7 +3,10 @@ #include -#if HAVE_BOEHMGC +// For `NIX_USE_BOEHMGC`, and if that's set, `GC_THREADS` +#include "nix/expr-config.hh" + +#if NIX_USE_BOEHMGC # define GC_INCLUDE_NEW @@ -43,7 +46,7 @@ void initGC(); */ void assertGCInitialized(); -#ifdef HAVE_BOEHMGC +#if NIX_USE_BOEHMGC /** * The number of GC cycles since initGC(). */ diff --git a/src/libexpr/include/nix/eval-inline.hh b/src/libexpr/include/nix/eval-inline.hh index c00b06006..09a85db06 100644 --- a/src/libexpr/include/nix/eval-inline.hh +++ b/src/libexpr/include/nix/eval-inline.hh @@ -6,6 +6,9 @@ #include "nix/eval-error.hh" #include "nix/eval-settings.hh" +// For `NIX_USE_BOEHMGC`, and if that's set, `GC_THREADS` +#include "nix/expr-config.hh" + namespace nix { /** @@ -15,7 +18,7 @@ namespace nix { inline void * allocBytes(size_t n) { void * p; -#if HAVE_BOEHMGC +#if NIX_USE_BOEHMGC p = GC_MALLOC(n); #else p = calloc(n, 1); @@ -28,7 +31,7 @@ inline void * allocBytes(size_t n) [[gnu::always_inline]] Value * EvalState::allocValue() { -#if HAVE_BOEHMGC +#if NIX_USE_BOEHMGC /* We use the boehm batch allocator to speed up allocations of Values (of which there are many). GC_malloc_many returns a linked list of objects of the given size, where the first word of each object is also the pointer to the next object in the list. This also means that we @@ -60,7 +63,7 @@ Env & EvalState::allocEnv(size_t size) Env * env; -#if HAVE_BOEHMGC +#if NIX_USE_BOEHMGC if (size == 1) { /* see allocValue for explanations. */ if (!*env1AllocCache) { diff --git a/src/libexpr/include/nix/eval.hh b/src/libexpr/include/nix/eval.hh index 42091b9ba..7a3ec065d 100644 --- a/src/libexpr/include/nix/eval.hh +++ b/src/libexpr/include/nix/eval.hh @@ -16,6 +16,9 @@ #include "nix/repl-exit-status.hh" #include "nix/ref.hh" +// For `NIX_USE_BOEHMGC`, and if that's set, `GC_THREADS` +#include "nix/expr-config.hh" + #include #include #include @@ -369,7 +372,7 @@ private: */ std::shared_ptr regexCache; -#if HAVE_BOEHMGC +#if NIX_USE_BOEHMGC /** * Allocation cache for GC'd Value objects. */ @@ -596,7 +599,7 @@ public: */ SingleDerivedPath coerceToSingleDerivedPath(const PosIdx pos, Value & v, std::string_view errorCtx); -#if HAVE_BOEHMGC +#if NIX_USE_BOEHMGC /** A GC root for the baseEnv reference. */ std::shared_ptr baseEnvP; #endif diff --git a/src/libexpr/include/nix/meson.build b/src/libexpr/include/nix/meson.build index d712cc798..89422004a 100644 --- a/src/libexpr/include/nix/meson.build +++ b/src/libexpr/include/nix/meson.build @@ -2,12 +2,12 @@ include_dirs = [include_directories('..')] -config_h = configure_file( - configuration : configdata, - output : 'config-expr.hh', +config_pub_h = configure_file( + configuration : configdata_pub, + output : 'expr-config.hh', ) -headers = [config_h] + files( +headers = [config_pub_h] + files( 'attr-path.hh', 'attr-set.hh', 'eval-cache.hh', diff --git a/src/libexpr/meson.build b/src/libexpr/meson.build index 3fd4dca7f..02873f4db 100644 --- a/src/libexpr/meson.build +++ b/src/libexpr/meson.build @@ -14,7 +14,8 @@ cxx = meson.get_compiler('cpp') subdir('nix-meson-build-support/deps-lists') -configdata = configuration_data() +configdata_pub = configuration_data() +configdata_priv = configuration_data() deps_private_maybe_subproject = [ ] @@ -26,6 +27,16 @@ deps_public_maybe_subproject = [ subdir('nix-meson-build-support/subprojects') subdir('nix-meson-build-support/big-objs') +# Check for each of these functions, and create a define like `#define HAVE_LCHOWN 1`. +check_funcs = [ + 'sysconf', +] +foreach funcspec : check_funcs + define_name = 'HAVE_' + funcspec.underscorify().to_upper() + define_value = cxx.has_function(funcspec).to_int() + configdata_priv.set(define_name, define_value) +endforeach + boost = dependency( 'boost', modules : ['container', 'context'], @@ -47,11 +58,13 @@ if bdw_gc.found() ] define_name = 'HAVE_' + funcspec.underscorify().to_upper() define_value = cxx.has_function(funcspec).to_int() - configdata.set(define_name, define_value) + configdata_priv.set(define_name, define_value) endforeach - configdata.set('GC_THREADS', 1) + # Affects ABI, because it changes what bdw_gc itself does! + configdata_pub.set('GC_THREADS', 1) endif -configdata.set('HAVE_BOEHMGC', bdw_gc.found().to_int()) +# Used in public header. Affects ABI! +configdata_pub.set('NIX_USE_BOEHMGC', bdw_gc.found().to_int()) toml11 = dependency( 'toml11', @@ -61,14 +74,9 @@ toml11 = dependency( ) deps_other += toml11 -add_project_arguments( - # TODO(Qyriad): Yes this is how the autoconf+Make system did it. - # It would be nice for our headers to be idempotent instead. - '-include', 'nix/config-util.hh', - '-include', 'nix/config-store.hh', - # '-include', 'nix_api_fetchers_config.h', - '-include', 'nix/config-expr.hh', - language : 'cpp', +config_priv_h = configure_file( + configuration : configdata_priv, + output : 'expr-config-private.hh', ) subdir('nix-meson-build-support/common') @@ -158,6 +166,7 @@ subdir('nix-meson-build-support/windows-version') this_library = library( 'nixexpr', sources, + config_priv_h, parser_tab, lexer_tab, generated_headers, diff --git a/src/libfetchers-tests/meson.build b/src/libfetchers-tests/meson.build index 80f99c859..12b748e65 100644 --- a/src/libfetchers-tests/meson.build +++ b/src/libfetchers-tests/meson.build @@ -34,15 +34,6 @@ deps_private += gtest libgit2 = dependency('libgit2') deps_private += libgit2 -add_project_arguments( - # TODO(Qyriad): Yes this is how the autoconf+Make system did it. - # It would be nice for our headers to be idempotent instead. - '-include', 'nix/config-util.hh', - '-include', 'nix/config-store.hh', - # '-include', 'nix_api_fetchers_config.h', - language : 'cpp', -) - subdir('nix-meson-build-support/common') sources = files( diff --git a/src/libfetchers/meson.build b/src/libfetchers/meson.build index aaf52ff74..14a2647d5 100644 --- a/src/libfetchers/meson.build +++ b/src/libfetchers/meson.build @@ -30,15 +30,6 @@ deps_public += nlohmann_json libgit2 = dependency('libgit2') deps_private += libgit2 -add_project_arguments( - # TODO(Qyriad): Yes this is how the autoconf+Make system did it. - # It would be nice for our headers to be idempotent instead. - '-include', 'nix/config-util.hh', - '-include', 'nix/config-store.hh', - # '-include', 'nix_api_fetchers_config.h', - language : 'cpp', -) - subdir('nix-meson-build-support/common') sources = files( diff --git a/src/libflake-c/meson.build b/src/libflake-c/meson.build index ec754dfaa..fd3cdd01b 100644 --- a/src/libflake-c/meson.build +++ b/src/libflake-c/meson.build @@ -27,20 +27,6 @@ deps_public_maybe_subproject = [ ] subdir('nix-meson-build-support/subprojects') -add_project_arguments( - # TODO(Qyriad): Yes this is how the autoconf+Make system did it. - # It would be nice for our headers to be idempotent instead. - - # From C++ libraries, only for internals - '-include', 'nix/config-util.hh', - '-include', 'nix/config-store.hh', - '-include', 'nix/config-expr.hh', - # not generated (yet?) - # '-include', 'nix/config-flake.hh', - - language : 'cpp', -) - subdir('nix-meson-build-support/common') sources = files( diff --git a/src/libflake-tests/meson.build b/src/libflake-tests/meson.build index 4012582f2..593b0e18d 100644 --- a/src/libflake-tests/meson.build +++ b/src/libflake-tests/meson.build @@ -32,15 +32,6 @@ deps_private += rapidcheck gtest = dependency('gtest', main : true) deps_private += gtest -add_project_arguments( - # TODO(Qyriad): Yes this is how the autoconf+Make system did it. - # It would be nice for our headers to be idempotent instead. - '-include', 'nix/config-util.hh', - '-include', 'nix/config-store.hh', - '-include', 'nix/config-expr.hh', - language : 'cpp', -) - subdir('nix-meson-build-support/common') sources = files( diff --git a/src/libflake/meson.build b/src/libflake/meson.build index e231de9c1..de880c28d 100644 --- a/src/libflake/meson.build +++ b/src/libflake/meson.build @@ -27,16 +27,6 @@ subdir('nix-meson-build-support/subprojects') nlohmann_json = dependency('nlohmann_json', version : '>= 3.9') deps_public += nlohmann_json -add_project_arguments( - # TODO(Qyriad): Yes this is how the autoconf+Make system did it. - # It would be nice for our headers to be idempotent instead. - '-include', 'nix/config-util.hh', - '-include', 'nix/config-store.hh', - # '-include', 'nix_api_fetchers_config.h', - '-include', 'nix/config-expr.hh', - language : 'cpp', -) - subdir('nix-meson-build-support/common') subdir('nix-meson-build-support/generate-header') diff --git a/src/libmain-c/meson.build b/src/libmain-c/meson.build index 0229ef86b..e420520e6 100644 --- a/src/libmain-c/meson.build +++ b/src/libmain-c/meson.build @@ -25,17 +25,6 @@ deps_public_maybe_subproject = [ ] subdir('nix-meson-build-support/subprojects') -add_project_arguments( - # TODO(Qyriad): Yes this is how the autoconf+Make system did it. - # It would be nice for our headers to be idempotent instead. - - # From C++ libraries, only for internals - '-include', 'nix/config-util.hh', - '-include', 'nix/config-store.hh', - - language : 'cpp', -) - subdir('nix-meson-build-support/common') sources = files( diff --git a/src/libmain/include/nix/meson.build b/src/libmain/include/nix/meson.build index 8584b9042..e29981d3f 100644 --- a/src/libmain/include/nix/meson.build +++ b/src/libmain/include/nix/meson.build @@ -2,12 +2,7 @@ include_dirs = [include_directories('..')] -config_h = configure_file( - configuration : configdata, - output : 'config-main.hh', -) - -headers = [config_h] + files( +headers = files( 'common-args.hh', 'loggers.hh', 'plugin.hh', diff --git a/src/libmain/meson.build b/src/libmain/meson.build index 08b0bdb4f..f7ff93b66 100644 --- a/src/libmain/meson.build +++ b/src/libmain/meson.build @@ -42,13 +42,9 @@ configdata.set( description: 'Optionally used for buffering on standard error' ) -add_project_arguments( - # TODO(Qyriad): Yes this is how the autoconf+Make system did it. - # It would be nice for our headers to be idempotent instead. - '-include', 'nix/config-util.hh', - '-include', 'nix/config-store.hh', - '-include', 'nix/config-main.hh', - language : 'cpp', +config_priv_h = configure_file( + configuration : configdata, + output : 'main-config-private.hh', ) subdir('nix-meson-build-support/common') @@ -75,7 +71,7 @@ subdir('nix-meson-build-support/windows-version') this_library = library( 'nixmain', sources, - config_h, + config_priv_h, dependencies : deps_public + deps_private + deps_other, include_directories : include_dirs, link_args: linker_export_flags, diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc index 639977efc..0643e20ed 100644 --- a/src/libmain/shared.cc +++ b/src/libmain/shared.cc @@ -25,6 +25,8 @@ #include "nix/exit.hh" #include "nix/strings.hh" +#include "main-config-private.hh" + namespace nix { char * * savedArgv; @@ -297,7 +299,7 @@ void printVersion(const std::string & programName) std::cout << fmt("%1% (Nix) %2%", programName, nixVersion) << std::endl; if (verbosity > lvlInfo) { Strings cfg; -#if HAVE_BOEHMGC +#if NIX_USE_BOEHMGC cfg.push_back("gc"); #endif cfg.push_back("signed-caches"); diff --git a/src/libstore-c/meson.build b/src/libstore-c/meson.build index f7e192f3a..eb5563161 100644 --- a/src/libstore-c/meson.build +++ b/src/libstore-c/meson.build @@ -23,17 +23,6 @@ deps_public_maybe_subproject = [ ] subdir('nix-meson-build-support/subprojects') -add_project_arguments( - # TODO(Qyriad): Yes this is how the autoconf+Make system did it. - # It would be nice for our headers to be idempotent instead. - - # From C++ libraries, only for internals - '-include', 'nix/config-util.hh', - '-include', 'nix/config-store.hh', - - language : 'cpp', -) - subdir('nix-meson-build-support/common') sources = files( diff --git a/src/libstore-test-support/meson.build b/src/libstore-test-support/meson.build index c7d9689bf..a1f6777e4 100644 --- a/src/libstore-test-support/meson.build +++ b/src/libstore-test-support/meson.build @@ -27,14 +27,6 @@ subdir('nix-meson-build-support/subprojects') rapidcheck = dependency('rapidcheck') deps_public += rapidcheck -add_project_arguments( - # TODO(Qyriad): Yes this is how the autoconf+Make system did it. - # It would be nice for our headers to be idempotent instead. - '-include', 'nix/config-util.hh', - '-include', 'nix/config-store.hh', - language : 'cpp', -) - subdir('nix-meson-build-support/common') sources = files( diff --git a/src/libstore-tests/meson.build b/src/libstore-tests/meson.build index 0dcfeaacd..1822a3520 100644 --- a/src/libstore-tests/meson.build +++ b/src/libstore-tests/meson.build @@ -37,17 +37,17 @@ deps_private += rapidcheck gtest = dependency('gtest', main : true) deps_private += gtest +configdata = configuration_data() +configdata.set_quoted('PACKAGE_VERSION', meson.project_version()) + +config_priv_h = configure_file( + configuration : configdata, + output : 'store-tests-config.hh', +) + gtest = dependency('gmock') deps_private += gtest -add_project_arguments( - # TODO(Qyriad): Yes this is how the autoconf+Make system did it. - # It would be nice for our headers to be idempotent instead. - '-include', 'nix/config-util.hh', - '-include', 'nix/config-store.hh', - language : 'cpp', -) - subdir('nix-meson-build-support/common') sources = files( @@ -84,6 +84,7 @@ include_dirs = [include_directories('.')] this_exe = executable( meson.project_name(), sources, + config_priv_h, dependencies : deps_private_subproject + deps_private + deps_other, include_directories : include_dirs, # TODO: -lrapidcheck, see ../libutil-support/build.meson diff --git a/src/libstore-tests/nix_api_store.cc b/src/libstore-tests/nix_api_store.cc index b7d9860fb..293547c95 100644 --- a/src/libstore-tests/nix_api_store.cc +++ b/src/libstore-tests/nix_api_store.cc @@ -6,6 +6,8 @@ #include "nix/tests/nix_api_store.hh" #include "nix/tests/string_callback.hh" +#include "store-tests-config.hh" + namespace nixC { std::string PATH_SUFFIX = "/g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-name"; diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc index 81294a5b9..43b5c7891 100644 --- a/src/libstore/gc.cc +++ b/src/libstore/gc.cc @@ -6,6 +6,8 @@ #include "nix/signals.hh" #include "nix/posix-fs-canonicalise.hh" +#include "store-config-private.hh" + #if !defined(__linux__) // For shelling out to lsof # include "nix/processes.hh" diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc index 4f8c53ca8..70feaf311 100644 --- a/src/libstore/globals.cc +++ b/src/libstore/globals.cc @@ -6,6 +6,7 @@ #include "nix/abstract-setting-to-json.hh" #include "nix/compute-levels.hh" #include "nix/signals.hh" +#include "nix/strings.hh" #include #include @@ -35,7 +36,8 @@ #include #endif -#include "nix/strings.hh" +#include "store-config-private.hh" + namespace nix { @@ -202,7 +204,7 @@ StringSet Settings::getDefaultExtraPlatforms() { StringSet extraPlatforms; - if (std::string{SYSTEM} == "x86_64-linux" && !isWSL1()) + if (std::string{NIX_LOCAL_SYSTEM} == "x86_64-linux" && !isWSL1()) extraPlatforms.insert("i686-linux"); #if __linux__ @@ -214,7 +216,7 @@ StringSet Settings::getDefaultExtraPlatforms() // machines. Note that we can’t force processes from executing // x86_64 in aarch64 environments or vice versa since they can // always exec with their own binary preferences. - if (std::string{SYSTEM} == "aarch64-darwin" && + if (std::string{NIX_LOCAL_SYSTEM} == "aarch64-darwin" && runProgram(RunOptions {.program = "arch", .args = {"-arch", "x86_64", "/usr/bin/true"}, .mergeStderrToStdout = true}).first == 0) extraPlatforms.insert("x86_64-darwin"); #endif diff --git a/src/libstore/include/nix/globals.hh b/src/libstore/include/nix/globals.hh index bda883890..1630c0ae7 100644 --- a/src/libstore/include/nix/globals.hh +++ b/src/libstore/include/nix/globals.hh @@ -1,16 +1,18 @@ #pragma once ///@file +#include +#include + +#include + #include "nix/types.hh" #include "nix/config.hh" #include "nix/environment-variables.hh" #include "nix/experimental-features.hh" #include "nix/users.hh" -#include -#include - -#include +#include "nix/store-config.hh" namespace nix { @@ -181,7 +183,7 @@ public: bool readOnlyMode = false; Setting thisSystem{ - this, SYSTEM, "system", + this, NIX_LOCAL_SYSTEM, "system", R"( The system type of the current Nix installation. Nix will only build a given [store derivation](@docroot@/glossary.md#gloss-store-derivation) locally when its `system` attribute equals any of the values specified here or in [`extra-platforms`](#conf-extra-platforms). @@ -1089,7 +1091,7 @@ public: )"}; #endif -#if HAVE_ACL_SUPPORT +#if NIX_SUPPORT_ACL Setting ignoredAcls{ this, {"security.selinux", "system.nfs4_acl", "security.csm"}, "ignored-acls", R"( diff --git a/src/libstore/include/nix/meson.build b/src/libstore/include/nix/meson.build index 85ea75685..d29efe50e 100644 --- a/src/libstore/include/nix/meson.build +++ b/src/libstore/include/nix/meson.build @@ -4,12 +4,12 @@ include_dirs = [ include_directories('..'), ] -config_h = configure_file( - configuration : configdata, - output : 'config-store.hh', +config_pub_h = configure_file( + configuration : configdata_pub, + output : 'store-config.hh', ) -headers = [config_h] + files( +headers = [config_pub_h] + files( 'binary-cache-store.hh', 'build-result.hh', 'build/derivation-goal.hh', diff --git a/src/libstore/linux/include/nix/fchmodat2-compat.hh b/src/libstore/linux/include/nix/fchmodat2-compat.hh index fd03b9ed5..42b3f3a35 100644 --- a/src/libstore/linux/include/nix/fchmodat2-compat.hh +++ b/src/libstore/linux/include/nix/fchmodat2-compat.hh @@ -1,3 +1,5 @@ +#include "store-config-private.hh" + /* * Determine the syscall number for `fchmodat2`. * diff --git a/src/libstore/linux/personality.cc b/src/libstore/linux/personality.cc index bbff765de..452bd3e4b 100644 --- a/src/libstore/linux/personality.cc +++ b/src/libstore/linux/personality.cc @@ -15,7 +15,7 @@ void setPersonality(std::string_view system) struct utsname utsbuf; uname(&utsbuf); if ((system == "i686-linux" - && (std::string_view(SYSTEM) == "x86_64-linux" + && (std::string_view(NIX_LOCAL_SYSTEM) == "x86_64-linux" || (!strcmp(utsbuf.sysname, "Linux") && !strcmp(utsbuf.machine, "x86_64")))) || system == "armv7l-linux" || system == "armv6l-linux" diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index cf6644804..7d4f8e5c7 100644 --- a/src/libstore/local-store.cc +++ b/src/libstore/local-store.cc @@ -54,6 +54,8 @@ #include "nix/strings.hh" +#include "store-config-private.hh" + namespace nix { diff --git a/src/libstore/meson.build b/src/libstore/meson.build index dd6d7b404..b558c3bc9 100644 --- a/src/libstore/meson.build +++ b/src/libstore/meson.build @@ -15,12 +15,20 @@ cxx = meson.get_compiler('cpp') subdir('nix-meson-build-support/deps-lists') -configdata = configuration_data() +configdata_pub = configuration_data() +configdata_priv = configuration_data() # TODO rename, because it will conflict with downstream projects -configdata.set_quoted('PACKAGE_VERSION', meson.project_version()) +configdata_priv.set_quoted('PACKAGE_VERSION', meson.project_version()) -configdata.set_quoted('SYSTEM', host_machine.cpu_family() + '-' + host_machine.system()) +# Used in public header. +configdata_pub.set_quoted( + 'NIX_LOCAL_SYSTEM', + host_machine.cpu_family() + '-' + host_machine.system(), + description : + 'This is the system name Nix expects for local running instance of Nix.\n\n' + + 'See the "system" setting for additional details', +) deps_private_maybe_subproject = [ ] @@ -47,28 +55,30 @@ run_command('rm', '-f', check : true, ) summary('can hardlink to symlink', can_link_symlink, bool_yn : true) -configdata.set('CAN_LINK_SYMLINK', can_link_symlink.to_int()) +configdata_priv.set('CAN_LINK_SYMLINK', can_link_symlink.to_int()) # Check for each of these functions, and create a define like `#define HAVE_LCHOWN 1`. -# -# Only need to do functions that deps (like `libnixutil`) didn't already -# check for. check_funcs = [ # Optionally used for canonicalising files from the build 'lchown', + 'posix_fallocate', 'statvfs', ] foreach funcspec : check_funcs define_name = 'HAVE_' + funcspec.underscorify().to_upper() define_value = cxx.has_function(funcspec).to_int() - configdata.set(define_name, define_value) + configdata_priv.set(define_name, define_value) endforeach has_acl_support = cxx.has_header('sys/xattr.h') \ and cxx.has_function('llistxattr') \ and cxx.has_function('lremovexattr') -# TODO: used in header - make proper public header and make sure it's included. Affects ABI! -configdata.set('HAVE_ACL_SUPPORT', has_acl_support.to_int()) +# Used in public header. Affects ABI! +configdata_pub.set( + 'NIX_SUPPORT_ACL', + has_acl_support.to_int(), + description : 'FIXME: It\'s a bit peculiar that this needs to be exposed. The reason is that that it effects whether the settings struct in a header has a particular field. This is also odd, because it means when there is no ACL support one will just get an "unknown setting" warning from their configuration.', +) if host_machine.system() == 'darwin' sandbox = cxx.find_library('sandbox') @@ -104,7 +114,7 @@ seccomp = dependency('libseccomp', 'seccomp', required : seccomp_required, versi if is_linux and not seccomp.found() warning('Sandbox security is reduced because libseccomp has not been found! Please provide libseccomp if it supports your CPU architecture.') endif -configdata.set('HAVE_SECCOMP', seccomp.found().to_int()) +configdata_priv.set('HAVE_SECCOMP', seccomp.found().to_int()) deps_private += seccomp nlohmann_json = dependency('nlohmann_json', version : '>= 3.9') @@ -116,7 +126,7 @@ deps_private += sqlite # 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()) +configdata_priv.set('ENABLE_S3', aws_s3.found().to_int()) if aws_s3.found() aws_s3 = declare_dependency( include_directories: include_directories(aws_s3.get_variable('includedir')), @@ -148,7 +158,7 @@ if get_option('embedded-sandbox-shell') # The path to busybox is passed as a -D flag when compiling this_library. # This solution is inherited from the old make buildsystem # TODO: do this differently? - configdata.set('HAVE_EMBEDDED_SANDBOX_SHELL', 1) + configdata_priv.set('HAVE_EMBEDDED_SANDBOX_SHELL', 1) hexdump = find_program('hexdump', native : true) embedded_sandbox_shell_gen = custom_target( 'embedded-sandbox-shell.gen.hh', @@ -166,12 +176,9 @@ if get_option('embedded-sandbox-shell') generated_headers += embedded_sandbox_shell_gen endif -add_project_arguments( - # TODO(Qyriad): Yes this is how the autoconf+Make system did it. - # It would be nice for our headers to be idempotent instead. - '-include', 'nix/config-util.hh', - '-include', 'nix/config-store.hh', - language : 'cpp', +config_priv_h = configure_file( + configuration : configdata_priv, + output : 'store-config-private.hh', ) subdir('nix-meson-build-support/common') @@ -346,6 +353,7 @@ this_library = library( 'nixstore', generated_headers, sources, + config_priv_h, dependencies : deps_public + deps_private + deps_other, include_directories : include_dirs, cpp_args : cpp_args, diff --git a/src/libstore/posix-fs-canonicalise.cc b/src/libstore/posix-fs-canonicalise.cc index 5fddae42f..c1b451324 100644 --- a/src/libstore/posix-fs-canonicalise.cc +++ b/src/libstore/posix-fs-canonicalise.cc @@ -1,13 +1,16 @@ -#if HAVE_ACL_SUPPORT -# include -#endif - #include "nix/posix-fs-canonicalise.hh" #include "nix/file-system.hh" #include "nix/signals.hh" #include "nix/util.hh" #include "nix/globals.hh" #include "nix/store-api.hh" +#include "nix/store-config.hh" + +#include "store-config-private.hh" + +#if NIX_SUPPORT_ACL +# include +#endif namespace nix { @@ -72,7 +75,7 @@ static void canonicalisePathMetaData_( if (!(S_ISREG(st.st_mode) || S_ISDIR(st.st_mode) || S_ISLNK(st.st_mode))) throw Error("file '%1%' has an unsupported type", path); -#if HAVE_ACL_SUPPORT +#if NIX_SUPPORT_ACL /* Remove extended attributes / ACLs. */ ssize_t eaSize = llistxattr(path.c_str(), nullptr, 0); diff --git a/src/libstore/unix/build/local-derivation-goal.cc b/src/libstore/unix/build/local-derivation-goal.cc index 74186242b..afffe8e71 100644 --- a/src/libstore/unix/build/local-derivation-goal.cc +++ b/src/libstore/unix/build/local-derivation-goal.cc @@ -19,6 +19,7 @@ #include "nix/unix-domain-socket.hh" #include "nix/posix-fs-canonicalise.hh" #include "nix/posix-source-accessor.hh" +#include "nix/store-config.hh" #include #include @@ -31,6 +32,8 @@ #include #include +#include "store-config-private.hh" + #if HAVE_STATVFS #include #endif @@ -1701,7 +1704,7 @@ void setupSeccomp() seccomp_release(ctx); }); - constexpr std::string_view nativeSystem = SYSTEM; + constexpr std::string_view nativeSystem = NIX_LOCAL_SYSTEM; if (nativeSystem == "x86_64-linux" && seccomp_arch_add(ctx, SCMP_ARCH_X86) != 0) diff --git a/src/libutil-c/meson.build b/src/libutil-c/meson.build index cd53bc585..3414a6d31 100644 --- a/src/libutil-c/meson.build +++ b/src/libutil-c/meson.build @@ -25,21 +25,11 @@ subdir('nix-meson-build-support/subprojects') configdata.set_quoted('PACKAGE_VERSION', meson.project_version()) -config_h = configure_file( +config_priv_h = configure_file( configuration : configdata, output : 'nix_api_util_config.h', ) -add_project_arguments( - # TODO(Qyriad): Yes this is how the autoconf+Make system did it. - # It would be nice for our headers to be idempotent instead. - - # From C++ libraries, only for internals - '-include', 'nix/config-util.hh', - - language : 'cpp', -) - subdir('nix-meson-build-support/common') sources = files( @@ -61,7 +51,7 @@ subdir('nix-meson-build-support/windows-version') this_library = library( 'nixutilc', sources, - config_h, + config_priv_h, dependencies : deps_public + deps_private + deps_other, include_directories : include_dirs, link_args: linker_export_flags, diff --git a/src/libutil-test-support/meson.build b/src/libutil-test-support/meson.build index f235af9eb..265bdc249 100644 --- a/src/libutil-test-support/meson.build +++ b/src/libutil-test-support/meson.build @@ -25,13 +25,6 @@ subdir('nix-meson-build-support/subprojects') rapidcheck = dependency('rapidcheck') deps_public += rapidcheck -add_project_arguments( - # TODO(Qyriad): Yes this is how the autoconf+Make system did it. - # It would be nice for our headers to be idempotent instead. - '-include', 'nix/config-util.hh', - language : 'cpp', -) - subdir('nix-meson-build-support/common') sources = files( diff --git a/src/libutil-tests/meson.build b/src/libutil-tests/meson.build index f982d6cf6..8f9c18eed 100644 --- a/src/libutil-tests/meson.build +++ b/src/libutil-tests/meson.build @@ -35,14 +35,9 @@ deps_private += gtest configdata = configuration_data() configdata.set_quoted('PACKAGE_VERSION', meson.project_version()) -config_h = configure_file( +config_priv_h = configure_file( configuration : configdata, - output : 'config-util-tests.hh', -) - -add_project_arguments( - '-include', 'config-util-tests.hh', - language : 'cpp', + output : 'util-tests-config.hh', ) subdir('nix-meson-build-support/common') @@ -84,7 +79,7 @@ include_dirs = [include_directories('.')] this_exe = executable( meson.project_name(), sources, - config_h, + config_priv_h, dependencies : deps_private_subproject + deps_private + deps_other, include_directories : include_dirs, # TODO: -lrapidcheck, see ../libutil-support/build.meson diff --git a/src/libutil-tests/nix_api_util.cc b/src/libutil-tests/nix_api_util.cc index f768de011..f2d198aac 100644 --- a/src/libutil-tests/nix_api_util.cc +++ b/src/libutil-tests/nix_api_util.cc @@ -9,6 +9,8 @@ #include +#include "util-tests-config.hh" + namespace nixC { TEST_F(nix_api_util_context, nix_context_error) diff --git a/src/libutil/compute-levels.cc b/src/libutil/compute-levels.cc index 8cc3def18..2e3c84404 100644 --- a/src/libutil/compute-levels.cc +++ b/src/libutil/compute-levels.cc @@ -1,5 +1,7 @@ #include "nix/types.hh" +#include "util-config-private.hh" + #if HAVE_LIBCPUID #include #endif diff --git a/src/libutil/file-system.cc b/src/libutil/file-system.cc index 6a63e0242..8a309d120 100644 --- a/src/libutil/file-system.cc +++ b/src/libutil/file-system.cc @@ -27,6 +27,8 @@ #include "nix/strings-inline.hh" +#include "util-config-private.hh" + namespace nix { namespace fs { using namespace std::filesystem; } @@ -630,62 +632,6 @@ void replaceSymlink(const fs::path & target, const fs::path & link) } } -void setWriteTime( - const fs::path & path, - time_t accessedTime, - time_t modificationTime, - std::optional optIsSymlink) -{ -#ifdef _WIN32 - // FIXME use `fs::last_write_time`. - // - // Would be nice to use std::filesystem unconditionally, but - // doesn't support access time just modification time. - // - // System clock vs File clock issues also make that annoying. - warn("Changing file times is not yet implemented on Windows, path is %s", path); -#elif HAVE_UTIMENSAT && HAVE_DECL_AT_SYMLINK_NOFOLLOW - struct timespec times[2] = { - { - .tv_sec = accessedTime, - .tv_nsec = 0, - }, - { - .tv_sec = modificationTime, - .tv_nsec = 0, - }, - }; - if (utimensat(AT_FDCWD, path.c_str(), times, AT_SYMLINK_NOFOLLOW) == -1) - throw SysError("changing modification time of %s (using `utimensat`)", path); -#else - struct timeval times[2] = { - { - .tv_sec = accessedTime, - .tv_usec = 0, - }, - { - .tv_sec = modificationTime, - .tv_usec = 0, - }, - }; -#if HAVE_LUTIMES - if (lutimes(path.c_str(), times) == -1) - throw SysError("changing modification time of %s", path); -#else - bool isSymlink = optIsSymlink - ? *optIsSymlink - : fs::is_symlink(path); - - if (!isSymlink) { - if (utimes(path.c_str(), times) == -1) - throw SysError("changing modification time of %s (not a symlink)", path); - } else { - throw Error("Cannot change modification time of symlink %s", path); - } -#endif -#endif -} - void setWriteTime(const fs::path & path, const struct stat & st) { setWriteTime(path, st.st_atime, st.st_mtime, S_ISLNK(st.st_mode)); diff --git a/src/libutil/fs-sink.cc b/src/libutil/fs-sink.cc index 5e7c2e9fd..7b8ba1189 100644 --- a/src/libutil/fs-sink.cc +++ b/src/libutil/fs-sink.cc @@ -10,6 +10,8 @@ # include "nix/windows-error.hh" #endif +#include "util-config-private.hh" + namespace nix { void copyRecursive( diff --git a/src/libutil/include/nix/meson.build b/src/libutil/include/nix/meson.build index 798d49828..3da9837ed 100644 --- a/src/libutil/include/nix/meson.build +++ b/src/libutil/include/nix/meson.build @@ -2,12 +2,7 @@ include_dirs = [include_directories('..')] -config_h = configure_file( - configuration : configdata, - output : 'config-util.hh', -) - -headers = [config_h] + files( +headers = files( 'abstract-setting-to-json.hh', 'ansicolor.hh', 'archive.hh', diff --git a/src/libutil/meson.build b/src/libutil/meson.build index e34bce0d5..c7509f030 100644 --- a/src/libutil/meson.build +++ b/src/libutil/meson.build @@ -23,36 +23,20 @@ deps_public_maybe_subproject = [ subdir('nix-meson-build-support/subprojects') # Check for each of these functions, and create a define like `#define -# HAVE_LUTIMES 1`. The `#define` is unconditional, 0 for not found and 1 -# for found. One therefore uses it with `#if` not `#ifdef`. +# HAVE_POSIX_FALLOCATE 1`. The `#define` is unconditional, 0 for not +# found and 1 for found. One therefore uses it with `#if` not `#ifdef`. check_funcs = [ - 'close_range', - # Optionally used for changing the mtime of symlinks. - 'lutimes', - # Optionally used for creating pipes on Unix - 'pipe2', - # Optionally used to preallocate files to be large enough before - # writing to them. - # WARNING: define also used in libstore - 'posix_fallocate', - # Optionally used to get more information about processes failing due - # to a signal on Unix. - 'strsignal', - # Optionally used to try to close more file descriptors (e.g. before - # forking) on Unix. - # WARNING: also used in libexpr - 'sysconf', - # Optionally used for changing the mtime of files and symlinks. - 'utimensat', + [ + 'posix_fallocate', + 'Optionally used to preallocate files to be large enough before writing to them.', + ], ] foreach funcspec : check_funcs - define_name = 'HAVE_' + funcspec.underscorify().to_upper() - define_value = cxx.has_function(funcspec).to_int() - configdata.set(define_name, define_value) + define_name = 'HAVE_' + funcspec[0].underscorify().to_upper() + define_value = cxx.has_function(funcspec[0]).to_int() + configdata.set(define_name, define_value, description: funcspec[1]) endforeach -configdata.set('HAVE_DECL_AT_SYMLINK_NOFOLLOW', cxx.has_header_symbol('fcntl.h', 'AT_SYMLINK_NOFOLLOW').to_int()) - subdir('nix-meson-build-support/libatomic') if host_machine.system() == 'windows' @@ -116,16 +100,14 @@ deps_public += nlohmann_json cxx = meson.get_compiler('cpp') -add_project_arguments( - # TODO(Qyriad): Yes this is how the autoconf+Make system did it. - # It would be nice for our headers to be idempotent instead. - '-include', 'nix/config-util.hh', - language : 'cpp', +config_priv_h = configure_file( + configuration : configdata, + output : 'util-config-private.hh', ) subdir('nix-meson-build-support/common') -sources = files( +sources = [config_priv_h] + files( 'archive.cc', 'args.cc', 'canon-path.cc', diff --git a/src/libutil/unix/file-descriptor.cc b/src/libutil/unix/file-descriptor.cc index 566675349..2911df54f 100644 --- a/src/libutil/unix/file-descriptor.cc +++ b/src/libutil/unix/file-descriptor.cc @@ -7,6 +7,9 @@ #include #include +#include "util-config-private.hh" +#include "util-unix-config-private.hh" + namespace nix { namespace { diff --git a/src/libutil/unix/file-system.cc b/src/libutil/unix/file-system.cc index 119e8a277..d79f4c64c 100644 --- a/src/libutil/unix/file-system.cc +++ b/src/libutil/unix/file-system.cc @@ -1,10 +1,72 @@ +#include +#include +#include +#include + +#include +#include +#include +#include + #include "nix/file-system.hh" +#include "util-unix-config-private.hh" + namespace nix { +namespace fs { +using namespace std::filesystem; +} + Descriptor openDirectory(const std::filesystem::path & path) { return open(path.c_str(), O_RDONLY | O_DIRECTORY); } +void setWriteTime(const fs::path & path, time_t accessedTime, time_t modificationTime, std::optional optIsSymlink) +{ + // Would be nice to use std::filesystem unconditionally, but + // doesn't support access time just modification time. + // + // System clock vs File clock issues also make that annoying. +#if HAVE_UTIMENSAT && HAVE_DECL_AT_SYMLINK_NOFOLLOW + struct timespec times[2] = { + { + .tv_sec = accessedTime, + .tv_nsec = 0, + }, + { + .tv_sec = modificationTime, + .tv_nsec = 0, + }, + }; + if (utimensat(AT_FDCWD, path.c_str(), times, AT_SYMLINK_NOFOLLOW) == -1) + throw SysError("changing modification time of %s (using `utimensat`)", path); +#else + struct timeval times[2] = { + { + .tv_sec = accessedTime, + .tv_usec = 0, + }, + { + .tv_sec = modificationTime, + .tv_usec = 0, + }, + }; +# if HAVE_LUTIMES + if (lutimes(path.c_str(), times) == -1) + throw SysError("changing modification time of %s", path); +# else + bool isSymlink = optIsSymlink ? *optIsSymlink : fs::is_symlink(path); + + if (!isSymlink) { + if (utimes(path.c_str(), times) == -1) + throw SysError("changing modification time of %s (not a symlink)", path); + } else { + throw Error("Cannot change modification time of symlink %s", path); + } +# endif +#endif +} + } diff --git a/src/libutil/unix/meson.build b/src/libutil/unix/meson.build index 1373ed17a..ee0c19aff 100644 --- a/src/libutil/unix/meson.build +++ b/src/libutil/unix/meson.build @@ -1,3 +1,53 @@ +include_dirs += include_directories('.') + +configdata_unix = configuration_data() + +configdata_unix.set( + 'HAVE_DECL_AT_SYMLINK_NOFOLLOW', + cxx.has_header_symbol('fcntl.h', 'AT_SYMLINK_NOFOLLOW').to_int(), + description : 'Optionally used for changing the files and symlinks.' +) + +# Check for each of these functions, and create a define like `#define +# HAVE_CLOSE_RANGE 1`. +check_funcs_unix = [ + [ + 'close_range', + 'For closing many file descriptors after forking.', + ], + [ + 'lutimes', + 'Optionally used for changing the mtime of symlinks.', + ], + [ + 'pipe2', + 'Optionally used for creating pipes on Unix.', + ], + [ + 'strsignal', + 'Optionally used to get more information about processes failing due to a signal on Unix.', + ], + [ + 'sysconf', + 'Optionally used to try to close more file descriptors (e.g. before forking) on Unix.', + ], + [ + 'utimensat', + 'Optionally used for changing the mtime of files and symlinks.', + ], +] +foreach funcspec : check_funcs_unix + define_name = 'HAVE_' + funcspec[0].underscorify().to_upper() + define_value = cxx.has_function(funcspec[0]).to_int() + configdata_unix.set(define_name, define_value, description: funcspec[1]) +endforeach + +config_unix_priv_h = configure_file( + configuration : configdata_unix, + output : 'util-unix-config-private.hh', +) +sources += config_unix_priv_h + sources += files( 'environment-variables.cc', 'file-descriptor.cc', diff --git a/src/libutil/unix/processes.cc b/src/libutil/unix/processes.cc index 032992a2f..06beacb87 100644 --- a/src/libutil/unix/processes.cc +++ b/src/libutil/unix/processes.cc @@ -28,6 +28,9 @@ # include #endif +#include "util-config-private.hh" +#include "util-unix-config-private.hh" + namespace nix { diff --git a/src/libutil/windows/file-system.cc b/src/libutil/windows/file-system.cc index 22f1f89ab..3c2a57bcd 100644 --- a/src/libutil/windows/file-system.cc +++ b/src/libutil/windows/file-system.cc @@ -3,6 +3,21 @@ #ifdef _WIN32 namespace nix { +namespace fs { +using namespace std::filesystem; +} + +void setWriteTime(const fs::path & path, time_t accessedTime, time_t modificationTime, std::optional optIsSymlink) +{ + // FIXME use `fs::last_write_time`. + // + // Would be nice to use std::filesystem unconditionally, but + // doesn't support access time just modification time. + // + // System clock vs File clock issues also make that annoying. + warn("Changing file times is not yet implemented on Windows, path is %s", path); +} + Descriptor openDirectory(const std::filesystem::path & path) { return CreateFileW( diff --git a/src/nix/main.cc b/src/nix/main.cc index 3d57263df..330cafce6 100644 --- a/src/nix/main.cc +++ b/src/nix/main.cc @@ -23,6 +23,7 @@ #include "self-exe.hh" #include "crash-handler.hh" +#include "cli-config-private.hh" #include #include diff --git a/src/nix/meson.build b/src/nix/meson.build index adcf80a25..b258778cc 100644 --- a/src/nix/meson.build +++ b/src/nix/meson.build @@ -46,25 +46,15 @@ if not fs.is_absolute(bindir) endif configdata.set_quoted('NIX_BIN_DIR', bindir) -config_h = configure_file( +config_priv_h = configure_file( configuration : configdata, - output : 'config-nix-cli.hh', -) - -add_project_arguments( - # TODO(Qyriad): Yes this is how the autoconf+Make system did it. - # It would be nice for our headers to be idempotent instead. - '-include', 'nix/config-util.hh', - '-include', 'nix/config-store.hh', - '-include', 'nix/config-expr.hh', - '-include', 'config-nix-cli.hh', - language : 'cpp', + output : 'cli-config-private.hh', ) subdir('nix-meson-build-support/common') subdir('nix-meson-build-support/generate-header') -nix_sources = [config_h] + files( +nix_sources = [config_priv_h] + files( 'add-to-store.cc', 'app.cc', 'self-exe.cc', diff --git a/src/nix/self-exe.cc b/src/nix/self-exe.cc index c9ab566ce..f9439dfd9 100644 --- a/src/nix/self-exe.cc +++ b/src/nix/self-exe.cc @@ -1,7 +1,9 @@ #include "nix/current-process.hh" #include "nix/file-system.hh" #include "nix/globals.hh" + #include "self-exe.hh" +#include "cli-config-private.hh" namespace nix { diff --git a/src/perl/lib/Nix/Store.xs b/src/perl/lib/Nix/Store.xs index f368a2e42..49bf8bd79 100644 --- a/src/perl/lib/Nix/Store.xs +++ b/src/perl/lib/Nix/Store.xs @@ -1,6 +1,3 @@ -#include "nix/config-util.hh" -#include "nix/config-store.hh" - #include "EXTERN.h" #include "perl.h" #include "XSUB.h" diff --git a/tests/functional/plugins/meson.build b/tests/functional/plugins/meson.build index cee43f0b5..ae66e3036 100644 --- a/tests/functional/plugins/meson.build +++ b/tests/functional/plugins/meson.build @@ -1,13 +1,6 @@ libplugintest = shared_module( 'plugintest', 'plugintest.cc', - cpp_args : [ - # TODO(Qyriad): Yes this is how the autoconf+Make system did it. - # It would be nice for our headers to be idempotent instead. - '-include', 'nix/config-util.hh', - '-include', 'nix/config-store.hh', - '-include', 'nix/config-expr.hh', - ], dependencies : [ dependency('nix-expr'), ], diff --git a/tests/functional/test-libstoreconsumer/meson.build b/tests/functional/test-libstoreconsumer/meson.build index 13a7f6d6f..e5a1cc182 100644 --- a/tests/functional/test-libstoreconsumer/meson.build +++ b/tests/functional/test-libstoreconsumer/meson.build @@ -1,12 +1,6 @@ libstoreconsumer_tester = executable( 'test-libstoreconsumer', 'main.cc', - cpp_args : [ - # TODO(Qyriad): Yes this is how the autoconf+Make system did it. - # It would be nice for our headers to be idempotent instead. - '-include', 'nix/config-util.hh', - '-include', 'nix/config-store.hh', - ], dependencies : [ dependency('nix-store'), ], From 6681b563755e6a006393288b675dbc6a53a1923d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 21 Mar 2025 15:43:58 +0100 Subject: [PATCH 42/84] libstore/local-store: fix linting warning about unused variable (cherry picked from commit 05082ea1c5b6cb1cc1a6bfc50f9d9c81052cbfe8) --- src/libstore/local-store.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index cf6644804..c88980575 100644 --- a/src/libstore/local-store.cc +++ b/src/libstore/local-store.cc @@ -247,7 +247,7 @@ LocalStore::LocalStore( else if (curSchema == 0) { /* new store */ curSchema = nixSchemaVersion; openDB(*state, true); - writeFile(schemaPath, fmt("%1%", nixSchemaVersion), 0666, true); + writeFile(schemaPath, fmt("%1%", curSchema), 0666, true); } else if (curSchema < nixSchemaVersion) { From b3902c7bf1cdf264c71bd628f84601e425201c0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 21 Mar 2025 15:43:39 +0100 Subject: [PATCH 43/84] git/getStringUntil: fix uninitialized stack variable at least clang-tidy is not convinced that this initialized. If this is not the case, the impact should be small and hopefully also more robust if changed. (cherry picked from commit 7e540059a33536517a508ffef323f6c88c61fad6) --- src/libutil/git.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libutil/git.cc b/src/libutil/git.cc index 696f86d0b..c6466bdda 100644 --- a/src/libutil/git.cc +++ b/src/libutil/git.cc @@ -33,7 +33,7 @@ std::optional decodeMode(RawMode m) { static std::string getStringUntil(Source & source, char byte) { std::string s; - char n[1]; + char n[1] = { 0 }; source(std::string_view { n, 1 }); while (*n != byte) { s += *n; From 11e6a1e6c8f5eddabb814b5414e5c504068bbcb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 21 Mar 2025 11:21:27 +0100 Subject: [PATCH 44/84] test/ca-fd-leak: fix clang-tidy lints (cherry picked from commit b050db951be9b94e1cce0341300bdae5ee4397a3) --- tests/nixos/ca-fd-leak/sender.c | 2 +- tests/nixos/ca-fd-leak/smuggler.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/nixos/ca-fd-leak/sender.c b/tests/nixos/ca-fd-leak/sender.c index 8356b2479..2ec79947a 100644 --- a/tests/nixos/ca-fd-leak/sender.c +++ b/tests/nixos/ca-fd-leak/sender.c @@ -19,7 +19,7 @@ int main(int argc, char **argv) { struct sockaddr_un data; data.sun_family = AF_UNIX; data.sun_path[0] = 0; - strcpy(data.sun_path + 1, argv[1]); + strncpy(data.sun_path + 1, argv[1], sizeof(data.sun_path) - 2); // Now try to connect, To ensure we work no matter what order we are // executed in, just busyloop here. diff --git a/tests/nixos/ca-fd-leak/smuggler.c b/tests/nixos/ca-fd-leak/smuggler.c index 3f89af5bb..7279c48bf 100644 --- a/tests/nixos/ca-fd-leak/smuggler.c +++ b/tests/nixos/ca-fd-leak/smuggler.c @@ -5,6 +5,7 @@ #include #include #include +#include int main(int argc, char **argv) { From 92978dc59c426bf79a6c02442081486dedb4f500 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 21 Mar 2025 11:11:27 +0100 Subject: [PATCH 45/84] libstore/daemon: make sure monitor is not considered "unused" (cherry picked from commit 5c3682d7a11658dddd242ea1c9be70f0e0cc7ff6) --- src/libstore/daemon.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libstore/daemon.cc b/src/libstore/daemon.cc index bce285141..6de844748 100644 --- a/src/libstore/daemon.cc +++ b/src/libstore/daemon.cc @@ -1025,6 +1025,7 @@ void processConnection( { #ifndef _WIN32 // TODO need graceful async exit support on Windows? auto monitor = !recursive ? std::make_unique(from.fd) : nullptr; + (void) monitor; // suppress warning #endif /* Exchange the greeting. */ From cb50eb0370f02ac21c17c5334249366b13bee3fd Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 1 Apr 2025 11:53:20 -0400 Subject: [PATCH 46/84] Bump version --- .version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.version b/.version index 05abc5526..90efbd4e3 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -2.27.2 +2.28.0 From ec4c581adcab68d2326bce9ba1a17d866374967d Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Tue, 1 Apr 2025 15:19:41 +0200 Subject: [PATCH 47/84] flake: nixpkgs: 24.11 -> nixos-unstable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/48d12d5e70ee91fe8481378e540433a7303dbf6a?narHash=sha256-1Noao/H%2BN8nFB4Beoy8fgwrcOQLVm9o4zKW1ODaqK9E%3D' (2024-12-16) → 'github:NixOS/nixpkgs/52faf482a3889b7619003c0daec593a1912fddc1?narHash=sha256-6hl6L/tRnwubHcA4pfUUtk542wn2Om%2BD4UnDhlDW9BE%3D' (2025-03-30) (cherry picked from commit c212035d94ee4407cd19927ba33e3246a07a54d0) --- flake.lock | 8 ++++---- flake.nix | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/flake.lock b/flake.lock index ce484a67a..7e008fadc 100644 --- a/flake.lock +++ b/flake.lock @@ -63,16 +63,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1734359947, - "narHash": "sha256-1Noao/H+N8nFB4Beoy8fgwrcOQLVm9o4zKW1ODaqK9E=", + "lastModified": 1743315132, + "narHash": "sha256-6hl6L/tRnwubHcA4pfUUtk542wn2Om+D4UnDhlDW9BE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "48d12d5e70ee91fe8481378e540433a7303dbf6a", + "rev": "52faf482a3889b7619003c0daec593a1912fddc1", "type": "github" }, "original": { "owner": "NixOS", - "ref": "release-24.11", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } diff --git a/flake.nix b/flake.nix index 87f1350e0..302f1304c 100644 --- a/flake.nix +++ b/flake.nix @@ -1,7 +1,7 @@ { description = "The purely functional package manager"; - inputs.nixpkgs.url = "github:NixOS/nixpkgs/release-24.11"; + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; inputs.nixpkgs-regression.url = "github:NixOS/nixpkgs/215d4d0fd80ca5163643b03a33fde804a29cc1e2"; inputs.nixpkgs-23-11.url = "github:NixOS/nixpkgs/a62e6edd6d5e1fa0329b8653c801147986f8d446"; From 36f23279bfecd0bd111fc9cce52dc3c733a70489 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Tue, 1 Apr 2025 15:33:01 +0200 Subject: [PATCH 48/84] Format clang-format: 18.1.8 -> 19.1.7 (cherry picked from commit 55297f865c9dc938dc6c9a76ea68dd527f2ba2a8) --- src/libfetchers/git-lfs-fetch.cc | 9 +++++---- src/libstore-test-support/outputs-spec.cc | 5 +++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/libfetchers/git-lfs-fetch.cc b/src/libfetchers/git-lfs-fetch.cc index 9f48d1e98..f90ab8a1f 100644 --- a/src/libfetchers/git-lfs-fetch.cc +++ b/src/libfetchers/git-lfs-fetch.cc @@ -44,10 +44,11 @@ static void downloadToSink( static std::string getLfsApiToken(const ParsedURL & url) { - auto [status, output] = runProgram(RunOptions{ - .program = "ssh", - .args = {*url.authority, "git-lfs-authenticate", url.path, "download"}, - }); + auto [status, output] = runProgram( + RunOptions{ + .program = "ssh", + .args = {*url.authority, "git-lfs-authenticate", url.path, "download"}, + }); if (output.empty()) throw Error( diff --git a/src/libstore-test-support/outputs-spec.cc b/src/libstore-test-support/outputs-spec.cc index e1b987720..04b243738 100644 --- a/src/libstore-test-support/outputs-spec.cc +++ b/src/libstore-test-support/outputs-spec.cc @@ -14,8 +14,9 @@ Gen Arbitrary::arbitrary() return gen::just((OutputsSpec) OutputsSpec::All{}); case 1: return gen::map( - gen::nonEmpty(gen::container( - gen::map(gen::arbitrary(), [](StorePathName n) { return n.name; }))), + gen::nonEmpty( + gen::container( + gen::map(gen::arbitrary(), [](StorePathName n) { return n.name; }))), [](StringSet names) { return (OutputsSpec) OutputsSpec::Names{names}; }); default: assert(false); From f5731aa9a297b85d53167353ae47f97a193a5c2b Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Tue, 1 Apr 2025 16:36:47 +0200 Subject: [PATCH 49/84] tests/nixos: Work around network-online.target inactivity (cherry picked from commit 58b657b97685285b0d842c1afce03782e800cd6d) --- tests/nixos/git-submodules.nix | 6 +++--- tests/nixos/github-flakes.nix | 4 ++-- tests/nixos/nix-copy-closure.nix | 4 ++-- tests/nixos/nix-copy.nix | 4 ++-- tests/nixos/nix-docker.nix | 2 +- tests/nixos/nss-preload.nix | 4 ++-- tests/nixos/remote-builds-ssh-ng.nix | 4 ++-- tests/nixos/remote-builds.nix | 4 ++-- tests/nixos/s3-binary-cache-store.nix | 4 ++-- tests/nixos/sourcehut-flakes.nix | 4 ++-- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/tests/nixos/git-submodules.nix b/tests/nixos/git-submodules.nix index 5b1d9ed5f..c6f53ada2 100644 --- a/tests/nixos/git-submodules.nix +++ b/tests/nixos/git-submodules.nix @@ -45,14 +45,14 @@ client.succeed("chmod 600 /root/.ssh/id_ed25519") # Install the SSH key on the builders. - client.wait_for_unit("network-online.target") + client.wait_for_unit("network-addresses-eth1.service") remote.succeed("mkdir -p -m 700 /root/.ssh") remote.copy_from_host("key.pub", "/root/.ssh/authorized_keys") remote.wait_for_unit("sshd") remote.wait_for_unit("multi-user.target") - remote.wait_for_unit("network-online.target") - client.wait_for_unit("network-online.target") + remote.wait_for_unit("network-addresses-eth1.service") + client.wait_for_unit("network-addresses-eth1.service") client.succeed(f"ssh -o StrictHostKeyChecking=no {remote.name} 'echo hello world'") remote.succeed(""" diff --git a/tests/nixos/github-flakes.nix b/tests/nixos/github-flakes.nix index dcba464a3..30ab1f333 100644 --- a/tests/nixos/github-flakes.nix +++ b/tests/nixos/github-flakes.nix @@ -187,9 +187,9 @@ in github.succeed("cat /var/log/httpd/*.log >&2") github.wait_for_unit("httpd.service") - github.wait_for_unit("network-online.target") + github.wait_for_unit("network-addresses-eth1.service") - client.wait_for_unit("network-online.target") + client.wait_for_unit("network-addresses-eth1.service") client.succeed("curl -v https://github.com/ >&2") out = client.succeed("nix registry list") print(out) diff --git a/tests/nixos/nix-copy-closure.nix b/tests/nixos/nix-copy-closure.nix index b6ec856e0..34e3a2c7d 100644 --- a/tests/nixos/nix-copy-closure.nix +++ b/tests/nixos/nix-copy-closure.nix @@ -70,9 +70,9 @@ in server.copy_from_host("key.pub", "/root/.ssh/authorized_keys") server.wait_for_unit("sshd") server.wait_for_unit("multi-user.target") - server.wait_for_unit("network-online.target") + server.wait_for_unit("network-addresses-eth1.service") - client.wait_for_unit("network-online.target") + client.wait_for_unit("network-addresses-eth1.service") client.succeed(f"ssh -o StrictHostKeyChecking=no {server.name} 'echo hello world'") # Copy the closure of package A from the client to the server. diff --git a/tests/nixos/nix-copy.nix b/tests/nixos/nix-copy.nix index 3565e83e7..64de622de 100644 --- a/tests/nixos/nix-copy.nix +++ b/tests/nixos/nix-copy.nix @@ -79,9 +79,9 @@ in server.wait_for_unit("sshd") server.wait_for_unit("multi-user.target") - server.wait_for_unit("network-online.target") + server.wait_for_unit("network-addresses-eth1.service") - client.wait_for_unit("network-online.target") + client.wait_for_unit("network-addresses-eth1.service") client.wait_for_unit("getty@tty1.service") # Either the prompt: ]# # or an OCR misreading of it: 1# diff --git a/tests/nixos/nix-docker.nix b/tests/nixos/nix-docker.nix index bd77b25c8..c58a00cdd 100644 --- a/tests/nixos/nix-docker.nix +++ b/tests/nixos/nix-docker.nix @@ -61,7 +61,7 @@ in { nodes }: '' cache.wait_for_unit("harmonia.service") - cache.wait_for_unit("network-online.target") + cache.wait_for_unit("network-addresses-eth1.service") machine.succeed("mkdir -p /etc/containers") machine.succeed("""echo '{"default":[{"type":"insecureAcceptAnything"}]}' > /etc/containers/policy.json""") diff --git a/tests/nixos/nss-preload.nix b/tests/nixos/nss-preload.nix index 29cd5e6a2..d99f22208 100644 --- a/tests/nixos/nss-preload.nix +++ b/tests/nixos/nss-preload.nix @@ -145,7 +145,7 @@ in testScript = { nodes, ... }: '' - http_dns.wait_for_unit("network-online.target") + http_dns.wait_for_unit("network-addresses-eth1.service") http_dns.wait_for_unit("nginx") http_dns.wait_for_open_port(80) http_dns.wait_for_unit("unbound") @@ -153,7 +153,7 @@ in client.start() client.wait_for_unit('multi-user.target') - client.wait_for_unit('network-online.target') + client.wait_for_unit('network-addresses-eth1.service') with subtest("can fetch data from a remote server outside sandbox"): client.succeed("nix --version >&2") diff --git a/tests/nixos/remote-builds-ssh-ng.nix b/tests/nixos/remote-builds-ssh-ng.nix index 726522029..c298ab92d 100644 --- a/tests/nixos/remote-builds-ssh-ng.nix +++ b/tests/nixos/remote-builds-ssh-ng.nix @@ -102,12 +102,12 @@ in client.succeed("chmod 600 /root/.ssh/id_ed25519") # Install the SSH key on the builder. - client.wait_for_unit("network-online.target") + client.wait_for_unit("network-addresses-eth1.service") builder.succeed("mkdir -p -m 700 /root/.ssh") builder.copy_from_host("key.pub", "/root/.ssh/authorized_keys") builder.wait_for_unit("sshd") builder.wait_for_unit("multi-user.target") - builder.wait_for_unit("network-online.target") + builder.wait_for_unit("network-addresses-eth1.service") client.succeed(f"ssh -o StrictHostKeyChecking=no {builder.name} 'echo hello world'") diff --git a/tests/nixos/remote-builds.nix b/tests/nixos/remote-builds.nix index 3251984db..fbfff9a7d 100644 --- a/tests/nixos/remote-builds.nix +++ b/tests/nixos/remote-builds.nix @@ -123,12 +123,12 @@ in client.succeed("chmod 600 /root/.ssh/id_ed25519") # Install the SSH key on the builders. - client.wait_for_unit("network-online.target") + client.wait_for_unit("network-addresses-eth1.service") for builder in [builder1, builder2]: builder.succeed("mkdir -p -m 700 /root/.ssh") builder.copy_from_host("key.pub", "/root/.ssh/authorized_keys") builder.wait_for_unit("sshd") - builder.wait_for_unit("network-online.target") + builder.wait_for_unit("network-addresses-eth1.service") # Make sure the builder can handle our login correctly builder.wait_for_unit("multi-user.target") # Make sure there's no funny business on the client either diff --git a/tests/nixos/s3-binary-cache-store.nix b/tests/nixos/s3-binary-cache-store.nix index 8e4808660..fc55a27ae 100644 --- a/tests/nixos/s3-binary-cache-store.nix +++ b/tests/nixos/s3-binary-cache-store.nix @@ -67,14 +67,14 @@ in # Create a binary cache. server.wait_for_unit("minio") - server.wait_for_unit("network-online.target") + server.wait_for_unit("network-addresses-eth1.service") server.succeed("mc config host add minio http://localhost:9000 ${accessKey} ${secretKey} --api s3v4") server.succeed("mc mb minio/my-cache") server.succeed("${env} nix copy --to '${storeUrl}' ${pkgA}") - client.wait_for_unit("network-online.target") + client.wait_for_unit("network-addresses-eth1.service") # Test fetchurl on s3:// URLs while we're at it. client.succeed("${env} nix eval --impure --expr 'builtins.fetchurl { name = \"foo\"; url = \"s3://my-cache/nix-cache-info?endpoint=http://server:9000®ion=eu-west-1\"; }'") diff --git a/tests/nixos/sourcehut-flakes.nix b/tests/nixos/sourcehut-flakes.nix index bb26b7ebb..61670ccf3 100644 --- a/tests/nixos/sourcehut-flakes.nix +++ b/tests/nixos/sourcehut-flakes.nix @@ -139,8 +139,8 @@ in start_all() sourcehut.wait_for_unit("httpd.service") - sourcehut.wait_for_unit("network-online.target") - client.wait_for_unit("network-online.target") + sourcehut.wait_for_unit("network-addresses-eth1.service") + client.wait_for_unit("network-addresses-eth1.service") client.succeed("curl -v https://git.sr.ht/ >&2") client.succeed("nix registry list | grep nixpkgs") From abd5909fb6692d57f991aa1f7412662d8c061755 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Mon, 31 Mar 2025 15:16:17 +0200 Subject: [PATCH 50/84] packaging: Various improvements Co-authored-by: Mic92 (cherry picked from commit 1172e49a3a1d3debe41845170edc80f79388e3e4) --- flake.nix | 7 ++++ packaging/components.nix | 58 ++++++++++++++++++++++++++---- packaging/everything.nix | 78 ++++++++++++++++++---------------------- 3 files changed, 93 insertions(+), 50 deletions(-) diff --git a/flake.nix b/flake.nix index 302f1304c..bfb2c7127 100644 --- a/flake.nix +++ b/flake.nix @@ -156,6 +156,13 @@ inherit officialRelease; pkgs = final; src = self; + maintainers = with lib.maintainers; [ + edolstra + Ericson2314 + Mic92 + roberth + tomberek + ]; }; }; diff --git a/packaging/components.nix b/packaging/components.nix index 991d54241..cd1d219b8 100644 --- a/packaging/components.nix +++ b/packaging/components.nix @@ -3,6 +3,7 @@ pkgs, src, officialRelease, + maintainers, }: scope: @@ -110,7 +111,7 @@ let let n = lib.length finalScope.patches; in - if n == 0 then finalAttrs.version else finalAttrs.version + "+${toString n}"; + if n == 0 then prevAttrs.version else prevAttrs.version + "+${toString n}"; # Clear what `derivation` can't/shouldn't serialize; see prevAttrs.workDir. fileset = null; @@ -180,9 +181,24 @@ let mesonFlags = [ (lib.mesonBool "b_asneeded" false) ] ++ prevAttrs.mesonFlags or [ ]; }; - miscGoodPractice = finalAttrs: prevAttrs: { + nixDefaultsLayer = finalAttrs: prevAttrs: { strictDeps = prevAttrs.strictDeps or true; enableParallelBuilding = true; + pos = builtins.unsafeGetAttrPos "pname" prevAttrs; + meta = prevAttrs.meta or { } // { + homepage = prevAttrs.meta.homepage or "https://nixos.org/nix"; + longDescription = + prevAttrs.longDescription or '' + Nix is a powerful package manager for mainly Linux and other Unix systems that + makes package management reliable and reproducible. It provides atomic + upgrades and rollbacks, side-by-side installation of multiple versions of + a package, multi-user package management and easy setup of build + environments. + ''; + license = prevAttrs.meta.license or lib.licenses.lgpl21Plus; + maintainers = prevAttrs.meta.maintainers or [ ] ++ scope.maintainers; + platforms = prevAttrs.meta.platforms or (lib.platforms.unix ++ lib.platforms.windows); + }; }; /** @@ -202,6 +218,7 @@ in { version = baseVersion + versionSuffix; inherit versionSuffix; + inherit maintainers; inherit filesetToSource; @@ -237,6 +254,10 @@ in but it does make the build non-granular; all components will use a complete source. Packaging expressions will be ignored. + + Single argument: the source to use. + + See also `appendPatches` */ overrideSource = src: @@ -265,6 +286,7 @@ in } ); resolvePath = p: finalScope.patchedSrc + "/${resolveRelPath p}"; + filesetToSource = { root, fileset }: finalScope.resolvePath root; appendPatches = appendPatches finalScope; } ); @@ -281,14 +303,14 @@ in (scope.overrideSource "${./..}").appendPatches patches; mkMesonDerivation = mkPackageBuilder [ - miscGoodPractice + nixDefaultsLayer scope.sourceLayer setVersionLayer mesonLayer scope.mesonComponentOverrides ]; mkMesonExecutable = mkPackageBuilder [ - miscGoodPractice + nixDefaultsLayer bsdNoLinkAsNeeded scope.sourceLayer setVersionLayer @@ -297,7 +319,7 @@ in scope.mesonComponentOverrides ]; mkMesonLibrary = mkPackageBuilder [ - miscGoodPractice + nixDefaultsLayer bsdNoLinkAsNeeded scope.sourceLayer mesonLayer @@ -347,7 +369,7 @@ in nix-perl-bindings = callPackage ../src/perl/package.nix { }; nix-everything = callPackage ../packaging/everything.nix { } // { - # Note: no `passthru.overrideAllMesonComponents` + # Note: no `passthru.overrideAllMesonComponents` etc # This would propagate into `nix.overrideAttrs f`, but then discard # `f` when `.overrideAllMesonComponents` is used. # Both "methods" should be views on the same fixpoint overriding mechanism @@ -355,6 +377,8 @@ in # two-fixpoint solution. /** Apply an extension function (i.e. overlay-shaped) to all component derivations, and return the nix package. + + Single argument: the extension function to apply (finalAttrs: prevAttrs: { ... }) */ overrideAllMesonComponents = f: (scope.overrideAllMesonComponents f).nix-everything; @@ -363,6 +387,10 @@ in This affects all components. Changes to the packaging expressions will be ignored. + + Single argument: list of patches to apply + + See also `overrideSource` */ appendPatches = ps: (scope.appendPatches ps).nix-everything; @@ -371,8 +399,26 @@ in but it does make the build non-granular; all components will use a complete source. Packaging expressions will be ignored. + + Filesets in the packaging expressions will be ignored. + + Single argument: the source to use. + + See also `appendPatches` */ overrideSource = src: (scope.overrideSource src).nix-everything; + /** + Override any internals of the Nix package set. + + Single argument: the extension function to apply to the package set (finalScope: prevScope: { ... }) + + Example: + ``` + overrideScope (finalScope: prevScope: { aws-sdk-cpp = null; }) + ``` + */ + overrideScope = f: (scope.overrideScope f).nix-everything; + }; } diff --git a/packaging/everything.nix b/packaging/everything.nix index 2c65f209f..1835eefb6 100644 --- a/packaging/everything.nix +++ b/packaging/everything.nix @@ -4,6 +4,8 @@ lndir, buildEnv, + maintainers, + nix-util, nix-util-c, nix-util-tests, @@ -39,6 +41,8 @@ nix-perl-bindings, testers, + + patchedSrc ? null, }: let @@ -68,48 +72,6 @@ let ; }; - dev = stdenv.mkDerivation (finalAttrs: { - name = "nix-${nix-cli.version}-dev"; - pname = "nix"; - version = nix-cli.version; - dontUnpack = true; - dontBuild = true; - libs = map lib.getDev (lib.attrValues libs); - installPhase = '' - mkdir -p $out/nix-support - echo $libs >> $out/nix-support/propagated-build-inputs - ''; - passthru = { - tests = { - pkg-config = testers.hasPkgConfigModules { - package = finalAttrs.finalPackage; - }; - }; - - # If we were to fully emulate output selection here, we'd confuse the Nix CLIs, - # because they rely on `drvPath`. - dev = finalAttrs.finalPackage.out; - - libs = throw "`nix.dev.libs` is not meant to be used; use `nix.libs` instead."; - }; - meta = { - mainProgram = "nix"; - pkgConfigModules = [ - "nix-cmd" - "nix-expr" - "nix-expr-c" - "nix-fetchers" - "nix-flake" - "nix-flake-c" - "nix-main" - "nix-main-c" - "nix-store" - "nix-store-c" - "nix-util" - "nix-util-c" - ]; - }; - }); devdoc = buildEnv { name = "nix-${nix-cli.version}-devdoc"; paths = [ @@ -192,10 +154,15 @@ stdenv.mkDerivation (finalAttrs: { devPaths = lib.mapAttrsToList (_k: lib.getDev) finalAttrs.finalPackage.libs; in '' - mkdir -p $out $dev + mkdir -p $out $dev/nix-support + + # Custom files + echo $libs >> $dev/nix-support/propagated-build-inputs + echo ${nix-cli} ${lib.escapeShellArgs devPaths} >> $dev/nix-support/propagated-build-inputs # Merged outputs lndir ${nix-cli} $out + for lib in ${lib.escapeShellArgs devPaths}; do lndir $lib $dev done @@ -207,6 +174,7 @@ stdenv.mkDerivation (finalAttrs: { passthru = { inherit (nix-cli) version; + src = patchedSrc; /** These are the libraries that are part of the Nix project. They are used @@ -248,7 +216,29 @@ stdenv.mkDerivation (finalAttrs: { meta = { mainProgram = "nix"; description = "The Nix package manager"; - pkgConfigModules = dev.meta.pkgConfigModules; + longDescription = nix-cli.meta.longDescription; + homepage = nix-cli.meta.homepage; + license = nix-cli.meta.license; + maintainers = maintainers; + platforms = nix-cli.meta.platforms; + outputsToInstall = [ + "out" + "man" + ]; + pkgConfigModules = [ + "nix-cmd" + "nix-expr" + "nix-expr-c" + "nix-fetchers" + "nix-flake" + "nix-flake-c" + "nix-main" + "nix-main-c" + "nix-store" + "nix-store-c" + "nix-util" + "nix-util-c" + ]; }; }) From c908eef782060c25c2a3e2adb0b3d2f76e5160fc Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Mon, 31 Mar 2025 15:17:32 +0200 Subject: [PATCH 51/84] packaging: `finalAttrs.doCheck` -> `finalAttrs.finalPackage.doCheck` This includes the logic that disables checks on cross appropriately. Co-authored-by: Peder Bergebakken Sundt (cherry picked from commit 27d71b21fc417595b9f9697d8b6cef66dc633121) --- src/perl/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/perl/package.nix b/src/perl/package.nix index d95d13aa9..5841570cd 100644 --- a/src/perl/package.nix +++ b/src/perl/package.nix @@ -31,7 +31,7 @@ perl.pkgs.toPerlModule ( ./meson.build ./meson.options ] - ++ lib.optionals finalAttrs.doCheck [ + ++ lib.optionals finalAttrs.finalPackage.doCheck [ ./.yath.rc.in ./t ] @@ -70,7 +70,7 @@ perl.pkgs.toPerlModule ( mesonFlags = [ (lib.mesonOption "dbi_path" "${perlPackages.DBI}/${perl.libPrefix}") (lib.mesonOption "dbd_sqlite_path" "${perlPackages.DBDSQLite}/${perl.libPrefix}") - (lib.mesonEnable "tests" finalAttrs.doCheck) + (lib.mesonEnable "tests" finalAttrs.finalPackage.doCheck) ]; mesonCheckFlags = [ From 8b448c841e15368f060aa9042663aece90d0f170 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 31 Mar 2025 15:03:57 +0200 Subject: [PATCH 52/84] Throw CachedEvalError if a cached value exists but has type "failed" Otherwise you get unhelpful errors like error: 'apps' is not an attribute set Fixes #12762. (cherry picked from commit 8b438fccb4fce1e8c06136ff9f9bae324911c193) --- src/libexpr/eval-cache.cc | 29 ++++++++++++++------------- src/libexpr/include/nix/eval-cache.hh | 8 ++++++++ 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/src/libexpr/eval-cache.cc b/src/libexpr/eval-cache.cc index f35c332c9..5b238bddb 100644 --- a/src/libexpr/eval-cache.cc +++ b/src/libexpr/eval-cache.cc @@ -418,6 +418,14 @@ Value & AttrCursor::getValue() return **_value; } +void AttrCursor::fetchCachedValue() +{ + if (!cachedValue) + cachedValue = root->db->getAttr(getKey()); + if (cachedValue && std::get_if(&cachedValue->second) && parent) + throw CachedEvalError(ref(parent->first), parent->second); +} + std::vector AttrCursor::getAttrPath() const { if (parent) { @@ -494,8 +502,7 @@ Suggestions AttrCursor::getSuggestionsForAttr(Symbol name) std::shared_ptr AttrCursor::maybeGetAttr(Symbol name) { if (root->db) { - if (!cachedValue) - cachedValue = root->db->getAttr(getKey()); + fetchCachedValue(); if (cachedValue) { if (auto attrs = std::get_if>(&cachedValue->second)) { @@ -585,8 +592,7 @@ OrSuggestions> AttrCursor::findAlongAttrPath(const std::vectordb) { - if (!cachedValue) - cachedValue = root->db->getAttr(getKey()); + fetchCachedValue(); if (cachedValue && !std::get_if(&cachedValue->second)) { if (auto s = std::get_if(&cachedValue->second)) { debug("using cached string attribute '%s'", getAttrPathStr()); @@ -607,8 +613,7 @@ std::string AttrCursor::getString() string_t AttrCursor::getStringWithContext() { if (root->db) { - if (!cachedValue) - cachedValue = root->db->getAttr(getKey()); + fetchCachedValue(); if (cachedValue && !std::get_if(&cachedValue->second)) { if (auto s = std::get_if(&cachedValue->second)) { bool valid = true; @@ -654,8 +659,7 @@ string_t AttrCursor::getStringWithContext() bool AttrCursor::getBool() { if (root->db) { - if (!cachedValue) - cachedValue = root->db->getAttr(getKey()); + fetchCachedValue(); if (cachedValue && !std::get_if(&cachedValue->second)) { if (auto b = std::get_if(&cachedValue->second)) { debug("using cached Boolean attribute '%s'", getAttrPathStr()); @@ -676,8 +680,7 @@ bool AttrCursor::getBool() NixInt AttrCursor::getInt() { if (root->db) { - if (!cachedValue) - cachedValue = root->db->getAttr(getKey()); + fetchCachedValue(); if (cachedValue && !std::get_if(&cachedValue->second)) { if (auto i = std::get_if(&cachedValue->second)) { debug("using cached integer attribute '%s'", getAttrPathStr()); @@ -698,8 +701,7 @@ NixInt AttrCursor::getInt() std::vector AttrCursor::getListOfStrings() { if (root->db) { - if (!cachedValue) - cachedValue = root->db->getAttr(getKey()); + fetchCachedValue(); if (cachedValue && !std::get_if(&cachedValue->second)) { if (auto l = std::get_if>(&cachedValue->second)) { debug("using cached list of strings attribute '%s'", getAttrPathStr()); @@ -731,8 +733,7 @@ std::vector AttrCursor::getListOfStrings() std::vector AttrCursor::getAttrs() { if (root->db) { - if (!cachedValue) - cachedValue = root->db->getAttr(getKey()); + fetchCachedValue(); if (cachedValue && !std::get_if(&cachedValue->second)) { if (auto attrs = std::get_if>(&cachedValue->second)) { debug("using cached attrset attribute '%s'", getAttrPathStr()); diff --git a/src/libexpr/include/nix/eval-cache.hh b/src/libexpr/include/nix/eval-cache.hh index 899ae715b..4dd2e0332 100644 --- a/src/libexpr/include/nix/eval-cache.hh +++ b/src/libexpr/include/nix/eval-cache.hh @@ -99,6 +99,14 @@ class AttrCursor : public std::enable_shared_from_this Value & getValue(); + /** + * If `cachedValue` is unset, try to initialize it from the + * database. It is not an error if it does not exist. Throw a + * `CachedEvalError` exception if it does exist but has type + * `AttrType::Failed`. + */ + void fetchCachedValue(); + public: AttrCursor( From 64fb6ab435cd32b4101c75833f7905d48ebfabfa Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 31 Mar 2025 15:14:10 +0200 Subject: [PATCH 53/84] AttrCursor::Parent: shared_ptr -> ref (cherry picked from commit 5a357459497c5111207fba63af21e5cdd6a945c0) --- src/libexpr/eval-cache.cc | 8 ++++---- src/libexpr/include/nix/eval-cache.hh | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libexpr/eval-cache.cc b/src/libexpr/eval-cache.cc index 5b238bddb..5491f5d4c 100644 --- a/src/libexpr/eval-cache.cc +++ b/src/libexpr/eval-cache.cc @@ -423,7 +423,7 @@ void AttrCursor::fetchCachedValue() if (!cachedValue) cachedValue = root->db->getAttr(getKey()); if (cachedValue && std::get_if(&cachedValue->second) && parent) - throw CachedEvalError(ref(parent->first), parent->second); + throw CachedEvalError(parent->first, parent->second); } std::vector AttrCursor::getAttrPath() const @@ -508,7 +508,7 @@ std::shared_ptr AttrCursor::maybeGetAttr(Symbol name) if (auto attrs = std::get_if>(&cachedValue->second)) { for (auto & attr : *attrs) if (attr == name) - return std::make_shared(root, std::make_pair(shared_from_this(), attr)); + return std::make_shared(root, std::make_pair(ref(shared_from_this()), attr)); return nullptr; } else if (std::get_if(&cachedValue->second)) { auto attr = root->db->getAttr({cachedValue->first, name}); @@ -519,7 +519,7 @@ std::shared_ptr AttrCursor::maybeGetAttr(Symbol name) throw CachedEvalError(ref(shared_from_this()), name); else return std::make_shared(root, - std::make_pair(shared_from_this(), name), nullptr, std::move(attr)); + std::make_pair(ref(shared_from_this()), name), nullptr, std::move(attr)); } // Incomplete attrset, so need to fall thru and // evaluate to see whether 'name' exists @@ -554,7 +554,7 @@ std::shared_ptr AttrCursor::maybeGetAttr(Symbol name) } return make_ref( - root, std::make_pair(shared_from_this(), name), attr->value, std::move(cachedValue2)); + root, std::make_pair(ref(shared_from_this()), name), attr->value, std::move(cachedValue2)); } std::shared_ptr AttrCursor::maybeGetAttr(std::string_view name) diff --git a/src/libexpr/include/nix/eval-cache.hh b/src/libexpr/include/nix/eval-cache.hh index 4dd2e0332..2d70aa99e 100644 --- a/src/libexpr/include/nix/eval-cache.hh +++ b/src/libexpr/include/nix/eval-cache.hh @@ -90,7 +90,7 @@ class AttrCursor : public std::enable_shared_from_this friend struct CachedEvalError; ref root; - typedef std::optional, Symbol>> Parent; + using Parent = std::optional, Symbol>>; Parent parent; RootValue _value; std::optional> cachedValue; From 0c677773967caa52ee41fb41d9d4818ff8bae859 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 31 Mar 2025 16:38:20 -0400 Subject: [PATCH 54/84] Expose the nix component in header include paths For example, instead of doing #include "nix/store-config.hh" #include "nix/derived-path.hh" Now do #include "nix/store/config.hh" #include "nix/store/derived-path.hh" This was originally planned in the issue, and also recent requested by Eelco. Most of the change is purely mechanical. There is just one small additional issue. See how, in the example above, we took this opportunity to also turn `-config.hh` into `/config.hh`. Well, there was already a `nix/util/config.{cc,hh}`. Even though there is not a public configuration header for libutil (which also would be called `nix/util/config.{cc,hh}`) that's still confusing, To avoid any such confusion, we renamed that to `nix/util/configuration.{cc,hh}`. Finally, note that the libflake headers already did this, so we didn't need to do anything to them. We wouldn't want to mistakenly get `nix/flake/flake/flake.hh`! Progress on #7876 (cherry picked from commit cc24766fa6af4eb4ec8c54af6b0990bc25c19715) --- doc/manual/source/development/testing.md | 8 +- maintainers/flake-module.nix | 328 +++++++++--------- src/build-remote/build-remote.cc | 26 +- src/libcmd/built-path.cc | 8 +- src/libcmd/command-installable-value.cc | 2 +- src/libcmd/command.cc | 20 +- src/libcmd/common-eval-args.cc | 30 +- src/libcmd/editor-for.cc | 6 +- .../include/nix/{ => cmd}/built-path.hh | 4 +- .../{ => cmd}/command-installable-value.hh | 4 +- src/libcmd/include/nix/{ => cmd}/command.hh | 8 +- .../include/nix/{ => cmd}/common-eval-args.hh | 8 +- .../nix/{ => cmd}/compatibility-settings.hh | 2 +- .../include/nix/{ => cmd}/editor-for.hh | 4 +- .../nix/{ => cmd}/installable-attr-path.hh | 32 +- .../nix/{ => cmd}/installable-derived-path.hh | 2 +- .../nix/{ => cmd}/installable-flake.hh | 4 +- .../nix/{ => cmd}/installable-value.hh | 2 +- .../include/nix/{ => cmd}/installables.hh | 12 +- src/libcmd/include/nix/{ => cmd}/legacy.hh | 0 src/libcmd/include/nix/{ => cmd}/markdown.hh | 0 src/libcmd/include/nix/{ => cmd}/meson.build | 2 +- .../include/nix/{ => cmd}/misc-store-flags.hh | 4 +- .../include/nix/{ => cmd}/network-proxy.hh | 2 +- .../include/nix/{ => cmd}/repl-interacter.hh | 4 +- src/libcmd/include/nix/{ => cmd}/repl.hh | 2 +- src/libcmd/installable-attr-path.cc | 34 +- src/libcmd/installable-derived-path.cc | 4 +- src/libcmd/installable-flake.cc | 36 +- src/libcmd/installable-value.cc | 6 +- src/libcmd/installables.cc | 46 +-- src/libcmd/legacy.cc | 2 +- src/libcmd/markdown.cc | 10 +- src/libcmd/meson.build | 4 +- src/libcmd/misc-store-flags.cc | 2 +- src/libcmd/network-proxy.cc | 4 +- src/libcmd/package.nix | 2 +- src/libcmd/repl-interacter.cc | 12 +- src/libcmd/repl.cc | 48 +-- src/libexpr-c/nix_api_expr.cc | 10 +- src/libexpr-c/nix_api_expr_internal.h | 10 +- src/libexpr-c/nix_api_external.cc | 12 +- src/libexpr-c/nix_api_value.cc | 16 +- .../include/nix/{ => expr}/tests/libexpr.hh | 18 +- .../include/nix/expr/tests/meson.build | 9 + .../nix/{ => expr}/tests/nix_api_expr.hh | 2 +- .../nix/{ => expr}/tests/value/context.hh | 2 +- .../include/nix/meson.build | 9 - src/libexpr-test-support/meson.build | 4 +- src/libexpr-test-support/package.nix | 2 +- .../tests/value/context.cc | 4 +- src/libexpr-tests/derived-path.cc | 4 +- src/libexpr-tests/error_traces.cc | 2 +- src/libexpr-tests/eval.cc | 4 +- src/libexpr-tests/json.cc | 4 +- src/libexpr-tests/main.cc | 4 +- src/libexpr-tests/nix_api_expr.cc | 6 +- src/libexpr-tests/nix_api_external.cc | 4 +- src/libexpr-tests/nix_api_value.cc | 4 +- src/libexpr-tests/primops.cc | 6 +- src/libexpr-tests/search-path.cc | 2 +- src/libexpr-tests/trivial.cc | 2 +- src/libexpr-tests/value/context.cc | 6 +- src/libexpr-tests/value/print.cc | 6 +- src/libexpr-tests/value/value.cc | 4 +- src/libexpr/attr-path.cc | 4 +- src/libexpr/attr-set.cc | 4 +- src/libexpr/eval-cache.cc | 14 +- src/libexpr/eval-error.cc | 6 +- src/libexpr/eval-gc.cc | 12 +- src/libexpr/eval-settings.cc | 10 +- src/libexpr/eval.cc | 44 +-- src/libexpr/function-trace.cc | 4 +- src/libexpr/get-drvs.cc | 10 +- .../include/nix/{ => expr}/attr-path.hh | 2 +- .../include/nix/{ => expr}/attr-set.hh | 4 +- .../include/nix/{ => expr}/eval-cache.hh | 6 +- .../include/nix/{ => expr}/eval-error.hh | 4 +- src/libexpr/include/nix/{ => expr}/eval-gc.hh | 2 +- .../include/nix/{ => expr}/eval-inline.hh | 10 +- .../include/nix/{ => expr}/eval-settings.hh | 4 +- src/libexpr/include/nix/{ => expr}/eval.hh | 32 +- .../include/nix/{ => expr}/function-trace.hh | 2 +- .../include/nix/{ => expr}/gc-small-vector.hh | 2 +- .../include/nix/{ => expr}/get-drvs.hh | 4 +- .../include/nix/{ => expr}/json-to-value.hh | 2 +- .../include/nix/{ => expr}/lexer-helpers.hh | 0 .../include/nix/{ => expr}/meson.build | 4 +- src/libexpr/include/nix/{ => expr}/nixexpr.hh | 8 +- .../include/nix/{ => expr}/parser-state.hh | 2 +- src/libexpr/include/nix/{ => expr}/primops.hh | 2 +- .../include/nix/{ => expr}/print-ambiguous.hh | 2 +- .../include/nix/{ => expr}/print-options.hh | 0 src/libexpr/include/nix/{ => expr}/print.hh | 4 +- .../nix/{ => expr}/repl-exit-status.hh | 0 .../include/nix/{ => expr}/search-path.hh | 4 +- .../include/nix/{ => expr}/symbol-table.hh | 6 +- .../include/nix/{ => expr}/value-to-json.hh | 4 +- .../include/nix/{ => expr}/value-to-xml.hh | 4 +- src/libexpr/include/nix/{ => expr}/value.hh | 12 +- .../include/nix/{ => expr}/value/context.hh | 6 +- src/libexpr/json-to-value.cc | 6 +- src/libexpr/lexer-helpers.cc | 2 +- src/libexpr/lexer.l | 6 +- src/libexpr/meson.build | 4 +- src/libexpr/nixexpr.cc | 12 +- src/libexpr/package.nix | 2 +- src/libexpr/parser.y | 16 +- src/libexpr/paths.cc | 4 +- src/libexpr/primops.cc | 32 +- src/libexpr/primops/context.cc | 8 +- src/libexpr/primops/fetchClosure.cc | 10 +- src/libexpr/primops/fetchMercurial.cc | 14 +- src/libexpr/primops/fetchTree.cc | 24 +- src/libexpr/primops/fromTOML.cc | 4 +- src/libexpr/print-ambiguous.cc | 8 +- src/libexpr/print.cc | 14 +- src/libexpr/search-path.cc | 2 +- src/libexpr/value-to-json.cc | 8 +- src/libexpr/value-to-xml.cc | 8 +- src/libexpr/value/context.cc | 4 +- src/libfetchers-tests/access-tokens.cc | 8 +- src/libfetchers-tests/git-utils.cc | 10 +- src/libfetchers-tests/public-key.cc | 6 +- src/libfetchers/attrs.cc | 4 +- src/libfetchers/cache.cc | 10 +- src/libfetchers/fetch-settings.cc | 2 +- src/libfetchers/fetch-to-store.cc | 6 +- src/libfetchers/fetchers.cc | 14 +- src/libfetchers/filtering-source-accessor.cc | 2 +- src/libfetchers/git-lfs-fetch.cc | 14 +- src/libfetchers/git-utils.cc | 18 +- src/libfetchers/git.cc | 34 +- src/libfetchers/github.cc | 24 +- .../include/nix/{ => fetchers}/attrs.hh | 4 +- .../include/nix/{ => fetchers}/cache.hh | 4 +- .../nix/{ => fetchers}/fetch-settings.hh | 4 +- .../nix/{ => fetchers}/fetch-to-store.hh | 10 +- .../include/nix/{ => fetchers}/fetchers.hh | 14 +- .../filtering-source-accessor.hh | 2 +- .../nix/{ => fetchers}/git-lfs-fetch.hh | 6 +- .../include/nix/{ => fetchers}/git-utils.hh | 4 +- .../include/nix/{ => fetchers}/meson.build | 2 +- .../include/nix/{ => fetchers}/registry.hh | 4 +- .../nix/{ => fetchers}/store-path-accessor.hh | 2 +- .../include/nix/{ => fetchers}/tarball.hh | 8 +- src/libfetchers/indirect.cc | 6 +- src/libfetchers/mercurial.cc | 20 +- src/libfetchers/meson.build | 4 +- src/libfetchers/package.nix | 2 +- src/libfetchers/path.cc | 8 +- src/libfetchers/registry.cc | 14 +- src/libfetchers/store-path-accessor.cc | 4 +- src/libfetchers/tarball.cc | 22 +- src/libflake-c/nix_api_flake_internal.hh | 2 +- src/libflake-tests/flakeref.cc | 2 +- src/libflake-tests/nix_api_flake.cc | 4 +- src/libflake/flake/config.cc | 4 +- src/libflake/flake/flake-primops.cc | 2 +- src/libflake/flake/flake.cc | 26 +- src/libflake/flake/flakeref.cc | 8 +- src/libflake/flake/lockfile.cc | 6 +- .../include/nix/flake/flake-primops.hh | 2 +- src/libflake/include/nix/flake/flake.hh | 4 +- src/libflake/include/nix/flake/flakeref.hh | 8 +- src/libflake/include/nix/flake/meson.build | 11 + src/libflake/include/nix/flake/settings.hh | 2 +- src/libflake/include/nix/flake/url-name.hh | 8 +- src/libflake/include/nix/meson.build | 11 - src/libflake/meson.build | 4 +- src/libflake/package.nix | 2 +- src/libmain-c/nix_api_main.cc | 2 +- src/libmain/common-args.cc | 16 +- .../include/nix/{ => main}/common-args.hh | 4 +- src/libmain/include/nix/{ => main}/loggers.hh | 2 +- .../include/nix/{ => main}/meson.build | 2 +- src/libmain/include/nix/{ => main}/plugin.hh | 0 .../include/nix/{ => main}/progress-bar.hh | 2 +- src/libmain/include/nix/{ => main}/shared.hh | 14 +- src/libmain/loggers.cc | 6 +- src/libmain/meson.build | 4 +- src/libmain/package.nix | 2 +- src/libmain/plugin.cc | 4 +- src/libmain/progress-bar.cc | 10 +- src/libmain/shared.cc | 21 +- src/libmain/unix/stack.cc | 4 +- src/libstore-c/nix_api_store.cc | 8 +- src/libstore-c/nix_api_store_internal.h | 2 +- src/libstore-test-support/derived-path.cc | 2 +- .../include/nix/meson.build | 12 - .../nix/{ => store}/tests/derived-path.hh | 6 +- .../include/nix/{ => store}/tests/libstore.hh | 2 +- .../include/nix/store/tests/meson.build | 12 + .../nix/{ => store}/tests/nix_api_store.hh | 4 +- .../nix/{ => store}/tests/outputs-spec.hh | 4 +- .../include/nix/{ => store}/tests/path.hh | 2 +- .../include/nix/{ => store}/tests/protocol.hh | 4 +- src/libstore-test-support/meson.build | 4 +- src/libstore-test-support/outputs-spec.cc | 2 +- src/libstore-test-support/package.nix | 2 +- src/libstore-test-support/path.cc | 8 +- src/libstore-tests/common-protocol.cc | 10 +- src/libstore-tests/content-address.cc | 2 +- .../derivation-advanced-attrs.cc | 18 +- src/libstore-tests/derivation.cc | 8 +- src/libstore-tests/derived-path.cc | 4 +- src/libstore-tests/downstream-placeholder.cc | 2 +- src/libstore-tests/http-binary-cache-store.cc | 2 +- src/libstore-tests/legacy-ssh-store.cc | 2 +- .../local-binary-cache-store.cc | 2 +- src/libstore-tests/local-overlay-store.cc | 2 +- src/libstore-tests/local-store.cc | 8 +- src/libstore-tests/machines.cc | 8 +- src/libstore-tests/nar-info-disk-cache.cc | 4 +- src/libstore-tests/nar-info.cc | 8 +- src/libstore-tests/nix_api_store.cc | 4 +- src/libstore-tests/outputs-spec.cc | 2 +- src/libstore-tests/path-info.cc | 6 +- src/libstore-tests/path.cc | 10 +- src/libstore-tests/references.cc | 2 +- src/libstore-tests/s3-binary-cache-store.cc | 2 +- src/libstore-tests/serve-protocol.cc | 14 +- src/libstore-tests/ssh-store.cc | 2 +- src/libstore-tests/store-reference.cc | 8 +- src/libstore-tests/uds-remote-store.cc | 2 +- src/libstore-tests/worker-protocol.cc | 14 +- src/libstore/binary-cache-store.cc | 30 +- src/libstore/build-result.cc | 2 +- src/libstore/build/derivation-goal.cc | 36 +- .../build/drv-output-substitution-goal.cc | 10 +- src/libstore/build/entry-points.cc | 10 +- src/libstore/build/goal.cc | 4 +- src/libstore/build/substitution-goal.cc | 10 +- src/libstore/build/worker.cc | 18 +- src/libstore/builtins/buildenv.cc | 6 +- src/libstore/builtins/fetchurl.cc | 10 +- src/libstore/builtins/unpack-channel.cc | 4 +- src/libstore/common-protocol.cc | 16 +- src/libstore/common-ssh-store-config.cc | 4 +- src/libstore/content-address.cc | 6 +- src/libstore/daemon.cc | 36 +- src/libstore/derivation-options.cc | 10 +- src/libstore/derivations.cc | 22 +- src/libstore/derived-path-map.cc | 4 +- src/libstore/derived-path.cc | 8 +- src/libstore/downstream-placeholder.cc | 4 +- src/libstore/dummy-store.cc | 4 +- src/libstore/export-import.cc | 10 +- src/libstore/filetransfer.cc | 20 +- src/libstore/gc.cc | 16 +- src/libstore/globals.cc | 22 +- src/libstore/http-binary-cache-store.cc | 10 +- .../nix/{ => store}/binary-cache-store.hh | 8 +- .../include/nix/{ => store}/build-result.hh | 4 +- .../nix/{ => store}/build/derivation-goal.hh | 14 +- .../build/drv-output-substitution-goal.hh | 8 +- .../include/nix/{ => store}/build/goal.hh | 4 +- .../{ => store}/build/substitution-goal.hh | 8 +- .../include/nix/{ => store}/build/worker.hh | 10 +- .../include/nix/{ => store}/builtins.hh | 2 +- .../nix/{ => store}/builtins/buildenv.hh | 2 +- .../nix/{ => store}/common-protocol-impl.hh | 4 +- .../nix/{ => store}/common-protocol.hh | 2 +- .../{ => store}/common-ssh-store-config.hh | 2 +- .../nix/{ => store}/content-address.hh | 8 +- .../include/nix/{ => store}/daemon.hh | 4 +- .../nix/{ => store}/derivation-options.hh | 4 +- .../include/nix/{ => store}/derivations.hh | 16 +- .../nix/{ => store}/derived-path-map.hh | 4 +- .../include/nix/{ => store}/derived-path.hh | 8 +- .../nix/{ => store}/downstream-placeholder.hh | 6 +- .../include/nix/{ => store}/filetransfer.hh | 10 +- .../include/nix/{ => store}/gc-store.hh | 2 +- .../include/nix/{ => store}/globals.hh | 12 +- .../{ => store}/http-binary-cache-store.hh | 2 +- .../nix/{ => store}/indirect-root-store.hh | 2 +- src/libstore/include/nix/{ => store}/keys.hh | 2 +- .../nix/{ => store}/legacy-ssh-store.hh | 12 +- .../length-prefixed-protocol-helper.hh | 2 +- .../{ => store}/local-binary-cache-store.hh | 2 +- .../include/nix/{ => store}/local-fs-store.hh | 6 +- .../nix/{ => store}/local-overlay-store.hh | 2 +- .../include/nix/{ => store}/local-store.hh | 10 +- .../include/nix/{ => store}/log-store.hh | 2 +- .../include/nix/{ => store}/machines.hh | 4 +- .../nix/{ => store}/make-content-addressed.hh | 2 +- .../include/nix/{ => store}/meson.build | 4 +- src/libstore/include/nix/{ => store}/names.hh | 2 +- .../include/nix/{ => store}/nar-accessor.hh | 2 +- .../nix/{ => store}/nar-info-disk-cache.hh | 6 +- .../include/nix/{ => store}/nar-info.hh | 6 +- .../include/nix/{ => store}/outputs-spec.hh | 4 +- .../nix/{ => store}/parsed-derivations.hh | 4 +- .../include/nix/{ => store}/path-info.hh | 8 +- .../nix/{ => store}/path-references.hh | 4 +- .../include/nix/{ => store}/path-regex.hh | 0 .../nix/{ => store}/path-with-outputs.hh | 4 +- src/libstore/include/nix/{ => store}/path.hh | 2 +- .../include/nix/{ => store}/pathlocks.hh | 2 +- .../nix/{ => store}/posix-fs-canonicalise.hh | 4 +- .../include/nix/{ => store}/profiles.hh | 4 +- .../include/nix/{ => store}/realisation.hh | 10 +- .../nix/{ => store}/remote-fs-accessor.hh | 6 +- .../{ => store}/remote-store-connection.hh | 8 +- .../include/nix/{ => store}/remote-store.hh | 6 +- .../nix/{ => store}/s3-binary-cache-store.hh | 2 +- src/libstore/include/nix/{ => store}/s3.hh | 2 +- .../{ => store}/serve-protocol-connection.hh | 4 +- .../nix/{ => store}/serve-protocol-impl.hh | 4 +- .../include/nix/{ => store}/serve-protocol.hh | 2 +- .../include/nix/{ => store}/sqlite.hh | 2 +- .../include/nix/{ => store}/ssh-store.hh | 8 +- src/libstore/include/nix/{ => store}/ssh.hh | 6 +- .../include/nix/{ => store}/store-api.hh | 28 +- .../include/nix/{ => store}/store-cast.hh | 2 +- .../nix/{ => store}/store-dir-config.hh | 10 +- .../nix/{ => store}/store-reference.hh | 2 +- .../nix/{ => store}/uds-remote-store.hh | 6 +- .../{ => store}/worker-protocol-connection.hh | 4 +- .../nix/{ => store}/worker-protocol-impl.hh | 4 +- .../nix/{ => store}/worker-protocol.hh | 2 +- src/libstore/indirect-root-store.cc | 2 +- src/libstore/keys.cc | 6 +- src/libstore/legacy-ssh-store.cc | 28 +- .../nix/{ => store}/fchmodat2-compat.hh | 0 .../linux/include/nix/{ => store}/meson.build | 2 +- .../include/nix/{ => store}/personality.hh | 0 src/libstore/linux/meson.build | 2 +- src/libstore/linux/personality.cc | 4 +- src/libstore/local-binary-cache-store.cc | 8 +- src/libstore/local-fs-store.cc | 14 +- src/libstore/local-overlay-store.cc | 10 +- src/libstore/local-store.cc | 40 +-- src/libstore/log-store.cc | 2 +- src/libstore/machines.cc | 6 +- src/libstore/make-content-addressed.cc | 4 +- src/libstore/meson.build | 4 +- src/libstore/misc.cc | 24 +- src/libstore/names.cc | 4 +- src/libstore/nar-accessor.cc | 4 +- src/libstore/nar-info-disk-cache.cc | 12 +- src/libstore/nar-info.cc | 10 +- src/libstore/optimise-store.cc | 10 +- src/libstore/outputs-spec.cc | 10 +- src/libstore/package.nix | 6 +- src/libstore/parsed-derivations.cc | 2 +- src/libstore/path-info.cc | 10 +- src/libstore/path-references.cc | 6 +- src/libstore/path-with-outputs.cc | 6 +- src/libstore/path.cc | 2 +- src/libstore/pathlocks.cc | 8 +- src/libstore/posix-fs-canonicalise.cc | 13 +- src/libstore/profiles.cc | 10 +- src/libstore/realisation.cc | 8 +- src/libstore/remote-fs-accessor.cc | 4 +- src/libstore/remote-store.cc | 40 +-- src/libstore/s3-binary-cache-store.cc | 16 +- src/libstore/serve-protocol-connection.cc | 8 +- src/libstore/serve-protocol.cc | 16 +- src/libstore/sqlite.cc | 10 +- src/libstore/ssh-store.cc | 18 +- src/libstore/ssh.cc | 12 +- src/libstore/store-api.cc | 42 +-- src/libstore/store-reference.cc | 10 +- src/libstore/uds-remote-store.cc | 6 +- src/libstore/unix/build/child.cc | 6 +- src/libstore/unix/build/hook-instance.cc | 14 +- .../unix/build/local-derivation-goal.cc | 58 ++-- .../include/nix/{ => store}/build/child.hh | 0 .../nix/{ => store}/build/hook-instance.hh | 6 +- .../build/local-derivation-goal.hh | 6 +- .../unix/include/nix/{ => store}/meson.build | 2 +- .../unix/include/nix/{ => store}/user-lock.hh | 0 src/libstore/unix/meson.build | 2 +- src/libstore/unix/pathlocks.cc | 8 +- src/libstore/unix/user-lock.cc | 10 +- src/libstore/windows/pathlocks.cc | 10 +- src/libstore/worker-protocol-connection.cc | 8 +- src/libstore/worker-protocol.cc | 16 +- src/libutil-c/nix_api_util.cc | 6 +- src/libutil-c/nix_api_util_internal.h | 2 +- src/libutil-test-support/hash.cc | 4 +- .../include/nix/meson.build | 11 - .../nix/{ => util}/tests/characterization.hh | 6 +- .../nix/{ => util}/tests/gtest-with-params.hh | 0 .../include/nix/{ => util}/tests/hash.hh | 2 +- .../include/nix/util/tests/meson.build | 11 + .../nix/{ => util}/tests/nix_api_util.hh | 0 .../nix/{ => util}/tests/string_callback.hh | 0 .../tests/tracing-file-system-object-sink.hh | 2 +- src/libutil-test-support/meson.build | 4 +- src/libutil-test-support/package.nix | 2 +- src/libutil-test-support/string_callback.cc | 2 +- src/libutil-tests/args.cc | 4 +- src/libutil-tests/canon-path.cc | 2 +- src/libutil-tests/checked-arithmetic.cc | 4 +- src/libutil-tests/chunked-vector.cc | 2 +- src/libutil-tests/closure.cc | 2 +- src/libutil-tests/compression.cc | 2 +- src/libutil-tests/config.cc | 4 +- src/libutil-tests/executable-path.cc | 2 +- src/libutil-tests/file-content-address.cc | 2 +- src/libutil-tests/file-system.cc | 12 +- src/libutil-tests/git.cc | 6 +- src/libutil-tests/hash.cc | 2 +- src/libutil-tests/hilite.cc | 2 +- src/libutil-tests/json-utils.cc | 4 +- src/libutil-tests/logging.cc | 4 +- src/libutil-tests/lru-cache.cc | 2 +- src/libutil-tests/nix_api_util.cc | 8 +- src/libutil-tests/pool.cc | 2 +- src/libutil-tests/position.cc | 2 +- src/libutil-tests/processes.cc | 2 +- src/libutil-tests/references.cc | 2 +- src/libutil-tests/spawn.cc | 2 +- src/libutil-tests/strings.cc | 4 +- src/libutil-tests/suggestions.cc | 2 +- src/libutil-tests/terminal.cc | 8 +- src/libutil-tests/url.cc | 2 +- src/libutil-tests/util.cc | 10 +- src/libutil-tests/xml-writer.cc | 2 +- src/libutil/archive.cc | 12 +- src/libutil/args.cc | 14 +- src/libutil/canon-path.cc | 8 +- src/libutil/compression.cc | 10 +- src/libutil/compute-levels.cc | 2 +- src/libutil/config-global.cc | 2 +- src/libutil/{config.cc => configuration.cc} | 18 +- src/libutil/current-process.cc | 16 +- src/libutil/english.cc | 2 +- src/libutil/environment-variables.cc | 4 +- src/libutil/error.cc | 12 +- src/libutil/executable-path.cc | 10 +- src/libutil/exit.cc | 2 +- src/libutil/experimental-features.cc | 6 +- src/libutil/file-content-address.cc | 8 +- src/libutil/file-descriptor.cc | 6 +- src/libutil/file-system.cc | 18 +- src/libutil/fs-sink.cc | 10 +- src/libutil/git.cc | 10 +- src/libutil/hash.cc | 10 +- src/libutil/hilite.cc | 2 +- .../{ => util}/abstract-setting-to-json.hh | 4 +- .../include/nix/{ => util}/ansicolor.hh | 0 src/libutil/include/nix/{ => util}/archive.hh | 6 +- src/libutil/include/nix/{ => util}/args.hh | 6 +- .../include/nix/{ => util}/args/root.hh | 2 +- .../include/nix/{ => util}/callback.hh | 0 .../include/nix/{ => util}/canon-path.hh | 0 .../nix/{ => util}/checked-arithmetic.hh | 0 .../include/nix/{ => util}/chunked-vector.hh | 2 +- src/libutil/include/nix/{ => util}/closure.hh | 2 +- .../include/nix/{ => util}/comparator.hh | 0 .../include/nix/{ => util}/compression.hh | 6 +- .../include/nix/{ => util}/compute-levels.hh | 2 +- .../include/nix/{ => util}/config-global.hh | 2 +- .../include/nix/{ => util}/config-impl.hh | 4 +- .../nix/{config.hh => util/configuration.hh} | 4 +- .../include/nix/{ => util}/current-process.hh | 2 +- src/libutil/include/nix/{ => util}/english.hh | 0 .../nix/{ => util}/environment-variables.hh | 4 +- src/libutil/include/nix/{ => util}/error.hh | 6 +- src/libutil/include/nix/{ => util}/exec.hh | 2 +- .../include/nix/{ => util}/executable-path.hh | 2 +- src/libutil/include/nix/{ => util}/exit.hh | 0 .../nix/{ => util}/experimental-features.hh | 4 +- .../nix/{ => util}/file-content-address.hh | 2 +- .../include/nix/{ => util}/file-descriptor.hh | 4 +- .../include/nix/{ => util}/file-path-impl.hh | 0 .../include/nix/{ => util}/file-path.hh | 4 +- .../include/nix/{ => util}/file-system.hh | 10 +- src/libutil/include/nix/{ => util}/finally.hh | 0 src/libutil/include/nix/{ => util}/fmt.hh | 2 +- src/libutil/include/nix/{ => util}/fs-sink.hh | 6 +- src/libutil/include/nix/{ => util}/git.hh | 10 +- src/libutil/include/nix/{ => util}/hash.hh | 8 +- src/libutil/include/nix/{ => util}/hilite.hh | 0 .../include/nix/{ => util}/json-impls.hh | 0 .../include/nix/{ => util}/json-utils.hh | 2 +- src/libutil/include/nix/{ => util}/logging.hh | 8 +- .../include/nix/{ => util}/lru-cache.hh | 0 .../nix/{ => util}/memory-source-accessor.hh | 6 +- .../include/nix/{ => util}/meson.build | 4 +- .../include/nix/{ => util}/muxable-pipe.hh | 6 +- .../include/nix/{ => util}/os-string.hh | 0 src/libutil/include/nix/{ => util}/pool.hh | 4 +- src/libutil/include/nix/{ => util}/pos-idx.hh | 0 .../include/nix/{ => util}/pos-table.hh | 6 +- .../include/nix/{ => util}/position.hh | 2 +- .../nix/{ => util}/posix-source-accessor.hh | 2 +- .../include/nix/{ => util}/processes.hh | 10 +- src/libutil/include/nix/{ => util}/ref.hh | 0 .../include/nix/{ => util}/references.hh | 2 +- .../nix/{ => util}/regex-combinators.hh | 0 .../include/nix/{ => util}/repair-flag.hh | 0 .../include/nix/{ => util}/serialise.hh | 6 +- src/libutil/include/nix/{ => util}/signals.hh | 8 +- .../nix/{ => util}/signature/local-keys.hh | 2 +- .../nix/{ => util}/signature/signer.hh | 4 +- .../include/nix/{ => util}/source-accessor.hh | 6 +- .../include/nix/{ => util}/source-path.hh | 8 +- src/libutil/include/nix/{ => util}/split.hh | 2 +- .../include/nix/{ => util}/std-hash.hh | 0 .../include/nix/{ => util}/strings-inline.hh | 2 +- src/libutil/include/nix/{ => util}/strings.hh | 0 .../include/nix/{ => util}/suggestions.hh | 2 +- src/libutil/include/nix/{ => util}/sync.hh | 2 +- src/libutil/include/nix/{ => util}/tarfile.hh | 4 +- .../include/nix/{ => util}/terminal.hh | 0 .../include/nix/{ => util}/thread-pool.hh | 4 +- .../include/nix/{ => util}/topo-sort.hh | 2 +- src/libutil/include/nix/{ => util}/types.hh | 0 .../nix/{ => util}/unix-domain-socket.hh | 4 +- .../include/nix/{ => util}/url-parts.hh | 0 src/libutil/include/nix/{ => util}/url.hh | 2 +- src/libutil/include/nix/{ => util}/users.hh | 2 +- src/libutil/include/nix/{ => util}/util.hh | 8 +- .../include/nix/{ => util}/variant-wrapper.hh | 0 .../include/nix/{ => util}/xml-writer.hh | 0 src/libutil/json-utils.cc | 6 +- src/libutil/linux/cgroup.cc | 10 +- .../linux/include/nix/{ => util}/cgroup.hh | 2 +- .../linux/include/nix/{ => util}/meson.build | 2 +- .../include/nix/{ => util}/namespaces.hh | 2 +- src/libutil/linux/meson.build | 2 +- src/libutil/linux/namespaces.cc | 14 +- src/libutil/logging.cc | 16 +- src/libutil/memory-source-accessor.cc | 2 +- src/libutil/meson.build | 6 +- src/libutil/mounted-source-accessor.cc | 2 +- src/libutil/package.nix | 8 +- src/libutil/pos-table.cc | 2 +- src/libutil/position.cc | 2 +- src/libutil/posix-source-accessor.cc | 8 +- src/libutil/references.cc | 6 +- src/libutil/serialise.cc | 8 +- src/libutil/signature/local-keys.cc | 6 +- src/libutil/signature/signer.cc | 4 +- src/libutil/source-accessor.cc | 4 +- src/libutil/source-path.cc | 2 +- src/libutil/strings.cc | 6 +- src/libutil/suggestions.cc | 6 +- src/libutil/tarfile.cc | 8 +- src/libutil/terminal.cc | 6 +- src/libutil/thread-pool.cc | 6 +- src/libutil/union-source-accessor.cc | 2 +- src/libutil/unix-domain-socket.cc | 8 +- src/libutil/unix/environment-variables.cc | 2 +- src/libutil/unix/file-descriptor.cc | 8 +- src/libutil/unix/file-path.cc | 4 +- src/libutil/unix/file-system.cc | 2 +- .../unix/include/nix/{ => util}/meson.build | 2 +- .../unix/include/nix/{ => util}/monitor-fd.hh | 2 +- .../include/nix/{ => util}/signals-impl.hh | 10 +- src/libutil/unix/meson.build | 2 +- src/libutil/unix/muxable-pipe.cc | 6 +- src/libutil/unix/os-string.cc | 4 +- src/libutil/unix/processes.cc | 14 +- src/libutil/unix/signals.cc | 10 +- src/libutil/unix/users.cc | 8 +- src/libutil/url.cc | 10 +- src/libutil/users.cc | 8 +- src/libutil/util.cc | 8 +- src/libutil/windows/environment-variables.cc | 2 +- src/libutil/windows/file-descriptor.cc | 12 +- src/libutil/windows/file-path.cc | 6 +- src/libutil/windows/file-system.cc | 2 +- .../include/nix/{ => util}/meson.build | 2 +- .../include/nix/{ => util}/signals-impl.hh | 2 +- .../nix/{ => util}/windows-async-pipe.hh | 2 +- .../include/nix/{ => util}/windows-error.hh | 2 +- src/libutil/windows/meson.build | 2 +- src/libutil/windows/muxable-pipe.cc | 8 +- src/libutil/windows/os-string.cc | 6 +- src/libutil/windows/processes.cc | 26 +- src/libutil/windows/users.cc | 10 +- src/libutil/windows/windows-async-pipe.cc | 4 +- src/libutil/windows/windows-error.cc | 2 +- src/libutil/xml-writer.cc | 2 +- src/nix-build/nix-build.cc | 38 +- src/nix-channel/nix-channel.cc | 18 +- .../nix-collect-garbage.cc | 18 +- src/nix-copy-closure/nix-copy-closure.cc | 8 +- src/nix-env/nix-env.cc | 36 +- src/nix-env/user-env.cc | 20 +- src/nix-env/user-env.hh | 2 +- src/nix-instantiate/nix-instantiate.cc | 28 +- src/nix-store/dotgraph.cc | 2 +- src/nix-store/dotgraph.hh | 2 +- src/nix-store/graphml.cc | 4 +- src/nix-store/graphml.hh | 2 +- src/nix-store/nix-store.cc | 36 +- src/nix/add-to-store.cc | 14 +- src/nix/app.cc | 20 +- src/nix/build.cc | 10 +- src/nix/bundle.cc | 14 +- src/nix/cat.cc | 6 +- src/nix/config-check.cc | 18 +- src/nix/config.cc | 10 +- src/nix/copy.cc | 8 +- src/nix/crash-handler.cc | 4 +- src/nix/derivation-add.cc | 10 +- src/nix/derivation-show.cc | 10 +- src/nix/derivation.cc | 2 +- src/nix/develop.cc | 20 +- src/nix/diff-closures.cc | 12 +- src/nix/dump-path.cc | 6 +- src/nix/edit.cc | 12 +- src/nix/env.cc | 8 +- src/nix/eval.cc | 14 +- src/nix/flake.cc | 42 +-- src/nix/fmt.cc | 6 +- src/nix/hash.cc | 20 +- src/nix/log.cc | 10 +- src/nix/ls.cc | 8 +- src/nix/main.cc | 44 +-- src/nix/make-content-addressed.cc | 8 +- src/nix/man-pages.cc | 6 +- src/nix/nar.cc | 2 +- src/nix/optimise-store.cc | 6 +- src/nix/path-from-hash-part.cc | 4 +- src/nix/path-info.cc | 12 +- src/nix/prefetch.cc | 28 +- src/nix/profile.cc | 24 +- src/nix/realisation.cc | 4 +- src/nix/registry.cc | 14 +- src/nix/repl.cc | 16 +- src/nix/run.cc | 24 +- src/nix/run.hh | 2 +- src/nix/search.cc | 28 +- src/nix/self-exe.cc | 6 +- src/nix/sigs.cc | 10 +- src/nix/store-copy-log.cc | 14 +- src/nix/store-delete.cc | 12 +- src/nix/store-gc.cc | 12 +- src/nix/store-info.cc | 8 +- src/nix/store-repair.cc | 4 +- src/nix/store.cc | 2 +- src/nix/unix/daemon.cc | 32 +- src/nix/upgrade-nix.cc | 20 +- src/nix/verify.cc | 14 +- src/nix/why-depends.cc | 8 +- src/perl/lib/Nix/Store.xs | 10 +- tests/functional/plugins/plugintest.cc | 4 +- .../functional/test-libstoreconsumer/main.cc | 6 +- 645 files changed, 2562 insertions(+), 2562 deletions(-) rename src/libcmd/include/nix/{ => cmd}/built-path.hh (97%) rename src/libcmd/include/nix/{ => cmd}/command-installable-value.hh (85%) rename src/libcmd/include/nix/{ => cmd}/command.hh (98%) rename src/libcmd/include/nix/{ => cmd}/common-eval-args.hh (91%) rename src/libcmd/include/nix/{ => cmd}/compatibility-settings.hh (97%) rename src/libcmd/include/nix/{ => cmd}/editor-for.hh (74%) rename src/libcmd/include/nix/{ => cmd}/installable-attr-path.hh (61%) rename src/libcmd/include/nix/{ => cmd}/installable-derived-path.hh (94%) rename src/libcmd/include/nix/{ => cmd}/installable-flake.hh (96%) rename src/libcmd/include/nix/{ => cmd}/installable-value.hh (98%) rename src/libcmd/include/nix/{ => cmd}/installables.hh (95%) rename src/libcmd/include/nix/{ => cmd}/legacy.hh (100%) rename src/libcmd/include/nix/{ => cmd}/markdown.hh (100%) rename src/libcmd/include/nix/{ => cmd}/meson.build (90%) rename src/libcmd/include/nix/{ => cmd}/misc-store-flags.hh (90%) rename src/libcmd/include/nix/{ => cmd}/network-proxy.hh (93%) rename src/libcmd/include/nix/{ => cmd}/repl-interacter.hh (94%) rename src/libcmd/include/nix/{ => cmd}/repl.hh (97%) rename src/libexpr-test-support/include/nix/{ => expr}/tests/libexpr.hh (93%) create mode 100644 src/libexpr-test-support/include/nix/expr/tests/meson.build rename src/libexpr-test-support/include/nix/{ => expr}/tests/nix_api_expr.hh (92%) rename src/libexpr-test-support/include/nix/{ => expr}/tests/value/context.hh (93%) delete mode 100644 src/libexpr-test-support/include/nix/meson.build rename src/libexpr/include/nix/{ => expr}/attr-path.hh (95%) rename src/libexpr/include/nix/{ => expr}/attr-set.hh (98%) rename src/libexpr/include/nix/{ => expr}/eval-cache.hh (97%) rename src/libexpr/include/nix/{ => expr}/eval-error.hh (98%) rename src/libexpr/include/nix/{ => expr}/eval-gc.hh (96%) rename src/libexpr/include/nix/{ => expr}/eval-inline.hh (96%) rename src/libexpr/include/nix/{ => expr}/eval-settings.hh (99%) rename src/libexpr/include/nix/{ => expr}/eval.hh (98%) rename src/libexpr/include/nix/{ => expr}/function-trace.hh (86%) rename src/libexpr/include/nix/{ => expr}/gc-small-vector.hh (95%) rename src/libexpr/include/nix/{ => expr}/get-drvs.hh (97%) rename src/libexpr/include/nix/{ => expr}/json-to-value.hh (87%) rename src/libexpr/include/nix/{ => expr}/lexer-helpers.hh (100%) rename src/libexpr/include/nix/{ => expr}/meson.build (90%) rename src/libexpr/include/nix/{ => expr}/nixexpr.hh (99%) rename src/libexpr/include/nix/{ => expr}/parser-state.hh (99%) rename src/libexpr/include/nix/{ => expr}/primops.hh (98%) rename src/libexpr/include/nix/{ => expr}/print-ambiguous.hh (95%) rename src/libexpr/include/nix/{ => expr}/print-options.hh (100%) rename src/libexpr/include/nix/{ => expr}/print.hh (97%) rename src/libexpr/include/nix/{ => expr}/repl-exit-status.hh (100%) rename src/libexpr/include/nix/{ => expr}/search-path.hh (97%) rename src/libexpr/include/nix/{ => expr}/symbol-table.hh (97%) rename src/libexpr/include/nix/{ => expr}/value-to-json.hh (88%) rename src/libexpr/include/nix/{ => expr}/value-to-xml.hh (79%) rename src/libexpr/include/nix/{ => expr}/value.hh (98%) rename src/libexpr/include/nix/{ => expr}/value/context.hh (94%) rename src/libfetchers/include/nix/{ => fetchers}/attrs.hh (95%) rename src/libfetchers/include/nix/{ => fetchers}/cache.hh (97%) rename src/libfetchers/include/nix/{ => fetchers}/fetch-settings.hh (98%) rename src/libfetchers/include/nix/{ => fetchers}/fetch-to-store.hh (68%) rename src/libfetchers/include/nix/{ => fetchers}/fetchers.hh (97%) rename src/libfetchers/include/nix/{ => fetchers}/filtering-source-accessor.hh (98%) rename src/libfetchers/include/nix/{ => fetchers}/git-lfs-fetch.hh (90%) rename src/libfetchers/include/nix/{ => fetchers}/git-utils.hh (97%) rename src/libfetchers/include/nix/{ => fetchers}/meson.build (84%) rename src/libfetchers/include/nix/{ => fetchers}/registry.hh (96%) rename src/libfetchers/include/nix/{ => fetchers}/store-path-accessor.hh (85%) rename src/libfetchers/include/nix/{ => fetchers}/tarball.hh (88%) create mode 100644 src/libflake/include/nix/flake/meson.build delete mode 100644 src/libflake/include/nix/meson.build rename src/libmain/include/nix/{ => main}/common-args.hh (96%) rename src/libmain/include/nix/{ => main}/loggers.hh (88%) rename src/libmain/include/nix/{ => main}/meson.build (74%) rename src/libmain/include/nix/{ => main}/plugin.hh (100%) rename src/libmain/include/nix/{ => main}/progress-bar.hh (73%) rename src/libmain/include/nix/{ => main}/shared.hh (94%) delete mode 100644 src/libstore-test-support/include/nix/meson.build rename src/libstore-test-support/include/nix/{ => store}/tests/derived-path.hh (84%) rename src/libstore-test-support/include/nix/{ => store}/tests/libstore.hh (93%) create mode 100644 src/libstore-test-support/include/nix/store/tests/meson.build rename src/libstore-test-support/include/nix/{ => store}/tests/nix_api_store.hh (96%) rename src/libstore-test-support/include/nix/{ => store}/tests/outputs-spec.hh (72%) rename src/libstore-test-support/include/nix/{ => store}/tests/path.hh (93%) rename src/libstore-test-support/include/nix/{ => store}/tests/protocol.hh (96%) rename src/libstore/include/nix/{ => store}/binary-cache-store.hh (97%) rename src/libstore/include/nix/{ => store}/build-result.hh (98%) rename src/libstore/include/nix/{ => store}/build/derivation-goal.hh (97%) rename src/libstore/include/nix/{ => store}/build/drv-output-substitution-goal.hh (88%) rename src/libstore/include/nix/{ => store}/build/goal.hh (99%) rename src/libstore/include/nix/{ => store}/build/substitution-goal.hh (93%) rename src/libstore/include/nix/{ => store}/build/worker.hh (98%) rename src/libstore/include/nix/{ => store}/builtins.hh (90%) rename src/libstore/include/nix/{ => store}/builtins/buildenv.hh (96%) rename src/libstore/include/nix/{ => store}/common-protocol-impl.hh (92%) rename src/libstore/include/nix/{ => store}/common-protocol.hh (98%) rename src/libstore/include/nix/{ => store}/common-ssh-store-config.hh (98%) rename src/libstore/include/nix/{ => store}/content-address.hh (98%) rename src/libstore/include/nix/{ => store}/daemon.hh (79%) rename src/libstore/include/nix/{ => store}/derivation-options.hh (98%) rename src/libstore/include/nix/{ => store}/derivations.hh (98%) rename src/libstore/include/nix/{ => store}/derived-path-map.hh (98%) rename src/libstore/include/nix/{ => store}/derived-path.hh (98%) rename src/libstore/include/nix/{ => store}/downstream-placeholder.hh (97%) rename src/libstore/include/nix/{ => store}/filetransfer.hh (96%) rename src/libstore/include/nix/{ => store}/gc-store.hh (99%) rename src/libstore/include/nix/{ => store}/globals.hh (99%) rename src/libstore/include/nix/{ => store}/http-binary-cache-store.hh (93%) rename src/libstore/include/nix/{ => store}/indirect-root-store.hh (98%) rename src/libstore/include/nix/{ => store}/keys.hh (64%) rename src/libstore/include/nix/{ => store}/legacy-ssh-store.hh (96%) rename src/libstore/include/nix/{ => store}/length-prefixed-protocol-helper.hh (99%) rename src/libstore/include/nix/{ => store}/local-binary-cache-store.hh (91%) rename src/libstore/include/nix/{ => store}/local-fs-store.hh (96%) rename src/libstore/include/nix/{ => store}/local-overlay-store.hh (99%) rename src/libstore/include/nix/{ => store}/local-store.hh (98%) rename src/libstore/include/nix/{ => store}/log-store.hh (94%) rename src/libstore/include/nix/{ => store}/machines.hh (97%) rename src/libstore/include/nix/{ => store}/make-content-addressed.hh (93%) rename src/libstore/include/nix/{ => store}/meson.build (96%) rename src/libstore/include/nix/{ => store}/names.hh (95%) rename src/libstore/include/nix/{ => store}/nar-accessor.hh (95%) rename src/libstore/include/nix/{ => store}/nar-info-disk-cache.hh (93%) rename src/libstore/include/nix/{ => store}/nar-info.hh (92%) rename src/libstore/include/nix/{ => store}/outputs-spec.hh (97%) rename src/libstore/include/nix/{ => store}/parsed-derivations.hh (94%) rename src/libstore/include/nix/{ => store}/path-info.hh (97%) rename src/libstore/include/nix/{ => store}/path-references.hh (89%) rename src/libstore/include/nix/{ => store}/path-regex.hh (100%) rename src/libstore/include/nix/{ => store}/path-with-outputs.hh (95%) rename src/libstore/include/nix/{ => store}/path.hh (98%) rename src/libstore/include/nix/{ => store}/pathlocks.hh (96%) rename src/libstore/include/nix/{ => store}/posix-fs-canonicalise.hh (95%) rename src/libstore/include/nix/{ => store}/profiles.hh (99%) rename src/libstore/include/nix/{ => store}/realisation.hh (96%) rename src/libstore/include/nix/{ => store}/remote-fs-accessor.hh (90%) rename src/libstore/include/nix/{ => store}/remote-store-connection.hh (90%) rename src/libstore/include/nix/{ => store}/remote-store.hh (98%) rename src/libstore/include/nix/{ => store}/s3-binary-cache-store.hh (98%) rename src/libstore/include/nix/{ => store}/s3.hh (96%) rename src/libstore/include/nix/{ => store}/serve-protocol-connection.hh (97%) rename src/libstore/include/nix/{ => store}/serve-protocol-impl.hh (94%) rename src/libstore/include/nix/{ => store}/serve-protocol.hh (99%) rename src/libstore/include/nix/{ => store}/sqlite.hh (99%) rename src/libstore/include/nix/{ => store}/ssh-store.hh (89%) rename src/libstore/include/nix/{ => store}/ssh.hh (95%) rename src/libstore/include/nix/{ => store}/store-api.hh (98%) rename src/libstore/include/nix/{ => store}/store-cast.hh (93%) rename src/libstore/include/nix/{ => store}/store-dir-config.hh (94%) rename src/libstore/include/nix/{ => store}/store-reference.hh (98%) rename src/libstore/include/nix/{ => store}/uds-remote-store.hh (94%) rename src/libstore/include/nix/{ => store}/worker-protocol-connection.hh (98%) rename src/libstore/include/nix/{ => store}/worker-protocol-impl.hh (94%) rename src/libstore/include/nix/{ => store}/worker-protocol.hh (99%) rename src/libstore/linux/include/nix/{ => store}/fchmodat2-compat.hh (100%) rename src/libstore/linux/include/nix/{ => store}/meson.build (59%) rename src/libstore/linux/include/nix/{ => store}/personality.hh (100%) rename src/libstore/unix/include/nix/{ => store}/build/child.hh (100%) rename src/libstore/unix/include/nix/{ => store}/build/hook-instance.hh (83%) rename src/libstore/unix/include/nix/{ => store}/build/local-derivation-goal.hh (98%) rename src/libstore/unix/include/nix/{ => store}/meson.build (73%) rename src/libstore/unix/include/nix/{ => store}/user-lock.hh (100%) delete mode 100644 src/libutil-test-support/include/nix/meson.build rename src/libutil-test-support/include/nix/{ => util}/tests/characterization.hh (95%) rename src/libutil-test-support/include/nix/{ => util}/tests/gtest-with-params.hh (100%) rename src/libutil-test-support/include/nix/{ => util}/tests/hash.hh (86%) create mode 100644 src/libutil-test-support/include/nix/util/tests/meson.build rename src/libutil-test-support/include/nix/{ => util}/tests/nix_api_util.hh (100%) rename src/libutil-test-support/include/nix/{ => util}/tests/string_callback.hh (100%) rename src/libutil-test-support/include/nix/{ => util}/tests/tracing-file-system-object-sink.hh (97%) rename src/libutil/{config.cc => configuration.cc} (97%) rename src/libutil/include/nix/{ => util}/abstract-setting-to-json.hh (83%) rename src/libutil/include/nix/{ => util}/ansicolor.hh (100%) rename src/libutil/include/nix/{ => util}/archive.hh (95%) rename src/libutil/include/nix/{ => util}/args.hh (99%) rename src/libutil/include/nix/{ => util}/args/root.hh (98%) rename src/libutil/include/nix/{ => util}/callback.hh (100%) rename src/libutil/include/nix/{ => util}/canon-path.hh (100%) rename src/libutil/include/nix/{ => util}/checked-arithmetic.hh (100%) rename src/libutil/include/nix/{ => util}/chunked-vector.hh (98%) rename src/libutil/include/nix/{ => util}/closure.hh (98%) rename src/libutil/include/nix/{ => util}/comparator.hh (100%) rename src/libutil/include/nix/{ => util}/compression.hh (89%) rename src/libutil/include/nix/{ => util}/compute-levels.hh (71%) rename src/libutil/include/nix/{ => util}/config-global.hh (94%) rename src/libutil/include/nix/{ => util}/config-impl.hh (98%) rename src/libutil/include/nix/{config.hh => util/configuration.hh} (99%) rename src/libutil/include/nix/{ => util}/current-process.hh (96%) rename src/libutil/include/nix/{ => util}/english.hh (100%) rename src/libutil/include/nix/{ => util}/environment-variables.hh (95%) rename src/libutil/include/nix/{ => util}/error.hh (98%) rename src/libutil/include/nix/{ => util}/exec.hh (89%) rename src/libutil/include/nix/{ => util}/executable-path.hh (98%) rename src/libutil/include/nix/{ => util}/exit.hh (100%) rename src/libutil/include/nix/{ => util}/experimental-features.hh (97%) rename src/libutil/include/nix/{ => util}/file-content-address.hh (99%) rename src/libutil/include/nix/{ => util}/file-descriptor.hh (98%) rename src/libutil/include/nix/{ => util}/file-path-impl.hh (100%) rename src/libutil/include/nix/{ => util}/file-path.hh (93%) rename src/libutil/include/nix/{ => util}/file-system.hh (98%) rename src/libutil/include/nix/{ => util}/finally.hh (100%) rename src/libutil/include/nix/{ => util}/fmt.hh (99%) rename src/libutil/include/nix/{ => util}/fs-sink.hh (96%) rename src/libutil/include/nix/{ => util}/git.hh (97%) rename src/libutil/include/nix/{ => util}/hash.hh (97%) rename src/libutil/include/nix/{ => util}/hilite.hh (100%) rename src/libutil/include/nix/{ => util}/json-impls.hh (100%) rename src/libutil/include/nix/{ => util}/json-utils.hh (99%) rename src/libutil/include/nix/{ => util}/logging.hh (98%) rename src/libutil/include/nix/{ => util}/lru-cache.hh (100%) rename src/libutil/include/nix/{ => util}/memory-source-accessor.hh (97%) rename src/libutil/include/nix/{ => util}/meson.build (95%) rename src/libutil/include/nix/{ => util}/muxable-pipe.hh (93%) rename src/libutil/include/nix/{ => util}/os-string.hh (100%) rename src/libutil/include/nix/{ => util}/pool.hh (98%) rename src/libutil/include/nix/{ => util}/pos-idx.hh (100%) rename src/libutil/include/nix/{ => util}/pos-table.hh (96%) rename src/libutil/include/nix/{ => util}/position.hh (98%) rename src/libutil/include/nix/{ => util}/posix-source-accessor.hh (98%) rename src/libutil/include/nix/{ => util}/processes.hh (94%) rename src/libutil/include/nix/{ => util}/ref.hh (100%) rename src/libutil/include/nix/{ => util}/references.hh (97%) rename src/libutil/include/nix/{ => util}/regex-combinators.hh (100%) rename src/libutil/include/nix/{ => util}/repair-flag.hh (100%) rename src/libutil/include/nix/{ => util}/serialise.hh (99%) rename src/libutil/include/nix/{ => util}/signals.hh (89%) rename src/libutil/include/nix/{ => util}/signature/local-keys.hh (98%) rename src/libutil/include/nix/{ => util}/signature/signer.hh (94%) rename src/libutil/include/nix/{ => util}/source-accessor.hh (98%) rename src/libutil/include/nix/{ => util}/source-path.hh (96%) rename src/libutil/include/nix/{ => util}/split.hh (97%) rename src/libutil/include/nix/{ => util}/std-hash.hh (100%) rename src/libutil/include/nix/{ => util}/strings-inline.hh (98%) rename src/libutil/include/nix/{ => util}/strings.hh (100%) rename src/libutil/include/nix/{ => util}/suggestions.hh (98%) rename src/libutil/include/nix/{ => util}/sync.hh (99%) rename src/libutil/include/nix/{ => util}/tarfile.hh (95%) rename src/libutil/include/nix/{ => util}/terminal.hh (100%) rename src/libutil/include/nix/{ => util}/thread-pool.hh (98%) rename src/libutil/include/nix/{ => util}/topo-sort.hh (97%) rename src/libutil/include/nix/{ => util}/types.hh (100%) rename src/libutil/include/nix/{ => util}/unix-domain-socket.hh (95%) rename src/libutil/include/nix/{ => util}/url-parts.hh (100%) rename src/libutil/include/nix/{ => util}/url.hh (98%) rename src/libutil/include/nix/{ => util}/users.hh (97%) rename src/libutil/include/nix/{ => util}/util.hh (98%) rename src/libutil/include/nix/{ => util}/variant-wrapper.hh (100%) rename src/libutil/include/nix/{ => util}/xml-writer.hh (100%) rename src/libutil/linux/include/nix/{ => util}/cgroup.hh (96%) rename src/libutil/linux/include/nix/{ => util}/meson.build (64%) rename src/libutil/linux/include/nix/{ => util}/namespaces.hh (95%) rename src/libutil/unix/include/nix/{ => util}/meson.build (66%) rename src/libutil/unix/include/nix/{ => util}/monitor-fd.hh (99%) rename src/libutil/unix/include/nix/{ => util}/signals-impl.hh (94%) rename src/libutil/windows/include/nix/{ => util}/meson.build (72%) rename src/libutil/windows/include/nix/{ => util}/signals-impl.hh (94%) rename src/libutil/windows/include/nix/{ => util}/windows-async-pipe.hh (92%) rename src/libutil/windows/include/nix/{ => util}/windows-error.hh (97%) diff --git a/doc/manual/source/development/testing.md b/doc/manual/source/development/testing.md index ebc0e27d2..c0b130155 100644 --- a/doc/manual/source/development/testing.md +++ b/doc/manual/source/development/testing.md @@ -30,8 +30,8 @@ The unit tests are defined using the [googletest] and [rapidcheck] frameworks. > src > ├── libexpr > │ ├── meson.build -> │ ├── value/context.hh -> │ ├── include/nix/value/context.cc +> │ ├── include/nix/expr/value/context.hh +> │ ├── value/context.cc > │ … > │ > ├── tests @@ -46,7 +46,7 @@ The unit tests are defined using the [googletest] and [rapidcheck] frameworks. > │ │ > │ ├── libexpr-test-support > │ │ ├── meson.build -> │ │ ├── include/nix +> │ │ ├── include/nix/expr > │ │ │ ├── meson.build > │ │ │ └── tests > │ │ │ ├── value/context.hh @@ -63,7 +63,7 @@ The unit tests are defined using the [googletest] and [rapidcheck] frameworks. > ``` The tests for each Nix library (`libnixexpr`, `libnixstore`, etc..) live inside a directory `src/${library_name_without-nix}-test`. -Given an interface (header) and implementation pair in the original library, say, `src/libexpr/include/nix/value/context.hh` and `src/libexpr/value/context.cc`, we write tests for it in `src/libexpr-tests/value/context.cc`, and (possibly) declare/define additional interfaces for testing purposes in `src/libexpr-test-support/include/nix/tests/value/context.hh` and `src/libexpr-test-support/tests/value/context.cc`. +Given an interface (header) and implementation pair in the original library, say, `src/libexpr/include/nix/expr/value/context.hh` and `src/libexpr/value/context.cc`, we write tests for it in `src/libexpr-tests/value/context.cc`, and (possibly) declare/define additional interfaces for testing purposes in `src/libexpr-test-support/include/nix/expr/tests/value/context.hh` and `src/libexpr-test-support/tests/value/context.cc`. Data for unit tests is stored in a `data` subdir of the directory for each unit test executable. For example, `libnixstore` code is in `src/libstore`, and its test data is in `src/libstore-tests/data`. diff --git a/maintainers/flake-module.nix b/maintainers/flake-module.nix index 87dc1e18a..a8c52eb46 100644 --- a/maintainers/flake-module.nix +++ b/maintainers/flake-module.nix @@ -84,92 +84,92 @@ ''^precompiled-headers\.h$'' ''^src/build-remote/build-remote\.cc$'' ''^src/libcmd/built-path\.cc$'' - ''^src/libcmd/include/nix/built-path\.hh$'' + ''^src/libcmd/include/nix/cmd/built-path\.hh$'' ''^src/libcmd/common-eval-args\.cc$'' - ''^src/libcmd/include/nix/common-eval-args\.hh$'' + ''^src/libcmd/include/nix/cmd/common-eval-args\.hh$'' ''^src/libcmd/editor-for\.cc$'' ''^src/libcmd/installable-attr-path\.cc$'' - ''^src/libcmd/include/nix/installable-attr-path\.hh$'' + ''^src/libcmd/include/nix/cmd/installable-attr-path\.hh$'' ''^src/libcmd/installable-derived-path\.cc$'' - ''^src/libcmd/include/nix/installable-derived-path\.hh$'' + ''^src/libcmd/include/nix/cmd/installable-derived-path\.hh$'' ''^src/libcmd/installable-flake\.cc$'' - ''^src/libcmd/include/nix/installable-flake\.hh$'' + ''^src/libcmd/include/nix/cmd/installable-flake\.hh$'' ''^src/libcmd/installable-value\.cc$'' - ''^src/libcmd/include/nix/installable-value\.hh$'' + ''^src/libcmd/include/nix/cmd/installable-value\.hh$'' ''^src/libcmd/installables\.cc$'' - ''^src/libcmd/include/nix/installables\.hh$'' - ''^src/libcmd/include/nix/legacy\.hh$'' + ''^src/libcmd/include/nix/cmd/installables\.hh$'' + ''^src/libcmd/include/nix/cmd/legacy\.hh$'' ''^src/libcmd/markdown\.cc$'' ''^src/libcmd/misc-store-flags\.cc$'' ''^src/libcmd/repl-interacter\.cc$'' - ''^src/libcmd/include/nix/repl-interacter\.hh$'' + ''^src/libcmd/include/nix/cmd/repl-interacter\.hh$'' ''^src/libcmd/repl\.cc$'' - ''^src/libcmd/include/nix/repl\.hh$'' + ''^src/libcmd/include/nix/cmd/repl\.hh$'' ''^src/libexpr-c/nix_api_expr\.cc$'' ''^src/libexpr-c/nix_api_external\.cc$'' ''^src/libexpr/attr-path\.cc$'' - ''^src/libexpr/include/nix/attr-path\.hh$'' + ''^src/libexpr/include/nix/expr/attr-path\.hh$'' ''^src/libexpr/attr-set\.cc$'' - ''^src/libexpr/include/nix/attr-set\.hh$'' + ''^src/libexpr/include/nix/expr/attr-set\.hh$'' ''^src/libexpr/eval-cache\.cc$'' - ''^src/libexpr/include/nix/eval-cache\.hh$'' + ''^src/libexpr/include/nix/expr/eval-cache\.hh$'' ''^src/libexpr/eval-error\.cc$'' - ''^src/libexpr/include/nix/eval-inline\.hh$'' + ''^src/libexpr/include/nix/expr/eval-inline\.hh$'' ''^src/libexpr/eval-settings\.cc$'' - ''^src/libexpr/include/nix/eval-settings\.hh$'' + ''^src/libexpr/include/nix/expr/eval-settings\.hh$'' ''^src/libexpr/eval\.cc$'' - ''^src/libexpr/include/nix/eval\.hh$'' + ''^src/libexpr/include/nix/expr/eval\.hh$'' ''^src/libexpr/function-trace\.cc$'' - ''^src/libexpr/include/nix/gc-small-vector\.hh$'' + ''^src/libexpr/include/nix/expr/gc-small-vector\.hh$'' ''^src/libexpr/get-drvs\.cc$'' - ''^src/libexpr/include/nix/get-drvs\.hh$'' + ''^src/libexpr/include/nix/expr/get-drvs\.hh$'' ''^src/libexpr/json-to-value\.cc$'' ''^src/libexpr/nixexpr\.cc$'' - ''^src/libexpr/include/nix/nixexpr\.hh$'' - ''^src/libexpr/include/nix/parser-state\.hh$'' + ''^src/libexpr/include/nix/expr/nixexpr\.hh$'' + ''^src/libexpr/include/nix/expr/parser-state\.hh$'' ''^src/libexpr/primops\.cc$'' - ''^src/libexpr/include/nix/primops\.hh$'' + ''^src/libexpr/include/nix/expr/primops\.hh$'' ''^src/libexpr/primops/context\.cc$'' ''^src/libexpr/primops/fetchClosure\.cc$'' ''^src/libexpr/primops/fetchMercurial\.cc$'' ''^src/libexpr/primops/fetchTree\.cc$'' ''^src/libexpr/primops/fromTOML\.cc$'' ''^src/libexpr/print-ambiguous\.cc$'' - ''^src/libexpr/include/nix/print-ambiguous\.hh$'' - ''^src/libexpr/include/nix/print-options\.hh$'' + ''^src/libexpr/include/nix/expr/print-ambiguous\.hh$'' + ''^src/libexpr/include/nix/expr/print-options\.hh$'' ''^src/libexpr/print\.cc$'' - ''^src/libexpr/include/nix/print\.hh$'' + ''^src/libexpr/include/nix/expr/print\.hh$'' ''^src/libexpr/search-path\.cc$'' - ''^src/libexpr/include/nix/symbol-table\.hh$'' + ''^src/libexpr/include/nix/expr/symbol-table\.hh$'' ''^src/libexpr/value-to-json\.cc$'' - ''^src/libexpr/include/nix/value-to-json\.hh$'' + ''^src/libexpr/include/nix/expr/value-to-json\.hh$'' ''^src/libexpr/value-to-xml\.cc$'' - ''^src/libexpr/include/nix/value-to-xml\.hh$'' - ''^src/libexpr/include/nix/value\.hh$'' + ''^src/libexpr/include/nix/expr/value-to-xml\.hh$'' + ''^src/libexpr/include/nix/expr/value\.hh$'' ''^src/libexpr/value/context\.cc$'' - ''^src/libexpr/include/nix/value/context\.hh$'' + ''^src/libexpr/include/nix/expr/value/context\.hh$'' ''^src/libfetchers/attrs\.cc$'' ''^src/libfetchers/cache\.cc$'' - ''^src/libfetchers/include/nix/cache\.hh$'' + ''^src/libfetchers/include/nix/fetchers/cache\.hh$'' ''^src/libfetchers/fetch-settings\.cc$'' - ''^src/libfetchers/include/nix/fetch-settings\.hh$'' + ''^src/libfetchers/include/nix/fetchers/fetch-settings\.hh$'' ''^src/libfetchers/fetch-to-store\.cc$'' ''^src/libfetchers/fetchers\.cc$'' - ''^src/libfetchers/include/nix/fetchers\.hh$'' + ''^src/libfetchers/include/nix/fetchers/fetchers\.hh$'' ''^src/libfetchers/filtering-source-accessor\.cc$'' - ''^src/libfetchers/include/nix/filtering-source-accessor\.hh$'' + ''^src/libfetchers/include/nix/fetchers/filtering-source-accessor\.hh$'' ''^src/libfetchers/fs-source-accessor\.cc$'' ''^src/libfetchers/include/nix/fs-source-accessor\.hh$'' ''^src/libfetchers/git-utils\.cc$'' - ''^src/libfetchers/include/nix/git-utils\.hh$'' + ''^src/libfetchers/include/nix/fetchers/git-utils\.hh$'' ''^src/libfetchers/github\.cc$'' ''^src/libfetchers/indirect\.cc$'' ''^src/libfetchers/memory-source-accessor\.cc$'' ''^src/libfetchers/path\.cc$'' ''^src/libfetchers/registry\.cc$'' - ''^src/libfetchers/include/nix/registry\.hh$'' + ''^src/libfetchers/include/nix/fetchers/registry\.hh$'' ''^src/libfetchers/tarball\.cc$'' - ''^src/libfetchers/include/nix/tarball\.hh$'' + ''^src/libfetchers/include/nix/fetchers/tarball\.hh$'' ''^src/libfetchers/git\.cc$'' ''^src/libfetchers/mercurial\.cc$'' ''^src/libflake/flake/config\.cc$'' @@ -181,243 +181,243 @@ ''^src/libflake/include/nix/flake/lockfile\.hh$'' ''^src/libflake/flake/url-name\.cc$'' ''^src/libmain/common-args\.cc$'' - ''^src/libmain/include/nix/common-args\.hh$'' + ''^src/libmain/include/nix/main/common-args\.hh$'' ''^src/libmain/loggers\.cc$'' - ''^src/libmain/include/nix/loggers\.hh$'' + ''^src/libmain/include/nix/main/loggers\.hh$'' ''^src/libmain/progress-bar\.cc$'' ''^src/libmain/shared\.cc$'' - ''^src/libmain/include/nix/shared\.hh$'' + ''^src/libmain/include/nix/main/shared\.hh$'' ''^src/libmain/unix/stack\.cc$'' ''^src/libstore/binary-cache-store\.cc$'' - ''^src/libstore/include/nix/binary-cache-store\.hh$'' - ''^src/libstore/include/nix/build-result\.hh$'' - ''^src/libstore/include/nix/builtins\.hh$'' + ''^src/libstore/include/nix/store/binary-cache-store\.hh$'' + ''^src/libstore/include/nix/store/build-result\.hh$'' + ''^src/libstore/include/nix/store/builtins\.hh$'' ''^src/libstore/builtins/buildenv\.cc$'' - ''^src/libstore/include/nix/builtins/buildenv\.hh$'' - ''^src/libstore/include/nix/common-protocol-impl\.hh$'' + ''^src/libstore/include/nix/store/builtins/buildenv\.hh$'' + ''^src/libstore/include/nix/store/common-protocol-impl\.hh$'' ''^src/libstore/common-protocol\.cc$'' - ''^src/libstore/include/nix/common-protocol\.hh$'' - ''^src/libstore/include/nix/common-ssh-store-config\.hh$'' + ''^src/libstore/include/nix/store/common-protocol\.hh$'' + ''^src/libstore/include/nix/store/common-ssh-store-config\.hh$'' ''^src/libstore/content-address\.cc$'' - ''^src/libstore/include/nix/content-address\.hh$'' + ''^src/libstore/include/nix/store/content-address\.hh$'' ''^src/libstore/daemon\.cc$'' - ''^src/libstore/include/nix/daemon\.hh$'' + ''^src/libstore/include/nix/store/daemon\.hh$'' ''^src/libstore/derivations\.cc$'' - ''^src/libstore/include/nix/derivations\.hh$'' + ''^src/libstore/include/nix/store/derivations\.hh$'' ''^src/libstore/derived-path-map\.cc$'' - ''^src/libstore/include/nix/derived-path-map\.hh$'' + ''^src/libstore/include/nix/store/derived-path-map\.hh$'' ''^src/libstore/derived-path\.cc$'' - ''^src/libstore/include/nix/derived-path\.hh$'' + ''^src/libstore/include/nix/store/derived-path\.hh$'' ''^src/libstore/downstream-placeholder\.cc$'' - ''^src/libstore/include/nix/downstream-placeholder\.hh$'' + ''^src/libstore/include/nix/store/downstream-placeholder\.hh$'' ''^src/libstore/dummy-store\.cc$'' ''^src/libstore/export-import\.cc$'' ''^src/libstore/filetransfer\.cc$'' - ''^src/libstore/include/nix/filetransfer\.hh$'' - ''^src/libstore/include/nix/gc-store\.hh$'' + ''^src/libstore/include/nix/store/filetransfer\.hh$'' + ''^src/libstore/include/nix/store/gc-store\.hh$'' ''^src/libstore/globals\.cc$'' - ''^src/libstore/include/nix/globals\.hh$'' + ''^src/libstore/include/nix/store/globals\.hh$'' ''^src/libstore/http-binary-cache-store\.cc$'' ''^src/libstore/legacy-ssh-store\.cc$'' - ''^src/libstore/include/nix/legacy-ssh-store\.hh$'' - ''^src/libstore/include/nix/length-prefixed-protocol-helper\.hh$'' + ''^src/libstore/include/nix/store/legacy-ssh-store\.hh$'' + ''^src/libstore/include/nix/store/length-prefixed-protocol-helper\.hh$'' ''^src/libstore/linux/personality\.cc$'' - ''^src/libstore/linux/include/nix/personality\.hh$'' + ''^src/libstore/linux/include/nix/store/personality\.hh$'' ''^src/libstore/local-binary-cache-store\.cc$'' ''^src/libstore/local-fs-store\.cc$'' - ''^src/libstore/include/nix/local-fs-store\.hh$'' + ''^src/libstore/include/nix/store/local-fs-store\.hh$'' ''^src/libstore/log-store\.cc$'' - ''^src/libstore/include/nix/log-store\.hh$'' + ''^src/libstore/include/nix/store/log-store\.hh$'' ''^src/libstore/machines\.cc$'' - ''^src/libstore/include/nix/machines\.hh$'' + ''^src/libstore/include/nix/store/machines\.hh$'' ''^src/libstore/make-content-addressed\.cc$'' - ''^src/libstore/include/nix/make-content-addressed\.hh$'' + ''^src/libstore/include/nix/store/make-content-addressed\.hh$'' ''^src/libstore/misc\.cc$'' ''^src/libstore/names\.cc$'' - ''^src/libstore/include/nix/names\.hh$'' + ''^src/libstore/include/nix/store/names\.hh$'' ''^src/libstore/nar-accessor\.cc$'' - ''^src/libstore/include/nix/nar-accessor\.hh$'' + ''^src/libstore/include/nix/store/nar-accessor\.hh$'' ''^src/libstore/nar-info-disk-cache\.cc$'' - ''^src/libstore/include/nix/nar-info-disk-cache\.hh$'' + ''^src/libstore/include/nix/store/nar-info-disk-cache\.hh$'' ''^src/libstore/nar-info\.cc$'' - ''^src/libstore/include/nix/nar-info\.hh$'' + ''^src/libstore/include/nix/store/nar-info\.hh$'' ''^src/libstore/outputs-spec\.cc$'' - ''^src/libstore/include/nix/outputs-spec\.hh$'' + ''^src/libstore/include/nix/store/outputs-spec\.hh$'' ''^src/libstore/parsed-derivations\.cc$'' ''^src/libstore/path-info\.cc$'' - ''^src/libstore/include/nix/path-info\.hh$'' + ''^src/libstore/include/nix/store/path-info\.hh$'' ''^src/libstore/path-references\.cc$'' - ''^src/libstore/include/nix/path-regex\.hh$'' + ''^src/libstore/include/nix/store/path-regex\.hh$'' ''^src/libstore/path-with-outputs\.cc$'' ''^src/libstore/path\.cc$'' - ''^src/libstore/include/nix/path\.hh$'' + ''^src/libstore/include/nix/store/path\.hh$'' ''^src/libstore/pathlocks\.cc$'' - ''^src/libstore/include/nix/pathlocks\.hh$'' + ''^src/libstore/include/nix/store/pathlocks\.hh$'' ''^src/libstore/profiles\.cc$'' - ''^src/libstore/include/nix/profiles\.hh$'' + ''^src/libstore/include/nix/store/profiles\.hh$'' ''^src/libstore/realisation\.cc$'' - ''^src/libstore/include/nix/realisation\.hh$'' + ''^src/libstore/include/nix/store/realisation\.hh$'' ''^src/libstore/remote-fs-accessor\.cc$'' - ''^src/libstore/include/nix/remote-fs-accessor\.hh$'' - ''^src/libstore/include/nix/remote-store-connection\.hh$'' + ''^src/libstore/include/nix/store/remote-fs-accessor\.hh$'' + ''^src/libstore/include/nix/store/remote-store-connection\.hh$'' ''^src/libstore/remote-store\.cc$'' - ''^src/libstore/include/nix/remote-store\.hh$'' + ''^src/libstore/include/nix/store/remote-store\.hh$'' ''^src/libstore/s3-binary-cache-store\.cc$'' - ''^src/libstore/include/nix/s3\.hh$'' + ''^src/libstore/include/nix/store/s3\.hh$'' ''^src/libstore/serve-protocol-impl\.cc$'' - ''^src/libstore/include/nix/serve-protocol-impl\.hh$'' + ''^src/libstore/include/nix/store/serve-protocol-impl\.hh$'' ''^src/libstore/serve-protocol\.cc$'' - ''^src/libstore/include/nix/serve-protocol\.hh$'' + ''^src/libstore/include/nix/store/serve-protocol\.hh$'' ''^src/libstore/sqlite\.cc$'' - ''^src/libstore/include/nix/sqlite\.hh$'' + ''^src/libstore/include/nix/store/sqlite\.hh$'' ''^src/libstore/ssh-store\.cc$'' ''^src/libstore/ssh\.cc$'' - ''^src/libstore/include/nix/ssh\.hh$'' + ''^src/libstore/include/nix/store/ssh\.hh$'' ''^src/libstore/store-api\.cc$'' - ''^src/libstore/include/nix/store-api\.hh$'' - ''^src/libstore/include/nix/store-dir-config\.hh$'' + ''^src/libstore/include/nix/store/store-api\.hh$'' + ''^src/libstore/include/nix/store/store-dir-config\.hh$'' ''^src/libstore/build/derivation-goal\.cc$'' - ''^src/libstore/include/nix/build/derivation-goal\.hh$'' + ''^src/libstore/include/nix/store/build/derivation-goal\.hh$'' ''^src/libstore/build/drv-output-substitution-goal\.cc$'' - ''^src/libstore/include/nix/build/drv-output-substitution-goal\.hh$'' + ''^src/libstore/include/nix/store/build/drv-output-substitution-goal\.hh$'' ''^src/libstore/build/entry-points\.cc$'' ''^src/libstore/build/goal\.cc$'' - ''^src/libstore/include/nix/build/goal\.hh$'' + ''^src/libstore/include/nix/store/build/goal\.hh$'' ''^src/libstore/unix/build/hook-instance\.cc$'' ''^src/libstore/unix/build/local-derivation-goal\.cc$'' - ''^src/libstore/unix/include/nix/build/local-derivation-goal\.hh$'' + ''^src/libstore/unix/include/nix/store/build/local-derivation-goal\.hh$'' ''^src/libstore/build/substitution-goal\.cc$'' - ''^src/libstore/include/nix/build/substitution-goal\.hh$'' + ''^src/libstore/include/nix/store/build/substitution-goal\.hh$'' ''^src/libstore/build/worker\.cc$'' - ''^src/libstore/include/nix/build/worker\.hh$'' + ''^src/libstore/include/nix/store/build/worker\.hh$'' ''^src/libstore/builtins/fetchurl\.cc$'' ''^src/libstore/builtins/unpack-channel\.cc$'' ''^src/libstore/gc\.cc$'' ''^src/libstore/local-overlay-store\.cc$'' - ''^src/libstore/include/nix/local-overlay-store\.hh$'' + ''^src/libstore/include/nix/store/local-overlay-store\.hh$'' ''^src/libstore/local-store\.cc$'' - ''^src/libstore/include/nix/local-store\.hh$'' + ''^src/libstore/include/nix/store/local-store\.hh$'' ''^src/libstore/unix/user-lock\.cc$'' - ''^src/libstore/unix/include/nix/user-lock\.hh$'' + ''^src/libstore/unix/include/nix/store/user-lock\.hh$'' ''^src/libstore/optimise-store\.cc$'' ''^src/libstore/unix/pathlocks\.cc$'' ''^src/libstore/posix-fs-canonicalise\.cc$'' - ''^src/libstore/include/nix/posix-fs-canonicalise\.hh$'' + ''^src/libstore/include/nix/store/posix-fs-canonicalise\.hh$'' ''^src/libstore/uds-remote-store\.cc$'' - ''^src/libstore/include/nix/uds-remote-store\.hh$'' + ''^src/libstore/include/nix/store/uds-remote-store\.hh$'' ''^src/libstore/windows/build\.cc$'' - ''^src/libstore/include/nix/worker-protocol-impl\.hh$'' + ''^src/libstore/include/nix/store/worker-protocol-impl\.hh$'' ''^src/libstore/worker-protocol\.cc$'' - ''^src/libstore/include/nix/worker-protocol\.hh$'' + ''^src/libstore/include/nix/store/worker-protocol\.hh$'' ''^src/libutil-c/nix_api_util_internal\.h$'' ''^src/libutil/archive\.cc$'' - ''^src/libutil/include/nix/archive\.hh$'' + ''^src/libutil/include/nix/util/archive\.hh$'' ''^src/libutil/args\.cc$'' - ''^src/libutil/include/nix/args\.hh$'' - ''^src/libutil/include/nix/args/root\.hh$'' - ''^src/libutil/include/nix/callback\.hh$'' + ''^src/libutil/include/nix/util/args\.hh$'' + ''^src/libutil/include/nix/util/args/root\.hh$'' + ''^src/libutil/include/nix/util/callback\.hh$'' ''^src/libutil/canon-path\.cc$'' - ''^src/libutil/include/nix/canon-path\.hh$'' - ''^src/libutil/include/nix/chunked-vector\.hh$'' - ''^src/libutil/include/nix/closure\.hh$'' - ''^src/libutil/include/nix/comparator\.hh$'' + ''^src/libutil/include/nix/util/canon-path\.hh$'' + ''^src/libutil/include/nix/util/chunked-vector\.hh$'' + ''^src/libutil/include/nix/util/closure\.hh$'' + ''^src/libutil/include/nix/util/comparator\.hh$'' ''^src/libutil/compute-levels\.cc$'' - ''^src/libutil/include/nix/config-impl\.hh$'' - ''^src/libutil/config\.cc$'' - ''^src/libutil/include/nix/config\.hh$'' + ''^src/libutil/include/nix/util/config-impl\.hh$'' + ''^src/libutil/configuration\.cc$'' + ''^src/libutil/include/nix/util/configuration\.hh$'' ''^src/libutil/current-process\.cc$'' - ''^src/libutil/include/nix/current-process\.hh$'' + ''^src/libutil/include/nix/util/current-process\.hh$'' ''^src/libutil/english\.cc$'' - ''^src/libutil/include/nix/english\.hh$'' + ''^src/libutil/include/nix/util/english\.hh$'' ''^src/libutil/error\.cc$'' - ''^src/libutil/include/nix/error\.hh$'' - ''^src/libutil/include/nix/exit\.hh$'' + ''^src/libutil/include/nix/util/error\.hh$'' + ''^src/libutil/include/nix/util/exit\.hh$'' ''^src/libutil/experimental-features\.cc$'' - ''^src/libutil/include/nix/experimental-features\.hh$'' + ''^src/libutil/include/nix/util/experimental-features\.hh$'' ''^src/libutil/file-content-address\.cc$'' - ''^src/libutil/include/nix/file-content-address\.hh$'' + ''^src/libutil/include/nix/util/file-content-address\.hh$'' ''^src/libutil/file-descriptor\.cc$'' - ''^src/libutil/include/nix/file-descriptor\.hh$'' - ''^src/libutil/include/nix/file-path-impl\.hh$'' - ''^src/libutil/include/nix/file-path\.hh$'' + ''^src/libutil/include/nix/util/file-descriptor\.hh$'' + ''^src/libutil/include/nix/util/file-path-impl\.hh$'' + ''^src/libutil/include/nix/util/file-path\.hh$'' ''^src/libutil/file-system\.cc$'' - ''^src/libutil/include/nix/file-system\.hh$'' - ''^src/libutil/include/nix/finally\.hh$'' - ''^src/libutil/include/nix/fmt\.hh$'' + ''^src/libutil/include/nix/util/file-system\.hh$'' + ''^src/libutil/include/nix/util/finally\.hh$'' + ''^src/libutil/include/nix/util/fmt\.hh$'' ''^src/libutil/fs-sink\.cc$'' - ''^src/libutil/include/nix/fs-sink\.hh$'' + ''^src/libutil/include/nix/util/fs-sink\.hh$'' ''^src/libutil/git\.cc$'' - ''^src/libutil/include/nix/git\.hh$'' + ''^src/libutil/include/nix/util/git\.hh$'' ''^src/libutil/hash\.cc$'' - ''^src/libutil/include/nix/hash\.hh$'' + ''^src/libutil/include/nix/util/hash\.hh$'' ''^src/libutil/hilite\.cc$'' - ''^src/libutil/include/nix/hilite\.hh$'' + ''^src/libutil/include/nix/util/hilite\.hh$'' ''^src/libutil/source-accessor\.hh$'' - ''^src/libutil/include/nix/json-impls\.hh$'' + ''^src/libutil/include/nix/util/json-impls\.hh$'' ''^src/libutil/json-utils\.cc$'' - ''^src/libutil/include/nix/json-utils\.hh$'' + ''^src/libutil/include/nix/util/json-utils\.hh$'' ''^src/libutil/linux/cgroup\.cc$'' ''^src/libutil/linux/namespaces\.cc$'' ''^src/libutil/logging\.cc$'' - ''^src/libutil/include/nix/logging\.hh$'' - ''^src/libutil/include/nix/lru-cache\.hh$'' + ''^src/libutil/include/nix/util/logging\.hh$'' + ''^src/libutil/include/nix/util/lru-cache\.hh$'' ''^src/libutil/memory-source-accessor\.cc$'' - ''^src/libutil/include/nix/memory-source-accessor\.hh$'' - ''^src/libutil/include/nix/pool\.hh$'' + ''^src/libutil/include/nix/util/memory-source-accessor\.hh$'' + ''^src/libutil/include/nix/util/pool\.hh$'' ''^src/libutil/position\.cc$'' - ''^src/libutil/include/nix/position\.hh$'' + ''^src/libutil/include/nix/util/position\.hh$'' ''^src/libutil/posix-source-accessor\.cc$'' - ''^src/libutil/include/nix/posix-source-accessor\.hh$'' - ''^src/libutil/include/nix/processes\.hh$'' - ''^src/libutil/include/nix/ref\.hh$'' + ''^src/libutil/include/nix/util/posix-source-accessor\.hh$'' + ''^src/libutil/include/nix/util/processes\.hh$'' + ''^src/libutil/include/nix/util/ref\.hh$'' ''^src/libutil/references\.cc$'' - ''^src/libutil/include/nix/references\.hh$'' + ''^src/libutil/include/nix/util/references\.hh$'' ''^src/libutil/regex-combinators\.hh$'' ''^src/libutil/serialise\.cc$'' - ''^src/libutil/include/nix/serialise\.hh$'' - ''^src/libutil/include/nix/signals\.hh$'' + ''^src/libutil/include/nix/util/serialise\.hh$'' + ''^src/libutil/include/nix/util/signals\.hh$'' ''^src/libutil/signature/local-keys\.cc$'' - ''^src/libutil/include/nix/signature/local-keys\.hh$'' + ''^src/libutil/include/nix/util/signature/local-keys\.hh$'' ''^src/libutil/signature/signer\.cc$'' - ''^src/libutil/include/nix/signature/signer\.hh$'' + ''^src/libutil/include/nix/util/signature/signer\.hh$'' ''^src/libutil/source-accessor\.cc$'' - ''^src/libutil/include/nix/source-accessor\.hh$'' + ''^src/libutil/include/nix/util/source-accessor\.hh$'' ''^src/libutil/source-path\.cc$'' - ''^src/libutil/include/nix/source-path\.hh$'' - ''^src/libutil/include/nix/split\.hh$'' + ''^src/libutil/include/nix/util/source-path\.hh$'' + ''^src/libutil/include/nix/util/split\.hh$'' ''^src/libutil/suggestions\.cc$'' - ''^src/libutil/include/nix/suggestions\.hh$'' - ''^src/libutil/include/nix/sync\.hh$'' + ''^src/libutil/include/nix/util/suggestions\.hh$'' + ''^src/libutil/include/nix/util/sync\.hh$'' ''^src/libutil/terminal\.cc$'' - ''^src/libutil/include/nix/terminal\.hh$'' + ''^src/libutil/include/nix/util/terminal\.hh$'' ''^src/libutil/thread-pool\.cc$'' - ''^src/libutil/include/nix/thread-pool\.hh$'' - ''^src/libutil/include/nix/topo-sort\.hh$'' - ''^src/libutil/include/nix/types\.hh$'' + ''^src/libutil/include/nix/util/thread-pool\.hh$'' + ''^src/libutil/include/nix/util/topo-sort\.hh$'' + ''^src/libutil/include/nix/util/types\.hh$'' ''^src/libutil/unix/file-descriptor\.cc$'' ''^src/libutil/unix/file-path\.cc$'' ''^src/libutil/unix/processes\.cc$'' - ''^src/libutil/unix/include/nix/signals-impl\.hh$'' + ''^src/libutil/unix/include/nix/util/signals-impl\.hh$'' ''^src/libutil/unix/signals\.cc$'' ''^src/libutil/unix-domain-socket\.cc$'' ''^src/libutil/unix/users\.cc$'' - ''^src/libutil/include/nix/url-parts\.hh$'' + ''^src/libutil/include/nix/util/url-parts\.hh$'' ''^src/libutil/url\.cc$'' - ''^src/libutil/include/nix/url\.hh$'' + ''^src/libutil/include/nix/util/url\.hh$'' ''^src/libutil/users\.cc$'' - ''^src/libutil/include/nix/users\.hh$'' + ''^src/libutil/include/nix/util/users\.hh$'' ''^src/libutil/util\.cc$'' - ''^src/libutil/include/nix/util\.hh$'' - ''^src/libutil/include/nix/variant-wrapper\.hh$'' + ''^src/libutil/include/nix/util/util\.hh$'' + ''^src/libutil/include/nix/util/variant-wrapper\.hh$'' ''^src/libutil/widecharwidth/widechar_width\.h$'' # vendored source ''^src/libutil/windows/file-descriptor\.cc$'' ''^src/libutil/windows/file-path\.cc$'' ''^src/libutil/windows/processes\.cc$'' ''^src/libutil/windows/users\.cc$'' ''^src/libutil/windows/windows-error\.cc$'' - ''^src/libutil/windows/include/nix/windows-error\.hh$'' + ''^src/libutil/windows/include/nix/util/windows-error\.hh$'' ''^src/libutil/xml-writer\.cc$'' - ''^src/libutil/include/nix/xml-writer\.hh$'' + ''^src/libutil/include/nix/util/xml-writer\.hh$'' ''^src/nix-build/nix-build\.cc$'' ''^src/nix-channel/nix-channel\.cc$'' ''^src/nix-collect-garbage/nix-collect-garbage\.cc$'' @@ -481,9 +481,9 @@ ''^tests/nixos/ca-fd-leak/sender\.c'' ''^tests/nixos/ca-fd-leak/smuggler\.c'' ''^tests/nixos/user-sandboxing/attacker\.c'' - ''^src/libexpr-test-support/include/nix/tests/libexpr\.hh'' + ''^src/libexpr-test-support/include/nix/expr/tests/libexpr\.hh'' ''^src/libexpr-test-support/tests/value/context\.cc'' - ''^src/libexpr-test-support/include/nix/tests/value/context\.hh'' + ''^src/libexpr-test-support/include/nix/expr/tests/value/context\.hh'' ''^src/libexpr-tests/derived-path\.cc'' ''^src/libexpr-tests/error_traces\.cc'' ''^src/libexpr-tests/eval\.cc'' @@ -498,13 +498,13 @@ ''^src/libflake-tests/flakeref\.cc'' ''^src/libflake-tests/url-name\.cc'' ''^src/libstore-test-support/tests/derived-path\.cc'' - ''^src/libstore-test-support/include/nix/tests/derived-path\.hh'' - ''^src/libstore-test-support/include/nix/tests/nix_api_store\.hh'' + ''^src/libstore-test-support/include/nix/store/tests/derived-path\.hh'' + ''^src/libstore-test-support/include/nix/store/tests/nix_api_store\.hh'' ''^src/libstore-test-support/tests/outputs-spec\.cc'' - ''^src/libstore-test-support/include/nix/tests/outputs-spec\.hh'' + ''^src/libstore-test-support/include/nix/store/tests/outputs-spec\.hh'' ''^src/libstore-test-support/path\.cc'' - ''^src/libstore-test-support/include/nix/tests/path\.hh'' - ''^src/libstore-test-support/include/nix/tests/protocol\.hh'' + ''^src/libstore-test-support/include/nix/store/tests/path\.hh'' + ''^src/libstore-test-support/include/nix/store/tests/protocol\.hh'' ''^src/libstore-tests/common-protocol\.cc'' ''^src/libstore-tests/content-address\.cc'' ''^src/libstore-tests/derivation\.cc'' @@ -518,9 +518,9 @@ ''^src/libstore-tests/path\.cc'' ''^src/libstore-tests/serve-protocol\.cc'' ''^src/libstore-tests/worker-protocol\.cc'' - ''^src/libutil-test-support/include/nix/tests/characterization\.hh'' + ''^src/libutil-test-support/include/nix/util/tests/characterization\.hh'' ''^src/libutil-test-support/hash\.cc'' - ''^src/libutil-test-support/include/nix/tests/hash\.hh'' + ''^src/libutil-test-support/include/nix/util/tests/hash\.hh'' ''^src/libutil-tests/args\.cc'' ''^src/libutil-tests/canon-path\.cc'' ''^src/libutil-tests/chunked-vector\.cc'' diff --git a/src/build-remote/build-remote.cc b/src/build-remote/build-remote.cc index 56eb248a5..b4eaa389b 100644 --- a/src/build-remote/build-remote.cc +++ b/src/build-remote/build-remote.cc @@ -9,19 +9,19 @@ #include #endif -#include "nix/machines.hh" -#include "nix/shared.hh" -#include "nix/plugin.hh" -#include "nix/pathlocks.hh" -#include "nix/globals.hh" -#include "nix/serialise.hh" -#include "nix/build-result.hh" -#include "nix/store-api.hh" -#include "nix/strings.hh" -#include "nix/derivations.hh" -#include "nix/local-store.hh" -#include "nix/legacy.hh" -#include "nix/experimental-features.hh" +#include "nix/store/machines.hh" +#include "nix/main/shared.hh" +#include "nix/main/plugin.hh" +#include "nix/store/pathlocks.hh" +#include "nix/store/globals.hh" +#include "nix/util/serialise.hh" +#include "nix/store/build-result.hh" +#include "nix/store/store-api.hh" +#include "nix/util/strings.hh" +#include "nix/store/derivations.hh" +#include "nix/store/local-store.hh" +#include "nix/cmd/legacy.hh" +#include "nix/util/experimental-features.hh" using namespace nix; using std::cin; diff --git a/src/libcmd/built-path.cc b/src/libcmd/built-path.cc index 21b52cea5..1238f9422 100644 --- a/src/libcmd/built-path.cc +++ b/src/libcmd/built-path.cc @@ -1,7 +1,7 @@ -#include "nix/built-path.hh" -#include "nix/derivations.hh" -#include "nix/store-api.hh" -#include "nix/comparator.hh" +#include "nix/cmd/built-path.hh" +#include "nix/store/derivations.hh" +#include "nix/store/store-api.hh" +#include "nix/util/comparator.hh" #include diff --git a/src/libcmd/command-installable-value.cc b/src/libcmd/command-installable-value.cc index 52fa61091..0884f17e9 100644 --- a/src/libcmd/command-installable-value.cc +++ b/src/libcmd/command-installable-value.cc @@ -1,4 +1,4 @@ -#include "nix/command-installable-value.hh" +#include "nix/cmd/command-installable-value.hh" namespace nix { diff --git a/src/libcmd/command.cc b/src/libcmd/command.cc index efcdb799d..565f424dd 100644 --- a/src/libcmd/command.cc +++ b/src/libcmd/command.cc @@ -1,16 +1,16 @@ #include #include -#include "nix/command.hh" -#include "nix/markdown.hh" -#include "nix/store-api.hh" -#include "nix/local-fs-store.hh" -#include "nix/derivations.hh" -#include "nix/nixexpr.hh" -#include "nix/profiles.hh" -#include "nix/repl.hh" -#include "nix/strings.hh" -#include "nix/environment-variables.hh" +#include "nix/cmd/command.hh" +#include "nix/cmd/markdown.hh" +#include "nix/store/store-api.hh" +#include "nix/store/local-fs-store.hh" +#include "nix/store/derivations.hh" +#include "nix/expr/nixexpr.hh" +#include "nix/store/profiles.hh" +#include "nix/cmd/repl.hh" +#include "nix/util/strings.hh" +#include "nix/util/environment-variables.hh" namespace nix { diff --git a/src/libcmd/common-eval-args.cc b/src/libcmd/common-eval-args.cc index 805701749..c051792f3 100644 --- a/src/libcmd/common-eval-args.cc +++ b/src/libcmd/common-eval-args.cc @@ -1,20 +1,20 @@ -#include "nix/fetch-settings.hh" -#include "nix/eval-settings.hh" -#include "nix/common-eval-args.hh" -#include "nix/shared.hh" -#include "nix/config-global.hh" -#include "nix/filetransfer.hh" -#include "nix/eval.hh" -#include "nix/fetchers.hh" -#include "nix/registry.hh" +#include "nix/fetchers/fetch-settings.hh" +#include "nix/expr/eval-settings.hh" +#include "nix/cmd/common-eval-args.hh" +#include "nix/main/shared.hh" +#include "nix/util/config-global.hh" +#include "nix/store/filetransfer.hh" +#include "nix/expr/eval.hh" +#include "nix/fetchers/fetchers.hh" +#include "nix/fetchers/registry.hh" #include "nix/flake/flakeref.hh" #include "nix/flake/settings.hh" -#include "nix/store-api.hh" -#include "nix/command.hh" -#include "nix/tarball.hh" -#include "nix/fetch-to-store.hh" -#include "nix/compatibility-settings.hh" -#include "nix/eval-settings.hh" +#include "nix/store/store-api.hh" +#include "nix/cmd/command.hh" +#include "nix/fetchers/tarball.hh" +#include "nix/fetchers/fetch-to-store.hh" +#include "nix/cmd/compatibility-settings.hh" +#include "nix/expr/eval-settings.hh" namespace nix { diff --git a/src/libcmd/editor-for.cc b/src/libcmd/editor-for.cc index b82f41d2b..a5d635859 100644 --- a/src/libcmd/editor-for.cc +++ b/src/libcmd/editor-for.cc @@ -1,6 +1,6 @@ -#include "nix/editor-for.hh" -#include "nix/environment-variables.hh" -#include "nix/source-path.hh" +#include "nix/cmd/editor-for.hh" +#include "nix/util/environment-variables.hh" +#include "nix/util/source-path.hh" namespace nix { diff --git a/src/libcmd/include/nix/built-path.hh b/src/libcmd/include/nix/cmd/built-path.hh similarity index 97% rename from src/libcmd/include/nix/built-path.hh rename to src/libcmd/include/nix/cmd/built-path.hh index bd8f685e0..c885876a7 100644 --- a/src/libcmd/include/nix/built-path.hh +++ b/src/libcmd/include/nix/cmd/built-path.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "nix/derived-path.hh" -#include "nix/realisation.hh" +#include "nix/store/derived-path.hh" +#include "nix/store/realisation.hh" namespace nix { diff --git a/src/libcmd/include/nix/command-installable-value.hh b/src/libcmd/include/nix/cmd/command-installable-value.hh similarity index 85% rename from src/libcmd/include/nix/command-installable-value.hh rename to src/libcmd/include/nix/cmd/command-installable-value.hh index 5ce352a63..b171d9f73 100644 --- a/src/libcmd/include/nix/command-installable-value.hh +++ b/src/libcmd/include/nix/cmd/command-installable-value.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "nix/installable-value.hh" -#include "nix/command.hh" +#include "nix/cmd/installable-value.hh" +#include "nix/cmd/command.hh" namespace nix { diff --git a/src/libcmd/include/nix/command.hh b/src/libcmd/include/nix/cmd/command.hh similarity index 98% rename from src/libcmd/include/nix/command.hh rename to src/libcmd/include/nix/cmd/command.hh index 9d3c8e343..6b6418f51 100644 --- a/src/libcmd/include/nix/command.hh +++ b/src/libcmd/include/nix/cmd/command.hh @@ -1,10 +1,10 @@ #pragma once ///@file -#include "nix/installable-value.hh" -#include "nix/args.hh" -#include "nix/common-eval-args.hh" -#include "nix/path.hh" +#include "nix/cmd/installable-value.hh" +#include "nix/util/args.hh" +#include "nix/cmd/common-eval-args.hh" +#include "nix/store/path.hh" #include "nix/flake/lockfile.hh" #include diff --git a/src/libcmd/include/nix/common-eval-args.hh b/src/libcmd/include/nix/cmd/common-eval-args.hh similarity index 91% rename from src/libcmd/include/nix/common-eval-args.hh rename to src/libcmd/include/nix/cmd/common-eval-args.hh index e72175891..6f3367e58 100644 --- a/src/libcmd/include/nix/common-eval-args.hh +++ b/src/libcmd/include/nix/cmd/common-eval-args.hh @@ -1,10 +1,10 @@ #pragma once ///@file -#include "nix/args.hh" -#include "nix/canon-path.hh" -#include "nix/common-args.hh" -#include "nix/search-path.hh" +#include "nix/util/args.hh" +#include "nix/util/canon-path.hh" +#include "nix/main/common-args.hh" +#include "nix/expr/search-path.hh" #include diff --git a/src/libcmd/include/nix/compatibility-settings.hh b/src/libcmd/include/nix/cmd/compatibility-settings.hh similarity index 97% rename from src/libcmd/include/nix/compatibility-settings.hh rename to src/libcmd/include/nix/cmd/compatibility-settings.hh index 18319c1f2..c7061a0a1 100644 --- a/src/libcmd/include/nix/compatibility-settings.hh +++ b/src/libcmd/include/nix/cmd/compatibility-settings.hh @@ -1,5 +1,5 @@ #pragma once -#include "nix/config.hh" +#include "nix/util/configuration.hh" namespace nix { struct CompatibilitySettings : public Config diff --git a/src/libcmd/include/nix/editor-for.hh b/src/libcmd/include/nix/cmd/editor-for.hh similarity index 74% rename from src/libcmd/include/nix/editor-for.hh rename to src/libcmd/include/nix/cmd/editor-for.hh index 0a8aa48bc..11414e823 100644 --- a/src/libcmd/include/nix/editor-for.hh +++ b/src/libcmd/include/nix/cmd/editor-for.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "nix/types.hh" -#include "nix/source-path.hh" +#include "nix/util/types.hh" +#include "nix/util/source-path.hh" namespace nix { diff --git a/src/libcmd/include/nix/installable-attr-path.hh b/src/libcmd/include/nix/cmd/installable-attr-path.hh similarity index 61% rename from src/libcmd/include/nix/installable-attr-path.hh rename to src/libcmd/include/nix/cmd/installable-attr-path.hh index ceb2eca61..5a0dc993c 100644 --- a/src/libcmd/include/nix/installable-attr-path.hh +++ b/src/libcmd/include/nix/cmd/installable-attr-path.hh @@ -1,22 +1,22 @@ #pragma once ///@file -#include "nix/globals.hh" -#include "nix/installable-value.hh" -#include "nix/outputs-spec.hh" -#include "nix/command.hh" -#include "nix/attr-path.hh" -#include "nix/common-eval-args.hh" -#include "nix/derivations.hh" -#include "nix/eval-inline.hh" -#include "nix/eval.hh" -#include "nix/get-drvs.hh" -#include "nix/store-api.hh" -#include "nix/shared.hh" -#include "nix/eval-cache.hh" -#include "nix/url.hh" -#include "nix/registry.hh" -#include "nix/build-result.hh" +#include "nix/store/globals.hh" +#include "nix/cmd/installable-value.hh" +#include "nix/store/outputs-spec.hh" +#include "nix/cmd/command.hh" +#include "nix/expr/attr-path.hh" +#include "nix/cmd/common-eval-args.hh" +#include "nix/store/derivations.hh" +#include "nix/expr/eval-inline.hh" +#include "nix/expr/eval.hh" +#include "nix/expr/get-drvs.hh" +#include "nix/store/store-api.hh" +#include "nix/main/shared.hh" +#include "nix/expr/eval-cache.hh" +#include "nix/util/url.hh" +#include "nix/fetchers/registry.hh" +#include "nix/store/build-result.hh" #include #include diff --git a/src/libcmd/include/nix/installable-derived-path.hh b/src/libcmd/include/nix/cmd/installable-derived-path.hh similarity index 94% rename from src/libcmd/include/nix/installable-derived-path.hh rename to src/libcmd/include/nix/cmd/installable-derived-path.hh index 8f86e6c4c..daa6ba868 100644 --- a/src/libcmd/include/nix/installable-derived-path.hh +++ b/src/libcmd/include/nix/cmd/installable-derived-path.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "nix/installables.hh" +#include "nix/cmd/installables.hh" namespace nix { diff --git a/src/libcmd/include/nix/installable-flake.hh b/src/libcmd/include/nix/cmd/installable-flake.hh similarity index 96% rename from src/libcmd/include/nix/installable-flake.hh rename to src/libcmd/include/nix/cmd/installable-flake.hh index 5bbe4beb5..8699031b5 100644 --- a/src/libcmd/include/nix/installable-flake.hh +++ b/src/libcmd/include/nix/cmd/installable-flake.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "nix/common-eval-args.hh" -#include "nix/installable-value.hh" +#include "nix/cmd/common-eval-args.hh" +#include "nix/cmd/installable-value.hh" namespace nix { diff --git a/src/libcmd/include/nix/installable-value.hh b/src/libcmd/include/nix/cmd/installable-value.hh similarity index 98% rename from src/libcmd/include/nix/installable-value.hh rename to src/libcmd/include/nix/cmd/installable-value.hh index f8840103f..9c8f1a9fb 100644 --- a/src/libcmd/include/nix/installable-value.hh +++ b/src/libcmd/include/nix/cmd/installable-value.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "nix/installables.hh" +#include "nix/cmd/installables.hh" #include "nix/flake/flake.hh" namespace nix { diff --git a/src/libcmd/include/nix/installables.hh b/src/libcmd/include/nix/cmd/installables.hh similarity index 95% rename from src/libcmd/include/nix/installables.hh rename to src/libcmd/include/nix/cmd/installables.hh index 2393cbcff..84941278a 100644 --- a/src/libcmd/include/nix/installables.hh +++ b/src/libcmd/include/nix/cmd/installables.hh @@ -1,12 +1,12 @@ #pragma once ///@file -#include "nix/path.hh" -#include "nix/outputs-spec.hh" -#include "nix/derived-path.hh" -#include "nix/built-path.hh" -#include "nix/store-api.hh" -#include "nix/build-result.hh" +#include "nix/store/path.hh" +#include "nix/store/outputs-spec.hh" +#include "nix/store/derived-path.hh" +#include "nix/cmd/built-path.hh" +#include "nix/store/store-api.hh" +#include "nix/store/build-result.hh" #include diff --git a/src/libcmd/include/nix/legacy.hh b/src/libcmd/include/nix/cmd/legacy.hh similarity index 100% rename from src/libcmd/include/nix/legacy.hh rename to src/libcmd/include/nix/cmd/legacy.hh diff --git a/src/libcmd/include/nix/markdown.hh b/src/libcmd/include/nix/cmd/markdown.hh similarity index 100% rename from src/libcmd/include/nix/markdown.hh rename to src/libcmd/include/nix/cmd/markdown.hh diff --git a/src/libcmd/include/nix/meson.build b/src/libcmd/include/nix/cmd/meson.build similarity index 90% rename from src/libcmd/include/nix/meson.build rename to src/libcmd/include/nix/cmd/meson.build index debe4a605..368edb28e 100644 --- a/src/libcmd/include/nix/meson.build +++ b/src/libcmd/include/nix/cmd/meson.build @@ -1,6 +1,6 @@ # Public headers directory -include_dirs = [include_directories('..')] +include_dirs = [include_directories('../..')] headers = files( 'built-path.hh', diff --git a/src/libcmd/include/nix/misc-store-flags.hh b/src/libcmd/include/nix/cmd/misc-store-flags.hh similarity index 90% rename from src/libcmd/include/nix/misc-store-flags.hh rename to src/libcmd/include/nix/cmd/misc-store-flags.hh index b8579e90f..c9467ad8e 100644 --- a/src/libcmd/include/nix/misc-store-flags.hh +++ b/src/libcmd/include/nix/cmd/misc-store-flags.hh @@ -1,5 +1,5 @@ -#include "nix/args.hh" -#include "nix/content-address.hh" +#include "nix/util/args.hh" +#include "nix/store/content-address.hh" namespace nix::flag { diff --git a/src/libcmd/include/nix/network-proxy.hh b/src/libcmd/include/nix/cmd/network-proxy.hh similarity index 93% rename from src/libcmd/include/nix/network-proxy.hh rename to src/libcmd/include/nix/cmd/network-proxy.hh index ca797f465..255597a61 100644 --- a/src/libcmd/include/nix/network-proxy.hh +++ b/src/libcmd/include/nix/cmd/network-proxy.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "nix/types.hh" +#include "nix/util/types.hh" namespace nix { diff --git a/src/libcmd/include/nix/repl-interacter.hh b/src/libcmd/include/nix/cmd/repl-interacter.hh similarity index 94% rename from src/libcmd/include/nix/repl-interacter.hh rename to src/libcmd/include/nix/cmd/repl-interacter.hh index 463ba6818..eb58563b2 100644 --- a/src/libcmd/include/nix/repl-interacter.hh +++ b/src/libcmd/include/nix/cmd/repl-interacter.hh @@ -1,8 +1,8 @@ #pragma once /// @file -#include "nix/finally.hh" -#include "nix/types.hh" +#include "nix/util/finally.hh" +#include "nix/util/types.hh" #include #include diff --git a/src/libcmd/include/nix/repl.hh b/src/libcmd/include/nix/cmd/repl.hh similarity index 97% rename from src/libcmd/include/nix/repl.hh rename to src/libcmd/include/nix/cmd/repl.hh index b22fb9438..83e39727f 100644 --- a/src/libcmd/include/nix/repl.hh +++ b/src/libcmd/include/nix/cmd/repl.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "nix/eval.hh" +#include "nix/expr/eval.hh" namespace nix { diff --git a/src/libcmd/installable-attr-path.cc b/src/libcmd/installable-attr-path.cc index dfd7bdd65..fcbfe1482 100644 --- a/src/libcmd/installable-attr-path.cc +++ b/src/libcmd/installable-attr-path.cc @@ -1,21 +1,21 @@ -#include "nix/globals.hh" -#include "nix/installable-attr-path.hh" -#include "nix/outputs-spec.hh" -#include "nix/util.hh" -#include "nix/command.hh" -#include "nix/attr-path.hh" -#include "nix/common-eval-args.hh" -#include "nix/derivations.hh" -#include "nix/eval-inline.hh" -#include "nix/eval.hh" -#include "nix/get-drvs.hh" -#include "nix/store-api.hh" -#include "nix/shared.hh" +#include "nix/store/globals.hh" +#include "nix/cmd/installable-attr-path.hh" +#include "nix/store/outputs-spec.hh" +#include "nix/util/util.hh" +#include "nix/cmd/command.hh" +#include "nix/expr/attr-path.hh" +#include "nix/cmd/common-eval-args.hh" +#include "nix/store/derivations.hh" +#include "nix/expr/eval-inline.hh" +#include "nix/expr/eval.hh" +#include "nix/expr/get-drvs.hh" +#include "nix/store/store-api.hh" +#include "nix/main/shared.hh" #include "nix/flake/flake.hh" -#include "nix/eval-cache.hh" -#include "nix/url.hh" -#include "nix/registry.hh" -#include "nix/build-result.hh" +#include "nix/expr/eval-cache.hh" +#include "nix/util/url.hh" +#include "nix/fetchers/registry.hh" +#include "nix/store/build-result.hh" #include #include diff --git a/src/libcmd/installable-derived-path.cc b/src/libcmd/installable-derived-path.cc index 2e53f6198..5a92f81c7 100644 --- a/src/libcmd/installable-derived-path.cc +++ b/src/libcmd/installable-derived-path.cc @@ -1,5 +1,5 @@ -#include "nix/installable-derived-path.hh" -#include "nix/derivations.hh" +#include "nix/cmd/installable-derived-path.hh" +#include "nix/store/derivations.hh" namespace nix { diff --git a/src/libcmd/installable-flake.cc b/src/libcmd/installable-flake.cc index f4c272515..83285b739 100644 --- a/src/libcmd/installable-flake.cc +++ b/src/libcmd/installable-flake.cc @@ -1,22 +1,22 @@ -#include "nix/globals.hh" -#include "nix/installable-flake.hh" -#include "nix/installable-derived-path.hh" -#include "nix/outputs-spec.hh" -#include "nix/util.hh" -#include "nix/command.hh" -#include "nix/attr-path.hh" -#include "nix/common-eval-args.hh" -#include "nix/derivations.hh" -#include "nix/eval-inline.hh" -#include "nix/eval.hh" -#include "nix/get-drvs.hh" -#include "nix/store-api.hh" -#include "nix/shared.hh" +#include "nix/store/globals.hh" +#include "nix/cmd/installable-flake.hh" +#include "nix/cmd/installable-derived-path.hh" +#include "nix/store/outputs-spec.hh" +#include "nix/util/util.hh" +#include "nix/cmd/command.hh" +#include "nix/expr/attr-path.hh" +#include "nix/cmd/common-eval-args.hh" +#include "nix/store/derivations.hh" +#include "nix/expr/eval-inline.hh" +#include "nix/expr/eval.hh" +#include "nix/expr/get-drvs.hh" +#include "nix/store/store-api.hh" +#include "nix/main/shared.hh" #include "nix/flake/flake.hh" -#include "nix/eval-cache.hh" -#include "nix/url.hh" -#include "nix/registry.hh" -#include "nix/build-result.hh" +#include "nix/expr/eval-cache.hh" +#include "nix/util/url.hh" +#include "nix/fetchers/registry.hh" +#include "nix/store/build-result.hh" #include #include diff --git a/src/libcmd/installable-value.cc b/src/libcmd/installable-value.cc index ac2da0ed2..d9ac3a29e 100644 --- a/src/libcmd/installable-value.cc +++ b/src/libcmd/installable-value.cc @@ -1,6 +1,6 @@ -#include "nix/installable-value.hh" -#include "nix/eval-cache.hh" -#include "nix/fetch-to-store.hh" +#include "nix/cmd/installable-value.hh" +#include "nix/expr/eval-cache.hh" +#include "nix/fetchers/fetch-to-store.hh" namespace nix { diff --git a/src/libcmd/installables.cc b/src/libcmd/installables.cc index f1eaa71e9..c010887fa 100644 --- a/src/libcmd/installables.cc +++ b/src/libcmd/installables.cc @@ -1,33 +1,33 @@ -#include "nix/globals.hh" -#include "nix/installables.hh" -#include "nix/installable-derived-path.hh" -#include "nix/installable-attr-path.hh" -#include "nix/installable-flake.hh" -#include "nix/outputs-spec.hh" -#include "nix/users.hh" -#include "nix/util.hh" -#include "nix/command.hh" -#include "nix/attr-path.hh" -#include "nix/common-eval-args.hh" -#include "nix/derivations.hh" -#include "nix/eval-inline.hh" -#include "nix/eval.hh" -#include "nix/eval-settings.hh" -#include "nix/get-drvs.hh" -#include "nix/store-api.hh" -#include "nix/shared.hh" +#include "nix/store/globals.hh" +#include "nix/cmd/installables.hh" +#include "nix/cmd/installable-derived-path.hh" +#include "nix/cmd/installable-attr-path.hh" +#include "nix/cmd/installable-flake.hh" +#include "nix/store/outputs-spec.hh" +#include "nix/util/users.hh" +#include "nix/util/util.hh" +#include "nix/cmd/command.hh" +#include "nix/expr/attr-path.hh" +#include "nix/cmd/common-eval-args.hh" +#include "nix/store/derivations.hh" +#include "nix/expr/eval-inline.hh" +#include "nix/expr/eval.hh" +#include "nix/expr/eval-settings.hh" +#include "nix/expr/get-drvs.hh" +#include "nix/store/store-api.hh" +#include "nix/main/shared.hh" #include "nix/flake/flake.hh" -#include "nix/eval-cache.hh" -#include "nix/url.hh" -#include "nix/registry.hh" -#include "nix/build-result.hh" +#include "nix/expr/eval-cache.hh" +#include "nix/util/url.hh" +#include "nix/fetchers/registry.hh" +#include "nix/store/build-result.hh" #include #include #include -#include "nix/strings-inline.hh" +#include "nix/util/strings-inline.hh" namespace nix { diff --git a/src/libcmd/legacy.cc b/src/libcmd/legacy.cc index 25da75d3f..69b066831 100644 --- a/src/libcmd/legacy.cc +++ b/src/libcmd/legacy.cc @@ -1,4 +1,4 @@ -#include "nix/legacy.hh" +#include "nix/cmd/legacy.hh" namespace nix { diff --git a/src/libcmd/markdown.cc b/src/libcmd/markdown.cc index 5670b590b..41da73c7a 100644 --- a/src/libcmd/markdown.cc +++ b/src/libcmd/markdown.cc @@ -1,8 +1,8 @@ -#include "nix/markdown.hh" -#include "nix/environment-variables.hh" -#include "nix/error.hh" -#include "nix/finally.hh" -#include "nix/terminal.hh" +#include "nix/cmd/markdown.hh" +#include "nix/util/environment-variables.hh" +#include "nix/util/error.hh" +#include "nix/util/finally.hh" +#include "nix/util/terminal.hh" #include "cmd-config-private.hh" diff --git a/src/libcmd/meson.build b/src/libcmd/meson.build index 07747e0a3..32f44697d 100644 --- a/src/libcmd/meson.build +++ b/src/libcmd/meson.build @@ -79,7 +79,7 @@ sources = files( 'repl.cc', ) -subdir('include/nix') +subdir('include/nix/cmd') subdir('nix-meson-build-support/export-all-symbols') subdir('nix-meson-build-support/windows-version') @@ -95,7 +95,7 @@ this_library = library( install : true, ) -install_headers(headers, subdir : 'nix', preserve_path : true) +install_headers(headers, subdir : 'nix/cmd', preserve_path : true) libraries_private = [] diff --git a/src/libcmd/misc-store-flags.cc b/src/libcmd/misc-store-flags.cc index 70933648f..a57ad35ff 100644 --- a/src/libcmd/misc-store-flags.cc +++ b/src/libcmd/misc-store-flags.cc @@ -1,4 +1,4 @@ -#include "nix/misc-store-flags.hh" +#include "nix/cmd/misc-store-flags.hh" namespace nix::flag { diff --git a/src/libcmd/network-proxy.cc b/src/libcmd/network-proxy.cc index 31e9eb8dd..a4a89685c 100644 --- a/src/libcmd/network-proxy.cc +++ b/src/libcmd/network-proxy.cc @@ -1,8 +1,8 @@ -#include "nix/network-proxy.hh" +#include "nix/cmd/network-proxy.hh" #include -#include "nix/environment-variables.hh" +#include "nix/util/environment-variables.hh" namespace nix { diff --git a/src/libcmd/package.nix b/src/libcmd/package.nix index 5cfe550a3..be5054f64 100644 --- a/src/libcmd/package.nix +++ b/src/libcmd/package.nix @@ -46,7 +46,7 @@ mkMesonLibrary (finalAttrs: { ./.version ./meson.build ./meson.options - ./include/nix/meson.build + ./include/nix/cmd/meson.build (fileset.fileFilter (file: file.hasExt "cc") ./.) (fileset.fileFilter (file: file.hasExt "hh") ./.) ]; diff --git a/src/libcmd/repl-interacter.cc b/src/libcmd/repl-interacter.cc index 093cc2b29..0da2cc615 100644 --- a/src/libcmd/repl-interacter.cc +++ b/src/libcmd/repl-interacter.cc @@ -16,12 +16,12 @@ extern "C" { } #endif -#include "nix/signals.hh" -#include "nix/finally.hh" -#include "nix/repl-interacter.hh" -#include "nix/file-system.hh" -#include "nix/repl.hh" -#include "nix/environment-variables.hh" +#include "nix/util/signals.hh" +#include "nix/util/finally.hh" +#include "nix/cmd/repl-interacter.hh" +#include "nix/util/file-system.hh" +#include "nix/cmd/repl.hh" +#include "nix/util/environment-variables.hh" namespace nix { diff --git a/src/libcmd/repl.cc b/src/libcmd/repl.cc index 8bd5417d7..c5a95268b 100644 --- a/src/libcmd/repl.cc +++ b/src/libcmd/repl.cc @@ -2,34 +2,34 @@ #include #include -#include "nix/error.hh" -#include "nix/repl-interacter.hh" -#include "nix/repl.hh" +#include "nix/util/error.hh" +#include "nix/cmd/repl-interacter.hh" +#include "nix/cmd/repl.hh" -#include "nix/ansicolor.hh" -#include "nix/shared.hh" -#include "nix/eval.hh" -#include "nix/eval-settings.hh" -#include "nix/attr-path.hh" -#include "nix/signals.hh" -#include "nix/store-api.hh" -#include "nix/log-store.hh" -#include "nix/common-eval-args.hh" -#include "nix/get-drvs.hh" -#include "nix/derivations.hh" -#include "nix/globals.hh" +#include "nix/util/ansicolor.hh" +#include "nix/main/shared.hh" +#include "nix/expr/eval.hh" +#include "nix/expr/eval-settings.hh" +#include "nix/expr/attr-path.hh" +#include "nix/util/signals.hh" +#include "nix/store/store-api.hh" +#include "nix/store/log-store.hh" +#include "nix/cmd/common-eval-args.hh" +#include "nix/expr/get-drvs.hh" +#include "nix/store/derivations.hh" +#include "nix/store/globals.hh" #include "nix/flake/flake.hh" #include "nix/flake/lockfile.hh" -#include "nix/users.hh" -#include "nix/editor-for.hh" -#include "nix/finally.hh" -#include "nix/markdown.hh" -#include "nix/local-fs-store.hh" -#include "nix/print.hh" -#include "nix/ref.hh" -#include "nix/value.hh" +#include "nix/util/users.hh" +#include "nix/cmd/editor-for.hh" +#include "nix/util/finally.hh" +#include "nix/cmd/markdown.hh" +#include "nix/store/local-fs-store.hh" +#include "nix/expr/print.hh" +#include "nix/util/ref.hh" +#include "nix/expr/value.hh" -#include "nix/strings.hh" +#include "nix/util/strings.hh" namespace nix { diff --git a/src/libexpr-c/nix_api_expr.cc b/src/libexpr-c/nix_api_expr.cc index 47eca4e65..f34b1b77f 100644 --- a/src/libexpr-c/nix_api_expr.cc +++ b/src/libexpr-c/nix_api_expr.cc @@ -2,11 +2,11 @@ #include #include -#include "nix/eval.hh" -#include "nix/eval-gc.hh" -#include "nix/globals.hh" -#include "nix/eval-settings.hh" -#include "nix/ref.hh" +#include "nix/expr/eval.hh" +#include "nix/expr/eval-gc.hh" +#include "nix/store/globals.hh" +#include "nix/expr/eval-settings.hh" +#include "nix/util/ref.hh" #include "nix_api_expr.h" #include "nix_api_expr_internal.h" diff --git a/src/libexpr-c/nix_api_expr_internal.h b/src/libexpr-c/nix_api_expr_internal.h index 205a2ee62..a26595cec 100644 --- a/src/libexpr-c/nix_api_expr_internal.h +++ b/src/libexpr-c/nix_api_expr_internal.h @@ -1,12 +1,12 @@ #ifndef NIX_API_EXPR_INTERNAL_H #define NIX_API_EXPR_INTERNAL_H -#include "nix/fetch-settings.hh" -#include "nix/eval.hh" -#include "nix/eval-settings.hh" -#include "nix/attr-set.hh" +#include "nix/fetchers/fetch-settings.hh" +#include "nix/expr/eval.hh" +#include "nix/expr/eval-settings.hh" +#include "nix/expr/attr-set.hh" #include "nix_api_value.h" -#include "nix/search-path.hh" +#include "nix/expr/search-path.hh" struct nix_eval_state_builder { diff --git a/src/libexpr-c/nix_api_external.cc b/src/libexpr-c/nix_api_external.cc index ab124b73b..04d2e52b5 100644 --- a/src/libexpr-c/nix_api_external.cc +++ b/src/libexpr-c/nix_api_external.cc @@ -1,8 +1,8 @@ -#include "nix/attr-set.hh" -#include "nix/config.hh" -#include "nix/eval.hh" -#include "nix/globals.hh" -#include "nix/value.hh" +#include "nix/expr/attr-set.hh" +#include "nix/util/configuration.hh" +#include "nix/expr/eval.hh" +#include "nix/store/globals.hh" +#include "nix/expr/value.hh" #include "nix_api_expr.h" #include "nix_api_expr_internal.h" @@ -10,7 +10,7 @@ #include "nix_api_util.h" #include "nix_api_util_internal.h" #include "nix_api_value.h" -#include "nix/value/context.hh" +#include "nix/expr/value/context.hh" #include diff --git a/src/libexpr-c/nix_api_value.cc b/src/libexpr-c/nix_api_value.cc index 4c2fdee42..298d94845 100644 --- a/src/libexpr-c/nix_api_value.cc +++ b/src/libexpr-c/nix_api_value.cc @@ -1,10 +1,10 @@ -#include "nix/attr-set.hh" -#include "nix/config.hh" -#include "nix/eval.hh" -#include "nix/globals.hh" -#include "nix/path.hh" -#include "nix/primops.hh" -#include "nix/value.hh" +#include "nix/expr/attr-set.hh" +#include "nix/util/configuration.hh" +#include "nix/expr/eval.hh" +#include "nix/store/globals.hh" +#include "nix/store/path.hh" +#include "nix/expr/primops.hh" +#include "nix/expr/value.hh" #include "nix_api_expr.h" #include "nix_api_expr_internal.h" @@ -12,7 +12,7 @@ #include "nix_api_util_internal.h" #include "nix_api_store_internal.h" #include "nix_api_value.h" -#include "nix/value/context.hh" +#include "nix/expr/value/context.hh" // Internal helper functions to check [in] and [out] `Value *` parameters static const nix::Value & check_value_not_null(const nix_value * value) diff --git a/src/libexpr-test-support/include/nix/tests/libexpr.hh b/src/libexpr-test-support/include/nix/expr/tests/libexpr.hh similarity index 93% rename from src/libexpr-test-support/include/nix/tests/libexpr.hh rename to src/libexpr-test-support/include/nix/expr/tests/libexpr.hh index dfd5fbd3d..48c96ae2c 100644 --- a/src/libexpr-test-support/include/nix/tests/libexpr.hh +++ b/src/libexpr-test-support/include/nix/expr/tests/libexpr.hh @@ -4,16 +4,16 @@ #include #include -#include "nix/fetch-settings.hh" -#include "nix/value.hh" -#include "nix/nixexpr.hh" -#include "nix/nixexpr.hh" -#include "nix/eval.hh" -#include "nix/eval-gc.hh" -#include "nix/eval-inline.hh" -#include "nix/eval-settings.hh" +#include "nix/fetchers/fetch-settings.hh" +#include "nix/expr/value.hh" +#include "nix/expr/nixexpr.hh" +#include "nix/expr/nixexpr.hh" +#include "nix/expr/eval.hh" +#include "nix/expr/eval-gc.hh" +#include "nix/expr/eval-inline.hh" +#include "nix/expr/eval-settings.hh" -#include "nix/tests/libstore.hh" +#include "nix/store/tests/libstore.hh" namespace nix { class LibExprTest : public LibStoreTest { diff --git a/src/libexpr-test-support/include/nix/expr/tests/meson.build b/src/libexpr-test-support/include/nix/expr/tests/meson.build new file mode 100644 index 000000000..710bd8d4e --- /dev/null +++ b/src/libexpr-test-support/include/nix/expr/tests/meson.build @@ -0,0 +1,9 @@ +# Public headers directory + +include_dirs = [include_directories('../../..')] + +headers = files( + 'libexpr.hh', + 'nix_api_expr.hh', + 'value/context.hh', +) diff --git a/src/libexpr-test-support/include/nix/tests/nix_api_expr.hh b/src/libexpr-test-support/include/nix/expr/tests/nix_api_expr.hh similarity index 92% rename from src/libexpr-test-support/include/nix/tests/nix_api_expr.hh rename to src/libexpr-test-support/include/nix/expr/tests/nix_api_expr.hh index e5960b177..3e5aec313 100644 --- a/src/libexpr-test-support/include/nix/tests/nix_api_expr.hh +++ b/src/libexpr-test-support/include/nix/expr/tests/nix_api_expr.hh @@ -2,7 +2,7 @@ ///@file #include "nix_api_expr.h" #include "nix_api_value.h" -#include "nix/tests/nix_api_store.hh" +#include "nix/store/tests/nix_api_store.hh" #include diff --git a/src/libexpr-test-support/include/nix/tests/value/context.hh b/src/libexpr-test-support/include/nix/expr/tests/value/context.hh similarity index 93% rename from src/libexpr-test-support/include/nix/tests/value/context.hh rename to src/libexpr-test-support/include/nix/expr/tests/value/context.hh index d98e72242..a6a851d3a 100644 --- a/src/libexpr-test-support/include/nix/tests/value/context.hh +++ b/src/libexpr-test-support/include/nix/expr/tests/value/context.hh @@ -3,7 +3,7 @@ #include -#include "nix/value/context.hh" +#include "nix/expr/value/context.hh" namespace rc { using namespace nix; diff --git a/src/libexpr-test-support/include/nix/meson.build b/src/libexpr-test-support/include/nix/meson.build deleted file mode 100644 index 9e517c7f6..000000000 --- a/src/libexpr-test-support/include/nix/meson.build +++ /dev/null @@ -1,9 +0,0 @@ -# Public headers directory - -include_dirs = [include_directories('..')] - -headers = files( - 'tests/libexpr.hh', - 'tests/nix_api_expr.hh', - 'tests/value/context.hh', -) diff --git a/src/libexpr-test-support/meson.build b/src/libexpr-test-support/meson.build index 3409dbf20..b97f94362 100644 --- a/src/libexpr-test-support/meson.build +++ b/src/libexpr-test-support/meson.build @@ -35,7 +35,7 @@ sources = files( 'tests/value/context.cc', ) -subdir('include/nix') +subdir('include/nix/expr/tests') subdir('nix-meson-build-support/export-all-symbols') subdir('nix-meson-build-support/windows-version') @@ -52,7 +52,7 @@ this_library = library( install : true, ) -install_headers(headers, subdir : 'nix', preserve_path : true) +install_headers(headers, subdir : 'nix/expr/tests', preserve_path : true) libraries_private = [] diff --git a/src/libexpr-test-support/package.nix b/src/libexpr-test-support/package.nix index 5d4af1088..5cb4adaa8 100644 --- a/src/libexpr-test-support/package.nix +++ b/src/libexpr-test-support/package.nix @@ -29,7 +29,7 @@ mkMesonLibrary (finalAttrs: { ./.version ./meson.build # ./meson.options - ./include/nix/meson.build + ./include/nix/expr/tests/meson.build (fileset.fileFilter (file: file.hasExt "cc") ./.) (fileset.fileFilter (file: file.hasExt "hh") ./.) ]; diff --git a/src/libexpr-test-support/tests/value/context.cc b/src/libexpr-test-support/tests/value/context.cc index 7b2d60269..51ff1b2ae 100644 --- a/src/libexpr-test-support/tests/value/context.cc +++ b/src/libexpr-test-support/tests/value/context.cc @@ -1,7 +1,7 @@ #include -#include "nix/tests/path.hh" -#include "nix/tests/value/context.hh" +#include "nix/store/tests/path.hh" +#include "nix/expr/tests/value/context.hh" namespace rc { using namespace nix; diff --git a/src/libexpr-tests/derived-path.cc b/src/libexpr-tests/derived-path.cc index 1e427ffa5..9cc5d5371 100644 --- a/src/libexpr-tests/derived-path.cc +++ b/src/libexpr-tests/derived-path.cc @@ -2,8 +2,8 @@ #include #include -#include "nix/tests/derived-path.hh" -#include "nix/tests/libexpr.hh" +#include "nix/store/tests/derived-path.hh" +#include "nix/expr/tests/libexpr.hh" namespace nix { diff --git a/src/libexpr-tests/error_traces.cc b/src/libexpr-tests/error_traces.cc index abba15db8..d0ccd970a 100644 --- a/src/libexpr-tests/error_traces.cc +++ b/src/libexpr-tests/error_traces.cc @@ -1,7 +1,7 @@ #include #include -#include "nix/tests/libexpr.hh" +#include "nix/expr/tests/libexpr.hh" namespace nix { diff --git a/src/libexpr-tests/eval.cc b/src/libexpr-tests/eval.cc index 3bc672746..e9664dc58 100644 --- a/src/libexpr-tests/eval.cc +++ b/src/libexpr-tests/eval.cc @@ -1,8 +1,8 @@ #include #include -#include "nix/eval.hh" -#include "nix/tests/libexpr.hh" +#include "nix/expr/eval.hh" +#include "nix/expr/tests/libexpr.hh" namespace nix { diff --git a/src/libexpr-tests/json.cc b/src/libexpr-tests/json.cc index 67fdcf209..11f31d058 100644 --- a/src/libexpr-tests/json.cc +++ b/src/libexpr-tests/json.cc @@ -1,5 +1,5 @@ -#include "nix/tests/libexpr.hh" -#include "nix/value-to-json.hh" +#include "nix/expr/tests/libexpr.hh" +#include "nix/expr/value-to-json.hh" namespace nix { // Testing the conversion to JSON diff --git a/src/libexpr-tests/main.cc b/src/libexpr-tests/main.cc index 719b5a727..6fdaa9178 100644 --- a/src/libexpr-tests/main.cc +++ b/src/libexpr-tests/main.cc @@ -1,7 +1,7 @@ #include #include -#include "nix/globals.hh" -#include "nix/logging.hh" +#include "nix/store/globals.hh" +#include "nix/util/logging.hh" using namespace nix; diff --git a/src/libexpr-tests/nix_api_expr.cc b/src/libexpr-tests/nix_api_expr.cc index 55893488f..e2eeace6c 100644 --- a/src/libexpr-tests/nix_api_expr.cc +++ b/src/libexpr-tests/nix_api_expr.cc @@ -5,9 +5,9 @@ #include "nix_api_expr.h" #include "nix_api_value.h" -#include "nix/tests/nix_api_expr.hh" -#include "nix/tests/string_callback.hh" -#include "nix/file-system.hh" +#include "nix/expr/tests/nix_api_expr.hh" +#include "nix/util/tests/string_callback.hh" +#include "nix/util/file-system.hh" #include #include diff --git a/src/libexpr-tests/nix_api_external.cc b/src/libexpr-tests/nix_api_external.cc index f3f4771c7..b32326f9e 100644 --- a/src/libexpr-tests/nix_api_external.cc +++ b/src/libexpr-tests/nix_api_external.cc @@ -7,8 +7,8 @@ #include "nix_api_value.h" #include "nix_api_external.h" -#include "nix/tests/nix_api_expr.hh" -#include "nix/tests/string_callback.hh" +#include "nix/expr/tests/nix_api_expr.hh" +#include "nix/util/tests/string_callback.hh" #include diff --git a/src/libexpr-tests/nix_api_value.cc b/src/libexpr-tests/nix_api_value.cc index 0f86ba650..14f8bd0b0 100644 --- a/src/libexpr-tests/nix_api_value.cc +++ b/src/libexpr-tests/nix_api_value.cc @@ -6,8 +6,8 @@ #include "nix_api_value.h" #include "nix_api_expr_internal.h" -#include "nix/tests/nix_api_expr.hh" -#include "nix/tests/string_callback.hh" +#include "nix/expr/tests/nix_api_expr.hh" +#include "nix/util/tests/string_callback.hh" #include #include diff --git a/src/libexpr-tests/primops.cc b/src/libexpr-tests/primops.cc index 4114f08f6..66850d78b 100644 --- a/src/libexpr-tests/primops.cc +++ b/src/libexpr-tests/primops.cc @@ -1,10 +1,10 @@ #include #include -#include "nix/eval-settings.hh" -#include "nix/memory-source-accessor.hh" +#include "nix/expr/eval-settings.hh" +#include "nix/util/memory-source-accessor.hh" -#include "nix/tests/libexpr.hh" +#include "nix/expr/tests/libexpr.hh" namespace nix { class CaptureLogger : public Logger diff --git a/src/libexpr-tests/search-path.cc b/src/libexpr-tests/search-path.cc index 72f233597..792bb0812 100644 --- a/src/libexpr-tests/search-path.cc +++ b/src/libexpr-tests/search-path.cc @@ -1,7 +1,7 @@ #include #include -#include "nix/search-path.hh" +#include "nix/expr/search-path.hh" namespace nix { diff --git a/src/libexpr-tests/trivial.cc b/src/libexpr-tests/trivial.cc index 4ddd24d12..50a8f29f8 100644 --- a/src/libexpr-tests/trivial.cc +++ b/src/libexpr-tests/trivial.cc @@ -1,4 +1,4 @@ -#include "nix/tests/libexpr.hh" +#include "nix/expr/tests/libexpr.hh" namespace nix { // Testing of trivial expressions diff --git a/src/libexpr-tests/value/context.cc b/src/libexpr-tests/value/context.cc index bf3b501f4..97cd50f75 100644 --- a/src/libexpr-tests/value/context.cc +++ b/src/libexpr-tests/value/context.cc @@ -2,9 +2,9 @@ #include #include -#include "nix/tests/path.hh" -#include "nix/tests/libexpr.hh" -#include "nix/tests/value/context.hh" +#include "nix/store/tests/path.hh" +#include "nix/expr/tests/libexpr.hh" +#include "nix/expr/tests/value/context.hh" namespace nix { diff --git a/src/libexpr-tests/value/print.cc b/src/libexpr-tests/value/print.cc index 8590f9aac..d337a29a3 100644 --- a/src/libexpr-tests/value/print.cc +++ b/src/libexpr-tests/value/print.cc @@ -1,7 +1,7 @@ -#include "nix/tests/libexpr.hh" +#include "nix/expr/tests/libexpr.hh" -#include "nix/value.hh" -#include "nix/print.hh" +#include "nix/expr/value.hh" +#include "nix/expr/print.hh" namespace nix { diff --git a/src/libexpr-tests/value/value.cc b/src/libexpr-tests/value/value.cc index 9f91f8ff5..63501dd49 100644 --- a/src/libexpr-tests/value/value.cc +++ b/src/libexpr-tests/value/value.cc @@ -1,6 +1,6 @@ -#include "nix/value.hh" +#include "nix/expr/value.hh" -#include "nix/tests/libstore.hh" +#include "nix/store/tests/libstore.hh" namespace nix { diff --git a/src/libexpr/attr-path.cc b/src/libexpr/attr-path.cc index 8dde64790..cee805d14 100644 --- a/src/libexpr/attr-path.cc +++ b/src/libexpr/attr-path.cc @@ -1,5 +1,5 @@ -#include "nix/attr-path.hh" -#include "nix/eval-inline.hh" +#include "nix/expr/attr-path.hh" +#include "nix/expr/eval-inline.hh" namespace nix { diff --git a/src/libexpr/attr-set.cc b/src/libexpr/attr-set.cc index c6fc9f32a..06e245aea 100644 --- a/src/libexpr/attr-set.cc +++ b/src/libexpr/attr-set.cc @@ -1,5 +1,5 @@ -#include "nix/attr-set.hh" -#include "nix/eval-inline.hh" +#include "nix/expr/attr-set.hh" +#include "nix/expr/eval-inline.hh" #include diff --git a/src/libexpr/eval-cache.cc b/src/libexpr/eval-cache.cc index 5491f5d4c..30aa6076a 100644 --- a/src/libexpr/eval-cache.cc +++ b/src/libexpr/eval-cache.cc @@ -1,11 +1,11 @@ -#include "nix/users.hh" -#include "nix/eval-cache.hh" -#include "nix/sqlite.hh" -#include "nix/eval.hh" -#include "nix/eval-inline.hh" -#include "nix/store-api.hh" +#include "nix/util/users.hh" +#include "nix/expr/eval-cache.hh" +#include "nix/store/sqlite.hh" +#include "nix/expr/eval.hh" +#include "nix/expr/eval-inline.hh" +#include "nix/store/store-api.hh" // Need specialization involving `SymbolStr` just in this one module. -#include "nix/strings-inline.hh" +#include "nix/util/strings-inline.hh" namespace nix::eval_cache { diff --git a/src/libexpr/eval-error.cc b/src/libexpr/eval-error.cc index f983107a3..2c8b6e325 100644 --- a/src/libexpr/eval-error.cc +++ b/src/libexpr/eval-error.cc @@ -1,6 +1,6 @@ -#include "nix/eval-error.hh" -#include "nix/eval.hh" -#include "nix/value.hh" +#include "nix/expr/eval-error.hh" +#include "nix/expr/eval.hh" +#include "nix/expr/value.hh" namespace nix { diff --git a/src/libexpr/eval-gc.cc b/src/libexpr/eval-gc.cc index 1166548f6..6fc5ac334 100644 --- a/src/libexpr/eval-gc.cc +++ b/src/libexpr/eval-gc.cc @@ -1,9 +1,9 @@ -#include "nix/error.hh" -#include "nix/environment-variables.hh" -#include "nix/eval-settings.hh" -#include "nix/config-global.hh" -#include "nix/serialise.hh" -#include "nix/eval-gc.hh" +#include "nix/util/error.hh" +#include "nix/util/environment-variables.hh" +#include "nix/expr/eval-settings.hh" +#include "nix/util/config-global.hh" +#include "nix/util/serialise.hh" +#include "nix/expr/eval-gc.hh" #include "expr-config-private.hh" diff --git a/src/libexpr/eval-settings.cc b/src/libexpr/eval-settings.cc index 458507db8..659c01a9e 100644 --- a/src/libexpr/eval-settings.cc +++ b/src/libexpr/eval-settings.cc @@ -1,8 +1,8 @@ -#include "nix/users.hh" -#include "nix/globals.hh" -#include "nix/profiles.hh" -#include "nix/eval.hh" -#include "nix/eval-settings.hh" +#include "nix/util/users.hh" +#include "nix/store/globals.hh" +#include "nix/store/profiles.hh" +#include "nix/expr/eval.hh" +#include "nix/expr/eval-settings.hh" namespace nix { diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index 41b64a90a..624d7d4aa 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -1,24 +1,24 @@ -#include "nix/eval.hh" -#include "nix/eval-settings.hh" -#include "nix/primops.hh" -#include "nix/print-options.hh" -#include "nix/exit.hh" -#include "nix/types.hh" -#include "nix/util.hh" -#include "nix/store-api.hh" -#include "nix/derivations.hh" -#include "nix/downstream-placeholder.hh" -#include "nix/eval-inline.hh" -#include "nix/filetransfer.hh" -#include "nix/function-trace.hh" -#include "nix/profiles.hh" -#include "nix/print.hh" -#include "nix/filtering-source-accessor.hh" -#include "nix/memory-source-accessor.hh" -#include "nix/gc-small-vector.hh" -#include "nix/url.hh" -#include "nix/fetch-to-store.hh" -#include "nix/tarball.hh" +#include "nix/expr/eval.hh" +#include "nix/expr/eval-settings.hh" +#include "nix/expr/primops.hh" +#include "nix/expr/print-options.hh" +#include "nix/util/exit.hh" +#include "nix/util/types.hh" +#include "nix/util/util.hh" +#include "nix/store/store-api.hh" +#include "nix/store/derivations.hh" +#include "nix/store/downstream-placeholder.hh" +#include "nix/expr/eval-inline.hh" +#include "nix/store/filetransfer.hh" +#include "nix/expr/function-trace.hh" +#include "nix/store/profiles.hh" +#include "nix/expr/print.hh" +#include "nix/fetchers/filtering-source-accessor.hh" +#include "nix/util/memory-source-accessor.hh" +#include "nix/expr/gc-small-vector.hh" +#include "nix/util/url.hh" +#include "nix/fetchers/fetch-to-store.hh" +#include "nix/fetchers/tarball.hh" #include "parser-tab.hh" @@ -39,7 +39,7 @@ # include #endif -#include "nix/strings-inline.hh" +#include "nix/util/strings-inline.hh" using json = nlohmann::json; diff --git a/src/libexpr/function-trace.cc b/src/libexpr/function-trace.cc index 9c6e54e4b..1dce51726 100644 --- a/src/libexpr/function-trace.cc +++ b/src/libexpr/function-trace.cc @@ -1,5 +1,5 @@ -#include "nix/function-trace.hh" -#include "nix/logging.hh" +#include "nix/expr/function-trace.hh" +#include "nix/util/logging.hh" namespace nix { diff --git a/src/libexpr/get-drvs.cc b/src/libexpr/get-drvs.cc index 61b44aa17..f15ad4d73 100644 --- a/src/libexpr/get-drvs.cc +++ b/src/libexpr/get-drvs.cc @@ -1,8 +1,8 @@ -#include "nix/get-drvs.hh" -#include "nix/eval-inline.hh" -#include "nix/derivations.hh" -#include "nix/store-api.hh" -#include "nix/path-with-outputs.hh" +#include "nix/expr/get-drvs.hh" +#include "nix/expr/eval-inline.hh" +#include "nix/store/derivations.hh" +#include "nix/store/store-api.hh" +#include "nix/store/path-with-outputs.hh" #include #include diff --git a/src/libexpr/include/nix/attr-path.hh b/src/libexpr/include/nix/expr/attr-path.hh similarity index 95% rename from src/libexpr/include/nix/attr-path.hh rename to src/libexpr/include/nix/expr/attr-path.hh index 06d00efc2..66a3f4e00 100644 --- a/src/libexpr/include/nix/attr-path.hh +++ b/src/libexpr/include/nix/expr/attr-path.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "nix/eval.hh" +#include "nix/expr/eval.hh" #include #include diff --git a/src/libexpr/include/nix/attr-set.hh b/src/libexpr/include/nix/expr/attr-set.hh similarity index 98% rename from src/libexpr/include/nix/attr-set.hh rename to src/libexpr/include/nix/expr/attr-set.hh index 93360e4e3..283786f4d 100644 --- a/src/libexpr/include/nix/attr-set.hh +++ b/src/libexpr/include/nix/expr/attr-set.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "nix/nixexpr.hh" -#include "nix/symbol-table.hh" +#include "nix/expr/nixexpr.hh" +#include "nix/expr/symbol-table.hh" #include diff --git a/src/libexpr/include/nix/eval-cache.hh b/src/libexpr/include/nix/expr/eval-cache.hh similarity index 97% rename from src/libexpr/include/nix/eval-cache.hh rename to src/libexpr/include/nix/expr/eval-cache.hh index 2d70aa99e..31873f7a3 100644 --- a/src/libexpr/include/nix/eval-cache.hh +++ b/src/libexpr/include/nix/expr/eval-cache.hh @@ -1,9 +1,9 @@ #pragma once ///@file -#include "nix/sync.hh" -#include "nix/hash.hh" -#include "nix/eval.hh" +#include "nix/util/sync.hh" +#include "nix/util/hash.hh" +#include "nix/expr/eval.hh" #include #include diff --git a/src/libexpr/include/nix/eval-error.hh b/src/libexpr/include/nix/expr/eval-error.hh similarity index 98% rename from src/libexpr/include/nix/eval-error.hh rename to src/libexpr/include/nix/expr/eval-error.hh index 3dee88fa4..ae4f40689 100644 --- a/src/libexpr/include/nix/eval-error.hh +++ b/src/libexpr/include/nix/expr/eval-error.hh @@ -1,7 +1,7 @@ #pragma once -#include "nix/error.hh" -#include "nix/pos-idx.hh" +#include "nix/util/error.hh" +#include "nix/util/pos-idx.hh" namespace nix { diff --git a/src/libexpr/include/nix/eval-gc.hh b/src/libexpr/include/nix/expr/eval-gc.hh similarity index 96% rename from src/libexpr/include/nix/eval-gc.hh rename to src/libexpr/include/nix/expr/eval-gc.hh index 8f28fe0e2..25144d40c 100644 --- a/src/libexpr/include/nix/eval-gc.hh +++ b/src/libexpr/include/nix/expr/eval-gc.hh @@ -4,7 +4,7 @@ #include // For `NIX_USE_BOEHMGC`, and if that's set, `GC_THREADS` -#include "nix/expr-config.hh" +#include "nix/expr/config.hh" #if NIX_USE_BOEHMGC diff --git a/src/libexpr/include/nix/eval-inline.hh b/src/libexpr/include/nix/expr/eval-inline.hh similarity index 96% rename from src/libexpr/include/nix/eval-inline.hh rename to src/libexpr/include/nix/expr/eval-inline.hh index 09a85db06..6e5759c0b 100644 --- a/src/libexpr/include/nix/eval-inline.hh +++ b/src/libexpr/include/nix/expr/eval-inline.hh @@ -1,13 +1,13 @@ #pragma once ///@file -#include "nix/print.hh" -#include "nix/eval.hh" -#include "nix/eval-error.hh" -#include "nix/eval-settings.hh" +#include "nix/expr/print.hh" +#include "nix/expr/eval.hh" +#include "nix/expr/eval-error.hh" +#include "nix/expr/eval-settings.hh" // For `NIX_USE_BOEHMGC`, and if that's set, `GC_THREADS` -#include "nix/expr-config.hh" +#include "nix/expr/config.hh" namespace nix { diff --git a/src/libexpr/include/nix/eval-settings.hh b/src/libexpr/include/nix/expr/eval-settings.hh similarity index 99% rename from src/libexpr/include/nix/eval-settings.hh rename to src/libexpr/include/nix/expr/eval-settings.hh index 48d8a544b..8d3db59b3 100644 --- a/src/libexpr/include/nix/eval-settings.hh +++ b/src/libexpr/include/nix/expr/eval-settings.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "nix/config.hh" -#include "nix/source-path.hh" +#include "nix/util/configuration.hh" +#include "nix/util/source-path.hh" namespace nix { diff --git a/src/libexpr/include/nix/eval.hh b/src/libexpr/include/nix/expr/eval.hh similarity index 98% rename from src/libexpr/include/nix/eval.hh rename to src/libexpr/include/nix/expr/eval.hh index 7a3ec065d..0933c6e89 100644 --- a/src/libexpr/include/nix/eval.hh +++ b/src/libexpr/include/nix/expr/eval.hh @@ -1,23 +1,23 @@ #pragma once ///@file -#include "nix/attr-set.hh" -#include "nix/eval-error.hh" -#include "nix/types.hh" -#include "nix/value.hh" -#include "nix/nixexpr.hh" -#include "nix/symbol-table.hh" -#include "nix/config.hh" -#include "nix/experimental-features.hh" -#include "nix/position.hh" -#include "nix/pos-table.hh" -#include "nix/source-accessor.hh" -#include "nix/search-path.hh" -#include "nix/repl-exit-status.hh" -#include "nix/ref.hh" +#include "nix/expr/attr-set.hh" +#include "nix/expr/eval-error.hh" +#include "nix/util/types.hh" +#include "nix/expr/value.hh" +#include "nix/expr/nixexpr.hh" +#include "nix/expr/symbol-table.hh" +#include "nix/util/configuration.hh" +#include "nix/util/experimental-features.hh" +#include "nix/util/position.hh" +#include "nix/util/pos-table.hh" +#include "nix/util/source-accessor.hh" +#include "nix/expr/search-path.hh" +#include "nix/expr/repl-exit-status.hh" +#include "nix/util/ref.hh" // For `NIX_USE_BOEHMGC`, and if that's set, `GC_THREADS` -#include "nix/expr-config.hh" +#include "nix/expr/config.hh" #include #include @@ -947,4 +947,4 @@ bool isAllowedURI(std::string_view uri, const Strings & allowedPaths); } -#include "nix/eval-inline.hh" +#include "nix/expr/eval-inline.hh" diff --git a/src/libexpr/include/nix/function-trace.hh b/src/libexpr/include/nix/expr/function-trace.hh similarity index 86% rename from src/libexpr/include/nix/function-trace.hh rename to src/libexpr/include/nix/expr/function-trace.hh index 59743fe79..dc92d4b5c 100644 --- a/src/libexpr/include/nix/function-trace.hh +++ b/src/libexpr/include/nix/expr/function-trace.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "nix/eval.hh" +#include "nix/expr/eval.hh" #include diff --git a/src/libexpr/include/nix/gc-small-vector.hh b/src/libexpr/include/nix/expr/gc-small-vector.hh similarity index 95% rename from src/libexpr/include/nix/gc-small-vector.hh rename to src/libexpr/include/nix/expr/gc-small-vector.hh index 2becffe7c..ad4503de7 100644 --- a/src/libexpr/include/nix/gc-small-vector.hh +++ b/src/libexpr/include/nix/expr/gc-small-vector.hh @@ -2,7 +2,7 @@ #include -#include "nix/value.hh" +#include "nix/expr/value.hh" namespace nix { diff --git a/src/libexpr/include/nix/get-drvs.hh b/src/libexpr/include/nix/expr/get-drvs.hh similarity index 97% rename from src/libexpr/include/nix/get-drvs.hh rename to src/libexpr/include/nix/expr/get-drvs.hh index aeb70c79e..0787c44a8 100644 --- a/src/libexpr/include/nix/get-drvs.hh +++ b/src/libexpr/include/nix/expr/get-drvs.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "nix/eval.hh" -#include "nix/path.hh" +#include "nix/expr/eval.hh" +#include "nix/store/path.hh" #include #include diff --git a/src/libexpr/include/nix/json-to-value.hh b/src/libexpr/include/nix/expr/json-to-value.hh similarity index 87% rename from src/libexpr/include/nix/json-to-value.hh rename to src/libexpr/include/nix/expr/json-to-value.hh index a2e0d303d..b01d63bfe 100644 --- a/src/libexpr/include/nix/json-to-value.hh +++ b/src/libexpr/include/nix/expr/json-to-value.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "nix/error.hh" +#include "nix/util/error.hh" #include diff --git a/src/libexpr/include/nix/lexer-helpers.hh b/src/libexpr/include/nix/expr/lexer-helpers.hh similarity index 100% rename from src/libexpr/include/nix/lexer-helpers.hh rename to src/libexpr/include/nix/expr/lexer-helpers.hh diff --git a/src/libexpr/include/nix/meson.build b/src/libexpr/include/nix/expr/meson.build similarity index 90% rename from src/libexpr/include/nix/meson.build rename to src/libexpr/include/nix/expr/meson.build index 89422004a..01275e52e 100644 --- a/src/libexpr/include/nix/meson.build +++ b/src/libexpr/include/nix/expr/meson.build @@ -1,10 +1,10 @@ # Public headers directory -include_dirs = [include_directories('..')] +include_dirs = [include_directories('../..')] config_pub_h = configure_file( configuration : configdata_pub, - output : 'expr-config.hh', + output : 'config.hh', ) headers = [config_pub_h] + files( diff --git a/src/libexpr/include/nix/nixexpr.hh b/src/libexpr/include/nix/expr/nixexpr.hh similarity index 99% rename from src/libexpr/include/nix/nixexpr.hh rename to src/libexpr/include/nix/expr/nixexpr.hh index deb26dd29..9409bdca8 100644 --- a/src/libexpr/include/nix/nixexpr.hh +++ b/src/libexpr/include/nix/expr/nixexpr.hh @@ -4,10 +4,10 @@ #include #include -#include "nix/value.hh" -#include "nix/symbol-table.hh" -#include "nix/eval-error.hh" -#include "nix/pos-idx.hh" +#include "nix/expr/value.hh" +#include "nix/expr/symbol-table.hh" +#include "nix/expr/eval-error.hh" +#include "nix/util/pos-idx.hh" namespace nix { diff --git a/src/libexpr/include/nix/parser-state.hh b/src/libexpr/include/nix/expr/parser-state.hh similarity index 99% rename from src/libexpr/include/nix/parser-state.hh rename to src/libexpr/include/nix/expr/parser-state.hh index aa3c2455d..0505913d0 100644 --- a/src/libexpr/include/nix/parser-state.hh +++ b/src/libexpr/include/nix/expr/parser-state.hh @@ -3,7 +3,7 @@ #include -#include "nix/eval.hh" +#include "nix/expr/eval.hh" namespace nix { diff --git a/src/libexpr/include/nix/primops.hh b/src/libexpr/include/nix/expr/primops.hh similarity index 98% rename from src/libexpr/include/nix/primops.hh rename to src/libexpr/include/nix/expr/primops.hh index 75c6f0d46..f0742a138 100644 --- a/src/libexpr/include/nix/primops.hh +++ b/src/libexpr/include/nix/expr/primops.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "nix/eval.hh" +#include "nix/expr/eval.hh" #include #include diff --git a/src/libexpr/include/nix/print-ambiguous.hh b/src/libexpr/include/nix/expr/print-ambiguous.hh similarity index 95% rename from src/libexpr/include/nix/print-ambiguous.hh rename to src/libexpr/include/nix/expr/print-ambiguous.hh index 06f4e805c..09a849c49 100644 --- a/src/libexpr/include/nix/print-ambiguous.hh +++ b/src/libexpr/include/nix/expr/print-ambiguous.hh @@ -1,6 +1,6 @@ #pragma once -#include "nix/value.hh" +#include "nix/expr/value.hh" namespace nix { diff --git a/src/libexpr/include/nix/print-options.hh b/src/libexpr/include/nix/expr/print-options.hh similarity index 100% rename from src/libexpr/include/nix/print-options.hh rename to src/libexpr/include/nix/expr/print-options.hh diff --git a/src/libexpr/include/nix/print.hh b/src/libexpr/include/nix/expr/print.hh similarity index 97% rename from src/libexpr/include/nix/print.hh rename to src/libexpr/include/nix/expr/print.hh index 09405e8f0..ac9bf23a4 100644 --- a/src/libexpr/include/nix/print.hh +++ b/src/libexpr/include/nix/expr/print.hh @@ -9,8 +9,8 @@ #include -#include "nix/fmt.hh" -#include "nix/print-options.hh" +#include "nix/util/fmt.hh" +#include "nix/expr/print-options.hh" namespace nix { diff --git a/src/libexpr/include/nix/repl-exit-status.hh b/src/libexpr/include/nix/expr/repl-exit-status.hh similarity index 100% rename from src/libexpr/include/nix/repl-exit-status.hh rename to src/libexpr/include/nix/expr/repl-exit-status.hh diff --git a/src/libexpr/include/nix/search-path.hh b/src/libexpr/include/nix/expr/search-path.hh similarity index 97% rename from src/libexpr/include/nix/search-path.hh rename to src/libexpr/include/nix/expr/search-path.hh index 22a97b5f3..202527fd2 100644 --- a/src/libexpr/include/nix/search-path.hh +++ b/src/libexpr/include/nix/expr/search-path.hh @@ -3,8 +3,8 @@ #include -#include "nix/types.hh" -#include "nix/comparator.hh" +#include "nix/util/types.hh" +#include "nix/util/comparator.hh" namespace nix { diff --git a/src/libexpr/include/nix/symbol-table.hh b/src/libexpr/include/nix/expr/symbol-table.hh similarity index 97% rename from src/libexpr/include/nix/symbol-table.hh rename to src/libexpr/include/nix/expr/symbol-table.hh index b55674b12..018465bf5 100644 --- a/src/libexpr/include/nix/symbol-table.hh +++ b/src/libexpr/include/nix/expr/symbol-table.hh @@ -5,9 +5,9 @@ #include #include -#include "nix/types.hh" -#include "nix/chunked-vector.hh" -#include "nix/error.hh" +#include "nix/util/types.hh" +#include "nix/util/chunked-vector.hh" +#include "nix/util/error.hh" namespace nix { diff --git a/src/libexpr/include/nix/value-to-json.hh b/src/libexpr/include/nix/expr/value-to-json.hh similarity index 88% rename from src/libexpr/include/nix/value-to-json.hh rename to src/libexpr/include/nix/expr/value-to-json.hh index 9875c83c6..1a6911347 100644 --- a/src/libexpr/include/nix/value-to-json.hh +++ b/src/libexpr/include/nix/expr/value-to-json.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "nix/nixexpr.hh" -#include "nix/eval.hh" +#include "nix/expr/nixexpr.hh" +#include "nix/expr/eval.hh" #include #include diff --git a/src/libexpr/include/nix/value-to-xml.hh b/src/libexpr/include/nix/expr/value-to-xml.hh similarity index 79% rename from src/libexpr/include/nix/value-to-xml.hh rename to src/libexpr/include/nix/expr/value-to-xml.hh index 3e9dce4d6..e22325de5 100644 --- a/src/libexpr/include/nix/value-to-xml.hh +++ b/src/libexpr/include/nix/expr/value-to-xml.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "nix/nixexpr.hh" -#include "nix/eval.hh" +#include "nix/expr/nixexpr.hh" +#include "nix/expr/eval.hh" #include #include diff --git a/src/libexpr/include/nix/value.hh b/src/libexpr/include/nix/expr/value.hh similarity index 98% rename from src/libexpr/include/nix/value.hh rename to src/libexpr/include/nix/expr/value.hh index 45155b3d4..e9cc1cd3f 100644 --- a/src/libexpr/include/nix/value.hh +++ b/src/libexpr/include/nix/expr/value.hh @@ -4,12 +4,12 @@ #include #include -#include "nix/eval-gc.hh" -#include "nix/symbol-table.hh" -#include "nix/value/context.hh" -#include "nix/source-path.hh" -#include "nix/print-options.hh" -#include "nix/checked-arithmetic.hh" +#include "nix/expr/eval-gc.hh" +#include "nix/expr/symbol-table.hh" +#include "nix/expr/value/context.hh" +#include "nix/util/source-path.hh" +#include "nix/expr/print-options.hh" +#include "nix/util/checked-arithmetic.hh" #include diff --git a/src/libexpr/include/nix/value/context.hh b/src/libexpr/include/nix/expr/value/context.hh similarity index 94% rename from src/libexpr/include/nix/value/context.hh rename to src/libexpr/include/nix/expr/value/context.hh index f996cce42..f2de184ea 100644 --- a/src/libexpr/include/nix/value/context.hh +++ b/src/libexpr/include/nix/expr/value/context.hh @@ -1,9 +1,9 @@ #pragma once ///@file -#include "nix/comparator.hh" -#include "nix/derived-path.hh" -#include "nix/variant-wrapper.hh" +#include "nix/util/comparator.hh" +#include "nix/store/derived-path.hh" +#include "nix/util/variant-wrapper.hh" #include diff --git a/src/libexpr/json-to-value.cc b/src/libexpr/json-to-value.cc index d5da3f2b1..e38ac7db4 100644 --- a/src/libexpr/json-to-value.cc +++ b/src/libexpr/json-to-value.cc @@ -1,6 +1,6 @@ -#include "nix/json-to-value.hh" -#include "nix/value.hh" -#include "nix/eval.hh" +#include "nix/expr/json-to-value.hh" +#include "nix/expr/value.hh" +#include "nix/expr/eval.hh" #include #include diff --git a/src/libexpr/lexer-helpers.cc b/src/libexpr/lexer-helpers.cc index 9eb4502fc..4b27393bb 100644 --- a/src/libexpr/lexer-helpers.cc +++ b/src/libexpr/lexer-helpers.cc @@ -1,7 +1,7 @@ #include "lexer-tab.hh" #include "parser-tab.hh" -#include "nix/lexer-helpers.hh" +#include "nix/expr/lexer-helpers.hh" void nix::lexer::internal::initLoc(YYLTYPE * loc) { diff --git a/src/libexpr/lexer.l b/src/libexpr/lexer.l index c8a5ec9fd..511c8e47b 100644 --- a/src/libexpr/lexer.l +++ b/src/libexpr/lexer.l @@ -16,7 +16,7 @@ %top { #include "parser-tab.hh" // YYSTYPE -#include "nix/parser-state.hh" +#include "nix/expr/parser-state.hh" } %{ @@ -24,9 +24,9 @@ #pragma clang diagnostic ignored "-Wunneeded-internal-declaration" #endif -#include "nix/nixexpr.hh" +#include "nix/expr/nixexpr.hh" #include "parser-tab.hh" -#include "nix/lexer-helpers.hh" +#include "nix/expr/lexer-helpers.hh" namespace nix { struct LexerState; diff --git a/src/libexpr/meson.build b/src/libexpr/meson.build index 02873f4db..2e773938d 100644 --- a/src/libexpr/meson.build +++ b/src/libexpr/meson.build @@ -156,7 +156,7 @@ sources = files( 'value/context.cc', ) -subdir('include/nix') +subdir('include/nix/expr') subdir('primops') @@ -177,7 +177,7 @@ this_library = library( install : true, ) -install_headers(headers, subdir : 'nix', preserve_path : true) +install_headers(headers, subdir : 'nix/expr', preserve_path : true) libraries_private = [] diff --git a/src/libexpr/nixexpr.cc b/src/libexpr/nixexpr.cc index e5289de6a..1a71096d4 100644 --- a/src/libexpr/nixexpr.cc +++ b/src/libexpr/nixexpr.cc @@ -1,13 +1,13 @@ -#include "nix/nixexpr.hh" -#include "nix/eval.hh" -#include "nix/symbol-table.hh" -#include "nix/util.hh" -#include "nix/print.hh" +#include "nix/expr/nixexpr.hh" +#include "nix/expr/eval.hh" +#include "nix/expr/symbol-table.hh" +#include "nix/util/util.hh" +#include "nix/expr/print.hh" #include #include -#include "nix/strings-inline.hh" +#include "nix/util/strings-inline.hh" namespace nix { diff --git a/src/libexpr/package.nix b/src/libexpr/package.nix index 8f309b14e..50161c58b 100644 --- a/src/libexpr/package.nix +++ b/src/libexpr/package.nix @@ -48,7 +48,7 @@ mkMesonLibrary (finalAttrs: { ./meson.build ./meson.options ./primops/meson.build - ./include/nix/meson.build + ./include/nix/expr/meson.build (fileset.fileFilter (file: file.hasExt "cc") ./.) (fileset.fileFilter (file: file.hasExt "hh") ./.) ./lexer.l diff --git a/src/libexpr/parser.y b/src/libexpr/parser.y index c90bafa05..99cc687cc 100644 --- a/src/libexpr/parser.y +++ b/src/libexpr/parser.y @@ -17,14 +17,14 @@ #include -#include "nix/finally.hh" -#include "nix/util.hh" -#include "nix/users.hh" +#include "nix/util/finally.hh" +#include "nix/util/util.hh" +#include "nix/util/users.hh" -#include "nix/nixexpr.hh" -#include "nix/eval.hh" -#include "nix/eval-settings.hh" -#include "nix/parser-state.hh" +#include "nix/expr/nixexpr.hh" +#include "nix/expr/eval.hh" +#include "nix/expr/eval-settings.hh" +#include "nix/expr/parser-state.hh" // Bison seems to have difficulty growing the parser stack when using C++ with // a custom location type. This undocumented macro tells Bison that our @@ -514,7 +514,7 @@ formal %% -#include "nix/eval.hh" +#include "nix/expr/eval.hh" namespace nix { diff --git a/src/libexpr/paths.cc b/src/libexpr/paths.cc index 5aae69f9d..c5107de3a 100644 --- a/src/libexpr/paths.cc +++ b/src/libexpr/paths.cc @@ -1,5 +1,5 @@ -#include "nix/store-api.hh" -#include "nix/eval.hh" +#include "nix/store/store-api.hh" +#include "nix/expr/eval.hh" namespace nix { diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index a790076fe..47f048aef 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -1,19 +1,19 @@ -#include "nix/derivations.hh" -#include "nix/downstream-placeholder.hh" -#include "nix/eval-inline.hh" -#include "nix/eval.hh" -#include "nix/eval-settings.hh" -#include "nix/gc-small-vector.hh" -#include "nix/json-to-value.hh" -#include "nix/names.hh" -#include "nix/path-references.hh" -#include "nix/store-api.hh" -#include "nix/util.hh" -#include "nix/processes.hh" -#include "nix/value-to-json.hh" -#include "nix/value-to-xml.hh" -#include "nix/primops.hh" -#include "nix/fetch-to-store.hh" +#include "nix/store/derivations.hh" +#include "nix/store/downstream-placeholder.hh" +#include "nix/expr/eval-inline.hh" +#include "nix/expr/eval.hh" +#include "nix/expr/eval-settings.hh" +#include "nix/expr/gc-small-vector.hh" +#include "nix/expr/json-to-value.hh" +#include "nix/store/names.hh" +#include "nix/store/path-references.hh" +#include "nix/store/store-api.hh" +#include "nix/util/util.hh" +#include "nix/util/processes.hh" +#include "nix/expr/value-to-json.hh" +#include "nix/expr/value-to-xml.hh" +#include "nix/expr/primops.hh" +#include "nix/fetchers/fetch-to-store.hh" #include #include diff --git a/src/libexpr/primops/context.cc b/src/libexpr/primops/context.cc index 832d17cbb..6a7284e05 100644 --- a/src/libexpr/primops/context.cc +++ b/src/libexpr/primops/context.cc @@ -1,7 +1,7 @@ -#include "nix/primops.hh" -#include "nix/eval-inline.hh" -#include "nix/derivations.hh" -#include "nix/store-api.hh" +#include "nix/expr/primops.hh" +#include "nix/expr/eval-inline.hh" +#include "nix/store/derivations.hh" +#include "nix/store/store-api.hh" namespace nix { diff --git a/src/libexpr/primops/fetchClosure.cc b/src/libexpr/primops/fetchClosure.cc index fc48c54ee..d28680ae5 100644 --- a/src/libexpr/primops/fetchClosure.cc +++ b/src/libexpr/primops/fetchClosure.cc @@ -1,8 +1,8 @@ -#include "nix/primops.hh" -#include "nix/store-api.hh" -#include "nix/realisation.hh" -#include "nix/make-content-addressed.hh" -#include "nix/url.hh" +#include "nix/expr/primops.hh" +#include "nix/store/store-api.hh" +#include "nix/store/realisation.hh" +#include "nix/store/make-content-addressed.hh" +#include "nix/util/url.hh" namespace nix { diff --git a/src/libexpr/primops/fetchMercurial.cc b/src/libexpr/primops/fetchMercurial.cc index 59698552e..189bd1f73 100644 --- a/src/libexpr/primops/fetchMercurial.cc +++ b/src/libexpr/primops/fetchMercurial.cc @@ -1,10 +1,10 @@ -#include "nix/primops.hh" -#include "nix/eval-inline.hh" -#include "nix/eval-settings.hh" -#include "nix/store-api.hh" -#include "nix/fetchers.hh" -#include "nix/url.hh" -#include "nix/url-parts.hh" +#include "nix/expr/primops.hh" +#include "nix/expr/eval-inline.hh" +#include "nix/expr/eval-settings.hh" +#include "nix/store/store-api.hh" +#include "nix/fetchers/fetchers.hh" +#include "nix/util/url.hh" +#include "nix/util/url-parts.hh" namespace nix { diff --git a/src/libexpr/primops/fetchTree.cc b/src/libexpr/primops/fetchTree.cc index b14d54113..0be9f4bdc 100644 --- a/src/libexpr/primops/fetchTree.cc +++ b/src/libexpr/primops/fetchTree.cc @@ -1,15 +1,15 @@ -#include "nix/attrs.hh" -#include "nix/primops.hh" -#include "nix/eval-inline.hh" -#include "nix/eval-settings.hh" -#include "nix/store-api.hh" -#include "nix/fetchers.hh" -#include "nix/filetransfer.hh" -#include "nix/registry.hh" -#include "nix/tarball.hh" -#include "nix/url.hh" -#include "nix/value-to-json.hh" -#include "nix/fetch-to-store.hh" +#include "nix/fetchers/attrs.hh" +#include "nix/expr/primops.hh" +#include "nix/expr/eval-inline.hh" +#include "nix/expr/eval-settings.hh" +#include "nix/store/store-api.hh" +#include "nix/fetchers/fetchers.hh" +#include "nix/store/filetransfer.hh" +#include "nix/fetchers/registry.hh" +#include "nix/fetchers/tarball.hh" +#include "nix/util/url.hh" +#include "nix/expr/value-to-json.hh" +#include "nix/fetchers/fetch-to-store.hh" #include diff --git a/src/libexpr/primops/fromTOML.cc b/src/libexpr/primops/fromTOML.cc index 05fe2e7bd..2a29e0424 100644 --- a/src/libexpr/primops/fromTOML.cc +++ b/src/libexpr/primops/fromTOML.cc @@ -1,5 +1,5 @@ -#include "nix/primops.hh" -#include "nix/eval-inline.hh" +#include "nix/expr/primops.hh" +#include "nix/expr/eval-inline.hh" #include diff --git a/src/libexpr/print-ambiguous.cc b/src/libexpr/print-ambiguous.cc index b275e1e5c..0646783c2 100644 --- a/src/libexpr/print-ambiguous.cc +++ b/src/libexpr/print-ambiguous.cc @@ -1,7 +1,7 @@ -#include "nix/print-ambiguous.hh" -#include "nix/print.hh" -#include "nix/signals.hh" -#include "nix/eval.hh" +#include "nix/expr/print-ambiguous.hh" +#include "nix/expr/print.hh" +#include "nix/util/signals.hh" +#include "nix/expr/eval.hh" namespace nix { diff --git a/src/libexpr/print.cc b/src/libexpr/print.cc index 39f97e68b..06bae9c5c 100644 --- a/src/libexpr/print.cc +++ b/src/libexpr/print.cc @@ -2,13 +2,13 @@ #include #include -#include "nix/print.hh" -#include "nix/ansicolor.hh" -#include "nix/signals.hh" -#include "nix/store-api.hh" -#include "nix/terminal.hh" -#include "nix/english.hh" -#include "nix/eval.hh" +#include "nix/expr/print.hh" +#include "nix/util/ansicolor.hh" +#include "nix/util/signals.hh" +#include "nix/store/store-api.hh" +#include "nix/util/terminal.hh" +#include "nix/util/english.hh" +#include "nix/expr/eval.hh" namespace nix { diff --git a/src/libexpr/search-path.cc b/src/libexpr/search-path.cc index 8c33430f1..76aecd4e5 100644 --- a/src/libexpr/search-path.cc +++ b/src/libexpr/search-path.cc @@ -1,4 +1,4 @@ -#include "nix/search-path.hh" +#include "nix/expr/search-path.hh" namespace nix { diff --git a/src/libexpr/value-to-json.cc b/src/libexpr/value-to-json.cc index 846776aed..51652db1f 100644 --- a/src/libexpr/value-to-json.cc +++ b/src/libexpr/value-to-json.cc @@ -1,7 +1,7 @@ -#include "nix/value-to-json.hh" -#include "nix/eval-inline.hh" -#include "nix/store-api.hh" -#include "nix/signals.hh" +#include "nix/expr/value-to-json.hh" +#include "nix/expr/eval-inline.hh" +#include "nix/store/store-api.hh" +#include "nix/util/signals.hh" #include #include diff --git a/src/libexpr/value-to-xml.cc b/src/libexpr/value-to-xml.cc index e4df226a4..e26fff71b 100644 --- a/src/libexpr/value-to-xml.cc +++ b/src/libexpr/value-to-xml.cc @@ -1,7 +1,7 @@ -#include "nix/value-to-xml.hh" -#include "nix/xml-writer.hh" -#include "nix/eval-inline.hh" -#include "nix/signals.hh" +#include "nix/expr/value-to-xml.hh" +#include "nix/util/xml-writer.hh" +#include "nix/expr/eval-inline.hh" +#include "nix/util/signals.hh" #include diff --git a/src/libexpr/value/context.cc b/src/libexpr/value/context.cc index 2052e193a..40d08da59 100644 --- a/src/libexpr/value/context.cc +++ b/src/libexpr/value/context.cc @@ -1,5 +1,5 @@ -#include "nix/util.hh" -#include "nix/value/context.hh" +#include "nix/util/util.hh" +#include "nix/expr/value/context.hh" #include diff --git a/src/libfetchers-tests/access-tokens.cc b/src/libfetchers-tests/access-tokens.cc index 25c3e6b5f..93043ba3e 100644 --- a/src/libfetchers-tests/access-tokens.cc +++ b/src/libfetchers-tests/access-tokens.cc @@ -1,10 +1,10 @@ #include #include -#include "nix/fetchers.hh" -#include "nix/fetch-settings.hh" -#include "nix/json-utils.hh" -#include "nix/tests/characterization.hh" +#include "nix/fetchers/fetchers.hh" +#include "nix/fetchers/fetch-settings.hh" +#include "nix/util/json-utils.hh" +#include "nix/util/tests/characterization.hh" namespace nix::fetchers { diff --git a/src/libfetchers-tests/git-utils.cc b/src/libfetchers-tests/git-utils.cc index e41db0b5b..ceac809de 100644 --- a/src/libfetchers-tests/git-utils.cc +++ b/src/libfetchers-tests/git-utils.cc @@ -1,13 +1,13 @@ -#include "nix/git-utils.hh" -#include "nix/file-system.hh" +#include "nix/fetchers/git-utils.hh" +#include "nix/util/file-system.hh" #include #include #include #include #include -#include "nix/fs-sink.hh" -#include "nix/serialise.hh" -#include "nix/git-lfs-fetch.hh" +#include "nix/util/fs-sink.hh" +#include "nix/util/serialise.hh" +#include "nix/fetchers/git-lfs-fetch.hh" namespace nix { diff --git a/src/libfetchers-tests/public-key.cc b/src/libfetchers-tests/public-key.cc index 98965cf79..39a7cf4bd 100644 --- a/src/libfetchers-tests/public-key.cc +++ b/src/libfetchers-tests/public-key.cc @@ -1,8 +1,8 @@ #include -#include "nix/fetchers.hh" -#include "nix/json-utils.hh" +#include "nix/fetchers/fetchers.hh" +#include "nix/util/json-utils.hh" #include -#include "nix/tests/characterization.hh" +#include "nix/util/tests/characterization.hh" namespace nix { diff --git a/src/libfetchers/attrs.cc b/src/libfetchers/attrs.cc index 68e5e932b..47f6aa8c5 100644 --- a/src/libfetchers/attrs.cc +++ b/src/libfetchers/attrs.cc @@ -1,5 +1,5 @@ -#include "nix/attrs.hh" -#include "nix/fetchers.hh" +#include "nix/fetchers/attrs.hh" +#include "nix/fetchers/fetchers.hh" #include diff --git a/src/libfetchers/cache.cc b/src/libfetchers/cache.cc index 089c8d6f3..d369d213f 100644 --- a/src/libfetchers/cache.cc +++ b/src/libfetchers/cache.cc @@ -1,8 +1,8 @@ -#include "nix/cache.hh" -#include "nix/users.hh" -#include "nix/sqlite.hh" -#include "nix/sync.hh" -#include "nix/store-api.hh" +#include "nix/fetchers/cache.hh" +#include "nix/util/users.hh" +#include "nix/store/sqlite.hh" +#include "nix/util/sync.hh" +#include "nix/store/store-api.hh" #include diff --git a/src/libfetchers/fetch-settings.cc b/src/libfetchers/fetch-settings.cc index bdd095538..4b4e4e29d 100644 --- a/src/libfetchers/fetch-settings.cc +++ b/src/libfetchers/fetch-settings.cc @@ -1,4 +1,4 @@ -#include "nix/fetch-settings.hh" +#include "nix/fetchers/fetch-settings.hh" namespace nix::fetchers { diff --git a/src/libfetchers/fetch-to-store.cc b/src/libfetchers/fetch-to-store.cc index 2be08feaf..ea33922b6 100644 --- a/src/libfetchers/fetch-to-store.cc +++ b/src/libfetchers/fetch-to-store.cc @@ -1,6 +1,6 @@ -#include "nix/fetch-to-store.hh" -#include "nix/fetchers.hh" -#include "nix/cache.hh" +#include "nix/fetchers/fetch-to-store.hh" +#include "nix/fetchers/fetchers.hh" +#include "nix/fetchers/cache.hh" namespace nix { diff --git a/src/libfetchers/fetchers.cc b/src/libfetchers/fetchers.cc index 068a6722f..8b1b2b0cb 100644 --- a/src/libfetchers/fetchers.cc +++ b/src/libfetchers/fetchers.cc @@ -1,10 +1,10 @@ -#include "nix/fetchers.hh" -#include "nix/store-api.hh" -#include "nix/source-path.hh" -#include "nix/fetch-to-store.hh" -#include "nix/json-utils.hh" -#include "nix/store-path-accessor.hh" -#include "nix/fetch-settings.hh" +#include "nix/fetchers/fetchers.hh" +#include "nix/store/store-api.hh" +#include "nix/util/source-path.hh" +#include "nix/fetchers/fetch-to-store.hh" +#include "nix/util/json-utils.hh" +#include "nix/fetchers/store-path-accessor.hh" +#include "nix/fetchers/fetch-settings.hh" #include diff --git a/src/libfetchers/filtering-source-accessor.cc b/src/libfetchers/filtering-source-accessor.cc index 1a9c8ae6b..b1ba84140 100644 --- a/src/libfetchers/filtering-source-accessor.cc +++ b/src/libfetchers/filtering-source-accessor.cc @@ -1,4 +1,4 @@ -#include "nix/filtering-source-accessor.hh" +#include "nix/fetchers/filtering-source-accessor.hh" namespace nix { diff --git a/src/libfetchers/git-lfs-fetch.cc b/src/libfetchers/git-lfs-fetch.cc index f90ab8a1f..97f10f0c6 100644 --- a/src/libfetchers/git-lfs-fetch.cc +++ b/src/libfetchers/git-lfs-fetch.cc @@ -1,10 +1,10 @@ -#include "nix/git-lfs-fetch.hh" -#include "nix/git-utils.hh" -#include "nix/filetransfer.hh" -#include "nix/processes.hh" -#include "nix/url.hh" -#include "nix/users.hh" -#include "nix/hash.hh" +#include "nix/fetchers/git-lfs-fetch.hh" +#include "nix/fetchers/git-utils.hh" +#include "nix/store/filetransfer.hh" +#include "nix/util/processes.hh" +#include "nix/util/url.hh" +#include "nix/util/users.hh" +#include "nix/util/hash.hh" #include #include diff --git a/src/libfetchers/git-utils.cc b/src/libfetchers/git-utils.cc index ad8a6e89c..3ffefc940 100644 --- a/src/libfetchers/git-utils.cc +++ b/src/libfetchers/git-utils.cc @@ -1,12 +1,12 @@ -#include "nix/git-utils.hh" -#include "nix/git-lfs-fetch.hh" -#include "nix/cache.hh" -#include "nix/finally.hh" -#include "nix/processes.hh" -#include "nix/signals.hh" -#include "nix/users.hh" -#include "nix/fs-sink.hh" -#include "nix/sync.hh" +#include "nix/fetchers/git-utils.hh" +#include "nix/fetchers/git-lfs-fetch.hh" +#include "nix/fetchers/cache.hh" +#include "nix/util/finally.hh" +#include "nix/util/processes.hh" +#include "nix/util/signals.hh" +#include "nix/util/users.hh" +#include "nix/util/fs-sink.hh" +#include "nix/util/sync.hh" #include #include diff --git a/src/libfetchers/git.cc b/src/libfetchers/git.cc index fa310c370..fb91f98a3 100644 --- a/src/libfetchers/git.cc +++ b/src/libfetchers/git.cc @@ -1,20 +1,20 @@ -#include "nix/error.hh" -#include "nix/fetchers.hh" -#include "nix/users.hh" -#include "nix/cache.hh" -#include "nix/globals.hh" -#include "nix/tarfile.hh" -#include "nix/store-api.hh" -#include "nix/url-parts.hh" -#include "nix/pathlocks.hh" -#include "nix/processes.hh" -#include "nix/git.hh" -#include "nix/git-utils.hh" -#include "nix/logging.hh" -#include "nix/finally.hh" -#include "nix/fetch-settings.hh" -#include "nix/json-utils.hh" -#include "nix/archive.hh" +#include "nix/util/error.hh" +#include "nix/fetchers/fetchers.hh" +#include "nix/util/users.hh" +#include "nix/fetchers/cache.hh" +#include "nix/store/globals.hh" +#include "nix/util/tarfile.hh" +#include "nix/store/store-api.hh" +#include "nix/util/url-parts.hh" +#include "nix/store/pathlocks.hh" +#include "nix/util/processes.hh" +#include "nix/util/git.hh" +#include "nix/fetchers/git-utils.hh" +#include "nix/util/logging.hh" +#include "nix/util/finally.hh" +#include "nix/fetchers/fetch-settings.hh" +#include "nix/util/json-utils.hh" +#include "nix/util/archive.hh" #include #include diff --git a/src/libfetchers/github.cc b/src/libfetchers/github.cc index 3459c0b3d..9202904e0 100644 --- a/src/libfetchers/github.cc +++ b/src/libfetchers/github.cc @@ -1,15 +1,15 @@ -#include "nix/filetransfer.hh" -#include "nix/cache.hh" -#include "nix/globals.hh" -#include "nix/store-api.hh" -#include "nix/types.hh" -#include "nix/url-parts.hh" -#include "nix/git.hh" -#include "nix/fetchers.hh" -#include "nix/fetch-settings.hh" -#include "nix/tarball.hh" -#include "nix/tarfile.hh" -#include "nix/git-utils.hh" +#include "nix/store/filetransfer.hh" +#include "nix/fetchers/cache.hh" +#include "nix/store/globals.hh" +#include "nix/store/store-api.hh" +#include "nix/util/types.hh" +#include "nix/util/url-parts.hh" +#include "nix/util/git.hh" +#include "nix/fetchers/fetchers.hh" +#include "nix/fetchers/fetch-settings.hh" +#include "nix/fetchers/tarball.hh" +#include "nix/util/tarfile.hh" +#include "nix/fetchers/git-utils.hh" #include #include diff --git a/src/libfetchers/include/nix/attrs.hh b/src/libfetchers/include/nix/fetchers/attrs.hh similarity index 95% rename from src/libfetchers/include/nix/attrs.hh rename to src/libfetchers/include/nix/fetchers/attrs.hh index f1fdee35f..1b757d712 100644 --- a/src/libfetchers/include/nix/attrs.hh +++ b/src/libfetchers/include/nix/fetchers/attrs.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "nix/types.hh" -#include "nix/hash.hh" +#include "nix/util/types.hh" +#include "nix/util/hash.hh" #include diff --git a/src/libfetchers/include/nix/cache.hh b/src/libfetchers/include/nix/fetchers/cache.hh similarity index 97% rename from src/libfetchers/include/nix/cache.hh rename to src/libfetchers/include/nix/fetchers/cache.hh index 592401785..5b9319d77 100644 --- a/src/libfetchers/include/nix/cache.hh +++ b/src/libfetchers/include/nix/fetchers/cache.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "nix/fetchers.hh" -#include "nix/path.hh" +#include "nix/fetchers/fetchers.hh" +#include "nix/store/path.hh" namespace nix::fetchers { diff --git a/src/libfetchers/include/nix/fetch-settings.hh b/src/libfetchers/include/nix/fetchers/fetch-settings.hh similarity index 98% rename from src/libfetchers/include/nix/fetch-settings.hh rename to src/libfetchers/include/nix/fetchers/fetch-settings.hh index 811e27b30..54c420843 100644 --- a/src/libfetchers/include/nix/fetch-settings.hh +++ b/src/libfetchers/include/nix/fetchers/fetch-settings.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "nix/types.hh" -#include "nix/config.hh" +#include "nix/util/types.hh" +#include "nix/util/configuration.hh" #include #include diff --git a/src/libfetchers/include/nix/fetch-to-store.hh b/src/libfetchers/include/nix/fetchers/fetch-to-store.hh similarity index 68% rename from src/libfetchers/include/nix/fetch-to-store.hh rename to src/libfetchers/include/nix/fetchers/fetch-to-store.hh index 7ef809c1c..a0144cb76 100644 --- a/src/libfetchers/include/nix/fetch-to-store.hh +++ b/src/libfetchers/include/nix/fetchers/fetch-to-store.hh @@ -1,10 +1,10 @@ #pragma once -#include "nix/source-path.hh" -#include "nix/store-api.hh" -#include "nix/file-system.hh" -#include "nix/repair-flag.hh" -#include "nix/file-content-address.hh" +#include "nix/util/source-path.hh" +#include "nix/store/store-api.hh" +#include "nix/util/file-system.hh" +#include "nix/util/repair-flag.hh" +#include "nix/util/file-content-address.hh" namespace nix { diff --git a/src/libfetchers/include/nix/fetchers.hh b/src/libfetchers/include/nix/fetchers/fetchers.hh similarity index 97% rename from src/libfetchers/include/nix/fetchers.hh rename to src/libfetchers/include/nix/fetchers/fetchers.hh index 07a9adfbe..3288ecc5e 100644 --- a/src/libfetchers/include/nix/fetchers.hh +++ b/src/libfetchers/include/nix/fetchers/fetchers.hh @@ -1,17 +1,17 @@ #pragma once ///@file -#include "nix/types.hh" -#include "nix/hash.hh" -#include "nix/canon-path.hh" -#include "nix/json-impls.hh" -#include "nix/attrs.hh" -#include "nix/url.hh" +#include "nix/util/types.hh" +#include "nix/util/hash.hh" +#include "nix/util/canon-path.hh" +#include "nix/util/json-impls.hh" +#include "nix/fetchers/attrs.hh" +#include "nix/util/url.hh" #include #include -#include "nix/ref.hh" +#include "nix/util/ref.hh" namespace nix { class Store; class StorePath; struct SourceAccessor; } diff --git a/src/libfetchers/include/nix/filtering-source-accessor.hh b/src/libfetchers/include/nix/fetchers/filtering-source-accessor.hh similarity index 98% rename from src/libfetchers/include/nix/filtering-source-accessor.hh rename to src/libfetchers/include/nix/fetchers/filtering-source-accessor.hh index 04855c070..0e6b71e9a 100644 --- a/src/libfetchers/include/nix/filtering-source-accessor.hh +++ b/src/libfetchers/include/nix/fetchers/filtering-source-accessor.hh @@ -1,6 +1,6 @@ #pragma once -#include "nix/source-path.hh" +#include "nix/util/source-path.hh" namespace nix { diff --git a/src/libfetchers/include/nix/git-lfs-fetch.hh b/src/libfetchers/include/nix/fetchers/git-lfs-fetch.hh similarity index 90% rename from src/libfetchers/include/nix/git-lfs-fetch.hh rename to src/libfetchers/include/nix/fetchers/git-lfs-fetch.hh index cd7c86a82..e701288cf 100644 --- a/src/libfetchers/include/nix/git-lfs-fetch.hh +++ b/src/libfetchers/include/nix/fetchers/git-lfs-fetch.hh @@ -1,6 +1,6 @@ -#include "nix/canon-path.hh" -#include "nix/serialise.hh" -#include "nix/url.hh" +#include "nix/util/canon-path.hh" +#include "nix/util/serialise.hh" +#include "nix/util/url.hh" #include diff --git a/src/libfetchers/include/nix/git-utils.hh b/src/libfetchers/include/nix/fetchers/git-utils.hh similarity index 97% rename from src/libfetchers/include/nix/git-utils.hh rename to src/libfetchers/include/nix/fetchers/git-utils.hh index 65c86a7c4..1506f8509 100644 --- a/src/libfetchers/include/nix/git-utils.hh +++ b/src/libfetchers/include/nix/fetchers/git-utils.hh @@ -1,7 +1,7 @@ #pragma once -#include "nix/filtering-source-accessor.hh" -#include "nix/fs-sink.hh" +#include "nix/fetchers/filtering-source-accessor.hh" +#include "nix/util/fs-sink.hh" namespace nix { diff --git a/src/libfetchers/include/nix/meson.build b/src/libfetchers/include/nix/fetchers/meson.build similarity index 84% rename from src/libfetchers/include/nix/meson.build rename to src/libfetchers/include/nix/fetchers/meson.build index eb02be43c..3a752d9cb 100644 --- a/src/libfetchers/include/nix/meson.build +++ b/src/libfetchers/include/nix/fetchers/meson.build @@ -1,4 +1,4 @@ -include_dirs = [include_directories('..')] +include_dirs = [include_directories('../..')] headers = files( 'attrs.hh', diff --git a/src/libfetchers/include/nix/registry.hh b/src/libfetchers/include/nix/fetchers/registry.hh similarity index 96% rename from src/libfetchers/include/nix/registry.hh rename to src/libfetchers/include/nix/fetchers/registry.hh index 7c091ea12..47ff9e86f 100644 --- a/src/libfetchers/include/nix/registry.hh +++ b/src/libfetchers/include/nix/fetchers/registry.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "nix/types.hh" -#include "nix/fetchers.hh" +#include "nix/util/types.hh" +#include "nix/fetchers/fetchers.hh" namespace nix { class Store; } diff --git a/src/libfetchers/include/nix/store-path-accessor.hh b/src/libfetchers/include/nix/fetchers/store-path-accessor.hh similarity index 85% rename from src/libfetchers/include/nix/store-path-accessor.hh rename to src/libfetchers/include/nix/fetchers/store-path-accessor.hh index 8e65fda11..021df5a62 100644 --- a/src/libfetchers/include/nix/store-path-accessor.hh +++ b/src/libfetchers/include/nix/fetchers/store-path-accessor.hh @@ -1,6 +1,6 @@ #pragma once -#include "nix/source-path.hh" +#include "nix/util/source-path.hh" namespace nix { diff --git a/src/libfetchers/include/nix/tarball.hh b/src/libfetchers/include/nix/fetchers/tarball.hh similarity index 88% rename from src/libfetchers/include/nix/tarball.hh rename to src/libfetchers/include/nix/fetchers/tarball.hh index 63a217124..691142091 100644 --- a/src/libfetchers/include/nix/tarball.hh +++ b/src/libfetchers/include/nix/fetchers/tarball.hh @@ -2,10 +2,10 @@ #include -#include "nix/hash.hh" -#include "nix/path.hh" -#include "nix/ref.hh" -#include "nix/types.hh" +#include "nix/util/hash.hh" +#include "nix/store/path.hh" +#include "nix/util/ref.hh" +#include "nix/util/types.hh" namespace nix { class Store; diff --git a/src/libfetchers/indirect.cc b/src/libfetchers/indirect.cc index 7e5eb0be3..47cb7587c 100644 --- a/src/libfetchers/indirect.cc +++ b/src/libfetchers/indirect.cc @@ -1,6 +1,6 @@ -#include "nix/fetchers.hh" -#include "nix/url-parts.hh" -#include "nix/path.hh" +#include "nix/fetchers/fetchers.hh" +#include "nix/util/url-parts.hh" +#include "nix/store/path.hh" namespace nix::fetchers { diff --git a/src/libfetchers/mercurial.cc b/src/libfetchers/mercurial.cc index 73e677f44..eb6bdd1eb 100644 --- a/src/libfetchers/mercurial.cc +++ b/src/libfetchers/mercurial.cc @@ -1,13 +1,13 @@ -#include "nix/fetchers.hh" -#include "nix/processes.hh" -#include "nix/users.hh" -#include "nix/cache.hh" -#include "nix/globals.hh" -#include "nix/tarfile.hh" -#include "nix/store-api.hh" -#include "nix/url-parts.hh" -#include "nix/store-path-accessor.hh" -#include "nix/fetch-settings.hh" +#include "nix/fetchers/fetchers.hh" +#include "nix/util/processes.hh" +#include "nix/util/users.hh" +#include "nix/fetchers/cache.hh" +#include "nix/store/globals.hh" +#include "nix/util/tarfile.hh" +#include "nix/store/store-api.hh" +#include "nix/util/url-parts.hh" +#include "nix/fetchers/store-path-accessor.hh" +#include "nix/fetchers/fetch-settings.hh" #include diff --git a/src/libfetchers/meson.build b/src/libfetchers/meson.build index 14a2647d5..6e7129f4c 100644 --- a/src/libfetchers/meson.build +++ b/src/libfetchers/meson.build @@ -51,7 +51,7 @@ sources = files( 'tarball.cc', ) -subdir('include/nix') +subdir('include/nix/fetchers') subdir('nix-meson-build-support/export-all-symbols') subdir('nix-meson-build-support/windows-version') @@ -66,7 +66,7 @@ this_library = library( install : true, ) -install_headers(headers, subdir : 'nix', preserve_path : true) +install_headers(headers, subdir : 'nix/fetchers', preserve_path : true) libraries_private = [] diff --git a/src/libfetchers/package.nix b/src/libfetchers/package.nix index aaeaa4b5d..145920879 100644 --- a/src/libfetchers/package.nix +++ b/src/libfetchers/package.nix @@ -27,7 +27,7 @@ mkMesonLibrary (finalAttrs: { ../../.version ./.version ./meson.build - ./include/nix/meson.build + ./include/nix/fetchers/meson.build (fileset.fileFilter (file: file.hasExt "cc") ./.) (fileset.fileFilter (file: file.hasExt "hh") ./.) ]; diff --git a/src/libfetchers/path.cc b/src/libfetchers/path.cc index 95bc2ce50..173368dcc 100644 --- a/src/libfetchers/path.cc +++ b/src/libfetchers/path.cc @@ -1,7 +1,7 @@ -#include "nix/fetchers.hh" -#include "nix/store-api.hh" -#include "nix/archive.hh" -#include "nix/store-path-accessor.hh" +#include "nix/fetchers/fetchers.hh" +#include "nix/store/store-api.hh" +#include "nix/util/archive.hh" +#include "nix/fetchers/store-path-accessor.hh" namespace nix::fetchers { diff --git a/src/libfetchers/registry.cc b/src/libfetchers/registry.cc index ec470159b..e9b55f7f2 100644 --- a/src/libfetchers/registry.cc +++ b/src/libfetchers/registry.cc @@ -1,10 +1,10 @@ -#include "nix/fetch-settings.hh" -#include "nix/registry.hh" -#include "nix/tarball.hh" -#include "nix/users.hh" -#include "nix/globals.hh" -#include "nix/store-api.hh" -#include "nix/local-fs-store.hh" +#include "nix/fetchers/fetch-settings.hh" +#include "nix/fetchers/registry.hh" +#include "nix/fetchers/tarball.hh" +#include "nix/util/users.hh" +#include "nix/store/globals.hh" +#include "nix/store/store-api.hh" +#include "nix/store/local-fs-store.hh" #include diff --git a/src/libfetchers/store-path-accessor.cc b/src/libfetchers/store-path-accessor.cc index 997582b57..bed51541e 100644 --- a/src/libfetchers/store-path-accessor.cc +++ b/src/libfetchers/store-path-accessor.cc @@ -1,5 +1,5 @@ -#include "nix/store-path-accessor.hh" -#include "nix/store-api.hh" +#include "nix/fetchers/store-path-accessor.hh" +#include "nix/store/store-api.hh" namespace nix { diff --git a/src/libfetchers/tarball.cc b/src/libfetchers/tarball.cc index 01bff82f7..ef91d6b25 100644 --- a/src/libfetchers/tarball.cc +++ b/src/libfetchers/tarball.cc @@ -1,14 +1,14 @@ -#include "nix/tarball.hh" -#include "nix/fetchers.hh" -#include "nix/cache.hh" -#include "nix/filetransfer.hh" -#include "nix/store-api.hh" -#include "nix/archive.hh" -#include "nix/tarfile.hh" -#include "nix/types.hh" -#include "nix/store-path-accessor.hh" -#include "nix/store-api.hh" -#include "nix/git-utils.hh" +#include "nix/fetchers/tarball.hh" +#include "nix/fetchers/fetchers.hh" +#include "nix/fetchers/cache.hh" +#include "nix/store/filetransfer.hh" +#include "nix/store/store-api.hh" +#include "nix/util/archive.hh" +#include "nix/util/tarfile.hh" +#include "nix/util/types.hh" +#include "nix/fetchers/store-path-accessor.hh" +#include "nix/store/store-api.hh" +#include "nix/fetchers/git-utils.hh" namespace nix::fetchers { diff --git a/src/libflake-c/nix_api_flake_internal.hh b/src/libflake-c/nix_api_flake_internal.hh index 4565b4f5d..f7c5e7838 100644 --- a/src/libflake-c/nix_api_flake_internal.hh +++ b/src/libflake-c/nix_api_flake_internal.hh @@ -1,6 +1,6 @@ #pragma once -#include "nix/ref.hh" +#include "nix/util/ref.hh" #include "nix/flake/settings.hh" struct nix_flake_settings diff --git a/src/libflake-tests/flakeref.cc b/src/libflake-tests/flakeref.cc index f378ba6d6..1abaffb96 100644 --- a/src/libflake-tests/flakeref.cc +++ b/src/libflake-tests/flakeref.cc @@ -1,6 +1,6 @@ #include -#include "nix/fetch-settings.hh" +#include "nix/fetchers/fetch-settings.hh" #include "nix/flake/flakeref.hh" namespace nix { diff --git a/src/libflake-tests/nix_api_flake.cc b/src/libflake-tests/nix_api_flake.cc index 0d9e2a91f..b72342e4d 100644 --- a/src/libflake-tests/nix_api_flake.cc +++ b/src/libflake-tests/nix_api_flake.cc @@ -6,8 +6,8 @@ #include "nix_api_value.h" #include "nix_api_flake.h" -#include "nix/tests/nix_api_expr.hh" -#include "nix/tests/string_callback.hh" +#include "nix/expr/tests/nix_api_expr.hh" +#include "nix/util/tests/string_callback.hh" #include #include diff --git a/src/libflake/flake/config.cc b/src/libflake/flake/config.cc index a0ddf0387..a67f7884c 100644 --- a/src/libflake/flake/config.cc +++ b/src/libflake/flake/config.cc @@ -1,5 +1,5 @@ -#include "nix/users.hh" -#include "nix/config-global.hh" +#include "nix/util/users.hh" +#include "nix/util/config-global.hh" #include "nix/flake/settings.hh" #include "nix/flake/flake.hh" diff --git a/src/libflake/flake/flake-primops.cc b/src/libflake/flake/flake-primops.cc index 508274dbd..7c5ce01b2 100644 --- a/src/libflake/flake/flake-primops.cc +++ b/src/libflake/flake/flake-primops.cc @@ -1,5 +1,5 @@ #include "nix/flake/flake-primops.hh" -#include "nix/eval.hh" +#include "nix/expr/eval.hh" #include "nix/flake/flake.hh" #include "nix/flake/flakeref.hh" #include "nix/flake/settings.hh" diff --git a/src/libflake/flake/flake.cc b/src/libflake/flake/flake.cc index 4ff48967f..1cce0c978 100644 --- a/src/libflake/flake/flake.cc +++ b/src/libflake/flake/flake.cc @@ -1,19 +1,19 @@ -#include "nix/terminal.hh" +#include "nix/util/terminal.hh" #include "nix/flake/flake.hh" -#include "nix/eval.hh" -#include "nix/eval-settings.hh" +#include "nix/expr/eval.hh" +#include "nix/expr/eval-settings.hh" #include "nix/flake/lockfile.hh" -#include "nix/primops.hh" -#include "nix/eval-inline.hh" -#include "nix/store-api.hh" -#include "nix/fetchers.hh" -#include "nix/finally.hh" -#include "nix/fetch-settings.hh" +#include "nix/expr/primops.hh" +#include "nix/expr/eval-inline.hh" +#include "nix/store/store-api.hh" +#include "nix/fetchers/fetchers.hh" +#include "nix/util/finally.hh" +#include "nix/fetchers/fetch-settings.hh" #include "nix/flake/settings.hh" -#include "nix/value-to-json.hh" -#include "nix/local-fs-store.hh" -#include "nix/fetch-to-store.hh" -#include "nix/memory-source-accessor.hh" +#include "nix/expr/value-to-json.hh" +#include "nix/store/local-fs-store.hh" +#include "nix/fetchers/fetch-to-store.hh" +#include "nix/util/memory-source-accessor.hh" #include diff --git a/src/libflake/flake/flakeref.cc b/src/libflake/flake/flakeref.cc index 340fe4dc7..6e95eb767 100644 --- a/src/libflake/flake/flakeref.cc +++ b/src/libflake/flake/flakeref.cc @@ -1,8 +1,8 @@ #include "nix/flake/flakeref.hh" -#include "nix/store-api.hh" -#include "nix/url.hh" -#include "nix/url-parts.hh" -#include "nix/fetchers.hh" +#include "nix/store/store-api.hh" +#include "nix/util/url.hh" +#include "nix/util/url-parts.hh" +#include "nix/fetchers/fetchers.hh" namespace nix { diff --git a/src/libflake/flake/lockfile.cc b/src/libflake/flake/lockfile.cc index 08a384366..ba6f18c57 100644 --- a/src/libflake/flake/lockfile.cc +++ b/src/libflake/flake/lockfile.cc @@ -1,10 +1,10 @@ #include -#include "nix/fetch-settings.hh" +#include "nix/fetchers/fetch-settings.hh" #include "nix/flake/settings.hh" #include "nix/flake/lockfile.hh" -#include "nix/store-api.hh" -#include "nix/strings.hh" +#include "nix/store/store-api.hh" +#include "nix/util/strings.hh" #include #include diff --git a/src/libflake/include/nix/flake/flake-primops.hh b/src/libflake/include/nix/flake/flake-primops.hh index 07be75123..e7b86b9b3 100644 --- a/src/libflake/include/nix/flake/flake-primops.hh +++ b/src/libflake/include/nix/flake/flake-primops.hh @@ -1,6 +1,6 @@ #pragma once -#include "nix/eval.hh" +#include "nix/expr/eval.hh" #include "nix/flake/settings.hh" namespace nix::flake::primops { diff --git a/src/libflake/include/nix/flake/flake.hh b/src/libflake/include/nix/flake/flake.hh index 2fa385060..3336f8557 100644 --- a/src/libflake/include/nix/flake/flake.hh +++ b/src/libflake/include/nix/flake/flake.hh @@ -1,10 +1,10 @@ #pragma once ///@file -#include "nix/types.hh" +#include "nix/util/types.hh" #include "nix/flake/flakeref.hh" #include "nix/flake/lockfile.hh" -#include "nix/value.hh" +#include "nix/expr/value.hh" namespace nix { diff --git a/src/libflake/include/nix/flake/flakeref.hh b/src/libflake/include/nix/flake/flakeref.hh index 93ebaa497..0fd1fec4d 100644 --- a/src/libflake/include/nix/flake/flakeref.hh +++ b/src/libflake/include/nix/flake/flakeref.hh @@ -3,10 +3,10 @@ #include -#include "nix/types.hh" -#include "nix/fetchers.hh" -#include "nix/outputs-spec.hh" -#include "nix/registry.hh" +#include "nix/util/types.hh" +#include "nix/fetchers/fetchers.hh" +#include "nix/store/outputs-spec.hh" +#include "nix/fetchers/registry.hh" namespace nix { diff --git a/src/libflake/include/nix/flake/meson.build b/src/libflake/include/nix/flake/meson.build new file mode 100644 index 000000000..ece1ad4ea --- /dev/null +++ b/src/libflake/include/nix/flake/meson.build @@ -0,0 +1,11 @@ +# Public headers directory + +include_dirs = [include_directories('../..')] + +headers = files( + 'flake.hh', + 'flakeref.hh', + 'lockfile.hh', + 'settings.hh', + 'url-name.hh', +) diff --git a/src/libflake/include/nix/flake/settings.hh b/src/libflake/include/nix/flake/settings.hh index 54f501e11..b3bffad4c 100644 --- a/src/libflake/include/nix/flake/settings.hh +++ b/src/libflake/include/nix/flake/settings.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "nix/config.hh" +#include "nix/util/configuration.hh" #include diff --git a/src/libflake/include/nix/flake/url-name.hh b/src/libflake/include/nix/flake/url-name.hh index 4577e8f38..d295ca8f8 100644 --- a/src/libflake/include/nix/flake/url-name.hh +++ b/src/libflake/include/nix/flake/url-name.hh @@ -1,7 +1,7 @@ -#include "nix/url.hh" -#include "nix/url-parts.hh" -#include "nix/util.hh" -#include "nix/split.hh" +#include "nix/util/url.hh" +#include "nix/util/url-parts.hh" +#include "nix/util/util.hh" +#include "nix/util/split.hh" namespace nix { diff --git a/src/libflake/include/nix/meson.build b/src/libflake/include/nix/meson.build deleted file mode 100644 index 023bd64bd..000000000 --- a/src/libflake/include/nix/meson.build +++ /dev/null @@ -1,11 +0,0 @@ -# Public headers directory - -include_dirs = [include_directories('..')] - -headers = files( - 'flake/flake.hh', - 'flake/flakeref.hh', - 'flake/lockfile.hh', - 'flake/settings.hh', - 'flake/url-name.hh', -) diff --git a/src/libflake/meson.build b/src/libflake/meson.build index de880c28d..f4c034490 100644 --- a/src/libflake/meson.build +++ b/src/libflake/meson.build @@ -48,7 +48,7 @@ sources = files( 'flake/url-name.cc', ) -subdir('include/nix') +subdir('include/nix/flake') subdir('nix-meson-build-support/export-all-symbols') subdir('nix-meson-build-support/windows-version') @@ -64,7 +64,7 @@ this_library = library( install : true, ) -install_headers(headers, subdir : 'nix', preserve_path : true) +install_headers(headers, subdir : 'nix/flake', preserve_path : true) libraries_private = [] diff --git a/src/libflake/package.nix b/src/libflake/package.nix index 683880b20..dd442a44e 100644 --- a/src/libflake/package.nix +++ b/src/libflake/package.nix @@ -28,7 +28,7 @@ mkMesonLibrary (finalAttrs: { ../../.version ./.version ./meson.build - ./include/nix/meson.build + ./include/nix/flake/meson.build ./call-flake.nix (fileset.fileFilter (file: file.hasExt "cc") ./.) (fileset.fileFilter (file: file.hasExt "hh") ./.) diff --git a/src/libmain-c/nix_api_main.cc b/src/libmain-c/nix_api_main.cc index 61dbceff8..eacb80455 100644 --- a/src/libmain-c/nix_api_main.cc +++ b/src/libmain-c/nix_api_main.cc @@ -3,7 +3,7 @@ #include "nix_api_util.h" #include "nix_api_util_internal.h" -#include "nix/plugin.hh" +#include "nix/main/plugin.hh" nix_err nix_init_plugins(nix_c_context * context) { diff --git a/src/libmain/common-args.cc b/src/libmain/common-args.cc index 8d531bbcb..c3338996c 100644 --- a/src/libmain/common-args.cc +++ b/src/libmain/common-args.cc @@ -1,11 +1,11 @@ -#include "nix/common-args.hh" -#include "nix/args/root.hh" -#include "nix/config-global.hh" -#include "nix/globals.hh" -#include "nix/logging.hh" -#include "nix/loggers.hh" -#include "nix/util.hh" -#include "nix/plugin.hh" +#include "nix/main/common-args.hh" +#include "nix/util/args/root.hh" +#include "nix/util/config-global.hh" +#include "nix/store/globals.hh" +#include "nix/util/logging.hh" +#include "nix/main/loggers.hh" +#include "nix/util/util.hh" +#include "nix/main/plugin.hh" namespace nix { diff --git a/src/libmain/include/nix/common-args.hh b/src/libmain/include/nix/main/common-args.hh similarity index 96% rename from src/libmain/include/nix/common-args.hh rename to src/libmain/include/nix/main/common-args.hh index 5622115b8..ae0f3c6c5 100644 --- a/src/libmain/include/nix/common-args.hh +++ b/src/libmain/include/nix/main/common-args.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "nix/args.hh" -#include "nix/repair-flag.hh" +#include "nix/util/args.hh" +#include "nix/util/repair-flag.hh" namespace nix { diff --git a/src/libmain/include/nix/loggers.hh b/src/libmain/include/nix/main/loggers.hh similarity index 88% rename from src/libmain/include/nix/loggers.hh rename to src/libmain/include/nix/main/loggers.hh index dabdae83c..061b4a32a 100644 --- a/src/libmain/include/nix/loggers.hh +++ b/src/libmain/include/nix/main/loggers.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "nix/types.hh" +#include "nix/util/types.hh" namespace nix { diff --git a/src/libmain/include/nix/meson.build b/src/libmain/include/nix/main/meson.build similarity index 74% rename from src/libmain/include/nix/meson.build rename to src/libmain/include/nix/main/meson.build index e29981d3f..992a5ff0e 100644 --- a/src/libmain/include/nix/meson.build +++ b/src/libmain/include/nix/main/meson.build @@ -1,6 +1,6 @@ # Public headers directory -include_dirs = [include_directories('..')] +include_dirs = [include_directories('../..')] headers = files( 'common-args.hh', diff --git a/src/libmain/include/nix/plugin.hh b/src/libmain/include/nix/main/plugin.hh similarity index 100% rename from src/libmain/include/nix/plugin.hh rename to src/libmain/include/nix/main/plugin.hh diff --git a/src/libmain/include/nix/progress-bar.hh b/src/libmain/include/nix/main/progress-bar.hh similarity index 73% rename from src/libmain/include/nix/progress-bar.hh rename to src/libmain/include/nix/main/progress-bar.hh index 195c5ceee..f49fb2198 100644 --- a/src/libmain/include/nix/progress-bar.hh +++ b/src/libmain/include/nix/main/progress-bar.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "nix/logging.hh" +#include "nix/util/logging.hh" namespace nix { diff --git a/src/libmain/include/nix/shared.hh b/src/libmain/include/nix/main/shared.hh similarity index 94% rename from src/libmain/include/nix/shared.hh rename to src/libmain/include/nix/main/shared.hh index 8144ad845..2ff57135b 100644 --- a/src/libmain/include/nix/shared.hh +++ b/src/libmain/include/nix/main/shared.hh @@ -1,13 +1,13 @@ #pragma once ///@file -#include "nix/file-descriptor.hh" -#include "nix/processes.hh" -#include "nix/args.hh" -#include "nix/args/root.hh" -#include "nix/common-args.hh" -#include "nix/path.hh" -#include "nix/derived-path.hh" +#include "nix/util/file-descriptor.hh" +#include "nix/util/processes.hh" +#include "nix/util/args.hh" +#include "nix/util/args/root.hh" +#include "nix/main/common-args.hh" +#include "nix/store/path.hh" +#include "nix/store/derived-path.hh" #include diff --git a/src/libmain/loggers.cc b/src/libmain/loggers.cc index 1cf7c6dcf..c78e49b63 100644 --- a/src/libmain/loggers.cc +++ b/src/libmain/loggers.cc @@ -1,6 +1,6 @@ -#include "nix/loggers.hh" -#include "nix/environment-variables.hh" -#include "nix/progress-bar.hh" +#include "nix/main/loggers.hh" +#include "nix/util/environment-variables.hh" +#include "nix/main/progress-bar.hh" namespace nix { diff --git a/src/libmain/meson.build b/src/libmain/meson.build index f7ff93b66..414fc679f 100644 --- a/src/libmain/meson.build +++ b/src/libmain/meson.build @@ -63,7 +63,7 @@ if host_machine.system() != 'windows' ) endif -subdir('include/nix') +subdir('include/nix/main') subdir('nix-meson-build-support/export-all-symbols') subdir('nix-meson-build-support/windows-version') @@ -79,7 +79,7 @@ this_library = library( install : true, ) -install_headers(headers, subdir : 'nix', preserve_path : true) +install_headers(headers, subdir : 'nix/main', preserve_path : true) libraries_private = [] diff --git a/src/libmain/package.nix b/src/libmain/package.nix index 31b36dbcf..949603464 100644 --- a/src/libmain/package.nix +++ b/src/libmain/package.nix @@ -27,7 +27,7 @@ mkMesonLibrary (finalAttrs: { ../../.version ./.version ./meson.build - ./include/nix/meson.build + ./include/nix/main/meson.build (fileset.fileFilter (file: file.hasExt "cc") ./.) (fileset.fileFilter (file: file.hasExt "hh") ./.) ]; diff --git a/src/libmain/plugin.cc b/src/libmain/plugin.cc index db1067c1a..63ed650a7 100644 --- a/src/libmain/plugin.cc +++ b/src/libmain/plugin.cc @@ -4,8 +4,8 @@ #include -#include "nix/config-global.hh" -#include "nix/signals.hh" +#include "nix/util/config-global.hh" +#include "nix/util/signals.hh" namespace nix { diff --git a/src/libmain/progress-bar.cc b/src/libmain/progress-bar.cc index eb4db83e6..23f5ff8f7 100644 --- a/src/libmain/progress-bar.cc +++ b/src/libmain/progress-bar.cc @@ -1,8 +1,8 @@ -#include "nix/progress-bar.hh" -#include "nix/terminal.hh" -#include "nix/sync.hh" -#include "nix/store-api.hh" -#include "nix/names.hh" +#include "nix/main/progress-bar.hh" +#include "nix/util/terminal.hh" +#include "nix/util/sync.hh" +#include "nix/store/store-api.hh" +#include "nix/store/names.hh" #include #include diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc index 0643e20ed..65bfcfbd5 100644 --- a/src/libmain/shared.cc +++ b/src/libmain/shared.cc @@ -1,11 +1,11 @@ -#include "nix/globals.hh" -#include "nix/current-process.hh" -#include "nix/shared.hh" -#include "nix/store-api.hh" -#include "nix/gc-store.hh" -#include "nix/loggers.hh" -#include "nix/progress-bar.hh" -#include "nix/signals.hh" +#include "nix/store/globals.hh" +#include "nix/util/current-process.hh" +#include "nix/main/shared.hh" +#include "nix/store/store-api.hh" +#include "nix/store/gc-store.hh" +#include "nix/main/loggers.hh" +#include "nix/main/progress-bar.hh" +#include "nix/util/signals.hh" #include #include @@ -22,11 +22,12 @@ #include -#include "nix/exit.hh" -#include "nix/strings.hh" +#include "nix/util/exit.hh" +#include "nix/util/strings.hh" #include "main-config-private.hh" + namespace nix { char * * savedArgv; diff --git a/src/libmain/unix/stack.cc b/src/libmain/unix/stack.cc index b4ec5967e..cee21d2a2 100644 --- a/src/libmain/unix/stack.cc +++ b/src/libmain/unix/stack.cc @@ -1,5 +1,5 @@ -#include "nix/error.hh" -#include "nix/shared.hh" +#include "nix/util/error.hh" +#include "nix/main/shared.hh" #include #include diff --git a/src/libstore-c/nix_api_store.cc b/src/libstore-c/nix_api_store.cc index ab0af1f52..92aed9187 100644 --- a/src/libstore-c/nix_api_store.cc +++ b/src/libstore-c/nix_api_store.cc @@ -3,11 +3,11 @@ #include "nix_api_util.h" #include "nix_api_util_internal.h" -#include "nix/path.hh" -#include "nix/store-api.hh" -#include "nix/build-result.hh" +#include "nix/store/path.hh" +#include "nix/store/store-api.hh" +#include "nix/store/build-result.hh" -#include "nix/globals.hh" +#include "nix/store/globals.hh" nix_err nix_libstore_init(nix_c_context * context) { diff --git a/src/libstore-c/nix_api_store_internal.h b/src/libstore-c/nix_api_store_internal.h index e32cdfcca..b0194bfd3 100644 --- a/src/libstore-c/nix_api_store_internal.h +++ b/src/libstore-c/nix_api_store_internal.h @@ -1,6 +1,6 @@ #ifndef NIX_API_STORE_INTERNAL_H #define NIX_API_STORE_INTERNAL_H -#include "nix/store-api.hh" +#include "nix/store/store-api.hh" struct Store { diff --git a/src/libstore-test-support/derived-path.cc b/src/libstore-test-support/derived-path.cc index 4c04facce..c7714449c 100644 --- a/src/libstore-test-support/derived-path.cc +++ b/src/libstore-test-support/derived-path.cc @@ -2,7 +2,7 @@ #include -#include "nix/tests/derived-path.hh" +#include "nix/store/tests/derived-path.hh" namespace rc { using namespace nix; diff --git a/src/libstore-test-support/include/nix/meson.build b/src/libstore-test-support/include/nix/meson.build deleted file mode 100644 index ed3e4f2ff..000000000 --- a/src/libstore-test-support/include/nix/meson.build +++ /dev/null @@ -1,12 +0,0 @@ -# Public headers directory - -include_dirs = [include_directories('..')] - -headers = files( - 'tests/derived-path.hh', - 'tests/libstore.hh', - 'tests/nix_api_store.hh', - 'tests/outputs-spec.hh', - 'tests/path.hh', - 'tests/protocol.hh', -) diff --git a/src/libstore-test-support/include/nix/tests/derived-path.hh b/src/libstore-test-support/include/nix/store/tests/derived-path.hh similarity index 84% rename from src/libstore-test-support/include/nix/tests/derived-path.hh rename to src/libstore-test-support/include/nix/store/tests/derived-path.hh index 57cad487c..642ce557c 100644 --- a/src/libstore-test-support/include/nix/tests/derived-path.hh +++ b/src/libstore-test-support/include/nix/store/tests/derived-path.hh @@ -3,10 +3,10 @@ #include -#include "nix/derived-path.hh" +#include "nix/store/derived-path.hh" -#include "nix/tests/path.hh" -#include "nix/tests/outputs-spec.hh" +#include "nix/store/tests/path.hh" +#include "nix/store/tests/outputs-spec.hh" namespace rc { using namespace nix; diff --git a/src/libstore-test-support/include/nix/tests/libstore.hh b/src/libstore-test-support/include/nix/store/tests/libstore.hh similarity index 93% rename from src/libstore-test-support/include/nix/tests/libstore.hh rename to src/libstore-test-support/include/nix/store/tests/libstore.hh index 02e818f97..466b6f9b1 100644 --- a/src/libstore-test-support/include/nix/tests/libstore.hh +++ b/src/libstore-test-support/include/nix/store/tests/libstore.hh @@ -4,7 +4,7 @@ #include #include -#include "nix/store-api.hh" +#include "nix/store/store-api.hh" namespace nix { diff --git a/src/libstore-test-support/include/nix/store/tests/meson.build b/src/libstore-test-support/include/nix/store/tests/meson.build new file mode 100644 index 000000000..ae5db049e --- /dev/null +++ b/src/libstore-test-support/include/nix/store/tests/meson.build @@ -0,0 +1,12 @@ +# Public headers directory + +include_dirs = [include_directories('../../..')] + +headers = files( + 'derived-path.hh', + 'libstore.hh', + 'nix_api_store.hh', + 'outputs-spec.hh', + 'path.hh', + 'protocol.hh', +) diff --git a/src/libstore-test-support/include/nix/tests/nix_api_store.hh b/src/libstore-test-support/include/nix/store/tests/nix_api_store.hh similarity index 96% rename from src/libstore-test-support/include/nix/tests/nix_api_store.hh rename to src/libstore-test-support/include/nix/store/tests/nix_api_store.hh index f418b563d..bc0f31d05 100644 --- a/src/libstore-test-support/include/nix/tests/nix_api_store.hh +++ b/src/libstore-test-support/include/nix/store/tests/nix_api_store.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "nix/tests/nix_api_util.hh" +#include "nix/util/tests/nix_api_util.hh" -#include "nix/file-system.hh" +#include "nix/util/file-system.hh" #include #include "nix_api_store.h" diff --git a/src/libstore-test-support/include/nix/tests/outputs-spec.hh b/src/libstore-test-support/include/nix/store/tests/outputs-spec.hh similarity index 72% rename from src/libstore-test-support/include/nix/tests/outputs-spec.hh rename to src/libstore-test-support/include/nix/store/tests/outputs-spec.hh index 14a74d2e4..c13c992b6 100644 --- a/src/libstore-test-support/include/nix/tests/outputs-spec.hh +++ b/src/libstore-test-support/include/nix/store/tests/outputs-spec.hh @@ -3,9 +3,9 @@ #include -#include "nix/outputs-spec.hh" +#include "nix/store/outputs-spec.hh" -#include "nix/tests/path.hh" +#include "nix/store/tests/path.hh" namespace rc { using namespace nix; diff --git a/src/libstore-test-support/include/nix/tests/path.hh b/src/libstore-test-support/include/nix/store/tests/path.hh similarity index 93% rename from src/libstore-test-support/include/nix/tests/path.hh rename to src/libstore-test-support/include/nix/store/tests/path.hh index eebcda28e..59ff604d7 100644 --- a/src/libstore-test-support/include/nix/tests/path.hh +++ b/src/libstore-test-support/include/nix/store/tests/path.hh @@ -3,7 +3,7 @@ #include -#include "nix/path.hh" +#include "nix/store/path.hh" namespace nix { diff --git a/src/libstore-test-support/include/nix/tests/protocol.hh b/src/libstore-test-support/include/nix/store/tests/protocol.hh similarity index 96% rename from src/libstore-test-support/include/nix/tests/protocol.hh rename to src/libstore-test-support/include/nix/store/tests/protocol.hh index 6c7d69adb..acd10bf9d 100644 --- a/src/libstore-test-support/include/nix/tests/protocol.hh +++ b/src/libstore-test-support/include/nix/store/tests/protocol.hh @@ -4,8 +4,8 @@ #include #include -#include "nix/tests/libstore.hh" -#include "nix/tests/characterization.hh" +#include "nix/store/tests/libstore.hh" +#include "nix/util/tests/characterization.hh" namespace nix { diff --git a/src/libstore-test-support/meson.build b/src/libstore-test-support/meson.build index a1f6777e4..779b122fa 100644 --- a/src/libstore-test-support/meson.build +++ b/src/libstore-test-support/meson.build @@ -35,7 +35,7 @@ sources = files( 'path.cc', ) -subdir('include/nix') +subdir('include/nix/store/tests') subdir('nix-meson-build-support/export-all-symbols') subdir('nix-meson-build-support/windows-version') @@ -52,7 +52,7 @@ this_library = library( install : true, ) -install_headers(headers, subdir : 'nix', preserve_path : true) +install_headers(headers, subdir : 'nix/store/tests', preserve_path : true) libraries_private = [] diff --git a/src/libstore-test-support/outputs-spec.cc b/src/libstore-test-support/outputs-spec.cc index 04b243738..5b5251361 100644 --- a/src/libstore-test-support/outputs-spec.cc +++ b/src/libstore-test-support/outputs-spec.cc @@ -1,4 +1,4 @@ -#include "nix/tests/outputs-spec.hh" +#include "nix/store/tests/outputs-spec.hh" #include diff --git a/src/libstore-test-support/package.nix b/src/libstore-test-support/package.nix index c223ad116..391ddeefd 100644 --- a/src/libstore-test-support/package.nix +++ b/src/libstore-test-support/package.nix @@ -29,7 +29,7 @@ mkMesonLibrary (finalAttrs: { ./.version ./meson.build # ./meson.options - ./include/nix/meson.build + ./include/nix/store/tests/meson.build (fileset.fileFilter (file: file.hasExt "cc") ./.) (fileset.fileFilter (file: file.hasExt "hh") ./.) ]; diff --git a/src/libstore-test-support/path.cc b/src/libstore-test-support/path.cc index 945230187..47c1d693b 100644 --- a/src/libstore-test-support/path.cc +++ b/src/libstore-test-support/path.cc @@ -3,11 +3,11 @@ #include -#include "nix/path-regex.hh" -#include "nix/store-api.hh" +#include "nix/store/path-regex.hh" +#include "nix/store/store-api.hh" -#include "nix/tests/hash.hh" -#include "nix/tests/path.hh" +#include "nix/util/tests/hash.hh" +#include "nix/store/tests/path.hh" namespace nix { diff --git a/src/libstore-tests/common-protocol.cc b/src/libstore-tests/common-protocol.cc index 39293b0c0..6bfb8bd80 100644 --- a/src/libstore-tests/common-protocol.cc +++ b/src/libstore-tests/common-protocol.cc @@ -3,11 +3,11 @@ #include #include -#include "nix/common-protocol.hh" -#include "nix/common-protocol-impl.hh" -#include "nix/build-result.hh" -#include "nix/tests/protocol.hh" -#include "nix/tests/characterization.hh" +#include "nix/store/common-protocol.hh" +#include "nix/store/common-protocol-impl.hh" +#include "nix/store/build-result.hh" +#include "nix/store/tests/protocol.hh" +#include "nix/util/tests/characterization.hh" namespace nix { diff --git a/src/libstore-tests/content-address.cc b/src/libstore-tests/content-address.cc index 428ebcd76..c208c944d 100644 --- a/src/libstore-tests/content-address.cc +++ b/src/libstore-tests/content-address.cc @@ -1,6 +1,6 @@ #include -#include "nix/content-address.hh" +#include "nix/store/content-address.hh" namespace nix { diff --git a/src/libstore-tests/derivation-advanced-attrs.cc b/src/libstore-tests/derivation-advanced-attrs.cc index d8f9642ab..57b226826 100644 --- a/src/libstore-tests/derivation-advanced-attrs.cc +++ b/src/libstore-tests/derivation-advanced-attrs.cc @@ -1,16 +1,16 @@ #include #include -#include "nix/experimental-features.hh" -#include "nix/derivations.hh" -#include "nix/derivations.hh" -#include "nix/derivation-options.hh" -#include "nix/parsed-derivations.hh" -#include "nix/types.hh" -#include "nix/json-utils.hh" +#include "nix/util/experimental-features.hh" +#include "nix/store/derivations.hh" +#include "nix/store/derivations.hh" +#include "nix/store/derivation-options.hh" +#include "nix/store/parsed-derivations.hh" +#include "nix/util/types.hh" +#include "nix/util/json-utils.hh" -#include "nix/tests/libstore.hh" -#include "nix/tests/characterization.hh" +#include "nix/store/tests/libstore.hh" +#include "nix/util/tests/characterization.hh" namespace nix { diff --git a/src/libstore-tests/derivation.cc b/src/libstore-tests/derivation.cc index 5ef1c0094..fa6711d40 100644 --- a/src/libstore-tests/derivation.cc +++ b/src/libstore-tests/derivation.cc @@ -1,11 +1,11 @@ #include #include -#include "nix/experimental-features.hh" -#include "nix/derivations.hh" +#include "nix/util/experimental-features.hh" +#include "nix/store/derivations.hh" -#include "nix/tests/libstore.hh" -#include "nix/tests/characterization.hh" +#include "nix/store/tests/libstore.hh" +#include "nix/util/tests/characterization.hh" namespace nix { diff --git a/src/libstore-tests/derived-path.cc b/src/libstore-tests/derived-path.cc index e6a2fcace..51df25198 100644 --- a/src/libstore-tests/derived-path.cc +++ b/src/libstore-tests/derived-path.cc @@ -3,8 +3,8 @@ #include #include -#include "nix/tests/derived-path.hh" -#include "nix/tests/libstore.hh" +#include "nix/store/tests/derived-path.hh" +#include "nix/store/tests/libstore.hh" namespace nix { diff --git a/src/libstore-tests/downstream-placeholder.cc b/src/libstore-tests/downstream-placeholder.cc index 76c6410ad..604c80017 100644 --- a/src/libstore-tests/downstream-placeholder.cc +++ b/src/libstore-tests/downstream-placeholder.cc @@ -1,6 +1,6 @@ #include -#include "nix/downstream-placeholder.hh" +#include "nix/store/downstream-placeholder.hh" namespace nix { diff --git a/src/libstore-tests/http-binary-cache-store.cc b/src/libstore-tests/http-binary-cache-store.cc index bc4e52936..f4a3408b5 100644 --- a/src/libstore-tests/http-binary-cache-store.cc +++ b/src/libstore-tests/http-binary-cache-store.cc @@ -1,6 +1,6 @@ #include -#include "nix/http-binary-cache-store.hh" +#include "nix/store/http-binary-cache-store.hh" namespace nix { diff --git a/src/libstore-tests/legacy-ssh-store.cc b/src/libstore-tests/legacy-ssh-store.cc index 5a23cf5b2..158da2831 100644 --- a/src/libstore-tests/legacy-ssh-store.cc +++ b/src/libstore-tests/legacy-ssh-store.cc @@ -1,6 +1,6 @@ #include -#include "nix/legacy-ssh-store.hh" +#include "nix/store/legacy-ssh-store.hh" namespace nix { diff --git a/src/libstore-tests/local-binary-cache-store.cc b/src/libstore-tests/local-binary-cache-store.cc index 8adc22202..01f514e89 100644 --- a/src/libstore-tests/local-binary-cache-store.cc +++ b/src/libstore-tests/local-binary-cache-store.cc @@ -1,6 +1,6 @@ #include -#include "nix/local-binary-cache-store.hh" +#include "nix/store/local-binary-cache-store.hh" namespace nix { diff --git a/src/libstore-tests/local-overlay-store.cc b/src/libstore-tests/local-overlay-store.cc index 8e9d25bc3..fe064c3a5 100644 --- a/src/libstore-tests/local-overlay-store.cc +++ b/src/libstore-tests/local-overlay-store.cc @@ -3,7 +3,7 @@ #if 0 # include -# include "nix/local-overlay-store.hh" +# include "nix/store/local-overlay-store.hh" namespace nix { diff --git a/src/libstore-tests/local-store.cc b/src/libstore-tests/local-store.cc index 8977234a3..ece277609 100644 --- a/src/libstore-tests/local-store.cc +++ b/src/libstore-tests/local-store.cc @@ -3,13 +3,13 @@ #if 0 # include -# include "nix/local-store.hh" +# include "nix/store/local-store.hh" // Needed for template specialisations. This is not good! When we // overhaul how store configs work, this should be fixed. -# include "nix/args.hh" -# include "nix/config-impl.hh" -# include "nix/abstract-setting-to-json.hh" +# include "nix/util/args.hh" +# include "nix/util/config-impl.hh" +# include "nix/util/abstract-setting-to-json.hh" namespace nix { diff --git a/src/libstore-tests/machines.cc b/src/libstore-tests/machines.cc index 219494f16..1d574ceeb 100644 --- a/src/libstore-tests/machines.cc +++ b/src/libstore-tests/machines.cc @@ -1,8 +1,8 @@ -#include "nix/machines.hh" -#include "nix/file-system.hh" -#include "nix/util.hh" +#include "nix/store/machines.hh" +#include "nix/util/file-system.hh" +#include "nix/util/util.hh" -#include "nix/tests/characterization.hh" +#include "nix/util/tests/characterization.hh" #include #include diff --git a/src/libstore-tests/nar-info-disk-cache.cc b/src/libstore-tests/nar-info-disk-cache.cc index b15ee351a..4c7354c0c 100644 --- a/src/libstore-tests/nar-info-disk-cache.cc +++ b/src/libstore-tests/nar-info-disk-cache.cc @@ -1,8 +1,8 @@ -#include "nix/nar-info-disk-cache.hh" +#include "nix/store/nar-info-disk-cache.hh" #include #include -#include "nix/sqlite.hh" +#include "nix/store/sqlite.hh" #include diff --git a/src/libstore-tests/nar-info.cc b/src/libstore-tests/nar-info.cc index 544680914..1979deef8 100644 --- a/src/libstore-tests/nar-info.cc +++ b/src/libstore-tests/nar-info.cc @@ -1,11 +1,11 @@ #include #include -#include "nix/path-info.hh" -#include "nix/nar-info.hh" +#include "nix/store/path-info.hh" +#include "nix/store/nar-info.hh" -#include "nix/tests/characterization.hh" -#include "nix/tests/libstore.hh" +#include "nix/util/tests/characterization.hh" +#include "nix/store/tests/libstore.hh" namespace nix { diff --git a/src/libstore-tests/nix_api_store.cc b/src/libstore-tests/nix_api_store.cc index 293547c95..4eb95360a 100644 --- a/src/libstore-tests/nix_api_store.cc +++ b/src/libstore-tests/nix_api_store.cc @@ -3,8 +3,8 @@ #include "nix_api_store.h" #include "nix_api_store_internal.h" -#include "nix/tests/nix_api_store.hh" -#include "nix/tests/string_callback.hh" +#include "nix/store/tests/nix_api_store.hh" +#include "nix/util/tests/string_callback.hh" #include "store-tests-config.hh" diff --git a/src/libstore-tests/outputs-spec.cc b/src/libstore-tests/outputs-spec.cc index 007e5a935..a17922c46 100644 --- a/src/libstore-tests/outputs-spec.cc +++ b/src/libstore-tests/outputs-spec.cc @@ -1,4 +1,4 @@ -#include "nix/tests/outputs-spec.hh" +#include "nix/store/tests/outputs-spec.hh" #include #include diff --git a/src/libstore-tests/path-info.cc b/src/libstore-tests/path-info.cc index df3b60f13..9cd98a3d9 100644 --- a/src/libstore-tests/path-info.cc +++ b/src/libstore-tests/path-info.cc @@ -1,10 +1,10 @@ #include #include -#include "nix/path-info.hh" +#include "nix/store/path-info.hh" -#include "nix/tests/characterization.hh" -#include "nix/tests/libstore.hh" +#include "nix/util/tests/characterization.hh" +#include "nix/store/tests/libstore.hh" namespace nix { diff --git a/src/libstore-tests/path.cc b/src/libstore-tests/path.cc index bcfce2c9f..4da73a0ad 100644 --- a/src/libstore-tests/path.cc +++ b/src/libstore-tests/path.cc @@ -4,12 +4,12 @@ #include #include -#include "nix/path-regex.hh" -#include "nix/store-api.hh" +#include "nix/store/path-regex.hh" +#include "nix/store/store-api.hh" -#include "nix/tests/hash.hh" -#include "nix/tests/libstore.hh" -#include "nix/tests/path.hh" +#include "nix/util/tests/hash.hh" +#include "nix/store/tests/libstore.hh" +#include "nix/store/tests/path.hh" namespace nix { diff --git a/src/libstore-tests/references.cc b/src/libstore-tests/references.cc index da4b7af39..59993727d 100644 --- a/src/libstore-tests/references.cc +++ b/src/libstore-tests/references.cc @@ -1,4 +1,4 @@ -#include "nix/references.hh" +#include "nix/util/references.hh" #include diff --git a/src/libstore-tests/s3-binary-cache-store.cc b/src/libstore-tests/s3-binary-cache-store.cc index 99db360ce..be338084f 100644 --- a/src/libstore-tests/s3-binary-cache-store.cc +++ b/src/libstore-tests/s3-binary-cache-store.cc @@ -2,7 +2,7 @@ # include -# include "nix/s3-binary-cache-store.hh" +# include "nix/store/s3-binary-cache-store.hh" namespace nix { diff --git a/src/libstore-tests/serve-protocol.cc b/src/libstore-tests/serve-protocol.cc index dd53b80d6..9297d46ea 100644 --- a/src/libstore-tests/serve-protocol.cc +++ b/src/libstore-tests/serve-protocol.cc @@ -4,13 +4,13 @@ #include #include -#include "nix/serve-protocol.hh" -#include "nix/serve-protocol-impl.hh" -#include "nix/serve-protocol-connection.hh" -#include "nix/build-result.hh" -#include "nix/file-descriptor.hh" -#include "nix/tests/protocol.hh" -#include "nix/tests/characterization.hh" +#include "nix/store/serve-protocol.hh" +#include "nix/store/serve-protocol-impl.hh" +#include "nix/store/serve-protocol-connection.hh" +#include "nix/store/build-result.hh" +#include "nix/util/file-descriptor.hh" +#include "nix/store/tests/protocol.hh" +#include "nix/util/tests/characterization.hh" namespace nix { diff --git a/src/libstore-tests/ssh-store.cc b/src/libstore-tests/ssh-store.cc index 1c54a229e..ccb87b767 100644 --- a/src/libstore-tests/ssh-store.cc +++ b/src/libstore-tests/ssh-store.cc @@ -3,7 +3,7 @@ #if 0 # include -# include "nix/ssh-store.hh" +# include "nix/store/ssh-store.hh" namespace nix { diff --git a/src/libstore-tests/store-reference.cc b/src/libstore-tests/store-reference.cc index f8e533fa0..dd1b83090 100644 --- a/src/libstore-tests/store-reference.cc +++ b/src/libstore-tests/store-reference.cc @@ -1,11 +1,11 @@ #include #include -#include "nix/file-system.hh" -#include "nix/store-reference.hh" +#include "nix/util/file-system.hh" +#include "nix/store/store-reference.hh" -#include "nix/tests/characterization.hh" -#include "nix/tests/libstore.hh" +#include "nix/util/tests/characterization.hh" +#include "nix/store/tests/libstore.hh" namespace nix { diff --git a/src/libstore-tests/uds-remote-store.cc b/src/libstore-tests/uds-remote-store.cc index 7157bfbfd..c6a926668 100644 --- a/src/libstore-tests/uds-remote-store.cc +++ b/src/libstore-tests/uds-remote-store.cc @@ -3,7 +3,7 @@ #if 0 # include -# include "nix/uds-remote-store.hh" +# include "nix/store/uds-remote-store.hh" namespace nix { diff --git a/src/libstore-tests/worker-protocol.cc b/src/libstore-tests/worker-protocol.cc index 0a417ed3e..091cf8a0e 100644 --- a/src/libstore-tests/worker-protocol.cc +++ b/src/libstore-tests/worker-protocol.cc @@ -4,13 +4,13 @@ #include #include -#include "nix/worker-protocol.hh" -#include "nix/worker-protocol-connection.hh" -#include "nix/worker-protocol-impl.hh" -#include "nix/derived-path.hh" -#include "nix/build-result.hh" -#include "nix/tests/protocol.hh" -#include "nix/tests/characterization.hh" +#include "nix/store/worker-protocol.hh" +#include "nix/store/worker-protocol-connection.hh" +#include "nix/store/worker-protocol-impl.hh" +#include "nix/store/derived-path.hh" +#include "nix/store/build-result.hh" +#include "nix/store/tests/protocol.hh" +#include "nix/util/tests/characterization.hh" namespace nix { diff --git a/src/libstore/binary-cache-store.cc b/src/libstore/binary-cache-store.cc index 48c449e79..60bd68026 100644 --- a/src/libstore/binary-cache-store.cc +++ b/src/libstore/binary-cache-store.cc @@ -1,18 +1,18 @@ -#include "nix/archive.hh" -#include "nix/binary-cache-store.hh" -#include "nix/compression.hh" -#include "nix/derivations.hh" -#include "nix/source-accessor.hh" -#include "nix/globals.hh" -#include "nix/nar-info.hh" -#include "nix/sync.hh" -#include "nix/remote-fs-accessor.hh" -#include "nix/nar-info-disk-cache.hh" -#include "nix/nar-accessor.hh" -#include "nix/thread-pool.hh" -#include "nix/callback.hh" -#include "nix/signals.hh" -#include "nix/archive.hh" +#include "nix/util/archive.hh" +#include "nix/store/binary-cache-store.hh" +#include "nix/util/compression.hh" +#include "nix/store/derivations.hh" +#include "nix/util/source-accessor.hh" +#include "nix/store/globals.hh" +#include "nix/store/nar-info.hh" +#include "nix/util/sync.hh" +#include "nix/store/remote-fs-accessor.hh" +#include "nix/store/nar-info-disk-cache.hh" +#include "nix/store/nar-accessor.hh" +#include "nix/util/thread-pool.hh" +#include "nix/util/callback.hh" +#include "nix/util/signals.hh" +#include "nix/util/archive.hh" #include #include diff --git a/src/libstore/build-result.cc b/src/libstore/build-result.cc index 72ad11fae..091661337 100644 --- a/src/libstore/build-result.cc +++ b/src/libstore/build-result.cc @@ -1,4 +1,4 @@ -#include "nix/build-result.hh" +#include "nix/store/build-result.hh" namespace nix { diff --git a/src/libstore/build/derivation-goal.cc b/src/libstore/build/derivation-goal.cc index c2858bd34..00906eed4 100644 --- a/src/libstore/build/derivation-goal.cc +++ b/src/libstore/build/derivation-goal.cc @@ -1,22 +1,22 @@ -#include "nix/build/derivation-goal.hh" +#include "nix/store/build/derivation-goal.hh" #ifndef _WIN32 // TODO enable build hook on Windows -# include "nix/build/hook-instance.hh" +# include "nix/store/build/hook-instance.hh" #endif -#include "nix/processes.hh" -#include "nix/config-global.hh" -#include "nix/build/worker.hh" -#include "nix/builtins.hh" -#include "nix/builtins/buildenv.hh" -#include "nix/references.hh" -#include "nix/finally.hh" -#include "nix/util.hh" -#include "nix/archive.hh" -#include "nix/compression.hh" -#include "nix/common-protocol.hh" -#include "nix/common-protocol-impl.hh" -#include "nix/topo-sort.hh" -#include "nix/callback.hh" -#include "nix/local-store.hh" // TODO remove, along with remaining downcasts +#include "nix/util/processes.hh" +#include "nix/util/config-global.hh" +#include "nix/store/build/worker.hh" +#include "nix/store/builtins.hh" +#include "nix/store/builtins/buildenv.hh" +#include "nix/util/references.hh" +#include "nix/util/finally.hh" +#include "nix/util/util.hh" +#include "nix/util/archive.hh" +#include "nix/util/compression.hh" +#include "nix/store/common-protocol.hh" +#include "nix/store/common-protocol-impl.hh" +#include "nix/util/topo-sort.hh" +#include "nix/util/callback.hh" +#include "nix/store/local-store.hh" // TODO remove, along with remaining downcasts #include #include @@ -32,7 +32,7 @@ #include -#include "nix/strings.hh" +#include "nix/util/strings.hh" namespace nix { diff --git a/src/libstore/build/drv-output-substitution-goal.cc b/src/libstore/build/drv-output-substitution-goal.cc index 18853e531..bc2030fa5 100644 --- a/src/libstore/build/drv-output-substitution-goal.cc +++ b/src/libstore/build/drv-output-substitution-goal.cc @@ -1,8 +1,8 @@ -#include "nix/build/drv-output-substitution-goal.hh" -#include "nix/finally.hh" -#include "nix/build/worker.hh" -#include "nix/build/substitution-goal.hh" -#include "nix/callback.hh" +#include "nix/store/build/drv-output-substitution-goal.hh" +#include "nix/util/finally.hh" +#include "nix/store/build/worker.hh" +#include "nix/store/build/substitution-goal.hh" +#include "nix/util/callback.hh" namespace nix { diff --git a/src/libstore/build/entry-points.cc b/src/libstore/build/entry-points.cc index 70b32d3ad..c934b0704 100644 --- a/src/libstore/build/entry-points.cc +++ b/src/libstore/build/entry-points.cc @@ -1,10 +1,10 @@ -#include "nix/build/worker.hh" -#include "nix/build/substitution-goal.hh" +#include "nix/store/build/worker.hh" +#include "nix/store/build/substitution-goal.hh" #ifndef _WIN32 // TODO Enable building on Windows -# include "nix/build/derivation-goal.hh" +# include "nix/store/build/derivation-goal.hh" #endif -#include "nix/local-store.hh" -#include "nix/strings.hh" +#include "nix/store/local-store.hh" +#include "nix/util/strings.hh" namespace nix { diff --git a/src/libstore/build/goal.cc b/src/libstore/build/goal.cc index baee4ff16..aaa426793 100644 --- a/src/libstore/build/goal.cc +++ b/src/libstore/build/goal.cc @@ -1,5 +1,5 @@ -#include "nix/build/goal.hh" -#include "nix/build/worker.hh" +#include "nix/store/build/goal.hh" +#include "nix/store/build/worker.hh" namespace nix { diff --git a/src/libstore/build/substitution-goal.cc b/src/libstore/build/substitution-goal.cc index 6794fe73f..72bdfa632 100644 --- a/src/libstore/build/substitution-goal.cc +++ b/src/libstore/build/substitution-goal.cc @@ -1,8 +1,8 @@ -#include "nix/build/worker.hh" -#include "nix/build/substitution-goal.hh" -#include "nix/nar-info.hh" -#include "nix/finally.hh" -#include "nix/signals.hh" +#include "nix/store/build/worker.hh" +#include "nix/store/build/substitution-goal.hh" +#include "nix/store/nar-info.hh" +#include "nix/util/finally.hh" +#include "nix/util/signals.hh" #include namespace nix { diff --git a/src/libstore/build/worker.cc b/src/libstore/build/worker.cc index 38e965d35..87710e9ee 100644 --- a/src/libstore/build/worker.cc +++ b/src/libstore/build/worker.cc @@ -1,14 +1,14 @@ -#include "nix/local-store.hh" -#include "nix/machines.hh" -#include "nix/build/worker.hh" -#include "nix/build/substitution-goal.hh" -#include "nix/build/drv-output-substitution-goal.hh" -#include "nix/build/derivation-goal.hh" +#include "nix/store/local-store.hh" +#include "nix/store/machines.hh" +#include "nix/store/build/worker.hh" +#include "nix/store/build/substitution-goal.hh" +#include "nix/store/build/drv-output-substitution-goal.hh" +#include "nix/store/build/derivation-goal.hh" #ifndef _WIN32 // TODO Enable building on Windows -# include "nix/build/local-derivation-goal.hh" -# include "nix/build/hook-instance.hh" +# include "nix/store/build/local-derivation-goal.hh" +# include "nix/store/build/hook-instance.hh" #endif -#include "nix/signals.hh" +#include "nix/util/signals.hh" namespace nix { diff --git a/src/libstore/builtins/buildenv.cc b/src/libstore/builtins/buildenv.cc index 4145593cf..c3b80bb0b 100644 --- a/src/libstore/builtins/buildenv.cc +++ b/src/libstore/builtins/buildenv.cc @@ -1,6 +1,6 @@ -#include "nix/builtins/buildenv.hh" -#include "nix/derivations.hh" -#include "nix/signals.hh" +#include "nix/store/builtins/buildenv.hh" +#include "nix/store/derivations.hh" +#include "nix/util/signals.hh" #include #include diff --git a/src/libstore/builtins/fetchurl.cc b/src/libstore/builtins/fetchurl.cc index 28af8427c..82f268d80 100644 --- a/src/libstore/builtins/fetchurl.cc +++ b/src/libstore/builtins/fetchurl.cc @@ -1,8 +1,8 @@ -#include "nix/builtins.hh" -#include "nix/filetransfer.hh" -#include "nix/store-api.hh" -#include "nix/archive.hh" -#include "nix/compression.hh" +#include "nix/store/builtins.hh" +#include "nix/store/filetransfer.hh" +#include "nix/store/store-api.hh" +#include "nix/util/archive.hh" +#include "nix/util/compression.hh" namespace nix { diff --git a/src/libstore/builtins/unpack-channel.cc b/src/libstore/builtins/unpack-channel.cc index 9e76ee7d3..f6be21e35 100644 --- a/src/libstore/builtins/unpack-channel.cc +++ b/src/libstore/builtins/unpack-channel.cc @@ -1,5 +1,5 @@ -#include "nix/builtins.hh" -#include "nix/tarfile.hh" +#include "nix/store/builtins.hh" +#include "nix/util/tarfile.hh" namespace nix { diff --git a/src/libstore/common-protocol.cc b/src/libstore/common-protocol.cc index 4845d5873..311f4888c 100644 --- a/src/libstore/common-protocol.cc +++ b/src/libstore/common-protocol.cc @@ -1,11 +1,11 @@ -#include "nix/serialise.hh" -#include "nix/path-with-outputs.hh" -#include "nix/store-api.hh" -#include "nix/build-result.hh" -#include "nix/common-protocol.hh" -#include "nix/common-protocol-impl.hh" -#include "nix/archive.hh" -#include "nix/derivations.hh" +#include "nix/util/serialise.hh" +#include "nix/store/path-with-outputs.hh" +#include "nix/store/store-api.hh" +#include "nix/store/build-result.hh" +#include "nix/store/common-protocol.hh" +#include "nix/store/common-protocol-impl.hh" +#include "nix/util/archive.hh" +#include "nix/store/derivations.hh" #include diff --git a/src/libstore/common-ssh-store-config.cc b/src/libstore/common-ssh-store-config.cc index d4123e326..7cfbc5f98 100644 --- a/src/libstore/common-ssh-store-config.cc +++ b/src/libstore/common-ssh-store-config.cc @@ -1,7 +1,7 @@ #include -#include "nix/common-ssh-store-config.hh" -#include "nix/ssh.hh" +#include "nix/store/common-ssh-store-config.hh" +#include "nix/store/ssh.hh" namespace nix { diff --git a/src/libstore/content-address.cc b/src/libstore/content-address.cc index a3745b4ef..5d27c4136 100644 --- a/src/libstore/content-address.cc +++ b/src/libstore/content-address.cc @@ -1,6 +1,6 @@ -#include "nix/args.hh" -#include "nix/content-address.hh" -#include "nix/split.hh" +#include "nix/util/args.hh" +#include "nix/store/content-address.hh" +#include "nix/util/split.hh" namespace nix { diff --git a/src/libstore/daemon.cc b/src/libstore/daemon.cc index 6de844748..8f7514273 100644 --- a/src/libstore/daemon.cc +++ b/src/libstore/daemon.cc @@ -1,23 +1,23 @@ -#include "nix/daemon.hh" -#include "nix/signals.hh" -#include "nix/worker-protocol.hh" -#include "nix/worker-protocol-connection.hh" -#include "nix/worker-protocol-impl.hh" -#include "nix/build-result.hh" -#include "nix/store-api.hh" -#include "nix/store-cast.hh" -#include "nix/gc-store.hh" -#include "nix/log-store.hh" -#include "nix/indirect-root-store.hh" -#include "nix/path-with-outputs.hh" -#include "nix/finally.hh" -#include "nix/archive.hh" -#include "nix/derivations.hh" -#include "nix/args.hh" -#include "nix/git.hh" +#include "nix/store/daemon.hh" +#include "nix/util/signals.hh" +#include "nix/store/worker-protocol.hh" +#include "nix/store/worker-protocol-connection.hh" +#include "nix/store/worker-protocol-impl.hh" +#include "nix/store/build-result.hh" +#include "nix/store/store-api.hh" +#include "nix/store/store-cast.hh" +#include "nix/store/gc-store.hh" +#include "nix/store/log-store.hh" +#include "nix/store/indirect-root-store.hh" +#include "nix/store/path-with-outputs.hh" +#include "nix/util/finally.hh" +#include "nix/util/archive.hh" +#include "nix/store/derivations.hh" +#include "nix/util/args.hh" +#include "nix/util/git.hh" #ifndef _WIN32 // TODO need graceful async exit support on Windows? -# include "nix/monitor-fd.hh" +# include "nix/util/monitor-fd.hh" #endif #include diff --git a/src/libstore/derivation-options.cc b/src/libstore/derivation-options.cc index 8683fd8ad..962222f6d 100644 --- a/src/libstore/derivation-options.cc +++ b/src/libstore/derivation-options.cc @@ -1,8 +1,8 @@ -#include "nix/derivation-options.hh" -#include "nix/json-utils.hh" -#include "nix/parsed-derivations.hh" -#include "nix/types.hh" -#include "nix/util.hh" +#include "nix/store/derivation-options.hh" +#include "nix/util/json-utils.hh" +#include "nix/store/parsed-derivations.hh" +#include "nix/util/types.hh" +#include "nix/util/util.hh" #include #include #include diff --git a/src/libstore/derivations.cc b/src/libstore/derivations.cc index 4c027d64b..360d19afe 100644 --- a/src/libstore/derivations.cc +++ b/src/libstore/derivations.cc @@ -1,14 +1,14 @@ -#include "nix/derivations.hh" -#include "nix/downstream-placeholder.hh" -#include "nix/store-api.hh" -#include "nix/globals.hh" -#include "nix/types.hh" -#include "nix/util.hh" -#include "nix/split.hh" -#include "nix/common-protocol.hh" -#include "nix/common-protocol-impl.hh" -#include "nix/strings-inline.hh" -#include "nix/json-utils.hh" +#include "nix/store/derivations.hh" +#include "nix/store/downstream-placeholder.hh" +#include "nix/store/store-api.hh" +#include "nix/store/globals.hh" +#include "nix/util/types.hh" +#include "nix/util/util.hh" +#include "nix/util/split.hh" +#include "nix/store/common-protocol.hh" +#include "nix/store/common-protocol-impl.hh" +#include "nix/util/strings-inline.hh" +#include "nix/util/json-utils.hh" #include #include diff --git a/src/libstore/derived-path-map.cc b/src/libstore/derived-path-map.cc index cb6d98d5a..d4234d92c 100644 --- a/src/libstore/derived-path-map.cc +++ b/src/libstore/derived-path-map.cc @@ -1,5 +1,5 @@ -#include "nix/derived-path-map.hh" -#include "nix/util.hh" +#include "nix/store/derived-path-map.hh" +#include "nix/util/util.hh" namespace nix { diff --git a/src/libstore/derived-path.cc b/src/libstore/derived-path.cc index 94f8d93f7..950ac1c1a 100644 --- a/src/libstore/derived-path.cc +++ b/src/libstore/derived-path.cc @@ -1,7 +1,7 @@ -#include "nix/derived-path.hh" -#include "nix/derivations.hh" -#include "nix/store-api.hh" -#include "nix/comparator.hh" +#include "nix/store/derived-path.hh" +#include "nix/store/derivations.hh" +#include "nix/store/store-api.hh" +#include "nix/util/comparator.hh" #include diff --git a/src/libstore/downstream-placeholder.cc b/src/libstore/downstream-placeholder.cc index 52c46ddee..24ce2ad99 100644 --- a/src/libstore/downstream-placeholder.cc +++ b/src/libstore/downstream-placeholder.cc @@ -1,5 +1,5 @@ -#include "nix/downstream-placeholder.hh" -#include "nix/derivations.hh" +#include "nix/store/downstream-placeholder.hh" +#include "nix/store/derivations.hh" namespace nix { diff --git a/src/libstore/dummy-store.cc b/src/libstore/dummy-store.cc index b922b30a6..7252e1d33 100644 --- a/src/libstore/dummy-store.cc +++ b/src/libstore/dummy-store.cc @@ -1,5 +1,5 @@ -#include "nix/store-api.hh" -#include "nix/callback.hh" +#include "nix/store/store-api.hh" +#include "nix/util/callback.hh" namespace nix { diff --git a/src/libstore/export-import.cc b/src/libstore/export-import.cc index efec2a409..5bbdd1e5c 100644 --- a/src/libstore/export-import.cc +++ b/src/libstore/export-import.cc @@ -1,8 +1,8 @@ -#include "nix/serialise.hh" -#include "nix/store-api.hh" -#include "nix/archive.hh" -#include "nix/common-protocol.hh" -#include "nix/common-protocol-impl.hh" +#include "nix/util/serialise.hh" +#include "nix/store/store-api.hh" +#include "nix/util/archive.hh" +#include "nix/store/common-protocol.hh" +#include "nix/store/common-protocol-impl.hh" #include diff --git a/src/libstore/filetransfer.cc b/src/libstore/filetransfer.cc index fc77b6150..9d83bfa13 100644 --- a/src/libstore/filetransfer.cc +++ b/src/libstore/filetransfer.cc @@ -1,19 +1,19 @@ -#include "nix/filetransfer.hh" -#include "nix/globals.hh" -#include "nix/config-global.hh" -#include "nix/store-api.hh" -#include "nix/s3.hh" -#include "nix/compression.hh" -#include "nix/finally.hh" -#include "nix/callback.hh" -#include "nix/signals.hh" +#include "nix/store/filetransfer.hh" +#include "nix/store/globals.hh" +#include "nix/util/config-global.hh" +#include "nix/store/store-api.hh" +#include "nix/store/s3.hh" +#include "nix/util/compression.hh" +#include "nix/util/finally.hh" +#include "nix/util/callback.hh" +#include "nix/util/signals.hh" #if ENABLE_S3 #include #endif #if __linux__ -# include "nix/namespaces.hh" +# include "nix/util/namespaces.hh" #endif #include diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc index 43b5c7891..cb3a3c1cd 100644 --- a/src/libstore/gc.cc +++ b/src/libstore/gc.cc @@ -1,16 +1,16 @@ -#include "nix/derivations.hh" -#include "nix/globals.hh" -#include "nix/local-store.hh" -#include "nix/finally.hh" -#include "nix/unix-domain-socket.hh" -#include "nix/signals.hh" -#include "nix/posix-fs-canonicalise.hh" +#include "nix/store/derivations.hh" +#include "nix/store/globals.hh" +#include "nix/store/local-store.hh" +#include "nix/util/finally.hh" +#include "nix/util/unix-domain-socket.hh" +#include "nix/util/signals.hh" +#include "nix/store/posix-fs-canonicalise.hh" #include "store-config-private.hh" #if !defined(__linux__) // For shelling out to lsof -# include "nix/processes.hh" +# include "nix/util/processes.hh" #endif #include diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc index 70feaf311..a3633b084 100644 --- a/src/libstore/globals.cc +++ b/src/libstore/globals.cc @@ -1,12 +1,11 @@ -#include "nix/globals.hh" -#include "nix/config-global.hh" -#include "nix/current-process.hh" -#include "nix/archive.hh" -#include "nix/args.hh" -#include "nix/abstract-setting-to-json.hh" -#include "nix/compute-levels.hh" -#include "nix/signals.hh" -#include "nix/strings.hh" +#include "nix/store/globals.hh" +#include "nix/util/config-global.hh" +#include "nix/util/current-process.hh" +#include "nix/util/archive.hh" +#include "nix/util/args.hh" +#include "nix/util/abstract-setting-to-json.hh" +#include "nix/util/compute-levels.hh" +#include "nix/util/signals.hh" #include #include @@ -27,10 +26,10 @@ #endif #if __APPLE__ -# include "nix/processes.hh" +# include "nix/util/processes.hh" #endif -#include "nix/config-impl.hh" +#include "nix/util/config-impl.hh" #ifdef __APPLE__ #include @@ -38,7 +37,6 @@ #include "store-config-private.hh" - namespace nix { diff --git a/src/libstore/http-binary-cache-store.cc b/src/libstore/http-binary-cache-store.cc index a8d77f753..4c13d5c73 100644 --- a/src/libstore/http-binary-cache-store.cc +++ b/src/libstore/http-binary-cache-store.cc @@ -1,8 +1,8 @@ -#include "nix/http-binary-cache-store.hh" -#include "nix/filetransfer.hh" -#include "nix/globals.hh" -#include "nix/nar-info-disk-cache.hh" -#include "nix/callback.hh" +#include "nix/store/http-binary-cache-store.hh" +#include "nix/store/filetransfer.hh" +#include "nix/store/globals.hh" +#include "nix/store/nar-info-disk-cache.hh" +#include "nix/util/callback.hh" namespace nix { diff --git a/src/libstore/include/nix/binary-cache-store.hh b/src/libstore/include/nix/store/binary-cache-store.hh similarity index 97% rename from src/libstore/include/nix/binary-cache-store.hh rename to src/libstore/include/nix/store/binary-cache-store.hh index ec012cda8..da4906d3f 100644 --- a/src/libstore/include/nix/binary-cache-store.hh +++ b/src/libstore/include/nix/store/binary-cache-store.hh @@ -1,11 +1,11 @@ #pragma once ///@file -#include "nix/signature/local-keys.hh" -#include "nix/store-api.hh" -#include "nix/log-store.hh" +#include "nix/util/signature/local-keys.hh" +#include "nix/store/store-api.hh" +#include "nix/store/log-store.hh" -#include "nix/pool.hh" +#include "nix/util/pool.hh" #include diff --git a/src/libstore/include/nix/build-result.hh b/src/libstore/include/nix/store/build-result.hh similarity index 98% rename from src/libstore/include/nix/build-result.hh rename to src/libstore/include/nix/store/build-result.hh index 20d726346..edc77a523 100644 --- a/src/libstore/include/nix/build-result.hh +++ b/src/libstore/include/nix/store/build-result.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "nix/realisation.hh" -#include "nix/derived-path.hh" +#include "nix/store/realisation.hh" +#include "nix/store/derived-path.hh" #include #include diff --git a/src/libstore/include/nix/build/derivation-goal.hh b/src/libstore/include/nix/store/build/derivation-goal.hh similarity index 97% rename from src/libstore/include/nix/build/derivation-goal.hh rename to src/libstore/include/nix/store/build/derivation-goal.hh index 6e51956fd..8a1c6f33b 100644 --- a/src/libstore/include/nix/build/derivation-goal.hh +++ b/src/libstore/include/nix/store/build/derivation-goal.hh @@ -1,15 +1,15 @@ #pragma once ///@file -#include "nix/parsed-derivations.hh" -#include "nix/derivation-options.hh" +#include "nix/store/parsed-derivations.hh" +#include "nix/store/derivation-options.hh" #ifndef _WIN32 -# include "nix/user-lock.hh" +# include "nix/store/user-lock.hh" #endif -#include "nix/outputs-spec.hh" -#include "nix/store-api.hh" -#include "nix/pathlocks.hh" -#include "nix/build/goal.hh" +#include "nix/store/outputs-spec.hh" +#include "nix/store/store-api.hh" +#include "nix/store/pathlocks.hh" +#include "nix/store/build/goal.hh" namespace nix { diff --git a/src/libstore/include/nix/build/drv-output-substitution-goal.hh b/src/libstore/include/nix/store/build/drv-output-substitution-goal.hh similarity index 88% rename from src/libstore/include/nix/build/drv-output-substitution-goal.hh rename to src/libstore/include/nix/store/build/drv-output-substitution-goal.hh index 94db4fbbc..81d66fe1e 100644 --- a/src/libstore/include/nix/build/drv-output-substitution-goal.hh +++ b/src/libstore/include/nix/store/build/drv-output-substitution-goal.hh @@ -4,10 +4,10 @@ #include #include -#include "nix/store-api.hh" -#include "nix/build/goal.hh" -#include "nix/realisation.hh" -#include "nix/muxable-pipe.hh" +#include "nix/store/store-api.hh" +#include "nix/store/build/goal.hh" +#include "nix/store/realisation.hh" +#include "nix/util/muxable-pipe.hh" namespace nix { diff --git a/src/libstore/include/nix/build/goal.hh b/src/libstore/include/nix/store/build/goal.hh similarity index 99% rename from src/libstore/include/nix/build/goal.hh rename to src/libstore/include/nix/store/build/goal.hh index 53e1f4ba2..7c3873012 100644 --- a/src/libstore/include/nix/build/goal.hh +++ b/src/libstore/include/nix/store/build/goal.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "nix/store-api.hh" -#include "nix/build-result.hh" +#include "nix/store/store-api.hh" +#include "nix/store/build-result.hh" #include diff --git a/src/libstore/include/nix/build/substitution-goal.hh b/src/libstore/include/nix/store/build/substitution-goal.hh similarity index 93% rename from src/libstore/include/nix/build/substitution-goal.hh rename to src/libstore/include/nix/store/build/substitution-goal.hh index c8139025c..7b68b0821 100644 --- a/src/libstore/include/nix/build/substitution-goal.hh +++ b/src/libstore/include/nix/store/build/substitution-goal.hh @@ -1,10 +1,10 @@ #pragma once ///@file -#include "nix/build/worker.hh" -#include "nix/store-api.hh" -#include "nix/build/goal.hh" -#include "nix/muxable-pipe.hh" +#include "nix/store/build/worker.hh" +#include "nix/store/store-api.hh" +#include "nix/store/build/goal.hh" +#include "nix/util/muxable-pipe.hh" #include #include #include diff --git a/src/libstore/include/nix/build/worker.hh b/src/libstore/include/nix/store/build/worker.hh similarity index 98% rename from src/libstore/include/nix/build/worker.hh rename to src/libstore/include/nix/store/build/worker.hh index 467e258df..7e03a0c2f 100644 --- a/src/libstore/include/nix/build/worker.hh +++ b/src/libstore/include/nix/store/build/worker.hh @@ -1,11 +1,11 @@ #pragma once ///@file -#include "nix/types.hh" -#include "nix/store-api.hh" -#include "nix/build/goal.hh" -#include "nix/realisation.hh" -#include "nix/muxable-pipe.hh" +#include "nix/util/types.hh" +#include "nix/store/store-api.hh" +#include "nix/store/build/goal.hh" +#include "nix/store/realisation.hh" +#include "nix/util/muxable-pipe.hh" #include #include diff --git a/src/libstore/include/nix/builtins.hh b/src/libstore/include/nix/store/builtins.hh similarity index 90% rename from src/libstore/include/nix/builtins.hh rename to src/libstore/include/nix/store/builtins.hh index 5943ae507..004e9ef64 100644 --- a/src/libstore/include/nix/builtins.hh +++ b/src/libstore/include/nix/store/builtins.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "nix/derivations.hh" +#include "nix/store/derivations.hh" namespace nix { diff --git a/src/libstore/include/nix/builtins/buildenv.hh b/src/libstore/include/nix/store/builtins/buildenv.hh similarity index 96% rename from src/libstore/include/nix/builtins/buildenv.hh rename to src/libstore/include/nix/store/builtins/buildenv.hh index 00fc3bf90..a0a262037 100644 --- a/src/libstore/include/nix/builtins/buildenv.hh +++ b/src/libstore/include/nix/store/builtins/buildenv.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "nix/store-api.hh" +#include "nix/store/store-api.hh" namespace nix { diff --git a/src/libstore/include/nix/common-protocol-impl.hh b/src/libstore/include/nix/store/common-protocol-impl.hh similarity index 92% rename from src/libstore/include/nix/common-protocol-impl.hh rename to src/libstore/include/nix/store/common-protocol-impl.hh index 71d5fc015..171b4c6a5 100644 --- a/src/libstore/include/nix/common-protocol-impl.hh +++ b/src/libstore/include/nix/store/common-protocol-impl.hh @@ -8,8 +8,8 @@ * contributing guide. */ -#include "nix/common-protocol.hh" -#include "nix/length-prefixed-protocol-helper.hh" +#include "nix/store/common-protocol.hh" +#include "nix/store/length-prefixed-protocol-helper.hh" namespace nix { diff --git a/src/libstore/include/nix/common-protocol.hh b/src/libstore/include/nix/store/common-protocol.hh similarity index 98% rename from src/libstore/include/nix/common-protocol.hh rename to src/libstore/include/nix/store/common-protocol.hh index 260f19256..b464cda67 100644 --- a/src/libstore/include/nix/common-protocol.hh +++ b/src/libstore/include/nix/store/common-protocol.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "nix/serialise.hh" +#include "nix/util/serialise.hh" namespace nix { diff --git a/src/libstore/include/nix/common-ssh-store-config.hh b/src/libstore/include/nix/store/common-ssh-store-config.hh similarity index 98% rename from src/libstore/include/nix/common-ssh-store-config.hh rename to src/libstore/include/nix/store/common-ssh-store-config.hh index 54aa8cb5e..f82124c66 100644 --- a/src/libstore/include/nix/common-ssh-store-config.hh +++ b/src/libstore/include/nix/store/common-ssh-store-config.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "nix/store-api.hh" +#include "nix/store/store-api.hh" namespace nix { diff --git a/src/libstore/include/nix/content-address.hh b/src/libstore/include/nix/store/content-address.hh similarity index 98% rename from src/libstore/include/nix/content-address.hh rename to src/libstore/include/nix/store/content-address.hh index 6a2cbb1ef..8442fabb2 100644 --- a/src/libstore/include/nix/content-address.hh +++ b/src/libstore/include/nix/store/content-address.hh @@ -2,10 +2,10 @@ ///@file #include -#include "nix/hash.hh" -#include "nix/path.hh" -#include "nix/file-content-address.hh" -#include "nix/variant-wrapper.hh" +#include "nix/util/hash.hh" +#include "nix/store/path.hh" +#include "nix/util/file-content-address.hh" +#include "nix/util/variant-wrapper.hh" namespace nix { diff --git a/src/libstore/include/nix/daemon.hh b/src/libstore/include/nix/store/daemon.hh similarity index 79% rename from src/libstore/include/nix/daemon.hh rename to src/libstore/include/nix/store/daemon.hh index 38df57967..d14541df7 100644 --- a/src/libstore/include/nix/daemon.hh +++ b/src/libstore/include/nix/store/daemon.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "nix/serialise.hh" -#include "nix/store-api.hh" +#include "nix/util/serialise.hh" +#include "nix/store/store-api.hh" namespace nix::daemon { diff --git a/src/libstore/include/nix/derivation-options.hh b/src/libstore/include/nix/store/derivation-options.hh similarity index 98% rename from src/libstore/include/nix/derivation-options.hh rename to src/libstore/include/nix/store/derivation-options.hh index 459b7de78..8f549b737 100644 --- a/src/libstore/include/nix/derivation-options.hh +++ b/src/libstore/include/nix/store/derivation-options.hh @@ -6,8 +6,8 @@ #include #include -#include "nix/types.hh" -#include "nix/json-impls.hh" +#include "nix/util/types.hh" +#include "nix/util/json-impls.hh" namespace nix { diff --git a/src/libstore/include/nix/derivations.hh b/src/libstore/include/nix/store/derivations.hh similarity index 98% rename from src/libstore/include/nix/derivations.hh rename to src/libstore/include/nix/store/derivations.hh index 997cead4f..df490dc7b 100644 --- a/src/libstore/include/nix/derivations.hh +++ b/src/libstore/include/nix/store/derivations.hh @@ -1,14 +1,14 @@ #pragma once ///@file -#include "nix/path.hh" -#include "nix/types.hh" -#include "nix/hash.hh" -#include "nix/content-address.hh" -#include "nix/repair-flag.hh" -#include "nix/derived-path-map.hh" -#include "nix/sync.hh" -#include "nix/variant-wrapper.hh" +#include "nix/store/path.hh" +#include "nix/util/types.hh" +#include "nix/util/hash.hh" +#include "nix/store/content-address.hh" +#include "nix/util/repair-flag.hh" +#include "nix/store/derived-path-map.hh" +#include "nix/util/sync.hh" +#include "nix/util/variant-wrapper.hh" #include #include diff --git a/src/libstore/include/nix/derived-path-map.hh b/src/libstore/include/nix/store/derived-path-map.hh similarity index 98% rename from src/libstore/include/nix/derived-path-map.hh rename to src/libstore/include/nix/store/derived-path-map.hh index 24c5ca3d7..956f8bb0b 100644 --- a/src/libstore/include/nix/derived-path-map.hh +++ b/src/libstore/include/nix/store/derived-path-map.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "nix/types.hh" -#include "nix/derived-path.hh" +#include "nix/util/types.hh" +#include "nix/store/derived-path.hh" namespace nix { diff --git a/src/libstore/include/nix/derived-path.hh b/src/libstore/include/nix/store/derived-path.hh similarity index 98% rename from src/libstore/include/nix/derived-path.hh rename to src/libstore/include/nix/store/derived-path.hh index 719ae0350..2cf06c9b7 100644 --- a/src/libstore/include/nix/derived-path.hh +++ b/src/libstore/include/nix/store/derived-path.hh @@ -1,10 +1,10 @@ #pragma once ///@file -#include "nix/path.hh" -#include "nix/outputs-spec.hh" -#include "nix/config.hh" -#include "nix/ref.hh" +#include "nix/store/path.hh" +#include "nix/store/outputs-spec.hh" +#include "nix/util/configuration.hh" +#include "nix/util/ref.hh" #include diff --git a/src/libstore/include/nix/downstream-placeholder.hh b/src/libstore/include/nix/store/downstream-placeholder.hh similarity index 97% rename from src/libstore/include/nix/downstream-placeholder.hh rename to src/libstore/include/nix/store/downstream-placeholder.hh index eb6662d3b..da03cd9a6 100644 --- a/src/libstore/include/nix/downstream-placeholder.hh +++ b/src/libstore/include/nix/store/downstream-placeholder.hh @@ -1,9 +1,9 @@ #pragma once ///@file -#include "nix/hash.hh" -#include "nix/path.hh" -#include "nix/derived-path.hh" +#include "nix/util/hash.hh" +#include "nix/store/path.hh" +#include "nix/store/derived-path.hh" namespace nix { diff --git a/src/libstore/include/nix/filetransfer.hh b/src/libstore/include/nix/store/filetransfer.hh similarity index 96% rename from src/libstore/include/nix/filetransfer.hh rename to src/libstore/include/nix/store/filetransfer.hh index 31ad1aabd..217c52d77 100644 --- a/src/libstore/include/nix/filetransfer.hh +++ b/src/libstore/include/nix/store/filetransfer.hh @@ -4,11 +4,11 @@ #include #include -#include "nix/logging.hh" -#include "nix/types.hh" -#include "nix/ref.hh" -#include "nix/config.hh" -#include "nix/serialise.hh" +#include "nix/util/logging.hh" +#include "nix/util/types.hh" +#include "nix/util/ref.hh" +#include "nix/util/configuration.hh" +#include "nix/util/serialise.hh" namespace nix { diff --git a/src/libstore/include/nix/gc-store.hh b/src/libstore/include/nix/store/gc-store.hh similarity index 99% rename from src/libstore/include/nix/gc-store.hh rename to src/libstore/include/nix/store/gc-store.hh index f5f685540..cef6e8776 100644 --- a/src/libstore/include/nix/gc-store.hh +++ b/src/libstore/include/nix/store/gc-store.hh @@ -3,7 +3,7 @@ #include -#include "nix/store-api.hh" +#include "nix/store/store-api.hh" namespace nix { diff --git a/src/libstore/include/nix/globals.hh b/src/libstore/include/nix/store/globals.hh similarity index 99% rename from src/libstore/include/nix/globals.hh rename to src/libstore/include/nix/store/globals.hh index 1630c0ae7..4c4395e05 100644 --- a/src/libstore/include/nix/globals.hh +++ b/src/libstore/include/nix/store/globals.hh @@ -6,13 +6,13 @@ #include -#include "nix/types.hh" -#include "nix/config.hh" -#include "nix/environment-variables.hh" -#include "nix/experimental-features.hh" -#include "nix/users.hh" +#include "nix/util/types.hh" +#include "nix/util/configuration.hh" +#include "nix/util/environment-variables.hh" +#include "nix/util/experimental-features.hh" +#include "nix/util/users.hh" -#include "nix/store-config.hh" +#include "nix/store/config.hh" namespace nix { diff --git a/src/libstore/include/nix/http-binary-cache-store.hh b/src/libstore/include/nix/store/http-binary-cache-store.hh similarity index 93% rename from src/libstore/include/nix/http-binary-cache-store.hh rename to src/libstore/include/nix/store/http-binary-cache-store.hh index 9dadda4d3..aaec3116d 100644 --- a/src/libstore/include/nix/http-binary-cache-store.hh +++ b/src/libstore/include/nix/store/http-binary-cache-store.hh @@ -1,4 +1,4 @@ -#include "nix/binary-cache-store.hh" +#include "nix/store/binary-cache-store.hh" namespace nix { diff --git a/src/libstore/include/nix/indirect-root-store.hh b/src/libstore/include/nix/store/indirect-root-store.hh similarity index 98% rename from src/libstore/include/nix/indirect-root-store.hh rename to src/libstore/include/nix/store/indirect-root-store.hh index de4de138b..bbdad83f3 100644 --- a/src/libstore/include/nix/indirect-root-store.hh +++ b/src/libstore/include/nix/store/indirect-root-store.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "nix/local-fs-store.hh" +#include "nix/store/local-fs-store.hh" namespace nix { diff --git a/src/libstore/include/nix/keys.hh b/src/libstore/include/nix/store/keys.hh similarity index 64% rename from src/libstore/include/nix/keys.hh rename to src/libstore/include/nix/store/keys.hh index ae0fa8d02..77aec6bb2 100644 --- a/src/libstore/include/nix/keys.hh +++ b/src/libstore/include/nix/store/keys.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "nix/signature/local-keys.hh" +#include "nix/util/signature/local-keys.hh" namespace nix { diff --git a/src/libstore/include/nix/legacy-ssh-store.hh b/src/libstore/include/nix/store/legacy-ssh-store.hh similarity index 96% rename from src/libstore/include/nix/legacy-ssh-store.hh rename to src/libstore/include/nix/store/legacy-ssh-store.hh index 9c4a9230d..a1fbf3f1e 100644 --- a/src/libstore/include/nix/legacy-ssh-store.hh +++ b/src/libstore/include/nix/store/legacy-ssh-store.hh @@ -1,12 +1,12 @@ #pragma once ///@file -#include "nix/common-ssh-store-config.hh" -#include "nix/store-api.hh" -#include "nix/ssh.hh" -#include "nix/callback.hh" -#include "nix/pool.hh" -#include "nix/serve-protocol.hh" +#include "nix/store/common-ssh-store-config.hh" +#include "nix/store/store-api.hh" +#include "nix/store/ssh.hh" +#include "nix/util/callback.hh" +#include "nix/util/pool.hh" +#include "nix/store/serve-protocol.hh" namespace nix { diff --git a/src/libstore/include/nix/length-prefixed-protocol-helper.hh b/src/libstore/include/nix/store/length-prefixed-protocol-helper.hh similarity index 99% rename from src/libstore/include/nix/length-prefixed-protocol-helper.hh rename to src/libstore/include/nix/store/length-prefixed-protocol-helper.hh index ad7b32793..664841aae 100644 --- a/src/libstore/include/nix/length-prefixed-protocol-helper.hh +++ b/src/libstore/include/nix/store/length-prefixed-protocol-helper.hh @@ -8,7 +8,7 @@ * Used by both the Worker and Serve protocols. */ -#include "nix/types.hh" +#include "nix/util/types.hh" namespace nix { diff --git a/src/libstore/include/nix/local-binary-cache-store.hh b/src/libstore/include/nix/store/local-binary-cache-store.hh similarity index 91% rename from src/libstore/include/nix/local-binary-cache-store.hh rename to src/libstore/include/nix/store/local-binary-cache-store.hh index acff6621d..dde4701da 100644 --- a/src/libstore/include/nix/local-binary-cache-store.hh +++ b/src/libstore/include/nix/store/local-binary-cache-store.hh @@ -1,4 +1,4 @@ -#include "nix/binary-cache-store.hh" +#include "nix/store/binary-cache-store.hh" namespace nix { diff --git a/src/libstore/include/nix/local-fs-store.hh b/src/libstore/include/nix/store/local-fs-store.hh similarity index 96% rename from src/libstore/include/nix/local-fs-store.hh rename to src/libstore/include/nix/store/local-fs-store.hh index 2a5f6e3e7..6d5afcb08 100644 --- a/src/libstore/include/nix/local-fs-store.hh +++ b/src/libstore/include/nix/store/local-fs-store.hh @@ -1,9 +1,9 @@ #pragma once ///@file -#include "nix/store-api.hh" -#include "nix/gc-store.hh" -#include "nix/log-store.hh" +#include "nix/store/store-api.hh" +#include "nix/store/gc-store.hh" +#include "nix/store/log-store.hh" namespace nix { diff --git a/src/libstore/include/nix/local-overlay-store.hh b/src/libstore/include/nix/store/local-overlay-store.hh similarity index 99% rename from src/libstore/include/nix/local-overlay-store.hh rename to src/libstore/include/nix/store/local-overlay-store.hh index 1cee3cc9f..825214cb6 100644 --- a/src/libstore/include/nix/local-overlay-store.hh +++ b/src/libstore/include/nix/store/local-overlay-store.hh @@ -1,4 +1,4 @@ -#include "nix/local-store.hh" +#include "nix/store/local-store.hh" namespace nix { diff --git a/src/libstore/include/nix/local-store.hh b/src/libstore/include/nix/store/local-store.hh similarity index 98% rename from src/libstore/include/nix/local-store.hh rename to src/libstore/include/nix/store/local-store.hh index 2e1fcdfcf..3691fb4b6 100644 --- a/src/libstore/include/nix/local-store.hh +++ b/src/libstore/include/nix/store/local-store.hh @@ -1,12 +1,12 @@ #pragma once ///@file -#include "nix/sqlite.hh" +#include "nix/store/sqlite.hh" -#include "nix/pathlocks.hh" -#include "nix/store-api.hh" -#include "nix/indirect-root-store.hh" -#include "nix/sync.hh" +#include "nix/store/pathlocks.hh" +#include "nix/store/store-api.hh" +#include "nix/store/indirect-root-store.hh" +#include "nix/util/sync.hh" #include #include diff --git a/src/libstore/include/nix/log-store.hh b/src/libstore/include/nix/store/log-store.hh similarity index 94% rename from src/libstore/include/nix/log-store.hh rename to src/libstore/include/nix/store/log-store.hh index 5cd8a9f88..fc12b0c47 100644 --- a/src/libstore/include/nix/log-store.hh +++ b/src/libstore/include/nix/store/log-store.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "nix/store-api.hh" +#include "nix/store/store-api.hh" namespace nix { diff --git a/src/libstore/include/nix/machines.hh b/src/libstore/include/nix/store/machines.hh similarity index 97% rename from src/libstore/include/nix/machines.hh rename to src/libstore/include/nix/store/machines.hh index 6cd1853a5..f07d6b63b 100644 --- a/src/libstore/include/nix/machines.hh +++ b/src/libstore/include/nix/store/machines.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "nix/ref.hh" -#include "nix/store-reference.hh" +#include "nix/util/ref.hh" +#include "nix/store/store-reference.hh" namespace nix { diff --git a/src/libstore/include/nix/make-content-addressed.hh b/src/libstore/include/nix/store/make-content-addressed.hh similarity index 93% rename from src/libstore/include/nix/make-content-addressed.hh rename to src/libstore/include/nix/store/make-content-addressed.hh index 75fe4462f..3881b6d40 100644 --- a/src/libstore/include/nix/make-content-addressed.hh +++ b/src/libstore/include/nix/store/make-content-addressed.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "nix/store-api.hh" +#include "nix/store/store-api.hh" namespace nix { diff --git a/src/libstore/include/nix/meson.build b/src/libstore/include/nix/store/meson.build similarity index 96% rename from src/libstore/include/nix/meson.build rename to src/libstore/include/nix/store/meson.build index d29efe50e..312fd5e87 100644 --- a/src/libstore/include/nix/meson.build +++ b/src/libstore/include/nix/store/meson.build @@ -1,12 +1,12 @@ # Public headers directory include_dirs = [ - include_directories('..'), + include_directories('../..'), ] config_pub_h = configure_file( configuration : configdata_pub, - output : 'store-config.hh', + output : 'config.hh', ) headers = [config_pub_h] + files( diff --git a/src/libstore/include/nix/names.hh b/src/libstore/include/nix/store/names.hh similarity index 95% rename from src/libstore/include/nix/names.hh rename to src/libstore/include/nix/store/names.hh index f11c22b1c..ab315de63 100644 --- a/src/libstore/include/nix/names.hh +++ b/src/libstore/include/nix/store/names.hh @@ -3,7 +3,7 @@ #include -#include "nix/types.hh" +#include "nix/util/types.hh" namespace nix { diff --git a/src/libstore/include/nix/nar-accessor.hh b/src/libstore/include/nix/store/nar-accessor.hh similarity index 95% rename from src/libstore/include/nix/nar-accessor.hh rename to src/libstore/include/nix/store/nar-accessor.hh index b64330547..199d525cb 100644 --- a/src/libstore/include/nix/nar-accessor.hh +++ b/src/libstore/include/nix/store/nar-accessor.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "nix/source-accessor.hh" +#include "nix/util/source-accessor.hh" #include diff --git a/src/libstore/include/nix/nar-info-disk-cache.hh b/src/libstore/include/nix/store/nar-info-disk-cache.hh similarity index 93% rename from src/libstore/include/nix/nar-info-disk-cache.hh rename to src/libstore/include/nix/store/nar-info-disk-cache.hh index 3a301f7e8..a7fde1fbf 100644 --- a/src/libstore/include/nix/nar-info-disk-cache.hh +++ b/src/libstore/include/nix/store/nar-info-disk-cache.hh @@ -1,9 +1,9 @@ #pragma once ///@file -#include "nix/ref.hh" -#include "nix/nar-info.hh" -#include "nix/realisation.hh" +#include "nix/util/ref.hh" +#include "nix/store/nar-info.hh" +#include "nix/store/realisation.hh" namespace nix { diff --git a/src/libstore/include/nix/nar-info.hh b/src/libstore/include/nix/store/nar-info.hh similarity index 92% rename from src/libstore/include/nix/nar-info.hh rename to src/libstore/include/nix/store/nar-info.hh index 117be878f..d66b6e058 100644 --- a/src/libstore/include/nix/nar-info.hh +++ b/src/libstore/include/nix/store/nar-info.hh @@ -1,9 +1,9 @@ #pragma once ///@file -#include "nix/types.hh" -#include "nix/hash.hh" -#include "nix/path-info.hh" +#include "nix/util/types.hh" +#include "nix/util/hash.hh" +#include "nix/store/path-info.hh" namespace nix { diff --git a/src/libstore/include/nix/outputs-spec.hh b/src/libstore/include/nix/store/outputs-spec.hh similarity index 97% rename from src/libstore/include/nix/outputs-spec.hh rename to src/libstore/include/nix/store/outputs-spec.hh index 324d3a334..b89f425c2 100644 --- a/src/libstore/include/nix/outputs-spec.hh +++ b/src/libstore/include/nix/store/outputs-spec.hh @@ -6,8 +6,8 @@ #include #include -#include "nix/json-impls.hh" -#include "nix/variant-wrapper.hh" +#include "nix/util/json-impls.hh" +#include "nix/util/variant-wrapper.hh" namespace nix { diff --git a/src/libstore/include/nix/parsed-derivations.hh b/src/libstore/include/nix/store/parsed-derivations.hh similarity index 94% rename from src/libstore/include/nix/parsed-derivations.hh rename to src/libstore/include/nix/store/parsed-derivations.hh index 34e254e0d..d65db6133 100644 --- a/src/libstore/include/nix/parsed-derivations.hh +++ b/src/libstore/include/nix/store/parsed-derivations.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "nix/derivations.hh" -#include "nix/store-api.hh" +#include "nix/store/derivations.hh" +#include "nix/store/store-api.hh" #include diff --git a/src/libstore/include/nix/path-info.hh b/src/libstore/include/nix/store/path-info.hh similarity index 97% rename from src/libstore/include/nix/path-info.hh rename to src/libstore/include/nix/store/path-info.hh index 45c411ddd..9bd493422 100644 --- a/src/libstore/include/nix/path-info.hh +++ b/src/libstore/include/nix/store/path-info.hh @@ -1,10 +1,10 @@ #pragma once ///@file -#include "nix/signature/signer.hh" -#include "nix/path.hh" -#include "nix/hash.hh" -#include "nix/content-address.hh" +#include "nix/util/signature/signer.hh" +#include "nix/store/path.hh" +#include "nix/util/hash.hh" +#include "nix/store/content-address.hh" #include #include diff --git a/src/libstore/include/nix/path-references.hh b/src/libstore/include/nix/store/path-references.hh similarity index 89% rename from src/libstore/include/nix/path-references.hh rename to src/libstore/include/nix/store/path-references.hh index 0b5e42764..b8d0b4dd0 100644 --- a/src/libstore/include/nix/path-references.hh +++ b/src/libstore/include/nix/store/path-references.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "nix/references.hh" -#include "nix/path.hh" +#include "nix/util/references.hh" +#include "nix/store/path.hh" namespace nix { diff --git a/src/libstore/include/nix/path-regex.hh b/src/libstore/include/nix/store/path-regex.hh similarity index 100% rename from src/libstore/include/nix/path-regex.hh rename to src/libstore/include/nix/store/path-regex.hh diff --git a/src/libstore/include/nix/path-with-outputs.hh b/src/libstore/include/nix/store/path-with-outputs.hh similarity index 95% rename from src/libstore/include/nix/path-with-outputs.hh rename to src/libstore/include/nix/store/path-with-outputs.hh index e2ff303f2..76c1f9f8f 100644 --- a/src/libstore/include/nix/path-with-outputs.hh +++ b/src/libstore/include/nix/store/path-with-outputs.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "nix/path.hh" -#include "nix/derived-path.hh" +#include "nix/store/path.hh" +#include "nix/store/derived-path.hh" namespace nix { diff --git a/src/libstore/include/nix/path.hh b/src/libstore/include/nix/store/path.hh similarity index 98% rename from src/libstore/include/nix/path.hh rename to src/libstore/include/nix/store/path.hh index 56cd5aeb7..279e9dba4 100644 --- a/src/libstore/include/nix/path.hh +++ b/src/libstore/include/nix/store/path.hh @@ -3,7 +3,7 @@ #include -#include "nix/types.hh" +#include "nix/util/types.hh" namespace nix { diff --git a/src/libstore/include/nix/pathlocks.hh b/src/libstore/include/nix/store/pathlocks.hh similarity index 96% rename from src/libstore/include/nix/pathlocks.hh rename to src/libstore/include/nix/store/pathlocks.hh index 68f5a0262..33cad7868 100644 --- a/src/libstore/include/nix/pathlocks.hh +++ b/src/libstore/include/nix/store/pathlocks.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "nix/file-descriptor.hh" +#include "nix/util/file-descriptor.hh" namespace nix { diff --git a/src/libstore/include/nix/posix-fs-canonicalise.hh b/src/libstore/include/nix/store/posix-fs-canonicalise.hh similarity index 95% rename from src/libstore/include/nix/posix-fs-canonicalise.hh rename to src/libstore/include/nix/store/posix-fs-canonicalise.hh index 1309db098..1d6696023 100644 --- a/src/libstore/include/nix/posix-fs-canonicalise.hh +++ b/src/libstore/include/nix/store/posix-fs-canonicalise.hh @@ -4,8 +4,8 @@ #include #include -#include "nix/types.hh" -#include "nix/error.hh" +#include "nix/util/types.hh" +#include "nix/util/error.hh" namespace nix { diff --git a/src/libstore/include/nix/profiles.hh b/src/libstore/include/nix/store/profiles.hh similarity index 99% rename from src/libstore/include/nix/profiles.hh rename to src/libstore/include/nix/store/profiles.hh index 85f45cb73..804c6e2b7 100644 --- a/src/libstore/include/nix/profiles.hh +++ b/src/libstore/include/nix/store/profiles.hh @@ -7,8 +7,8 @@ * See the manual for additional information. */ -#include "nix/types.hh" -#include "nix/pathlocks.hh" +#include "nix/util/types.hh" +#include "nix/store/pathlocks.hh" #include #include diff --git a/src/libstore/include/nix/realisation.hh b/src/libstore/include/nix/store/realisation.hh similarity index 96% rename from src/libstore/include/nix/realisation.hh rename to src/libstore/include/nix/store/realisation.hh index 2d868980c..b93ae37b6 100644 --- a/src/libstore/include/nix/realisation.hh +++ b/src/libstore/include/nix/store/realisation.hh @@ -3,12 +3,12 @@ #include -#include "nix/hash.hh" -#include "nix/path.hh" -#include "nix/derived-path.hh" +#include "nix/util/hash.hh" +#include "nix/store/path.hh" +#include "nix/store/derived-path.hh" #include -#include "nix/comparator.hh" -#include "nix/signature/signer.hh" +#include "nix/util/comparator.hh" +#include "nix/util/signature/signer.hh" namespace nix { diff --git a/src/libstore/include/nix/remote-fs-accessor.hh b/src/libstore/include/nix/store/remote-fs-accessor.hh similarity index 90% rename from src/libstore/include/nix/remote-fs-accessor.hh rename to src/libstore/include/nix/store/remote-fs-accessor.hh index 5abb195ee..75a840fb0 100644 --- a/src/libstore/include/nix/remote-fs-accessor.hh +++ b/src/libstore/include/nix/store/remote-fs-accessor.hh @@ -1,9 +1,9 @@ #pragma once ///@file -#include "nix/source-accessor.hh" -#include "nix/ref.hh" -#include "nix/store-api.hh" +#include "nix/util/source-accessor.hh" +#include "nix/util/ref.hh" +#include "nix/store/store-api.hh" namespace nix { diff --git a/src/libstore/include/nix/remote-store-connection.hh b/src/libstore/include/nix/store/remote-store-connection.hh similarity index 90% rename from src/libstore/include/nix/remote-store-connection.hh rename to src/libstore/include/nix/store/remote-store-connection.hh index 5b11a04f7..33ec265c2 100644 --- a/src/libstore/include/nix/remote-store-connection.hh +++ b/src/libstore/include/nix/store/remote-store-connection.hh @@ -1,10 +1,10 @@ #pragma once ///@file -#include "nix/remote-store.hh" -#include "nix/worker-protocol.hh" -#include "nix/worker-protocol-connection.hh" -#include "nix/pool.hh" +#include "nix/store/remote-store.hh" +#include "nix/store/worker-protocol.hh" +#include "nix/store/worker-protocol-connection.hh" +#include "nix/util/pool.hh" namespace nix { diff --git a/src/libstore/include/nix/remote-store.hh b/src/libstore/include/nix/store/remote-store.hh similarity index 98% rename from src/libstore/include/nix/remote-store.hh rename to src/libstore/include/nix/store/remote-store.hh index ebc9b2a81..ecf18bd76 100644 --- a/src/libstore/include/nix/remote-store.hh +++ b/src/libstore/include/nix/store/remote-store.hh @@ -4,9 +4,9 @@ #include #include -#include "nix/store-api.hh" -#include "nix/gc-store.hh" -#include "nix/log-store.hh" +#include "nix/store/store-api.hh" +#include "nix/store/gc-store.hh" +#include "nix/store/log-store.hh" namespace nix { diff --git a/src/libstore/include/nix/s3-binary-cache-store.hh b/src/libstore/include/nix/store/s3-binary-cache-store.hh similarity index 98% rename from src/libstore/include/nix/s3-binary-cache-store.hh rename to src/libstore/include/nix/store/s3-binary-cache-store.hh index a0ca22bbb..eec2dc6ee 100644 --- a/src/libstore/include/nix/s3-binary-cache-store.hh +++ b/src/libstore/include/nix/store/s3-binary-cache-store.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "nix/binary-cache-store.hh" +#include "nix/store/binary-cache-store.hh" #include diff --git a/src/libstore/include/nix/s3.hh b/src/libstore/include/nix/store/s3.hh similarity index 96% rename from src/libstore/include/nix/s3.hh rename to src/libstore/include/nix/store/s3.hh index 367c41d36..c49fa3fb8 100644 --- a/src/libstore/include/nix/s3.hh +++ b/src/libstore/include/nix/store/s3.hh @@ -3,7 +3,7 @@ #if ENABLE_S3 -#include "nix/ref.hh" +#include "nix/util/ref.hh" #include #include diff --git a/src/libstore/include/nix/serve-protocol-connection.hh b/src/libstore/include/nix/store/serve-protocol-connection.hh similarity index 97% rename from src/libstore/include/nix/serve-protocol-connection.hh rename to src/libstore/include/nix/store/serve-protocol-connection.hh index f1a9e1ede..5822b4990 100644 --- a/src/libstore/include/nix/serve-protocol-connection.hh +++ b/src/libstore/include/nix/store/serve-protocol-connection.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "nix/serve-protocol.hh" -#include "nix/store-api.hh" +#include "nix/store/serve-protocol.hh" +#include "nix/store/store-api.hh" namespace nix { diff --git a/src/libstore/include/nix/serve-protocol-impl.hh b/src/libstore/include/nix/store/serve-protocol-impl.hh similarity index 94% rename from src/libstore/include/nix/serve-protocol-impl.hh rename to src/libstore/include/nix/store/serve-protocol-impl.hh index 2621d3b42..769b9ae2b 100644 --- a/src/libstore/include/nix/serve-protocol-impl.hh +++ b/src/libstore/include/nix/store/serve-protocol-impl.hh @@ -8,8 +8,8 @@ * contributing guide. */ -#include "nix/serve-protocol.hh" -#include "nix/length-prefixed-protocol-helper.hh" +#include "nix/store/serve-protocol.hh" +#include "nix/store/length-prefixed-protocol-helper.hh" namespace nix { diff --git a/src/libstore/include/nix/serve-protocol.hh b/src/libstore/include/nix/store/serve-protocol.hh similarity index 99% rename from src/libstore/include/nix/serve-protocol.hh rename to src/libstore/include/nix/store/serve-protocol.hh index a8587f618..76f0ecd49 100644 --- a/src/libstore/include/nix/serve-protocol.hh +++ b/src/libstore/include/nix/store/serve-protocol.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "nix/common-protocol.hh" +#include "nix/store/common-protocol.hh" namespace nix { diff --git a/src/libstore/include/nix/sqlite.hh b/src/libstore/include/nix/store/sqlite.hh similarity index 99% rename from src/libstore/include/nix/sqlite.hh rename to src/libstore/include/nix/store/sqlite.hh index 4143fa8a4..266930d75 100644 --- a/src/libstore/include/nix/sqlite.hh +++ b/src/libstore/include/nix/store/sqlite.hh @@ -4,7 +4,7 @@ #include #include -#include "nix/error.hh" +#include "nix/util/error.hh" struct sqlite3; struct sqlite3_stmt; diff --git a/src/libstore/include/nix/ssh-store.hh b/src/libstore/include/nix/store/ssh-store.hh similarity index 89% rename from src/libstore/include/nix/ssh-store.hh rename to src/libstore/include/nix/store/ssh-store.hh index 34ec4f79e..76e8e33a4 100644 --- a/src/libstore/include/nix/ssh-store.hh +++ b/src/libstore/include/nix/store/ssh-store.hh @@ -1,10 +1,10 @@ #pragma once ///@file -#include "nix/common-ssh-store-config.hh" -#include "nix/store-api.hh" -#include "nix/local-fs-store.hh" -#include "nix/remote-store.hh" +#include "nix/store/common-ssh-store-config.hh" +#include "nix/store/store-api.hh" +#include "nix/store/local-fs-store.hh" +#include "nix/store/remote-store.hh" namespace nix { diff --git a/src/libstore/include/nix/ssh.hh b/src/libstore/include/nix/store/ssh.hh similarity index 95% rename from src/libstore/include/nix/ssh.hh rename to src/libstore/include/nix/store/ssh.hh index fa046d6de..40f2189d8 100644 --- a/src/libstore/include/nix/ssh.hh +++ b/src/libstore/include/nix/store/ssh.hh @@ -1,9 +1,9 @@ #pragma once ///@file -#include "nix/sync.hh" -#include "nix/processes.hh" -#include "nix/file-system.hh" +#include "nix/util/sync.hh" +#include "nix/util/processes.hh" +#include "nix/util/file-system.hh" namespace nix { diff --git a/src/libstore/include/nix/store-api.hh b/src/libstore/include/nix/store/store-api.hh similarity index 98% rename from src/libstore/include/nix/store-api.hh rename to src/libstore/include/nix/store/store-api.hh index 8e297dab2..cee1dba6e 100644 --- a/src/libstore/include/nix/store-api.hh +++ b/src/libstore/include/nix/store/store-api.hh @@ -1,20 +1,20 @@ #pragma once ///@file -#include "nix/path.hh" -#include "nix/derived-path.hh" -#include "nix/hash.hh" -#include "nix/content-address.hh" -#include "nix/serialise.hh" -#include "nix/lru-cache.hh" -#include "nix/sync.hh" -#include "nix/globals.hh" -#include "nix/config.hh" -#include "nix/path-info.hh" -#include "nix/repair-flag.hh" -#include "nix/store-dir-config.hh" -#include "nix/store-reference.hh" -#include "nix/source-path.hh" +#include "nix/store/path.hh" +#include "nix/store/derived-path.hh" +#include "nix/util/hash.hh" +#include "nix/store/content-address.hh" +#include "nix/util/serialise.hh" +#include "nix/util/lru-cache.hh" +#include "nix/util/sync.hh" +#include "nix/store/globals.hh" +#include "nix/util/configuration.hh" +#include "nix/store/path-info.hh" +#include "nix/util/repair-flag.hh" +#include "nix/store/store-dir-config.hh" +#include "nix/store/store-reference.hh" +#include "nix/util/source-path.hh" #include #include diff --git a/src/libstore/include/nix/store-cast.hh b/src/libstore/include/nix/store/store-cast.hh similarity index 93% rename from src/libstore/include/nix/store-cast.hh rename to src/libstore/include/nix/store/store-cast.hh index 4e6691016..0bf61bb77 100644 --- a/src/libstore/include/nix/store-cast.hh +++ b/src/libstore/include/nix/store/store-cast.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "nix/store-api.hh" +#include "nix/store/store-api.hh" namespace nix { diff --git a/src/libstore/include/nix/store-dir-config.hh b/src/libstore/include/nix/store/store-dir-config.hh similarity index 94% rename from src/libstore/include/nix/store-dir-config.hh rename to src/libstore/include/nix/store/store-dir-config.hh index 66e084a24..845a003f5 100644 --- a/src/libstore/include/nix/store-dir-config.hh +++ b/src/libstore/include/nix/store/store-dir-config.hh @@ -1,10 +1,10 @@ #pragma once -#include "nix/path.hh" -#include "nix/hash.hh" -#include "nix/content-address.hh" -#include "nix/globals.hh" -#include "nix/config.hh" +#include "nix/store/path.hh" +#include "nix/util/hash.hh" +#include "nix/store/content-address.hh" +#include "nix/store/globals.hh" +#include "nix/util/configuration.hh" #include #include diff --git a/src/libstore/include/nix/store-reference.hh b/src/libstore/include/nix/store/store-reference.hh similarity index 98% rename from src/libstore/include/nix/store-reference.hh rename to src/libstore/include/nix/store/store-reference.hh index 922640fe0..433a347aa 100644 --- a/src/libstore/include/nix/store-reference.hh +++ b/src/libstore/include/nix/store/store-reference.hh @@ -3,7 +3,7 @@ #include -#include "nix/types.hh" +#include "nix/util/types.hh" namespace nix { diff --git a/src/libstore/include/nix/uds-remote-store.hh b/src/libstore/include/nix/store/uds-remote-store.hh similarity index 94% rename from src/libstore/include/nix/uds-remote-store.hh rename to src/libstore/include/nix/store/uds-remote-store.hh index 0a2e3fe9f..f7ef76058 100644 --- a/src/libstore/include/nix/uds-remote-store.hh +++ b/src/libstore/include/nix/store/uds-remote-store.hh @@ -1,9 +1,9 @@ #pragma once ///@file -#include "nix/remote-store.hh" -#include "nix/remote-store-connection.hh" -#include "nix/indirect-root-store.hh" +#include "nix/store/remote-store.hh" +#include "nix/store/remote-store-connection.hh" +#include "nix/store/indirect-root-store.hh" namespace nix { diff --git a/src/libstore/include/nix/worker-protocol-connection.hh b/src/libstore/include/nix/store/worker-protocol-connection.hh similarity index 98% rename from src/libstore/include/nix/worker-protocol-connection.hh rename to src/libstore/include/nix/store/worker-protocol-connection.hh index a1a4668f2..df2fe0ec2 100644 --- a/src/libstore/include/nix/worker-protocol-connection.hh +++ b/src/libstore/include/nix/store/worker-protocol-connection.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "nix/worker-protocol.hh" -#include "nix/store-api.hh" +#include "nix/store/worker-protocol.hh" +#include "nix/store/store-api.hh" namespace nix { diff --git a/src/libstore/include/nix/worker-protocol-impl.hh b/src/libstore/include/nix/store/worker-protocol-impl.hh similarity index 94% rename from src/libstore/include/nix/worker-protocol-impl.hh rename to src/libstore/include/nix/store/worker-protocol-impl.hh index 902d21542..337c245e2 100644 --- a/src/libstore/include/nix/worker-protocol-impl.hh +++ b/src/libstore/include/nix/store/worker-protocol-impl.hh @@ -8,8 +8,8 @@ * contributing guide. */ -#include "nix/worker-protocol.hh" -#include "nix/length-prefixed-protocol-helper.hh" +#include "nix/store/worker-protocol.hh" +#include "nix/store/length-prefixed-protocol-helper.hh" namespace nix { diff --git a/src/libstore/include/nix/worker-protocol.hh b/src/libstore/include/nix/store/worker-protocol.hh similarity index 99% rename from src/libstore/include/nix/worker-protocol.hh rename to src/libstore/include/nix/store/worker-protocol.hh index 175ddf01f..3060681b8 100644 --- a/src/libstore/include/nix/worker-protocol.hh +++ b/src/libstore/include/nix/store/worker-protocol.hh @@ -3,7 +3,7 @@ #include -#include "nix/common-protocol.hh" +#include "nix/store/common-protocol.hh" namespace nix { diff --git a/src/libstore/indirect-root-store.cc b/src/libstore/indirect-root-store.cc index 1b51cbe15..e23c01e5d 100644 --- a/src/libstore/indirect-root-store.cc +++ b/src/libstore/indirect-root-store.cc @@ -1,4 +1,4 @@ -#include "nix/indirect-root-store.hh" +#include "nix/store/indirect-root-store.hh" namespace nix { diff --git a/src/libstore/keys.cc b/src/libstore/keys.cc index 1b2a612a2..9abea9520 100644 --- a/src/libstore/keys.cc +++ b/src/libstore/keys.cc @@ -1,6 +1,6 @@ -#include "nix/file-system.hh" -#include "nix/globals.hh" -#include "nix/keys.hh" +#include "nix/util/file-system.hh" +#include "nix/store/globals.hh" +#include "nix/store/keys.hh" namespace nix { diff --git a/src/libstore/legacy-ssh-store.cc b/src/libstore/legacy-ssh-store.cc index bc2794499..1512a7944 100644 --- a/src/libstore/legacy-ssh-store.cc +++ b/src/libstore/legacy-ssh-store.cc @@ -1,17 +1,17 @@ -#include "nix/legacy-ssh-store.hh" -#include "nix/common-ssh-store-config.hh" -#include "nix/archive.hh" -#include "nix/pool.hh" -#include "nix/remote-store.hh" -#include "nix/serve-protocol.hh" -#include "nix/serve-protocol-connection.hh" -#include "nix/serve-protocol-impl.hh" -#include "nix/build-result.hh" -#include "nix/store-api.hh" -#include "nix/path-with-outputs.hh" -#include "nix/ssh.hh" -#include "nix/derivations.hh" -#include "nix/callback.hh" +#include "nix/store/legacy-ssh-store.hh" +#include "nix/store/common-ssh-store-config.hh" +#include "nix/util/archive.hh" +#include "nix/util/pool.hh" +#include "nix/store/remote-store.hh" +#include "nix/store/serve-protocol.hh" +#include "nix/store/serve-protocol-connection.hh" +#include "nix/store/serve-protocol-impl.hh" +#include "nix/store/build-result.hh" +#include "nix/store/store-api.hh" +#include "nix/store/path-with-outputs.hh" +#include "nix/store/ssh.hh" +#include "nix/store/derivations.hh" +#include "nix/util/callback.hh" namespace nix { diff --git a/src/libstore/linux/include/nix/fchmodat2-compat.hh b/src/libstore/linux/include/nix/store/fchmodat2-compat.hh similarity index 100% rename from src/libstore/linux/include/nix/fchmodat2-compat.hh rename to src/libstore/linux/include/nix/store/fchmodat2-compat.hh diff --git a/src/libstore/linux/include/nix/meson.build b/src/libstore/linux/include/nix/store/meson.build similarity index 59% rename from src/libstore/linux/include/nix/meson.build rename to src/libstore/linux/include/nix/store/meson.build index f37370c6f..fd05fcaea 100644 --- a/src/libstore/linux/include/nix/meson.build +++ b/src/libstore/linux/include/nix/store/meson.build @@ -1,4 +1,4 @@ -include_dirs += include_directories('..') +include_dirs += include_directories('../..') headers += files( 'fchmodat2-compat.hh', diff --git a/src/libstore/linux/include/nix/personality.hh b/src/libstore/linux/include/nix/store/personality.hh similarity index 100% rename from src/libstore/linux/include/nix/personality.hh rename to src/libstore/linux/include/nix/store/personality.hh diff --git a/src/libstore/linux/meson.build b/src/libstore/linux/meson.build index b9a2aed21..6fc193cf8 100644 --- a/src/libstore/linux/meson.build +++ b/src/libstore/linux/meson.build @@ -2,4 +2,4 @@ sources += files( 'personality.cc', ) -subdir('include/nix') +subdir('include/nix/store') diff --git a/src/libstore/linux/personality.cc b/src/libstore/linux/personality.cc index 452bd3e4b..e87006d86 100644 --- a/src/libstore/linux/personality.cc +++ b/src/libstore/linux/personality.cc @@ -1,5 +1,5 @@ -#include "nix/personality.hh" -#include "nix/globals.hh" +#include "nix/store/personality.hh" +#include "nix/store/globals.hh" #include #include diff --git a/src/libstore/local-binary-cache-store.cc b/src/libstore/local-binary-cache-store.cc index 90a770ab0..212eacc8c 100644 --- a/src/libstore/local-binary-cache-store.cc +++ b/src/libstore/local-binary-cache-store.cc @@ -1,7 +1,7 @@ -#include "nix/local-binary-cache-store.hh" -#include "nix/globals.hh" -#include "nix/nar-info-disk-cache.hh" -#include "nix/signals.hh" +#include "nix/store/local-binary-cache-store.hh" +#include "nix/store/globals.hh" +#include "nix/store/nar-info-disk-cache.hh" +#include "nix/util/signals.hh" #include diff --git a/src/libstore/local-fs-store.cc b/src/libstore/local-fs-store.cc index 2798899fa..599765ced 100644 --- a/src/libstore/local-fs-store.cc +++ b/src/libstore/local-fs-store.cc @@ -1,10 +1,10 @@ -#include "nix/archive.hh" -#include "nix/posix-source-accessor.hh" -#include "nix/store-api.hh" -#include "nix/local-fs-store.hh" -#include "nix/globals.hh" -#include "nix/compression.hh" -#include "nix/derivations.hh" +#include "nix/util/archive.hh" +#include "nix/util/posix-source-accessor.hh" +#include "nix/store/store-api.hh" +#include "nix/store/local-fs-store.hh" +#include "nix/store/globals.hh" +#include "nix/util/compression.hh" +#include "nix/store/derivations.hh" namespace nix { diff --git a/src/libstore/local-overlay-store.cc b/src/libstore/local-overlay-store.cc index c2cc329b4..38fa634ca 100644 --- a/src/libstore/local-overlay-store.cc +++ b/src/libstore/local-overlay-store.cc @@ -1,8 +1,8 @@ -#include "nix/local-overlay-store.hh" -#include "nix/callback.hh" -#include "nix/realisation.hh" -#include "nix/processes.hh" -#include "nix/url.hh" +#include "nix/store/local-overlay-store.hh" +#include "nix/util/callback.hh" +#include "nix/store/realisation.hh" +#include "nix/util/processes.hh" +#include "nix/util/url.hh" #include namespace nix { diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index 60c20bd65..e0699fac0 100644 --- a/src/libstore/local-store.cc +++ b/src/libstore/local-store.cc @@ -1,22 +1,22 @@ -#include "nix/local-store.hh" -#include "nix/globals.hh" -#include "nix/git.hh" -#include "nix/archive.hh" -#include "nix/pathlocks.hh" -#include "nix/worker-protocol.hh" -#include "nix/derivations.hh" -#include "nix/realisation.hh" -#include "nix/nar-info.hh" -#include "nix/references.hh" -#include "nix/callback.hh" -#include "nix/topo-sort.hh" -#include "nix/finally.hh" -#include "nix/compression.hh" -#include "nix/signals.hh" -#include "nix/posix-fs-canonicalise.hh" -#include "nix/posix-source-accessor.hh" -#include "nix/keys.hh" -#include "nix/users.hh" +#include "nix/store/local-store.hh" +#include "nix/store/globals.hh" +#include "nix/util/git.hh" +#include "nix/util/archive.hh" +#include "nix/store/pathlocks.hh" +#include "nix/store/worker-protocol.hh" +#include "nix/store/derivations.hh" +#include "nix/store/realisation.hh" +#include "nix/store/nar-info.hh" +#include "nix/util/references.hh" +#include "nix/util/callback.hh" +#include "nix/util/topo-sort.hh" +#include "nix/util/finally.hh" +#include "nix/util/compression.hh" +#include "nix/util/signals.hh" +#include "nix/store/posix-fs-canonicalise.hh" +#include "nix/util/posix-source-accessor.hh" +#include "nix/store/keys.hh" +#include "nix/util/users.hh" #include #include @@ -52,7 +52,7 @@ #include -#include "nix/strings.hh" +#include "nix/util/strings.hh" #include "store-config-private.hh" diff --git a/src/libstore/log-store.cc b/src/libstore/log-store.cc index b2c2ff16a..2ef791e19 100644 --- a/src/libstore/log-store.cc +++ b/src/libstore/log-store.cc @@ -1,4 +1,4 @@ -#include "nix/log-store.hh" +#include "nix/store/log-store.hh" namespace nix { diff --git a/src/libstore/machines.cc b/src/libstore/machines.cc index 7710ae99b..7c077239d 100644 --- a/src/libstore/machines.cc +++ b/src/libstore/machines.cc @@ -1,6 +1,6 @@ -#include "nix/machines.hh" -#include "nix/globals.hh" -#include "nix/store-api.hh" +#include "nix/store/machines.hh" +#include "nix/store/globals.hh" +#include "nix/store/store-api.hh" #include diff --git a/src/libstore/make-content-addressed.cc b/src/libstore/make-content-addressed.cc index c7d44b1a9..606d72866 100644 --- a/src/libstore/make-content-addressed.cc +++ b/src/libstore/make-content-addressed.cc @@ -1,5 +1,5 @@ -#include "nix/make-content-addressed.hh" -#include "nix/references.hh" +#include "nix/store/make-content-addressed.hh" +#include "nix/util/references.hh" namespace nix { diff --git a/src/libstore/meson.build b/src/libstore/meson.build index b558c3bc9..1ee11ec11 100644 --- a/src/libstore/meson.build +++ b/src/libstore/meson.build @@ -251,7 +251,7 @@ sources = files( 'worker-protocol.cc', ) -subdir('include/nix') +subdir('include/nix/store') if host_machine.system() == 'linux' subdir('linux') @@ -362,7 +362,7 @@ this_library = library( install : true, ) -install_headers(headers, subdir : 'nix', preserve_path : true) +install_headers(headers, subdir : 'nix/store', preserve_path : true) libraries_private = [] diff --git a/src/libstore/misc.cc b/src/libstore/misc.cc index ef08f4af7..0e2b62db5 100644 --- a/src/libstore/misc.cc +++ b/src/libstore/misc.cc @@ -1,17 +1,17 @@ #include -#include "nix/derivations.hh" -#include "nix/parsed-derivations.hh" -#include "nix/derivation-options.hh" -#include "nix/globals.hh" -#include "nix/store-api.hh" -#include "nix/thread-pool.hh" -#include "nix/realisation.hh" -#include "nix/topo-sort.hh" -#include "nix/callback.hh" -#include "nix/closure.hh" -#include "nix/filetransfer.hh" -#include "nix/strings.hh" +#include "nix/store/derivations.hh" +#include "nix/store/parsed-derivations.hh" +#include "nix/store/derivation-options.hh" +#include "nix/store/globals.hh" +#include "nix/store/store-api.hh" +#include "nix/util/thread-pool.hh" +#include "nix/store/realisation.hh" +#include "nix/util/topo-sort.hh" +#include "nix/util/callback.hh" +#include "nix/util/closure.hh" +#include "nix/store/filetransfer.hh" +#include "nix/util/strings.hh" namespace nix { diff --git a/src/libstore/names.cc b/src/libstore/names.cc index 2842bf3fb..998b9356a 100644 --- a/src/libstore/names.cc +++ b/src/libstore/names.cc @@ -1,5 +1,5 @@ -#include "nix/names.hh" -#include "nix/util.hh" +#include "nix/store/names.hh" +#include "nix/util/util.hh" #include diff --git a/src/libstore/nar-accessor.cc b/src/libstore/nar-accessor.cc index 7fe2e7ecb..6aba68a36 100644 --- a/src/libstore/nar-accessor.cc +++ b/src/libstore/nar-accessor.cc @@ -1,5 +1,5 @@ -#include "nix/nar-accessor.hh" -#include "nix/archive.hh" +#include "nix/store/nar-accessor.hh" +#include "nix/util/archive.hh" #include #include diff --git a/src/libstore/nar-info-disk-cache.cc b/src/libstore/nar-info-disk-cache.cc index acb7bd3bf..5d72ba8ae 100644 --- a/src/libstore/nar-info-disk-cache.cc +++ b/src/libstore/nar-info-disk-cache.cc @@ -1,13 +1,13 @@ -#include "nix/nar-info-disk-cache.hh" -#include "nix/users.hh" -#include "nix/sync.hh" -#include "nix/sqlite.hh" -#include "nix/globals.hh" +#include "nix/store/nar-info-disk-cache.hh" +#include "nix/util/users.hh" +#include "nix/util/sync.hh" +#include "nix/store/sqlite.hh" +#include "nix/store/globals.hh" #include #include -#include "nix/strings.hh" +#include "nix/util/strings.hh" namespace nix { diff --git a/src/libstore/nar-info.cc b/src/libstore/nar-info.cc index 176332a4a..ba80652d0 100644 --- a/src/libstore/nar-info.cc +++ b/src/libstore/nar-info.cc @@ -1,8 +1,8 @@ -#include "nix/globals.hh" -#include "nix/nar-info.hh" -#include "nix/store-api.hh" -#include "nix/strings.hh" -#include "nix/json-utils.hh" +#include "nix/store/globals.hh" +#include "nix/store/nar-info.hh" +#include "nix/store/store-api.hh" +#include "nix/util/strings.hh" +#include "nix/util/json-utils.hh" namespace nix { diff --git a/src/libstore/optimise-store.cc b/src/libstore/optimise-store.cc index c2cda58e7..17e13758b 100644 --- a/src/libstore/optimise-store.cc +++ b/src/libstore/optimise-store.cc @@ -1,8 +1,8 @@ -#include "nix/local-store.hh" -#include "nix/globals.hh" -#include "nix/signals.hh" -#include "nix/posix-fs-canonicalise.hh" -#include "nix/posix-source-accessor.hh" +#include "nix/store/local-store.hh" +#include "nix/store/globals.hh" +#include "nix/util/signals.hh" +#include "nix/store/posix-fs-canonicalise.hh" +#include "nix/util/posix-source-accessor.hh" #include #include diff --git a/src/libstore/outputs-spec.cc b/src/libstore/outputs-spec.cc index 7d56a7afd..28fe45de9 100644 --- a/src/libstore/outputs-spec.cc +++ b/src/libstore/outputs-spec.cc @@ -1,11 +1,11 @@ #include #include -#include "nix/util.hh" -#include "nix/regex-combinators.hh" -#include "nix/outputs-spec.hh" -#include "nix/path-regex.hh" -#include "nix/strings-inline.hh" +#include "nix/util/util.hh" +#include "nix/util/regex-combinators.hh" +#include "nix/store/outputs-spec.hh" +#include "nix/store/path-regex.hh" +#include "nix/util/strings-inline.hh" namespace nix { diff --git a/src/libstore/package.nix b/src/libstore/package.nix index 553bc043e..775776139 100644 --- a/src/libstore/package.nix +++ b/src/libstore/package.nix @@ -43,11 +43,11 @@ mkMesonLibrary (finalAttrs: { ./.version ./meson.build ./meson.options - ./include/nix/meson.build + ./include/nix/store/meson.build ./linux/meson.build - ./linux/include/nix/meson.build + ./linux/include/nix/store/meson.build ./unix/meson.build - ./unix/include/nix/meson.build + ./unix/include/nix/store/meson.build ./windows/meson.build (fileset.fileFilter (file: file.hasExt "cc") ./.) (fileset.fileFilter (file: file.hasExt "hh") ./.) diff --git a/src/libstore/parsed-derivations.cc b/src/libstore/parsed-derivations.cc index 0e8f9ba95..cc7203c6b 100644 --- a/src/libstore/parsed-derivations.cc +++ b/src/libstore/parsed-derivations.cc @@ -1,4 +1,4 @@ -#include "nix/parsed-derivations.hh" +#include "nix/store/parsed-derivations.hh" #include #include diff --git a/src/libstore/path-info.cc b/src/libstore/path-info.cc index 574ada7ac..df20edb3b 100644 --- a/src/libstore/path-info.cc +++ b/src/libstore/path-info.cc @@ -1,10 +1,10 @@ #include -#include "nix/path-info.hh" -#include "nix/store-api.hh" -#include "nix/json-utils.hh" -#include "nix/comparator.hh" -#include "nix/strings.hh" +#include "nix/store/path-info.hh" +#include "nix/store/store-api.hh" +#include "nix/util/json-utils.hh" +#include "nix/util/comparator.hh" +#include "nix/util/strings.hh" namespace nix { diff --git a/src/libstore/path-references.cc b/src/libstore/path-references.cc index a5aa8f48f..c06647eb1 100644 --- a/src/libstore/path-references.cc +++ b/src/libstore/path-references.cc @@ -1,6 +1,6 @@ -#include "nix/path-references.hh" -#include "nix/hash.hh" -#include "nix/archive.hh" +#include "nix/store/path-references.hh" +#include "nix/util/hash.hh" +#include "nix/util/archive.hh" #include #include diff --git a/src/libstore/path-with-outputs.cc b/src/libstore/path-with-outputs.cc index 87f7c6a72..9fbbc8f46 100644 --- a/src/libstore/path-with-outputs.cc +++ b/src/libstore/path-with-outputs.cc @@ -1,8 +1,8 @@ #include -#include "nix/path-with-outputs.hh" -#include "nix/store-api.hh" -#include "nix/strings.hh" +#include "nix/store/path-with-outputs.hh" +#include "nix/store/store-api.hh" +#include "nix/util/strings.hh" namespace nix { diff --git a/src/libstore/path.cc b/src/libstore/path.cc index d1eb02e70..5dd1a1699 100644 --- a/src/libstore/path.cc +++ b/src/libstore/path.cc @@ -1,4 +1,4 @@ -#include "nix/store-dir-config.hh" +#include "nix/store/store-dir-config.hh" namespace nix { diff --git a/src/libstore/pathlocks.cc b/src/libstore/pathlocks.cc index 36bee6741..34acfb02d 100644 --- a/src/libstore/pathlocks.cc +++ b/src/libstore/pathlocks.cc @@ -1,7 +1,7 @@ -#include "nix/pathlocks.hh" -#include "nix/util.hh" -#include "nix/sync.hh" -#include "nix/signals.hh" +#include "nix/store/pathlocks.hh" +#include "nix/util/util.hh" +#include "nix/util/sync.hh" +#include "nix/util/signals.hh" #include #include diff --git a/src/libstore/posix-fs-canonicalise.cc b/src/libstore/posix-fs-canonicalise.cc index c1b451324..df51ba307 100644 --- a/src/libstore/posix-fs-canonicalise.cc +++ b/src/libstore/posix-fs-canonicalise.cc @@ -1,10 +1,9 @@ -#include "nix/posix-fs-canonicalise.hh" -#include "nix/file-system.hh" -#include "nix/signals.hh" -#include "nix/util.hh" -#include "nix/globals.hh" -#include "nix/store-api.hh" -#include "nix/store-config.hh" +#include "nix/store/posix-fs-canonicalise.hh" +#include "nix/util/file-system.hh" +#include "nix/util/signals.hh" +#include "nix/util/util.hh" +#include "nix/store/globals.hh" +#include "nix/store/store-api.hh" #include "store-config-private.hh" diff --git a/src/libstore/profiles.cc b/src/libstore/profiles.cc index 19358f136..bd24332cb 100644 --- a/src/libstore/profiles.cc +++ b/src/libstore/profiles.cc @@ -1,8 +1,8 @@ -#include "nix/profiles.hh" -#include "nix/signals.hh" -#include "nix/store-api.hh" -#include "nix/local-fs-store.hh" -#include "nix/users.hh" +#include "nix/store/profiles.hh" +#include "nix/util/signals.hh" +#include "nix/store/store-api.hh" +#include "nix/store/local-fs-store.hh" +#include "nix/util/users.hh" #include #include diff --git a/src/libstore/realisation.cc b/src/libstore/realisation.cc index 63b156b30..635fb6946 100644 --- a/src/libstore/realisation.cc +++ b/src/libstore/realisation.cc @@ -1,7 +1,7 @@ -#include "nix/realisation.hh" -#include "nix/store-api.hh" -#include "nix/closure.hh" -#include "nix/signature/local-keys.hh" +#include "nix/store/realisation.hh" +#include "nix/store/store-api.hh" +#include "nix/util/closure.hh" +#include "nix/util/signature/local-keys.hh" #include namespace nix { diff --git a/src/libstore/remote-fs-accessor.cc b/src/libstore/remote-fs-accessor.cc index 2b3f0675d..340e7ee2e 100644 --- a/src/libstore/remote-fs-accessor.cc +++ b/src/libstore/remote-fs-accessor.cc @@ -1,6 +1,6 @@ #include -#include "nix/remote-fs-accessor.hh" -#include "nix/nar-accessor.hh" +#include "nix/store/remote-fs-accessor.hh" +#include "nix/store/nar-accessor.hh" #include #include diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc index bae03e5d0..0533b7c8a 100644 --- a/src/libstore/remote-store.cc +++ b/src/libstore/remote-store.cc @@ -1,23 +1,23 @@ -#include "nix/serialise.hh" -#include "nix/util.hh" -#include "nix/path-with-outputs.hh" -#include "nix/gc-store.hh" -#include "nix/remote-fs-accessor.hh" -#include "nix/build-result.hh" -#include "nix/remote-store.hh" -#include "nix/remote-store-connection.hh" -#include "nix/worker-protocol.hh" -#include "nix/worker-protocol-impl.hh" -#include "nix/archive.hh" -#include "nix/globals.hh" -#include "nix/derivations.hh" -#include "nix/pool.hh" -#include "nix/finally.hh" -#include "nix/git.hh" -#include "nix/logging.hh" -#include "nix/callback.hh" -#include "nix/filetransfer.hh" -#include "nix/signals.hh" +#include "nix/util/serialise.hh" +#include "nix/util/util.hh" +#include "nix/store/path-with-outputs.hh" +#include "nix/store/gc-store.hh" +#include "nix/store/remote-fs-accessor.hh" +#include "nix/store/build-result.hh" +#include "nix/store/remote-store.hh" +#include "nix/store/remote-store-connection.hh" +#include "nix/store/worker-protocol.hh" +#include "nix/store/worker-protocol-impl.hh" +#include "nix/util/archive.hh" +#include "nix/store/globals.hh" +#include "nix/store/derivations.hh" +#include "nix/util/pool.hh" +#include "nix/util/finally.hh" +#include "nix/util/git.hh" +#include "nix/util/logging.hh" +#include "nix/util/callback.hh" +#include "nix/store/filetransfer.hh" +#include "nix/util/signals.hh" #include diff --git a/src/libstore/s3-binary-cache-store.cc b/src/libstore/s3-binary-cache-store.cc index 69ebad75b..e76a508ba 100644 --- a/src/libstore/s3-binary-cache-store.cc +++ b/src/libstore/s3-binary-cache-store.cc @@ -2,14 +2,14 @@ #include -#include "nix/s3.hh" -#include "nix/s3-binary-cache-store.hh" -#include "nix/nar-info.hh" -#include "nix/nar-info-disk-cache.hh" -#include "nix/globals.hh" -#include "nix/compression.hh" -#include "nix/filetransfer.hh" -#include "nix/signals.hh" +#include "nix/store/s3.hh" +#include "nix/store/s3-binary-cache-store.hh" +#include "nix/store/nar-info.hh" +#include "nix/store/nar-info-disk-cache.hh" +#include "nix/store/globals.hh" +#include "nix/util/compression.hh" +#include "nix/store/filetransfer.hh" +#include "nix/util/signals.hh" #include #include diff --git a/src/libstore/serve-protocol-connection.cc b/src/libstore/serve-protocol-connection.cc index 577297af8..276086f6f 100644 --- a/src/libstore/serve-protocol-connection.cc +++ b/src/libstore/serve-protocol-connection.cc @@ -1,7 +1,7 @@ -#include "nix/serve-protocol-connection.hh" -#include "nix/serve-protocol-impl.hh" -#include "nix/build-result.hh" -#include "nix/derivations.hh" +#include "nix/store/serve-protocol-connection.hh" +#include "nix/store/serve-protocol-impl.hh" +#include "nix/store/build-result.hh" +#include "nix/store/derivations.hh" namespace nix { diff --git a/src/libstore/serve-protocol.cc b/src/libstore/serve-protocol.cc index 0e2a3bc9d..520c37951 100644 --- a/src/libstore/serve-protocol.cc +++ b/src/libstore/serve-protocol.cc @@ -1,11 +1,11 @@ -#include "nix/serialise.hh" -#include "nix/path-with-outputs.hh" -#include "nix/store-api.hh" -#include "nix/build-result.hh" -#include "nix/serve-protocol.hh" -#include "nix/serve-protocol-impl.hh" -#include "nix/archive.hh" -#include "nix/path-info.hh" +#include "nix/util/serialise.hh" +#include "nix/store/path-with-outputs.hh" +#include "nix/store/store-api.hh" +#include "nix/store/build-result.hh" +#include "nix/store/serve-protocol.hh" +#include "nix/store/serve-protocol-impl.hh" +#include "nix/util/archive.hh" +#include "nix/store/path-info.hh" #include diff --git a/src/libstore/sqlite.cc b/src/libstore/sqlite.cc index 1f9622255..55b967ed6 100644 --- a/src/libstore/sqlite.cc +++ b/src/libstore/sqlite.cc @@ -1,8 +1,8 @@ -#include "nix/sqlite.hh" -#include "nix/globals.hh" -#include "nix/util.hh" -#include "nix/url.hh" -#include "nix/signals.hh" +#include "nix/store/sqlite.hh" +#include "nix/store/globals.hh" +#include "nix/util/util.hh" +#include "nix/util/url.hh" +#include "nix/util/signals.hh" #include diff --git a/src/libstore/ssh-store.cc b/src/libstore/ssh-store.cc index dc889cb39..45ea05ffc 100644 --- a/src/libstore/ssh-store.cc +++ b/src/libstore/ssh-store.cc @@ -1,12 +1,12 @@ -#include "nix/ssh-store.hh" -#include "nix/local-fs-store.hh" -#include "nix/remote-store-connection.hh" -#include "nix/source-accessor.hh" -#include "nix/archive.hh" -#include "nix/worker-protocol.hh" -#include "nix/worker-protocol-impl.hh" -#include "nix/pool.hh" -#include "nix/ssh.hh" +#include "nix/store/ssh-store.hh" +#include "nix/store/local-fs-store.hh" +#include "nix/store/remote-store-connection.hh" +#include "nix/util/source-accessor.hh" +#include "nix/util/archive.hh" +#include "nix/store/worker-protocol.hh" +#include "nix/store/worker-protocol-impl.hh" +#include "nix/util/pool.hh" +#include "nix/store/ssh.hh" namespace nix { diff --git a/src/libstore/ssh.cc b/src/libstore/ssh.cc index 86b6eda7c..97b75cba1 100644 --- a/src/libstore/ssh.cc +++ b/src/libstore/ssh.cc @@ -1,9 +1,9 @@ -#include "nix/ssh.hh" -#include "nix/finally.hh" -#include "nix/current-process.hh" -#include "nix/environment-variables.hh" -#include "nix/util.hh" -#include "nix/exec.hh" +#include "nix/store/ssh.hh" +#include "nix/util/finally.hh" +#include "nix/util/current-process.hh" +#include "nix/util/environment-variables.hh" +#include "nix/util/util.hh" +#include "nix/util/exec.hh" namespace nix { diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc index 52a962553..a0104b96a 100644 --- a/src/libstore/store-api.cc +++ b/src/libstore/store-api.cc @@ -1,28 +1,28 @@ -#include "nix/signature/local-keys.hh" -#include "nix/source-accessor.hh" -#include "nix/globals.hh" -#include "nix/derived-path.hh" -#include "nix/realisation.hh" -#include "nix/derivations.hh" -#include "nix/store-api.hh" -#include "nix/util.hh" -#include "nix/nar-info-disk-cache.hh" -#include "nix/thread-pool.hh" -#include "nix/references.hh" -#include "nix/archive.hh" -#include "nix/callback.hh" -#include "nix/git.hh" -#include "nix/posix-source-accessor.hh" +#include "nix/util/signature/local-keys.hh" +#include "nix/util/source-accessor.hh" +#include "nix/store/globals.hh" +#include "nix/store/derived-path.hh" +#include "nix/store/realisation.hh" +#include "nix/store/derivations.hh" +#include "nix/store/store-api.hh" +#include "nix/util/util.hh" +#include "nix/store/nar-info-disk-cache.hh" +#include "nix/util/thread-pool.hh" +#include "nix/util/references.hh" +#include "nix/util/archive.hh" +#include "nix/util/callback.hh" +#include "nix/util/git.hh" +#include "nix/util/posix-source-accessor.hh" // FIXME this should not be here, see TODO below on // `addMultipleToStore`. -#include "nix/worker-protocol.hh" -#include "nix/signals.hh" -#include "nix/users.hh" +#include "nix/store/worker-protocol.hh" +#include "nix/util/signals.hh" +#include "nix/util/users.hh" #include #include -#include "nix/strings.hh" +#include "nix/util/strings.hh" using json = nlohmann::json; @@ -1277,8 +1277,8 @@ Derivation Store::readInvalidDerivation(const StorePath & drvPath) } -#include "nix/local-store.hh" -#include "nix/uds-remote-store.hh" +#include "nix/store/local-store.hh" +#include "nix/store/uds-remote-store.hh" namespace nix { diff --git a/src/libstore/store-reference.cc b/src/libstore/store-reference.cc index 610e70f99..cb4e2cfb8 100644 --- a/src/libstore/store-reference.cc +++ b/src/libstore/store-reference.cc @@ -1,10 +1,10 @@ #include -#include "nix/error.hh" -#include "nix/url.hh" -#include "nix/store-reference.hh" -#include "nix/file-system.hh" -#include "nix/util.hh" +#include "nix/util/error.hh" +#include "nix/util/url.hh" +#include "nix/store/store-reference.hh" +#include "nix/util/file-system.hh" +#include "nix/util/util.hh" namespace nix { diff --git a/src/libstore/uds-remote-store.cc b/src/libstore/uds-remote-store.cc index b41eae39c..3c1657d15 100644 --- a/src/libstore/uds-remote-store.cc +++ b/src/libstore/uds-remote-store.cc @@ -1,6 +1,6 @@ -#include "nix/uds-remote-store.hh" -#include "nix/unix-domain-socket.hh" -#include "nix/worker-protocol.hh" +#include "nix/store/uds-remote-store.hh" +#include "nix/util/unix-domain-socket.hh" +#include "nix/store/worker-protocol.hh" #include #include diff --git a/src/libstore/unix/build/child.cc b/src/libstore/unix/build/child.cc index c19d1e646..a21fddf51 100644 --- a/src/libstore/unix/build/child.cc +++ b/src/libstore/unix/build/child.cc @@ -1,6 +1,6 @@ -#include "nix/build/child.hh" -#include "nix/current-process.hh" -#include "nix/logging.hh" +#include "nix/store/build/child.hh" +#include "nix/util/current-process.hh" +#include "nix/util/logging.hh" #include #include diff --git a/src/libstore/unix/build/hook-instance.cc b/src/libstore/unix/build/hook-instance.cc index 5407bef14..3713f7c86 100644 --- a/src/libstore/unix/build/hook-instance.cc +++ b/src/libstore/unix/build/hook-instance.cc @@ -1,10 +1,10 @@ -#include "nix/globals.hh" -#include "nix/config-global.hh" -#include "nix/build/hook-instance.hh" -#include "nix/file-system.hh" -#include "nix/build/child.hh" -#include "nix/strings.hh" -#include "nix/executable-path.hh" +#include "nix/store/globals.hh" +#include "nix/util/config-global.hh" +#include "nix/store/build/hook-instance.hh" +#include "nix/util/file-system.hh" +#include "nix/store/build/child.hh" +#include "nix/util/strings.hh" +#include "nix/util/executable-path.hh" namespace nix { diff --git a/src/libstore/unix/build/local-derivation-goal.cc b/src/libstore/unix/build/local-derivation-goal.cc index afffe8e71..302569ac6 100644 --- a/src/libstore/unix/build/local-derivation-goal.cc +++ b/src/libstore/unix/build/local-derivation-goal.cc @@ -1,25 +1,27 @@ -#include "nix/build/local-derivation-goal.hh" -#include "nix/indirect-root-store.hh" -#include "nix/build/hook-instance.hh" -#include "nix/build/worker.hh" -#include "nix/builtins.hh" -#include "nix/builtins/buildenv.hh" -#include "nix/path-references.hh" -#include "nix/finally.hh" -#include "nix/util.hh" -#include "nix/archive.hh" -#include "nix/git.hh" -#include "nix/compression.hh" -#include "nix/daemon.hh" -#include "nix/topo-sort.hh" -#include "nix/callback.hh" -#include "nix/json-utils.hh" -#include "nix/current-process.hh" -#include "nix/build/child.hh" -#include "nix/unix-domain-socket.hh" -#include "nix/posix-fs-canonicalise.hh" -#include "nix/posix-source-accessor.hh" -#include "nix/store-config.hh" +#include "nix/store/build/local-derivation-goal.hh" +#include "nix/store/local-store.hh" +#include "nix/util/processes.hh" +#include "nix/store/indirect-root-store.hh" +#include "nix/store/build/hook-instance.hh" +#include "nix/store/build/worker.hh" +#include "nix/store/builtins.hh" +#include "nix/store/builtins/buildenv.hh" +#include "nix/store/path-references.hh" +#include "nix/util/finally.hh" +#include "nix/util/util.hh" +#include "nix/util/archive.hh" +#include "nix/util/git.hh" +#include "nix/util/compression.hh" +#include "nix/store/daemon.hh" +#include "nix/util/topo-sort.hh" +#include "nix/util/callback.hh" +#include "nix/util/json-utils.hh" +#include "nix/util/current-process.hh" +#include "nix/store/build/child.hh" +#include "nix/util/unix-domain-socket.hh" +#include "nix/store/posix-fs-canonicalise.hh" +#include "nix/util/posix-source-accessor.hh" +#include "nix/store/config.hh" #include #include @@ -40,7 +42,7 @@ /* Includes required for chroot support. */ #if __linux__ -# include "nix/fchmodat2-compat.hh" +# include "nix/store/fchmodat2-compat.hh" # include # include # include @@ -49,13 +51,13 @@ # include # include # include -# include "nix/namespaces.hh" +# include "nix/util/namespaces.hh" # if HAVE_SECCOMP # include # endif # define pivot_root(new_root, put_old) (syscall(SYS_pivot_root, new_root, put_old)) -# include "nix/cgroup.hh" -# include "nix/personality.hh" +# include "nix/util/cgroup.hh" +# include "nix/store/personality.hh" #endif #if __APPLE__ @@ -71,8 +73,8 @@ extern "C" int sandbox_init_with_parameters(const char *profile, uint64_t flags, #include #include -#include "nix/strings.hh" -#include "nix/signals.hh" +#include "nix/util/strings.hh" +#include "nix/util/signals.hh" namespace nix { diff --git a/src/libstore/unix/include/nix/build/child.hh b/src/libstore/unix/include/nix/store/build/child.hh similarity index 100% rename from src/libstore/unix/include/nix/build/child.hh rename to src/libstore/unix/include/nix/store/build/child.hh diff --git a/src/libstore/unix/include/nix/build/hook-instance.hh b/src/libstore/unix/include/nix/store/build/hook-instance.hh similarity index 83% rename from src/libstore/unix/include/nix/build/hook-instance.hh rename to src/libstore/unix/include/nix/store/build/hook-instance.hh index b82a51183..ff205ff76 100644 --- a/src/libstore/unix/include/nix/build/hook-instance.hh +++ b/src/libstore/unix/include/nix/store/build/hook-instance.hh @@ -1,9 +1,9 @@ #pragma once ///@file -#include "nix/logging.hh" -#include "nix/serialise.hh" -#include "nix/processes.hh" +#include "nix/util/logging.hh" +#include "nix/util/serialise.hh" +#include "nix/util/processes.hh" namespace nix { diff --git a/src/libstore/unix/include/nix/build/local-derivation-goal.hh b/src/libstore/unix/include/nix/store/build/local-derivation-goal.hh similarity index 98% rename from src/libstore/unix/include/nix/build/local-derivation-goal.hh rename to src/libstore/unix/include/nix/store/build/local-derivation-goal.hh index 1a14211be..795286a01 100644 --- a/src/libstore/unix/include/nix/build/local-derivation-goal.hh +++ b/src/libstore/unix/include/nix/store/build/local-derivation-goal.hh @@ -1,9 +1,9 @@ #pragma once ///@file -#include "nix/build/derivation-goal.hh" -#include "nix/local-store.hh" -#include "nix/processes.hh" +#include "nix/store/build/derivation-goal.hh" +#include "nix/store/local-store.hh" +#include "nix/util/processes.hh" namespace nix { diff --git a/src/libstore/unix/include/nix/meson.build b/src/libstore/unix/include/nix/store/meson.build similarity index 73% rename from src/libstore/unix/include/nix/meson.build rename to src/libstore/unix/include/nix/store/meson.build index b07787c0a..9f12440cd 100644 --- a/src/libstore/unix/include/nix/meson.build +++ b/src/libstore/unix/include/nix/store/meson.build @@ -1,4 +1,4 @@ -include_dirs += include_directories('..') +include_dirs += include_directories('../..') headers += files( 'build/child.hh', diff --git a/src/libstore/unix/include/nix/user-lock.hh b/src/libstore/unix/include/nix/store/user-lock.hh similarity index 100% rename from src/libstore/unix/include/nix/user-lock.hh rename to src/libstore/unix/include/nix/store/user-lock.hh diff --git a/src/libstore/unix/meson.build b/src/libstore/unix/meson.build index 7c80aa1a1..f06c9aa95 100644 --- a/src/libstore/unix/meson.build +++ b/src/libstore/unix/meson.build @@ -6,4 +6,4 @@ sources += files( 'user-lock.cc', ) -subdir('include/nix') +subdir('include/nix/store') diff --git a/src/libstore/unix/pathlocks.cc b/src/libstore/unix/pathlocks.cc index 3cc24c859..58d047f4e 100644 --- a/src/libstore/unix/pathlocks.cc +++ b/src/libstore/unix/pathlocks.cc @@ -1,7 +1,7 @@ -#include "nix/pathlocks.hh" -#include "nix/util.hh" -#include "nix/sync.hh" -#include "nix/signals.hh" +#include "nix/store/pathlocks.hh" +#include "nix/util/util.hh" +#include "nix/util/sync.hh" +#include "nix/util/signals.hh" #include #include diff --git a/src/libstore/unix/user-lock.cc b/src/libstore/unix/user-lock.cc index 4426f0768..770b00e2d 100644 --- a/src/libstore/unix/user-lock.cc +++ b/src/libstore/unix/user-lock.cc @@ -2,11 +2,11 @@ #include #include -#include "nix/user-lock.hh" -#include "nix/file-system.hh" -#include "nix/globals.hh" -#include "nix/pathlocks.hh" -#include "nix/users.hh" +#include "nix/store/user-lock.hh" +#include "nix/util/file-system.hh" +#include "nix/store/globals.hh" +#include "nix/store/pathlocks.hh" +#include "nix/util/users.hh" namespace nix { diff --git a/src/libstore/windows/pathlocks.cc b/src/libstore/windows/pathlocks.cc index 0161a8c32..0ba75853b 100644 --- a/src/libstore/windows/pathlocks.cc +++ b/src/libstore/windows/pathlocks.cc @@ -1,13 +1,13 @@ -#include "nix/logging.hh" -#include "nix/pathlocks.hh" -#include "nix/signals.hh" -#include "nix/util.hh" +#include "nix/util/logging.hh" +#include "nix/store/pathlocks.hh" +#include "nix/util/signals.hh" +#include "nix/util/util.hh" #ifdef _WIN32 # include # include # include -# include "nix/windows-error.hh" +# include "nix/util/windows-error.hh" namespace nix { diff --git a/src/libstore/worker-protocol-connection.cc b/src/libstore/worker-protocol-connection.cc index a30e808a7..d83be10e6 100644 --- a/src/libstore/worker-protocol-connection.cc +++ b/src/libstore/worker-protocol-connection.cc @@ -1,7 +1,7 @@ -#include "nix/worker-protocol-connection.hh" -#include "nix/worker-protocol-impl.hh" -#include "nix/build-result.hh" -#include "nix/derivations.hh" +#include "nix/store/worker-protocol-connection.hh" +#include "nix/store/worker-protocol-impl.hh" +#include "nix/store/build-result.hh" +#include "nix/store/derivations.hh" namespace nix { diff --git a/src/libstore/worker-protocol.cc b/src/libstore/worker-protocol.cc index e99723652..21b21a347 100644 --- a/src/libstore/worker-protocol.cc +++ b/src/libstore/worker-protocol.cc @@ -1,11 +1,11 @@ -#include "nix/serialise.hh" -#include "nix/path-with-outputs.hh" -#include "nix/store-api.hh" -#include "nix/build-result.hh" -#include "nix/worker-protocol.hh" -#include "nix/worker-protocol-impl.hh" -#include "nix/archive.hh" -#include "nix/path-info.hh" +#include "nix/util/serialise.hh" +#include "nix/store/path-with-outputs.hh" +#include "nix/store/store-api.hh" +#include "nix/store/build-result.hh" +#include "nix/store/worker-protocol.hh" +#include "nix/store/worker-protocol-impl.hh" +#include "nix/util/archive.hh" +#include "nix/store/path-info.hh" #include #include diff --git a/src/libutil-c/nix_api_util.cc b/src/libutil-c/nix_api_util.cc index 483c5484a..2254f18fa 100644 --- a/src/libutil-c/nix_api_util.cc +++ b/src/libutil-c/nix_api_util.cc @@ -1,8 +1,8 @@ #include "nix_api_util.h" -#include "nix/config-global.hh" -#include "nix/error.hh" +#include "nix/util/config-global.hh" +#include "nix/util/error.hh" #include "nix_api_util_internal.h" -#include "nix/util.hh" +#include "nix/util/util.hh" #include #include diff --git a/src/libutil-c/nix_api_util_internal.h b/src/libutil-c/nix_api_util_internal.h index 362d8c59a..8fbf3d91a 100644 --- a/src/libutil-c/nix_api_util_internal.h +++ b/src/libutil-c/nix_api_util_internal.h @@ -4,7 +4,7 @@ #include #include -#include "nix/error.hh" +#include "nix/util/error.hh" #include "nix_api_util.h" struct nix_c_context diff --git a/src/libutil-test-support/hash.cc b/src/libutil-test-support/hash.cc index 3614b42b3..d047f4073 100644 --- a/src/libutil-test-support/hash.cc +++ b/src/libutil-test-support/hash.cc @@ -2,9 +2,9 @@ #include -#include "nix/hash.hh" +#include "nix/util/hash.hh" -#include "nix/tests/hash.hh" +#include "nix/util/tests/hash.hh" namespace rc { using namespace nix; diff --git a/src/libutil-test-support/include/nix/meson.build b/src/libutil-test-support/include/nix/meson.build deleted file mode 100644 index 6490d19ac..000000000 --- a/src/libutil-test-support/include/nix/meson.build +++ /dev/null @@ -1,11 +0,0 @@ -# Public headers directory - -include_dirs = [include_directories('..')] - -headers = files( - 'tests/characterization.hh', - 'tests/gtest-with-params.hh', - 'tests/hash.hh', - 'tests/nix_api_util.hh', - 'tests/string_callback.hh', -) diff --git a/src/libutil-test-support/include/nix/tests/characterization.hh b/src/libutil-test-support/include/nix/util/tests/characterization.hh similarity index 95% rename from src/libutil-test-support/include/nix/tests/characterization.hh rename to src/libutil-test-support/include/nix/util/tests/characterization.hh index f90793633..3e8effe8b 100644 --- a/src/libutil-test-support/include/nix/tests/characterization.hh +++ b/src/libutil-test-support/include/nix/util/tests/characterization.hh @@ -3,9 +3,9 @@ #include -#include "nix/types.hh" -#include "nix/environment-variables.hh" -#include "nix/file-system.hh" +#include "nix/util/types.hh" +#include "nix/util/environment-variables.hh" +#include "nix/util/file-system.hh" namespace nix { diff --git a/src/libutil-test-support/include/nix/tests/gtest-with-params.hh b/src/libutil-test-support/include/nix/util/tests/gtest-with-params.hh similarity index 100% rename from src/libutil-test-support/include/nix/tests/gtest-with-params.hh rename to src/libutil-test-support/include/nix/util/tests/gtest-with-params.hh diff --git a/src/libutil-test-support/include/nix/tests/hash.hh b/src/libutil-test-support/include/nix/util/tests/hash.hh similarity index 86% rename from src/libutil-test-support/include/nix/tests/hash.hh rename to src/libutil-test-support/include/nix/util/tests/hash.hh index b965ac1a2..de832c12f 100644 --- a/src/libutil-test-support/include/nix/tests/hash.hh +++ b/src/libutil-test-support/include/nix/util/tests/hash.hh @@ -3,7 +3,7 @@ #include -#include "nix/hash.hh" +#include "nix/util/hash.hh" namespace rc { using namespace nix; diff --git a/src/libutil-test-support/include/nix/util/tests/meson.build b/src/libutil-test-support/include/nix/util/tests/meson.build new file mode 100644 index 000000000..f77dedff7 --- /dev/null +++ b/src/libutil-test-support/include/nix/util/tests/meson.build @@ -0,0 +1,11 @@ +# Public headers directory + +include_dirs = [include_directories('../../..')] + +headers = files( + 'characterization.hh', + 'gtest-with-params.hh', + 'hash.hh', + 'nix_api_util.hh', + 'string_callback.hh', +) diff --git a/src/libutil-test-support/include/nix/tests/nix_api_util.hh b/src/libutil-test-support/include/nix/util/tests/nix_api_util.hh similarity index 100% rename from src/libutil-test-support/include/nix/tests/nix_api_util.hh rename to src/libutil-test-support/include/nix/util/tests/nix_api_util.hh diff --git a/src/libutil-test-support/include/nix/tests/string_callback.hh b/src/libutil-test-support/include/nix/util/tests/string_callback.hh similarity index 100% rename from src/libutil-test-support/include/nix/tests/string_callback.hh rename to src/libutil-test-support/include/nix/util/tests/string_callback.hh diff --git a/src/libutil-test-support/include/nix/tests/tracing-file-system-object-sink.hh b/src/libutil-test-support/include/nix/util/tests/tracing-file-system-object-sink.hh similarity index 97% rename from src/libutil-test-support/include/nix/tests/tracing-file-system-object-sink.hh rename to src/libutil-test-support/include/nix/util/tests/tracing-file-system-object-sink.hh index f5d38d0f8..d721c13af 100644 --- a/src/libutil-test-support/include/nix/tests/tracing-file-system-object-sink.hh +++ b/src/libutil-test-support/include/nix/util/tests/tracing-file-system-object-sink.hh @@ -1,5 +1,5 @@ #pragma once -#include "nix/fs-sink.hh" +#include "nix/util/fs-sink.hh" namespace nix::test { diff --git a/src/libutil-test-support/meson.build b/src/libutil-test-support/meson.build index 265bdc249..ec6bc15d9 100644 --- a/src/libutil-test-support/meson.build +++ b/src/libutil-test-support/meson.build @@ -32,7 +32,7 @@ sources = files( 'string_callback.cc', ) -subdir('include/nix') +subdir('include/nix/util/tests') subdir('nix-meson-build-support/export-all-symbols') subdir('nix-meson-build-support/windows-version') @@ -49,7 +49,7 @@ this_library = library( install : true, ) -install_headers(headers, subdir : 'nix', preserve_path : true) +install_headers(headers, subdir : 'nix/util/tests', preserve_path : true) libraries_private = [] diff --git a/src/libutil-test-support/package.nix b/src/libutil-test-support/package.nix index 033758d7b..f8e92c271 100644 --- a/src/libutil-test-support/package.nix +++ b/src/libutil-test-support/package.nix @@ -28,7 +28,7 @@ mkMesonLibrary (finalAttrs: { ./.version ./meson.build # ./meson.options - ./include/nix/meson.build + ./include/nix/util/tests/meson.build (fileset.fileFilter (file: file.hasExt "cc") ./.) (fileset.fileFilter (file: file.hasExt "hh") ./.) ]; diff --git a/src/libutil-test-support/string_callback.cc b/src/libutil-test-support/string_callback.cc index 25781dc60..4f6a9cf40 100644 --- a/src/libutil-test-support/string_callback.cc +++ b/src/libutil-test-support/string_callback.cc @@ -1,4 +1,4 @@ -#include "nix/tests/string_callback.hh" +#include "nix/util/tests/string_callback.hh" namespace nix::testing { diff --git a/src/libutil-tests/args.cc b/src/libutil-tests/args.cc index abcc85641..2cc1a3438 100644 --- a/src/libutil-tests/args.cc +++ b/src/libutil-tests/args.cc @@ -1,5 +1,5 @@ -#include "nix/args.hh" -#include "nix/fs-sink.hh" +#include "nix/util/args.hh" +#include "nix/util/fs-sink.hh" #include #include diff --git a/src/libutil-tests/canon-path.cc b/src/libutil-tests/canon-path.cc index 6ef6d3c99..c6808bf66 100644 --- a/src/libutil-tests/canon-path.cc +++ b/src/libutil-tests/canon-path.cc @@ -1,4 +1,4 @@ -#include "nix/canon-path.hh" +#include "nix/util/canon-path.hh" #include diff --git a/src/libutil-tests/checked-arithmetic.cc b/src/libutil-tests/checked-arithmetic.cc index 4d98344fb..8056a430a 100644 --- a/src/libutil-tests/checked-arithmetic.cc +++ b/src/libutil-tests/checked-arithmetic.cc @@ -5,9 +5,9 @@ #include #include -#include "nix/checked-arithmetic.hh" +#include "nix/util/checked-arithmetic.hh" -#include "nix/tests/gtest-with-params.hh" +#include "nix/util/tests/gtest-with-params.hh" namespace rc { using namespace nix; diff --git a/src/libutil-tests/chunked-vector.cc b/src/libutil-tests/chunked-vector.cc index 16dedc63f..658581c2a 100644 --- a/src/libutil-tests/chunked-vector.cc +++ b/src/libutil-tests/chunked-vector.cc @@ -1,4 +1,4 @@ -#include "nix/chunked-vector.hh" +#include "nix/util/chunked-vector.hh" #include diff --git a/src/libutil-tests/closure.cc b/src/libutil-tests/closure.cc index b6b777bcc..6bbc128c2 100644 --- a/src/libutil-tests/closure.cc +++ b/src/libutil-tests/closure.cc @@ -1,4 +1,4 @@ -#include "nix/closure.hh" +#include "nix/util/closure.hh" #include namespace nix { diff --git a/src/libutil-tests/compression.cc b/src/libutil-tests/compression.cc index 7c7dfbd7b..de0c7cdb6 100644 --- a/src/libutil-tests/compression.cc +++ b/src/libutil-tests/compression.cc @@ -1,4 +1,4 @@ -#include "nix/compression.hh" +#include "nix/util/compression.hh" #include namespace nix { diff --git a/src/libutil-tests/config.cc b/src/libutil-tests/config.cc index aae410d2b..bc7db251b 100644 --- a/src/libutil-tests/config.cc +++ b/src/libutil-tests/config.cc @@ -1,5 +1,5 @@ -#include "nix/config.hh" -#include "nix/args.hh" +#include "nix/util/configuration.hh" +#include "nix/util/args.hh" #include #include diff --git a/src/libutil-tests/executable-path.cc b/src/libutil-tests/executable-path.cc index 041209882..7229b14e6 100644 --- a/src/libutil-tests/executable-path.cc +++ b/src/libutil-tests/executable-path.cc @@ -1,6 +1,6 @@ #include -#include "nix/executable-path.hh" +#include "nix/util/executable-path.hh" namespace nix { diff --git a/src/libutil-tests/file-content-address.cc b/src/libutil-tests/file-content-address.cc index 686114a9f..5cdf94edc 100644 --- a/src/libutil-tests/file-content-address.cc +++ b/src/libutil-tests/file-content-address.cc @@ -1,6 +1,6 @@ #include -#include "nix/file-content-address.hh" +#include "nix/util/file-content-address.hh" namespace nix { diff --git a/src/libutil-tests/file-system.cc b/src/libutil-tests/file-system.cc index 71e671a69..8c9eccc11 100644 --- a/src/libutil-tests/file-system.cc +++ b/src/libutil-tests/file-system.cc @@ -1,9 +1,9 @@ -#include "nix/util.hh" -#include "nix/types.hh" -#include "nix/file-system.hh" -#include "nix/processes.hh" -#include "nix/terminal.hh" -#include "nix/strings.hh" +#include "nix/util/util.hh" +#include "nix/util/types.hh" +#include "nix/util/file-system.hh" +#include "nix/util/processes.hh" +#include "nix/util/terminal.hh" +#include "nix/util/strings.hh" #include #include diff --git a/src/libutil-tests/git.cc b/src/libutil-tests/git.cc index b91d5019b..91432b76b 100644 --- a/src/libutil-tests/git.cc +++ b/src/libutil-tests/git.cc @@ -1,9 +1,9 @@ #include -#include "nix/git.hh" -#include "nix/memory-source-accessor.hh" +#include "nix/util/git.hh" +#include "nix/util/memory-source-accessor.hh" -#include "nix/tests/characterization.hh" +#include "nix/util/tests/characterization.hh" namespace nix { diff --git a/src/libutil-tests/hash.cc b/src/libutil-tests/hash.cc index 1ba69a573..3c71b0486 100644 --- a/src/libutil-tests/hash.cc +++ b/src/libutil-tests/hash.cc @@ -2,7 +2,7 @@ #include -#include "nix/hash.hh" +#include "nix/util/hash.hh" namespace nix { diff --git a/src/libutil-tests/hilite.cc b/src/libutil-tests/hilite.cc index e571a9bf6..98773afcf 100644 --- a/src/libutil-tests/hilite.cc +++ b/src/libutil-tests/hilite.cc @@ -1,4 +1,4 @@ -#include "nix/hilite.hh" +#include "nix/util/hilite.hh" #include diff --git a/src/libutil-tests/json-utils.cc b/src/libutil-tests/json-utils.cc index b8722bd30..051d86ec7 100644 --- a/src/libutil-tests/json-utils.cc +++ b/src/libutil-tests/json-utils.cc @@ -3,8 +3,8 @@ #include -#include "nix/error.hh" -#include "nix/json-utils.hh" +#include "nix/util/error.hh" +#include "nix/util/json-utils.hh" namespace nix { diff --git a/src/libutil-tests/logging.cc b/src/libutil-tests/logging.cc index ca89ee02f..494e9ce4c 100644 --- a/src/libutil-tests/logging.cc +++ b/src/libutil-tests/logging.cc @@ -1,7 +1,7 @@ #if 0 -#include "nix/logging.hh" -#include "nix/nixexpr.hh" +#include "nix/util/logging.hh" +#include "nix/expr/nixexpr.hh" #include #include diff --git a/src/libutil-tests/lru-cache.cc b/src/libutil-tests/lru-cache.cc index 98763588a..daa2a91fe 100644 --- a/src/libutil-tests/lru-cache.cc +++ b/src/libutil-tests/lru-cache.cc @@ -1,4 +1,4 @@ -#include "nix/lru-cache.hh" +#include "nix/util/lru-cache.hh" #include namespace nix { diff --git a/src/libutil-tests/nix_api_util.cc b/src/libutil-tests/nix_api_util.cc index f2d198aac..baaaa81fc 100644 --- a/src/libutil-tests/nix_api_util.cc +++ b/src/libutil-tests/nix_api_util.cc @@ -1,9 +1,9 @@ -#include "nix/config-global.hh" -#include "nix/args.hh" +#include "nix/util/config-global.hh" +#include "nix/util/args.hh" #include "nix_api_util.h" #include "nix_api_util_internal.h" -#include "nix/tests/nix_api_util.hh" -#include "nix/tests/string_callback.hh" +#include "nix/util/tests/nix_api_util.hh" +#include "nix/util/tests/string_callback.hh" #include diff --git a/src/libutil-tests/pool.cc b/src/libutil-tests/pool.cc index 8402768d3..c9f31f9a0 100644 --- a/src/libutil-tests/pool.cc +++ b/src/libutil-tests/pool.cc @@ -1,4 +1,4 @@ -#include "nix/pool.hh" +#include "nix/util/pool.hh" #include namespace nix { diff --git a/src/libutil-tests/position.cc b/src/libutil-tests/position.cc index 0726b89c0..fd65acd03 100644 --- a/src/libutil-tests/position.cc +++ b/src/libutil-tests/position.cc @@ -1,6 +1,6 @@ #include -#include "nix/position.hh" +#include "nix/util/position.hh" namespace nix { diff --git a/src/libutil-tests/processes.cc b/src/libutil-tests/processes.cc index 5d1435e3a..eb7561393 100644 --- a/src/libutil-tests/processes.cc +++ b/src/libutil-tests/processes.cc @@ -1,4 +1,4 @@ -#include "nix/processes.hh" +#include "nix/util/processes.hh" #include diff --git a/src/libutil-tests/references.cc b/src/libutil-tests/references.cc index 362629b55..622b3c35a 100644 --- a/src/libutil-tests/references.cc +++ b/src/libutil-tests/references.cc @@ -1,4 +1,4 @@ -#include "nix/references.hh" +#include "nix/util/references.hh" #include namespace nix { diff --git a/src/libutil-tests/spawn.cc b/src/libutil-tests/spawn.cc index 502d4e90b..594bced59 100644 --- a/src/libutil-tests/spawn.cc +++ b/src/libutil-tests/spawn.cc @@ -1,6 +1,6 @@ #include -#include "nix/processes.hh" +#include "nix/util/processes.hh" namespace nix { diff --git a/src/libutil-tests/strings.cc b/src/libutil-tests/strings.cc index 26b99263b..f5af4e0ff 100644 --- a/src/libutil-tests/strings.cc +++ b/src/libutil-tests/strings.cc @@ -1,8 +1,8 @@ #include #include -#include "nix/strings.hh" -#include "nix/error.hh" +#include "nix/util/strings.hh" +#include "nix/util/error.hh" namespace nix { diff --git a/src/libutil-tests/suggestions.cc b/src/libutil-tests/suggestions.cc index 36d0b7169..c58f033da 100644 --- a/src/libutil-tests/suggestions.cc +++ b/src/libutil-tests/suggestions.cc @@ -1,4 +1,4 @@ -#include "nix/suggestions.hh" +#include "nix/util/suggestions.hh" #include namespace nix { diff --git a/src/libutil-tests/terminal.cc b/src/libutil-tests/terminal.cc index 3d3296cc3..329c1a186 100644 --- a/src/libutil-tests/terminal.cc +++ b/src/libutil-tests/terminal.cc @@ -1,7 +1,7 @@ -#include "nix/util.hh" -#include "nix/types.hh" -#include "nix/terminal.hh" -#include "nix/strings.hh" +#include "nix/util/util.hh" +#include "nix/util/types.hh" +#include "nix/util/terminal.hh" +#include "nix/util/strings.hh" #include #include diff --git a/src/libutil-tests/url.cc b/src/libutil-tests/url.cc index 89a461c2c..4c089c106 100644 --- a/src/libutil-tests/url.cc +++ b/src/libutil-tests/url.cc @@ -1,4 +1,4 @@ -#include "nix/url.hh" +#include "nix/util/url.hh" #include namespace nix { diff --git a/src/libutil-tests/util.cc b/src/libutil-tests/util.cc index 53b7cd208..954867be8 100644 --- a/src/libutil-tests/util.cc +++ b/src/libutil-tests/util.cc @@ -1,8 +1,8 @@ -#include "nix/util.hh" -#include "nix/types.hh" -#include "nix/file-system.hh" -#include "nix/terminal.hh" -#include "nix/strings.hh" +#include "nix/util/util.hh" +#include "nix/util/types.hh" +#include "nix/util/file-system.hh" +#include "nix/util/terminal.hh" +#include "nix/util/strings.hh" #include #include diff --git a/src/libutil-tests/xml-writer.cc b/src/libutil-tests/xml-writer.cc index 7fc1f3154..000af700c 100644 --- a/src/libutil-tests/xml-writer.cc +++ b/src/libutil-tests/xml-writer.cc @@ -1,4 +1,4 @@ -#include "nix/xml-writer.hh" +#include "nix/util/xml-writer.hh" #include #include diff --git a/src/libutil/archive.cc b/src/libutil/archive.cc index 2c7c91dd0..143d01085 100644 --- a/src/libutil/archive.cc +++ b/src/libutil/archive.cc @@ -5,12 +5,12 @@ #include // for strcasecmp -#include "nix/archive.hh" -#include "nix/config-global.hh" -#include "nix/posix-source-accessor.hh" -#include "nix/source-path.hh" -#include "nix/file-system.hh" -#include "nix/signals.hh" +#include "nix/util/archive.hh" +#include "nix/util/config-global.hh" +#include "nix/util/posix-source-accessor.hh" +#include "nix/util/source-path.hh" +#include "nix/util/file-system.hh" +#include "nix/util/signals.hh" namespace nix { diff --git a/src/libutil/args.cc b/src/libutil/args.cc index 184318cc4..b4177bf93 100644 --- a/src/libutil/args.cc +++ b/src/libutil/args.cc @@ -1,10 +1,10 @@ -#include "nix/args.hh" -#include "nix/args/root.hh" -#include "nix/hash.hh" -#include "nix/environment-variables.hh" -#include "nix/signals.hh" -#include "nix/users.hh" -#include "nix/json-utils.hh" +#include "nix/util/args.hh" +#include "nix/util/args/root.hh" +#include "nix/util/hash.hh" +#include "nix/util/environment-variables.hh" +#include "nix/util/signals.hh" +#include "nix/util/users.hh" +#include "nix/util/json-utils.hh" #include #include diff --git a/src/libutil/canon-path.cc b/src/libutil/canon-path.cc index c6f48ac32..33ac700f0 100644 --- a/src/libutil/canon-path.cc +++ b/src/libutil/canon-path.cc @@ -1,7 +1,7 @@ -#include "nix/canon-path.hh" -#include "nix/util.hh" -#include "nix/file-path-impl.hh" -#include "nix/strings-inline.hh" +#include "nix/util/canon-path.hh" +#include "nix/util/util.hh" +#include "nix/util/file-path-impl.hh" +#include "nix/util/strings-inline.hh" namespace nix { diff --git a/src/libutil/compression.cc b/src/libutil/compression.cc index 788ad7109..0e38620d4 100644 --- a/src/libutil/compression.cc +++ b/src/libutil/compression.cc @@ -1,8 +1,8 @@ -#include "nix/compression.hh" -#include "nix/signals.hh" -#include "nix/tarfile.hh" -#include "nix/finally.hh" -#include "nix/logging.hh" +#include "nix/util/compression.hh" +#include "nix/util/signals.hh" +#include "nix/util/tarfile.hh" +#include "nix/util/finally.hh" +#include "nix/util/logging.hh" #include #include diff --git a/src/libutil/compute-levels.cc b/src/libutil/compute-levels.cc index 2e3c84404..c80b99404 100644 --- a/src/libutil/compute-levels.cc +++ b/src/libutil/compute-levels.cc @@ -1,4 +1,4 @@ -#include "nix/types.hh" +#include "nix/util/types.hh" #include "util-config-private.hh" diff --git a/src/libutil/config-global.cc b/src/libutil/config-global.cc index b325d09e7..10d176c51 100644 --- a/src/libutil/config-global.cc +++ b/src/libutil/config-global.cc @@ -1,4 +1,4 @@ -#include "nix/config-global.hh" +#include "nix/util/config-global.hh" #include diff --git a/src/libutil/config.cc b/src/libutil/configuration.cc similarity index 97% rename from src/libutil/config.cc rename to src/libutil/configuration.cc index b108dd58a..0f5a6a432 100644 --- a/src/libutil/config.cc +++ b/src/libutil/configuration.cc @@ -1,16 +1,16 @@ -#include "nix/config.hh" -#include "nix/args.hh" -#include "nix/abstract-setting-to-json.hh" -#include "nix/environment-variables.hh" -#include "nix/experimental-features.hh" -#include "nix/util.hh" -#include "nix/file-system.hh" +#include "nix/util/configuration.hh" +#include "nix/util/args.hh" +#include "nix/util/abstract-setting-to-json.hh" +#include "nix/util/environment-variables.hh" +#include "nix/util/experimental-features.hh" +#include "nix/util/util.hh" +#include "nix/util/file-system.hh" -#include "nix/config-impl.hh" +#include "nix/util/config-impl.hh" #include -#include "nix/strings.hh" +#include "nix/util/strings.hh" namespace nix { diff --git a/src/libutil/current-process.cc b/src/libutil/current-process.cc index 11655c55c..4103c0515 100644 --- a/src/libutil/current-process.cc +++ b/src/libutil/current-process.cc @@ -1,12 +1,12 @@ #include #include -#include "nix/current-process.hh" -#include "nix/util.hh" -#include "nix/finally.hh" -#include "nix/file-system.hh" -#include "nix/processes.hh" -#include "nix/signals.hh" +#include "nix/util/current-process.hh" +#include "nix/util/util.hh" +#include "nix/util/finally.hh" +#include "nix/util/file-system.hh" +#include "nix/util/processes.hh" +#include "nix/util/signals.hh" #include #ifdef __APPLE__ @@ -15,8 +15,8 @@ #if __linux__ # include -# include "nix/cgroup.hh" -# include "nix/namespaces.hh" +# include "nix/util/cgroup.hh" +# include "nix/util/namespaces.hh" #endif namespace nix { diff --git a/src/libutil/english.cc b/src/libutil/english.cc index 9ccc7ed3b..e697b8c30 100644 --- a/src/libutil/english.cc +++ b/src/libutil/english.cc @@ -1,4 +1,4 @@ -#include "nix/english.hh" +#include "nix/util/english.hh" namespace nix { diff --git a/src/libutil/environment-variables.cc b/src/libutil/environment-variables.cc index f2948807a..0b668f125 100644 --- a/src/libutil/environment-variables.cc +++ b/src/libutil/environment-variables.cc @@ -1,5 +1,5 @@ -#include "nix/util.hh" -#include "nix/environment-variables.hh" +#include "nix/util/util.hh" +#include "nix/util/environment-variables.hh" extern char ** environ __attribute__((weak)); diff --git a/src/libutil/error.cc b/src/libutil/error.cc index bd0baaeff..0ceaa4e76 100644 --- a/src/libutil/error.cc +++ b/src/libutil/error.cc @@ -1,14 +1,14 @@ #include -#include "nix/error.hh" -#include "nix/environment-variables.hh" -#include "nix/signals.hh" -#include "nix/terminal.hh" -#include "nix/position.hh" +#include "nix/util/error.hh" +#include "nix/util/environment-variables.hh" +#include "nix/util/signals.hh" +#include "nix/util/terminal.hh" +#include "nix/util/position.hh" #include #include -#include "nix/serialise.hh" +#include "nix/util/serialise.hh" #include namespace nix { diff --git a/src/libutil/executable-path.cc b/src/libutil/executable-path.cc index 24e3484f2..ed1ac49ce 100644 --- a/src/libutil/executable-path.cc +++ b/src/libutil/executable-path.cc @@ -1,8 +1,8 @@ -#include "nix/environment-variables.hh" -#include "nix/executable-path.hh" -#include "nix/strings-inline.hh" -#include "nix/util.hh" -#include "nix/file-path-impl.hh" +#include "nix/util/environment-variables.hh" +#include "nix/util/executable-path.hh" +#include "nix/util/strings-inline.hh" +#include "nix/util/util.hh" +#include "nix/util/file-path-impl.hh" namespace nix { diff --git a/src/libutil/exit.cc b/src/libutil/exit.cc index e177cfa31..3c59e46af 100644 --- a/src/libutil/exit.cc +++ b/src/libutil/exit.cc @@ -1,4 +1,4 @@ -#include "nix/exit.hh" +#include "nix/util/exit.hh" namespace nix { diff --git a/src/libutil/experimental-features.cc b/src/libutil/experimental-features.cc index c05c3e9ec..348caa44e 100644 --- a/src/libutil/experimental-features.cc +++ b/src/libutil/experimental-features.cc @@ -1,6 +1,6 @@ -#include "nix/experimental-features.hh" -#include "nix/fmt.hh" -#include "nix/util.hh" +#include "nix/util/experimental-features.hh" +#include "nix/util/fmt.hh" +#include "nix/util/util.hh" #include diff --git a/src/libutil/file-content-address.cc b/src/libutil/file-content-address.cc index 71eb34611..673e1dff1 100644 --- a/src/libutil/file-content-address.cc +++ b/src/libutil/file-content-address.cc @@ -1,7 +1,7 @@ -#include "nix/file-content-address.hh" -#include "nix/archive.hh" -#include "nix/git.hh" -#include "nix/source-path.hh" +#include "nix/util/file-content-address.hh" +#include "nix/util/archive.hh" +#include "nix/util/git.hh" +#include "nix/util/source-path.hh" namespace nix { diff --git a/src/libutil/file-descriptor.cc b/src/libutil/file-descriptor.cc index 2af1364b1..042edbf55 100644 --- a/src/libutil/file-descriptor.cc +++ b/src/libutil/file-descriptor.cc @@ -1,12 +1,12 @@ -#include "nix/serialise.hh" -#include "nix/util.hh" +#include "nix/util/serialise.hh" +#include "nix/util/util.hh" #include #include #ifdef _WIN32 # include # include -# include "nix/windows-error.hh" +# include "nix/util/windows-error.hh" #endif namespace nix { diff --git a/src/libutil/file-system.cc b/src/libutil/file-system.cc index 8a309d120..ebc9a9663 100644 --- a/src/libutil/file-system.cc +++ b/src/libutil/file-system.cc @@ -1,11 +1,11 @@ -#include "nix/environment-variables.hh" -#include "nix/file-system.hh" -#include "nix/file-path.hh" -#include "nix/file-path-impl.hh" -#include "nix/signals.hh" -#include "nix/finally.hh" -#include "nix/serialise.hh" -#include "nix/util.hh" +#include "nix/util/environment-variables.hh" +#include "nix/util/file-system.hh" +#include "nix/util/file-path.hh" +#include "nix/util/file-path-impl.hh" +#include "nix/util/signals.hh" +#include "nix/util/finally.hh" +#include "nix/util/serialise.hh" +#include "nix/util/util.hh" #include #include @@ -25,7 +25,7 @@ # include #endif -#include "nix/strings-inline.hh" +#include "nix/util/strings-inline.hh" #include "util-config-private.hh" diff --git a/src/libutil/fs-sink.cc b/src/libutil/fs-sink.cc index 7b8ba1189..aa46b3cd2 100644 --- a/src/libutil/fs-sink.cc +++ b/src/libutil/fs-sink.cc @@ -1,13 +1,13 @@ #include -#include "nix/error.hh" -#include "nix/config-global.hh" -#include "nix/fs-sink.hh" +#include "nix/util/error.hh" +#include "nix/util/config-global.hh" +#include "nix/util/fs-sink.hh" #if _WIN32 # include -# include "nix/file-path.hh" -# include "nix/windows-error.hh" +# include "nix/util/file-path.hh" +# include "nix/util/windows-error.hh" #endif #include "util-config-private.hh" diff --git a/src/libutil/git.cc b/src/libutil/git.cc index c6466bdda..45cda1c2c 100644 --- a/src/libutil/git.cc +++ b/src/libutil/git.cc @@ -5,12 +5,12 @@ #include #include // for strcasecmp -#include "nix/signals.hh" -#include "nix/config.hh" -#include "nix/hash.hh" +#include "nix/util/signals.hh" +#include "nix/util/configuration.hh" +#include "nix/util/hash.hh" -#include "nix/git.hh" -#include "nix/serialise.hh" +#include "nix/util/git.hh" +#include "nix/util/serialise.hh" namespace nix::git { diff --git a/src/libutil/hash.cc b/src/libutil/hash.cc index 22eca6014..0a654b914 100644 --- a/src/libutil/hash.cc +++ b/src/libutil/hash.cc @@ -6,11 +6,11 @@ #include #include -#include "nix/args.hh" -#include "nix/hash.hh" -#include "nix/archive.hh" -#include "nix/config.hh" -#include "nix/split.hh" +#include "nix/util/args.hh" +#include "nix/util/hash.hh" +#include "nix/util/archive.hh" +#include "nix/util/configuration.hh" +#include "nix/util/split.hh" #include #include diff --git a/src/libutil/hilite.cc b/src/libutil/hilite.cc index 6d843e091..cfadd6af9 100644 --- a/src/libutil/hilite.cc +++ b/src/libutil/hilite.cc @@ -1,4 +1,4 @@ -#include "nix/hilite.hh" +#include "nix/util/hilite.hh" namespace nix { diff --git a/src/libutil/include/nix/abstract-setting-to-json.hh b/src/libutil/include/nix/util/abstract-setting-to-json.hh similarity index 83% rename from src/libutil/include/nix/abstract-setting-to-json.hh rename to src/libutil/include/nix/util/abstract-setting-to-json.hh index 313b18faf..2848f8afe 100644 --- a/src/libutil/include/nix/abstract-setting-to-json.hh +++ b/src/libutil/include/nix/util/abstract-setting-to-json.hh @@ -2,8 +2,8 @@ ///@file #include -#include "nix/config.hh" -#include "nix/json-utils.hh" +#include "nix/util/configuration.hh" +#include "nix/util/json-utils.hh" namespace nix { template diff --git a/src/libutil/include/nix/ansicolor.hh b/src/libutil/include/nix/util/ansicolor.hh similarity index 100% rename from src/libutil/include/nix/ansicolor.hh rename to src/libutil/include/nix/util/ansicolor.hh diff --git a/src/libutil/include/nix/archive.hh b/src/libutil/include/nix/util/archive.hh similarity index 95% rename from src/libutil/include/nix/archive.hh rename to src/libutil/include/nix/util/archive.hh index 9131f49fa..ae3274fa6 100644 --- a/src/libutil/include/nix/archive.hh +++ b/src/libutil/include/nix/util/archive.hh @@ -1,9 +1,9 @@ #pragma once ///@file -#include "nix/types.hh" -#include "nix/serialise.hh" -#include "nix/fs-sink.hh" +#include "nix/util/types.hh" +#include "nix/util/serialise.hh" +#include "nix/util/fs-sink.hh" namespace nix { diff --git a/src/libutil/include/nix/args.hh b/src/libutil/include/nix/util/args.hh similarity index 99% rename from src/libutil/include/nix/args.hh rename to src/libutil/include/nix/util/args.hh index 987d14f9e..77c4fb5b6 100644 --- a/src/libutil/include/nix/args.hh +++ b/src/libutil/include/nix/util/args.hh @@ -9,9 +9,9 @@ #include -#include "nix/types.hh" -#include "nix/experimental-features.hh" -#include "nix/ref.hh" +#include "nix/util/types.hh" +#include "nix/util/experimental-features.hh" +#include "nix/util/ref.hh" namespace nix { diff --git a/src/libutil/include/nix/args/root.hh b/src/libutil/include/nix/util/args/root.hh similarity index 98% rename from src/libutil/include/nix/args/root.hh rename to src/libutil/include/nix/util/args/root.hh index bb83b85a5..cdc9be613 100644 --- a/src/libutil/include/nix/args/root.hh +++ b/src/libutil/include/nix/util/args/root.hh @@ -1,6 +1,6 @@ #pragma once -#include "nix/args.hh" +#include "nix/util/args.hh" namespace nix { diff --git a/src/libutil/include/nix/callback.hh b/src/libutil/include/nix/util/callback.hh similarity index 100% rename from src/libutil/include/nix/callback.hh rename to src/libutil/include/nix/util/callback.hh diff --git a/src/libutil/include/nix/canon-path.hh b/src/libutil/include/nix/util/canon-path.hh similarity index 100% rename from src/libutil/include/nix/canon-path.hh rename to src/libutil/include/nix/util/canon-path.hh diff --git a/src/libutil/include/nix/checked-arithmetic.hh b/src/libutil/include/nix/util/checked-arithmetic.hh similarity index 100% rename from src/libutil/include/nix/checked-arithmetic.hh rename to src/libutil/include/nix/util/checked-arithmetic.hh diff --git a/src/libutil/include/nix/chunked-vector.hh b/src/libutil/include/nix/util/chunked-vector.hh similarity index 98% rename from src/libutil/include/nix/chunked-vector.hh rename to src/libutil/include/nix/util/chunked-vector.hh index 34d5bbb1d..96a717556 100644 --- a/src/libutil/include/nix/chunked-vector.hh +++ b/src/libutil/include/nix/util/chunked-vector.hh @@ -6,7 +6,7 @@ #include #include -#include "nix/error.hh" +#include "nix/util/error.hh" namespace nix { diff --git a/src/libutil/include/nix/closure.hh b/src/libutil/include/nix/util/closure.hh similarity index 98% rename from src/libutil/include/nix/closure.hh rename to src/libutil/include/nix/util/closure.hh index c8fc7c9a4..54b18ab3d 100644 --- a/src/libutil/include/nix/closure.hh +++ b/src/libutil/include/nix/util/closure.hh @@ -3,7 +3,7 @@ #include #include -#include "nix/sync.hh" +#include "nix/util/sync.hh" using std::set; diff --git a/src/libutil/include/nix/comparator.hh b/src/libutil/include/nix/util/comparator.hh similarity index 100% rename from src/libutil/include/nix/comparator.hh rename to src/libutil/include/nix/util/comparator.hh diff --git a/src/libutil/include/nix/compression.hh b/src/libutil/include/nix/util/compression.hh similarity index 89% rename from src/libutil/include/nix/compression.hh rename to src/libutil/include/nix/util/compression.hh index 25f479e48..15d869e88 100644 --- a/src/libutil/include/nix/compression.hh +++ b/src/libutil/include/nix/util/compression.hh @@ -1,9 +1,9 @@ #pragma once ///@file -#include "nix/ref.hh" -#include "nix/types.hh" -#include "nix/serialise.hh" +#include "nix/util/ref.hh" +#include "nix/util/types.hh" +#include "nix/util/serialise.hh" #include diff --git a/src/libutil/include/nix/compute-levels.hh b/src/libutil/include/nix/util/compute-levels.hh similarity index 71% rename from src/libutil/include/nix/compute-levels.hh rename to src/libutil/include/nix/util/compute-levels.hh index d77eece93..401547793 100644 --- a/src/libutil/include/nix/compute-levels.hh +++ b/src/libutil/include/nix/util/compute-levels.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "nix/types.hh" +#include "nix/util/types.hh" namespace nix { diff --git a/src/libutil/include/nix/config-global.hh b/src/libutil/include/nix/util/config-global.hh similarity index 94% rename from src/libutil/include/nix/config-global.hh rename to src/libutil/include/nix/util/config-global.hh index b0e8ad2ce..b47ee0ad1 100644 --- a/src/libutil/include/nix/config-global.hh +++ b/src/libutil/include/nix/util/config-global.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "nix/config.hh" +#include "nix/util/configuration.hh" namespace nix { diff --git a/src/libutil/include/nix/config-impl.hh b/src/libutil/include/nix/util/config-impl.hh similarity index 98% rename from src/libutil/include/nix/config-impl.hh rename to src/libutil/include/nix/util/config-impl.hh index b02e27f50..15e0c9554 100644 --- a/src/libutil/include/nix/config-impl.hh +++ b/src/libutil/include/nix/util/config-impl.hh @@ -12,8 +12,8 @@ * instantiation. */ -#include "nix/config.hh" -#include "nix/args.hh" +#include "nix/util/configuration.hh" +#include "nix/util/args.hh" namespace nix { diff --git a/src/libutil/include/nix/config.hh b/src/libutil/include/nix/util/configuration.hh similarity index 99% rename from src/libutil/include/nix/config.hh rename to src/libutil/include/nix/util/configuration.hh index f4135af64..34cefd73b 100644 --- a/src/libutil/include/nix/config.hh +++ b/src/libutil/include/nix/util/configuration.hh @@ -7,8 +7,8 @@ #include -#include "nix/types.hh" -#include "nix/experimental-features.hh" +#include "nix/util/types.hh" +#include "nix/util/experimental-features.hh" namespace nix { diff --git a/src/libutil/include/nix/current-process.hh b/src/libutil/include/nix/util/current-process.hh similarity index 96% rename from src/libutil/include/nix/current-process.hh rename to src/libutil/include/nix/util/current-process.hh index d98f4e752..b2c92a34c 100644 --- a/src/libutil/include/nix/current-process.hh +++ b/src/libutil/include/nix/util/current-process.hh @@ -7,7 +7,7 @@ # include #endif -#include "nix/types.hh" +#include "nix/util/types.hh" namespace nix { diff --git a/src/libutil/include/nix/english.hh b/src/libutil/include/nix/util/english.hh similarity index 100% rename from src/libutil/include/nix/english.hh rename to src/libutil/include/nix/util/english.hh diff --git a/src/libutil/include/nix/environment-variables.hh b/src/libutil/include/nix/util/environment-variables.hh similarity index 95% rename from src/libutil/include/nix/environment-variables.hh rename to src/libutil/include/nix/util/environment-variables.hh index 9a5f364a3..d6c7472fc 100644 --- a/src/libutil/include/nix/environment-variables.hh +++ b/src/libutil/include/nix/util/environment-variables.hh @@ -8,8 +8,8 @@ #include -#include "nix/types.hh" -#include "nix/file-path.hh" +#include "nix/util/types.hh" +#include "nix/util/file-path.hh" namespace nix { diff --git a/src/libutil/include/nix/error.hh b/src/libutil/include/nix/util/error.hh similarity index 98% rename from src/libutil/include/nix/error.hh rename to src/libutil/include/nix/util/error.hh index 6ac4497cb..fa60d4c61 100644 --- a/src/libutil/include/nix/error.hh +++ b/src/libutil/include/nix/util/error.hh @@ -15,8 +15,8 @@ * See libutil/tests/logging.cc for usage examples. */ -#include "nix/suggestions.hh" -#include "nix/fmt.hh" +#include "nix/util/suggestions.hh" +#include "nix/util/fmt.hh" #include #include @@ -51,7 +51,7 @@ struct LinesOfCode { }; /* NOTE: position.hh recursively depends on source-path.hh -> source-accessor.hh - -> hash.hh -> config.hh -> experimental-features.hh -> error.hh -> Pos. + -> hash.hh -> configuration.hh -> experimental-features.hh -> error.hh -> Pos. There are other such cycles. Thus, Pos has to be an incomplete type in this header. But since ErrorInfo/Trace have to refer to Pos, they have to use pointer indirection via std::shared_ptr diff --git a/src/libutil/include/nix/exec.hh b/src/libutil/include/nix/util/exec.hh similarity index 89% rename from src/libutil/include/nix/exec.hh rename to src/libutil/include/nix/util/exec.hh index dc14691e2..a362cef35 100644 --- a/src/libutil/include/nix/exec.hh +++ b/src/libutil/include/nix/util/exec.hh @@ -1,6 +1,6 @@ #pragma once -#include "nix/os-string.hh" +#include "nix/util/os-string.hh" namespace nix { diff --git a/src/libutil/include/nix/executable-path.hh b/src/libutil/include/nix/util/executable-path.hh similarity index 98% rename from src/libutil/include/nix/executable-path.hh rename to src/libutil/include/nix/util/executable-path.hh index 3af4a24cf..700d296d5 100644 --- a/src/libutil/include/nix/executable-path.hh +++ b/src/libutil/include/nix/util/executable-path.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "nix/file-system.hh" +#include "nix/util/file-system.hh" namespace nix { diff --git a/src/libutil/include/nix/exit.hh b/src/libutil/include/nix/util/exit.hh similarity index 100% rename from src/libutil/include/nix/exit.hh rename to src/libutil/include/nix/util/exit.hh diff --git a/src/libutil/include/nix/experimental-features.hh b/src/libutil/include/nix/util/experimental-features.hh similarity index 97% rename from src/libutil/include/nix/experimental-features.hh rename to src/libutil/include/nix/util/experimental-features.hh index 946bb65b3..06dd7062b 100644 --- a/src/libutil/include/nix/experimental-features.hh +++ b/src/libutil/include/nix/util/experimental-features.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "nix/error.hh" -#include "nix/types.hh" +#include "nix/util/error.hh" +#include "nix/util/types.hh" #include diff --git a/src/libutil/include/nix/file-content-address.hh b/src/libutil/include/nix/util/file-content-address.hh similarity index 99% rename from src/libutil/include/nix/file-content-address.hh rename to src/libutil/include/nix/util/file-content-address.hh index c56debd2b..0922604f8 100644 --- a/src/libutil/include/nix/file-content-address.hh +++ b/src/libutil/include/nix/util/file-content-address.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "nix/source-accessor.hh" +#include "nix/util/source-accessor.hh" namespace nix { diff --git a/src/libutil/include/nix/file-descriptor.hh b/src/libutil/include/nix/util/file-descriptor.hh similarity index 98% rename from src/libutil/include/nix/file-descriptor.hh rename to src/libutil/include/nix/util/file-descriptor.hh index 785756a0f..2e8b4ce10 100644 --- a/src/libutil/include/nix/file-descriptor.hh +++ b/src/libutil/include/nix/util/file-descriptor.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "nix/types.hh" -#include "nix/error.hh" +#include "nix/util/types.hh" +#include "nix/util/error.hh" #ifdef _WIN32 # define WIN32_LEAN_AND_MEAN diff --git a/src/libutil/include/nix/file-path-impl.hh b/src/libutil/include/nix/util/file-path-impl.hh similarity index 100% rename from src/libutil/include/nix/file-path-impl.hh rename to src/libutil/include/nix/util/file-path-impl.hh diff --git a/src/libutil/include/nix/file-path.hh b/src/libutil/include/nix/util/file-path.hh similarity index 93% rename from src/libutil/include/nix/file-path.hh rename to src/libutil/include/nix/util/file-path.hh index 15bceac13..deff076f1 100644 --- a/src/libutil/include/nix/file-path.hh +++ b/src/libutil/include/nix/util/file-path.hh @@ -3,8 +3,8 @@ #include -#include "nix/types.hh" -#include "nix/os-string.hh" +#include "nix/util/types.hh" +#include "nix/util/os-string.hh" namespace nix { diff --git a/src/libutil/include/nix/file-system.hh b/src/libutil/include/nix/util/file-system.hh similarity index 98% rename from src/libutil/include/nix/file-system.hh rename to src/libutil/include/nix/util/file-system.hh index 1981d8d4d..78b1cb46c 100644 --- a/src/libutil/include/nix/file-system.hh +++ b/src/libutil/include/nix/util/file-system.hh @@ -5,11 +5,11 @@ * Utiltities for working with the file sytem and file paths. */ -#include "nix/types.hh" -#include "nix/error.hh" -#include "nix/logging.hh" -#include "nix/file-descriptor.hh" -#include "nix/file-path.hh" +#include "nix/util/types.hh" +#include "nix/util/error.hh" +#include "nix/util/logging.hh" +#include "nix/util/file-descriptor.hh" +#include "nix/util/file-path.hh" #include #include diff --git a/src/libutil/include/nix/finally.hh b/src/libutil/include/nix/util/finally.hh similarity index 100% rename from src/libutil/include/nix/finally.hh rename to src/libutil/include/nix/util/finally.hh diff --git a/src/libutil/include/nix/fmt.hh b/src/libutil/include/nix/util/fmt.hh similarity index 99% rename from src/libutil/include/nix/fmt.hh rename to src/libutil/include/nix/util/fmt.hh index 45d9f43b7..5435a4ebf 100644 --- a/src/libutil/include/nix/fmt.hh +++ b/src/libutil/include/nix/util/fmt.hh @@ -3,7 +3,7 @@ #include #include -#include "nix/ansicolor.hh" +#include "nix/util/ansicolor.hh" namespace nix { diff --git a/src/libutil/include/nix/fs-sink.hh b/src/libutil/include/nix/util/fs-sink.hh similarity index 96% rename from src/libutil/include/nix/fs-sink.hh rename to src/libutil/include/nix/util/fs-sink.hh index 30803e63e..1c34fba93 100644 --- a/src/libutil/include/nix/fs-sink.hh +++ b/src/libutil/include/nix/util/fs-sink.hh @@ -1,9 +1,9 @@ #pragma once ///@file -#include "nix/serialise.hh" -#include "nix/source-accessor.hh" -#include "nix/file-system.hh" +#include "nix/util/serialise.hh" +#include "nix/util/source-accessor.hh" +#include "nix/util/file-system.hh" namespace nix { diff --git a/src/libutil/include/nix/git.hh b/src/libutil/include/nix/util/git.hh similarity index 97% rename from src/libutil/include/nix/git.hh rename to src/libutil/include/nix/util/git.hh index 2dc1bb796..9bdb30bb9 100644 --- a/src/libutil/include/nix/git.hh +++ b/src/libutil/include/nix/util/git.hh @@ -5,11 +5,11 @@ #include #include -#include "nix/types.hh" -#include "nix/serialise.hh" -#include "nix/hash.hh" -#include "nix/source-path.hh" -#include "nix/fs-sink.hh" +#include "nix/util/types.hh" +#include "nix/util/serialise.hh" +#include "nix/util/hash.hh" +#include "nix/util/source-path.hh" +#include "nix/util/fs-sink.hh" namespace nix::git { diff --git a/src/libutil/include/nix/hash.hh b/src/libutil/include/nix/util/hash.hh similarity index 97% rename from src/libutil/include/nix/hash.hh rename to src/libutil/include/nix/util/hash.hh index 3c9adebac..f3cc4cc6c 100644 --- a/src/libutil/include/nix/hash.hh +++ b/src/libutil/include/nix/util/hash.hh @@ -1,10 +1,10 @@ #pragma once ///@file -#include "nix/config.hh" -#include "nix/types.hh" -#include "nix/serialise.hh" -#include "nix/file-system.hh" +#include "nix/util/configuration.hh" +#include "nix/util/types.hh" +#include "nix/util/serialise.hh" +#include "nix/util/file-system.hh" namespace nix { diff --git a/src/libutil/include/nix/hilite.hh b/src/libutil/include/nix/util/hilite.hh similarity index 100% rename from src/libutil/include/nix/hilite.hh rename to src/libutil/include/nix/util/hilite.hh diff --git a/src/libutil/include/nix/json-impls.hh b/src/libutil/include/nix/util/json-impls.hh similarity index 100% rename from src/libutil/include/nix/json-impls.hh rename to src/libutil/include/nix/util/json-impls.hh diff --git a/src/libutil/include/nix/json-utils.hh b/src/libutil/include/nix/util/json-utils.hh similarity index 99% rename from src/libutil/include/nix/json-utils.hh rename to src/libutil/include/nix/util/json-utils.hh index 96ffcd3c0..9308d4392 100644 --- a/src/libutil/include/nix/json-utils.hh +++ b/src/libutil/include/nix/util/json-utils.hh @@ -4,7 +4,7 @@ #include #include -#include "nix/types.hh" +#include "nix/util/types.hh" namespace nix { diff --git a/src/libutil/include/nix/logging.hh b/src/libutil/include/nix/util/logging.hh similarity index 98% rename from src/libutil/include/nix/logging.hh rename to src/libutil/include/nix/util/logging.hh index c83ad2316..9210229bf 100644 --- a/src/libutil/include/nix/logging.hh +++ b/src/libutil/include/nix/util/logging.hh @@ -1,10 +1,10 @@ #pragma once ///@file -#include "nix/error.hh" -#include "nix/config.hh" -#include "nix/file-descriptor.hh" -#include "nix/finally.hh" +#include "nix/util/error.hh" +#include "nix/util/configuration.hh" +#include "nix/util/file-descriptor.hh" +#include "nix/util/finally.hh" #include diff --git a/src/libutil/include/nix/lru-cache.hh b/src/libutil/include/nix/util/lru-cache.hh similarity index 100% rename from src/libutil/include/nix/lru-cache.hh rename to src/libutil/include/nix/util/lru-cache.hh diff --git a/src/libutil/include/nix/memory-source-accessor.hh b/src/libutil/include/nix/util/memory-source-accessor.hh similarity index 97% rename from src/libutil/include/nix/memory-source-accessor.hh rename to src/libutil/include/nix/util/memory-source-accessor.hh index 08ab3f2d4..d09ba153d 100644 --- a/src/libutil/include/nix/memory-source-accessor.hh +++ b/src/libutil/include/nix/util/memory-source-accessor.hh @@ -1,6 +1,6 @@ -#include "nix/source-path.hh" -#include "nix/fs-sink.hh" -#include "nix/variant-wrapper.hh" +#include "nix/util/source-path.hh" +#include "nix/util/fs-sink.hh" +#include "nix/util/variant-wrapper.hh" namespace nix { diff --git a/src/libutil/include/nix/meson.build b/src/libutil/include/nix/util/meson.build similarity index 95% rename from src/libutil/include/nix/meson.build rename to src/libutil/include/nix/util/meson.build index 3da9837ed..e30b8dacd 100644 --- a/src/libutil/include/nix/meson.build +++ b/src/libutil/include/nix/util/meson.build @@ -1,6 +1,6 @@ # Public headers directory -include_dirs = [include_directories('..')] +include_dirs = [include_directories('../..')] headers = files( 'abstract-setting-to-json.hh', @@ -18,7 +18,7 @@ headers = files( 'compute-levels.hh', 'config-global.hh', 'config-impl.hh', - 'config.hh', + 'configuration.hh', 'current-process.hh', 'english.hh', 'environment-variables.hh', diff --git a/src/libutil/include/nix/muxable-pipe.hh b/src/libutil/include/nix/util/muxable-pipe.hh similarity index 93% rename from src/libutil/include/nix/muxable-pipe.hh rename to src/libutil/include/nix/util/muxable-pipe.hh index e4d6a74a3..d912627fb 100644 --- a/src/libutil/include/nix/muxable-pipe.hh +++ b/src/libutil/include/nix/util/muxable-pipe.hh @@ -1,16 +1,16 @@ #pragma once ///@file -#include "nix/file-descriptor.hh" +#include "nix/util/file-descriptor.hh" #ifdef _WIN32 -# include "nix/windows-async-pipe.hh" +# include "nix/util/windows-async-pipe.hh" #endif #ifndef _WIN32 # include #else # include -# include "nix/windows-error.hh" +# include "nix/util/windows-error.hh" #endif namespace nix { diff --git a/src/libutil/include/nix/os-string.hh b/src/libutil/include/nix/util/os-string.hh similarity index 100% rename from src/libutil/include/nix/os-string.hh rename to src/libutil/include/nix/util/os-string.hh diff --git a/src/libutil/include/nix/pool.hh b/src/libutil/include/nix/util/pool.hh similarity index 98% rename from src/libutil/include/nix/pool.hh rename to src/libutil/include/nix/util/pool.hh index 65b789ba0..a63db50de 100644 --- a/src/libutil/include/nix/pool.hh +++ b/src/libutil/include/nix/util/pool.hh @@ -7,8 +7,8 @@ #include #include -#include "nix/sync.hh" -#include "nix/ref.hh" +#include "nix/util/sync.hh" +#include "nix/util/ref.hh" namespace nix { diff --git a/src/libutil/include/nix/pos-idx.hh b/src/libutil/include/nix/util/pos-idx.hh similarity index 100% rename from src/libutil/include/nix/pos-idx.hh rename to src/libutil/include/nix/util/pos-idx.hh diff --git a/src/libutil/include/nix/pos-table.hh b/src/libutil/include/nix/util/pos-table.hh similarity index 96% rename from src/libutil/include/nix/pos-table.hh rename to src/libutil/include/nix/util/pos-table.hh index 9f4ff2e0b..ef170e0f1 100644 --- a/src/libutil/include/nix/pos-table.hh +++ b/src/libutil/include/nix/util/pos-table.hh @@ -4,9 +4,9 @@ #include #include -#include "nix/pos-idx.hh" -#include "nix/position.hh" -#include "nix/sync.hh" +#include "nix/util/pos-idx.hh" +#include "nix/util/position.hh" +#include "nix/util/sync.hh" namespace nix { diff --git a/src/libutil/include/nix/position.hh b/src/libutil/include/nix/util/position.hh similarity index 98% rename from src/libutil/include/nix/position.hh rename to src/libutil/include/nix/util/position.hh index 34457a824..f9c984976 100644 --- a/src/libutil/include/nix/position.hh +++ b/src/libutil/include/nix/util/position.hh @@ -9,7 +9,7 @@ #include #include -#include "nix/source-path.hh" +#include "nix/util/source-path.hh" namespace nix { diff --git a/src/libutil/include/nix/posix-source-accessor.hh b/src/libutil/include/nix/util/posix-source-accessor.hh similarity index 98% rename from src/libutil/include/nix/posix-source-accessor.hh rename to src/libutil/include/nix/util/posix-source-accessor.hh index d81e9246c..ea65b148f 100644 --- a/src/libutil/include/nix/posix-source-accessor.hh +++ b/src/libutil/include/nix/util/posix-source-accessor.hh @@ -1,6 +1,6 @@ #pragma once -#include "nix/source-accessor.hh" +#include "nix/util/source-accessor.hh" namespace nix { diff --git a/src/libutil/include/nix/processes.hh b/src/libutil/include/nix/util/processes.hh similarity index 94% rename from src/libutil/include/nix/processes.hh rename to src/libutil/include/nix/util/processes.hh index 80ea14223..ef7bddf2f 100644 --- a/src/libutil/include/nix/processes.hh +++ b/src/libutil/include/nix/util/processes.hh @@ -1,11 +1,11 @@ #pragma once ///@file -#include "nix/types.hh" -#include "nix/error.hh" -#include "nix/file-descriptor.hh" -#include "nix/logging.hh" -#include "nix/ansicolor.hh" +#include "nix/util/types.hh" +#include "nix/util/error.hh" +#include "nix/util/file-descriptor.hh" +#include "nix/util/logging.hh" +#include "nix/util/ansicolor.hh" #include #include diff --git a/src/libutil/include/nix/ref.hh b/src/libutil/include/nix/util/ref.hh similarity index 100% rename from src/libutil/include/nix/ref.hh rename to src/libutil/include/nix/util/ref.hh diff --git a/src/libutil/include/nix/references.hh b/src/libutil/include/nix/util/references.hh similarity index 97% rename from src/libutil/include/nix/references.hh rename to src/libutil/include/nix/util/references.hh index b608f7015..89a42e009 100644 --- a/src/libutil/include/nix/references.hh +++ b/src/libutil/include/nix/util/references.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "nix/hash.hh" +#include "nix/util/hash.hh" namespace nix { diff --git a/src/libutil/include/nix/regex-combinators.hh b/src/libutil/include/nix/util/regex-combinators.hh similarity index 100% rename from src/libutil/include/nix/regex-combinators.hh rename to src/libutil/include/nix/util/regex-combinators.hh diff --git a/src/libutil/include/nix/repair-flag.hh b/src/libutil/include/nix/util/repair-flag.hh similarity index 100% rename from src/libutil/include/nix/repair-flag.hh rename to src/libutil/include/nix/util/repair-flag.hh diff --git a/src/libutil/include/nix/serialise.hh b/src/libutil/include/nix/util/serialise.hh similarity index 99% rename from src/libutil/include/nix/serialise.hh rename to src/libutil/include/nix/util/serialise.hh index ef49a43b6..d28c8e9a6 100644 --- a/src/libutil/include/nix/serialise.hh +++ b/src/libutil/include/nix/util/serialise.hh @@ -4,9 +4,9 @@ #include #include -#include "nix/types.hh" -#include "nix/util.hh" -#include "nix/file-descriptor.hh" +#include "nix/util/types.hh" +#include "nix/util/util.hh" +#include "nix/util/file-descriptor.hh" namespace boost::context { struct stack_context; } diff --git a/src/libutil/include/nix/signals.hh b/src/libutil/include/nix/util/signals.hh similarity index 89% rename from src/libutil/include/nix/signals.hh rename to src/libutil/include/nix/util/signals.hh index b4953525e..45130a90c 100644 --- a/src/libutil/include/nix/signals.hh +++ b/src/libutil/include/nix/util/signals.hh @@ -1,9 +1,9 @@ #pragma once ///@file -#include "nix/types.hh" -#include "nix/error.hh" -#include "nix/logging.hh" +#include "nix/util/types.hh" +#include "nix/util/error.hh" +#include "nix/util/logging.hh" #include @@ -62,4 +62,4 @@ struct ReceiveInterrupts; } -#include "nix/signals-impl.hh" +#include "nix/util/signals-impl.hh" diff --git a/src/libutil/include/nix/signature/local-keys.hh b/src/libutil/include/nix/util/signature/local-keys.hh similarity index 98% rename from src/libutil/include/nix/signature/local-keys.hh rename to src/libutil/include/nix/util/signature/local-keys.hh index 368976b11..85918f906 100644 --- a/src/libutil/include/nix/signature/local-keys.hh +++ b/src/libutil/include/nix/util/signature/local-keys.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "nix/types.hh" +#include "nix/util/types.hh" #include diff --git a/src/libutil/include/nix/signature/signer.hh b/src/libutil/include/nix/util/signature/signer.hh similarity index 94% rename from src/libutil/include/nix/signature/signer.hh rename to src/libutil/include/nix/util/signature/signer.hh index 3eeb75608..ca2905eef 100644 --- a/src/libutil/include/nix/signature/signer.hh +++ b/src/libutil/include/nix/util/signature/signer.hh @@ -1,7 +1,7 @@ #pragma once -#include "nix/types.hh" -#include "nix/signature/local-keys.hh" +#include "nix/util/types.hh" +#include "nix/util/signature/local-keys.hh" #include #include diff --git a/src/libutil/include/nix/source-accessor.hh b/src/libutil/include/nix/util/source-accessor.hh similarity index 98% rename from src/libutil/include/nix/source-accessor.hh rename to src/libutil/include/nix/util/source-accessor.hh index 5efc177fc..3a28b2c2b 100644 --- a/src/libutil/include/nix/source-accessor.hh +++ b/src/libutil/include/nix/util/source-accessor.hh @@ -2,9 +2,9 @@ #include -#include "nix/canon-path.hh" -#include "nix/hash.hh" -#include "nix/ref.hh" +#include "nix/util/canon-path.hh" +#include "nix/util/hash.hh" +#include "nix/util/ref.hh" namespace nix { diff --git a/src/libutil/include/nix/source-path.hh b/src/libutil/include/nix/util/source-path.hh similarity index 96% rename from src/libutil/include/nix/source-path.hh rename to src/libutil/include/nix/util/source-path.hh index 119a67016..c0cba0241 100644 --- a/src/libutil/include/nix/source-path.hh +++ b/src/libutil/include/nix/util/source-path.hh @@ -5,10 +5,10 @@ * @brief SourcePath */ -#include "nix/ref.hh" -#include "nix/canon-path.hh" -#include "nix/source-accessor.hh" -#include "nix/std-hash.hh" +#include "nix/util/ref.hh" +#include "nix/util/canon-path.hh" +#include "nix/util/source-accessor.hh" +#include "nix/util/std-hash.hh" namespace nix { diff --git a/src/libutil/include/nix/split.hh b/src/libutil/include/nix/util/split.hh similarity index 97% rename from src/libutil/include/nix/split.hh rename to src/libutil/include/nix/util/split.hh index 2d7c490b1..24a73fea8 100644 --- a/src/libutil/include/nix/split.hh +++ b/src/libutil/include/nix/util/split.hh @@ -4,7 +4,7 @@ #include #include -#include "nix/util.hh" +#include "nix/util/util.hh" namespace nix { diff --git a/src/libutil/include/nix/std-hash.hh b/src/libutil/include/nix/util/std-hash.hh similarity index 100% rename from src/libutil/include/nix/std-hash.hh rename to src/libutil/include/nix/util/std-hash.hh diff --git a/src/libutil/include/nix/strings-inline.hh b/src/libutil/include/nix/util/strings-inline.hh similarity index 98% rename from src/libutil/include/nix/strings-inline.hh rename to src/libutil/include/nix/util/strings-inline.hh index 38cf285e0..d99b686fc 100644 --- a/src/libutil/include/nix/strings-inline.hh +++ b/src/libutil/include/nix/util/strings-inline.hh @@ -1,6 +1,6 @@ #pragma once -#include "nix/strings.hh" +#include "nix/util/strings.hh" namespace nix { diff --git a/src/libutil/include/nix/strings.hh b/src/libutil/include/nix/util/strings.hh similarity index 100% rename from src/libutil/include/nix/strings.hh rename to src/libutil/include/nix/util/strings.hh diff --git a/src/libutil/include/nix/suggestions.hh b/src/libutil/include/nix/util/suggestions.hh similarity index 98% rename from src/libutil/include/nix/suggestions.hh rename to src/libutil/include/nix/util/suggestions.hh index 5517c20a6..16496379c 100644 --- a/src/libutil/include/nix/suggestions.hh +++ b/src/libutil/include/nix/util/suggestions.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "nix/types.hh" +#include "nix/util/types.hh" #include namespace nix { diff --git a/src/libutil/include/nix/sync.hh b/src/libutil/include/nix/util/sync.hh similarity index 99% rename from src/libutil/include/nix/sync.hh rename to src/libutil/include/nix/util/sync.hh index 25c062ac8..0c3e1f528 100644 --- a/src/libutil/include/nix/sync.hh +++ b/src/libutil/include/nix/util/sync.hh @@ -7,7 +7,7 @@ #include #include -#include "nix/error.hh" +#include "nix/util/error.hh" namespace nix { diff --git a/src/libutil/include/nix/tarfile.hh b/src/libutil/include/nix/util/tarfile.hh similarity index 95% rename from src/libutil/include/nix/tarfile.hh rename to src/libutil/include/nix/util/tarfile.hh index aea91f90e..2005d13ca 100644 --- a/src/libutil/include/nix/tarfile.hh +++ b/src/libutil/include/nix/util/tarfile.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "nix/serialise.hh" -#include "nix/fs-sink.hh" +#include "nix/util/serialise.hh" +#include "nix/util/fs-sink.hh" #include namespace nix { diff --git a/src/libutil/include/nix/terminal.hh b/src/libutil/include/nix/util/terminal.hh similarity index 100% rename from src/libutil/include/nix/terminal.hh rename to src/libutil/include/nix/util/terminal.hh diff --git a/src/libutil/include/nix/thread-pool.hh b/src/libutil/include/nix/util/thread-pool.hh similarity index 98% rename from src/libutil/include/nix/thread-pool.hh rename to src/libutil/include/nix/util/thread-pool.hh index e3b2a29b9..92009e396 100644 --- a/src/libutil/include/nix/thread-pool.hh +++ b/src/libutil/include/nix/util/thread-pool.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "nix/error.hh" -#include "nix/sync.hh" +#include "nix/util/error.hh" +#include "nix/util/sync.hh" #include #include diff --git a/src/libutil/include/nix/topo-sort.hh b/src/libutil/include/nix/util/topo-sort.hh similarity index 97% rename from src/libutil/include/nix/topo-sort.hh rename to src/libutil/include/nix/util/topo-sort.hh index ed37ca01e..77a9ce421 100644 --- a/src/libutil/include/nix/topo-sort.hh +++ b/src/libutil/include/nix/util/topo-sort.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "nix/error.hh" +#include "nix/util/error.hh" namespace nix { diff --git a/src/libutil/include/nix/types.hh b/src/libutil/include/nix/util/types.hh similarity index 100% rename from src/libutil/include/nix/types.hh rename to src/libutil/include/nix/util/types.hh diff --git a/src/libutil/include/nix/unix-domain-socket.hh b/src/libutil/include/nix/util/unix-domain-socket.hh similarity index 95% rename from src/libutil/include/nix/unix-domain-socket.hh rename to src/libutil/include/nix/util/unix-domain-socket.hh index 87508f9e4..704999ec1 100644 --- a/src/libutil/include/nix/unix-domain-socket.hh +++ b/src/libutil/include/nix/util/unix-domain-socket.hh @@ -1,8 +1,8 @@ #pragma once ///@file -#include "nix/types.hh" -#include "nix/file-descriptor.hh" +#include "nix/util/types.hh" +#include "nix/util/file-descriptor.hh" #ifdef _WIN32 # include diff --git a/src/libutil/include/nix/url-parts.hh b/src/libutil/include/nix/util/url-parts.hh similarity index 100% rename from src/libutil/include/nix/url-parts.hh rename to src/libutil/include/nix/util/url-parts.hh diff --git a/src/libutil/include/nix/url.hh b/src/libutil/include/nix/util/url.hh similarity index 98% rename from src/libutil/include/nix/url.hh rename to src/libutil/include/nix/util/url.hh index 071d5092f..ced846787 100644 --- a/src/libutil/include/nix/url.hh +++ b/src/libutil/include/nix/util/url.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "nix/error.hh" +#include "nix/util/error.hh" namespace nix { diff --git a/src/libutil/include/nix/users.hh b/src/libutil/include/nix/util/users.hh similarity index 97% rename from src/libutil/include/nix/users.hh rename to src/libutil/include/nix/util/users.hh index d48b8b9bf..1d467173c 100644 --- a/src/libutil/include/nix/users.hh +++ b/src/libutil/include/nix/util/users.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "nix/types.hh" +#include "nix/util/types.hh" #ifndef _WIN32 # include diff --git a/src/libutil/include/nix/util.hh b/src/libutil/include/nix/util/util.hh similarity index 98% rename from src/libutil/include/nix/util.hh rename to src/libutil/include/nix/util/util.hh index 7ece2bd7b..5a4530798 100644 --- a/src/libutil/include/nix/util.hh +++ b/src/libutil/include/nix/util/util.hh @@ -1,9 +1,9 @@ #pragma once ///@file -#include "nix/types.hh" -#include "nix/error.hh" -#include "nix/logging.hh" +#include "nix/util/types.hh" +#include "nix/util/error.hh" +#include "nix/util/logging.hh" #include @@ -11,7 +11,7 @@ #include #include -#include "nix/strings.hh" +#include "nix/util/strings.hh" namespace nix { diff --git a/src/libutil/include/nix/variant-wrapper.hh b/src/libutil/include/nix/util/variant-wrapper.hh similarity index 100% rename from src/libutil/include/nix/variant-wrapper.hh rename to src/libutil/include/nix/util/variant-wrapper.hh diff --git a/src/libutil/include/nix/xml-writer.hh b/src/libutil/include/nix/util/xml-writer.hh similarity index 100% rename from src/libutil/include/nix/xml-writer.hh rename to src/libutil/include/nix/util/xml-writer.hh diff --git a/src/libutil/json-utils.cc b/src/libutil/json-utils.cc index aff8abb9a..2c8edfce8 100644 --- a/src/libutil/json-utils.cc +++ b/src/libutil/json-utils.cc @@ -1,6 +1,6 @@ -#include "nix/json-utils.hh" -#include "nix/error.hh" -#include "nix/types.hh" +#include "nix/util/json-utils.hh" +#include "nix/util/error.hh" +#include "nix/util/types.hh" #include #include #include diff --git a/src/libutil/linux/cgroup.cc b/src/libutil/linux/cgroup.cc index 7b3c3fa3b..890797c91 100644 --- a/src/libutil/linux/cgroup.cc +++ b/src/libutil/linux/cgroup.cc @@ -1,8 +1,8 @@ -#include "nix/cgroup.hh" -#include "nix/signals.hh" -#include "nix/util.hh" -#include "nix/file-system.hh" -#include "nix/finally.hh" +#include "nix/util/cgroup.hh" +#include "nix/util/signals.hh" +#include "nix/util/util.hh" +#include "nix/util/file-system.hh" +#include "nix/util/finally.hh" #include #include diff --git a/src/libutil/linux/include/nix/cgroup.hh b/src/libutil/linux/include/nix/util/cgroup.hh similarity index 96% rename from src/libutil/linux/include/nix/cgroup.hh rename to src/libutil/linux/include/nix/util/cgroup.hh index 91c7de9d1..6a41c6b44 100644 --- a/src/libutil/linux/include/nix/cgroup.hh +++ b/src/libutil/linux/include/nix/util/cgroup.hh @@ -4,7 +4,7 @@ #include #include -#include "nix/types.hh" +#include "nix/util/types.hh" namespace nix { diff --git a/src/libutil/linux/include/nix/meson.build b/src/libutil/linux/include/nix/util/meson.build similarity index 64% rename from src/libutil/linux/include/nix/meson.build rename to src/libutil/linux/include/nix/util/meson.build index 285c1489b..9587aa916 100644 --- a/src/libutil/linux/include/nix/meson.build +++ b/src/libutil/linux/include/nix/util/meson.build @@ -1,6 +1,6 @@ # Public headers directory -include_dirs += include_directories('..') +include_dirs += include_directories('../..') headers += files( 'cgroup.hh', diff --git a/src/libutil/linux/include/nix/namespaces.hh b/src/libutil/linux/include/nix/util/namespaces.hh similarity index 95% rename from src/libutil/linux/include/nix/namespaces.hh rename to src/libutil/linux/include/nix/util/namespaces.hh index 3eb5f6a14..59db745d3 100644 --- a/src/libutil/linux/include/nix/namespaces.hh +++ b/src/libutil/linux/include/nix/util/namespaces.hh @@ -3,7 +3,7 @@ #include -#include "nix/types.hh" +#include "nix/util/types.hh" namespace nix { diff --git a/src/libutil/linux/meson.build b/src/libutil/linux/meson.build index 40907ed0d..bfda8b1a6 100644 --- a/src/libutil/linux/meson.build +++ b/src/libutil/linux/meson.build @@ -3,4 +3,4 @@ sources += files( 'namespaces.cc', ) -subdir('include/nix') +subdir('include/nix/util') diff --git a/src/libutil/linux/namespaces.cc b/src/libutil/linux/namespaces.cc index a53734a2f..405866c0b 100644 --- a/src/libutil/linux/namespaces.cc +++ b/src/libutil/linux/namespaces.cc @@ -1,13 +1,13 @@ -#include "nix/current-process.hh" -#include "nix/util.hh" -#include "nix/finally.hh" -#include "nix/file-system.hh" -#include "nix/processes.hh" -#include "nix/signals.hh" +#include "nix/util/current-process.hh" +#include "nix/util/util.hh" +#include "nix/util/finally.hh" +#include "nix/util/file-system.hh" +#include "nix/util/processes.hh" +#include "nix/util/signals.hh" #include #include -#include "nix/cgroup.hh" +#include "nix/util/cgroup.hh" #include diff --git a/src/libutil/logging.cc b/src/libutil/logging.cc index 39cacc22a..b26694d2d 100644 --- a/src/libutil/logging.cc +++ b/src/libutil/logging.cc @@ -1,11 +1,11 @@ -#include "nix/logging.hh" -#include "nix/file-descriptor.hh" -#include "nix/environment-variables.hh" -#include "nix/terminal.hh" -#include "nix/util.hh" -#include "nix/config-global.hh" -#include "nix/source-path.hh" -#include "nix/position.hh" +#include "nix/util/logging.hh" +#include "nix/util/file-descriptor.hh" +#include "nix/util/environment-variables.hh" +#include "nix/util/terminal.hh" +#include "nix/util/util.hh" +#include "nix/util/config-global.hh" +#include "nix/util/source-path.hh" +#include "nix/util/position.hh" #include #include diff --git a/src/libutil/memory-source-accessor.cc b/src/libutil/memory-source-accessor.cc index 7c8414fb0..7764ff946 100644 --- a/src/libutil/memory-source-accessor.cc +++ b/src/libutil/memory-source-accessor.cc @@ -1,4 +1,4 @@ -#include "nix/memory-source-accessor.hh" +#include "nix/util/memory-source-accessor.hh" namespace nix { diff --git a/src/libutil/meson.build b/src/libutil/meson.build index c7509f030..2a07e4a91 100644 --- a/src/libutil/meson.build +++ b/src/libutil/meson.build @@ -113,7 +113,7 @@ sources = [config_priv_h] + files( 'canon-path.cc', 'compression.cc', 'compute-levels.cc', - 'config.cc', + 'configuration.cc', 'config-global.cc', 'current-process.cc', 'english.cc', @@ -155,7 +155,7 @@ sources = [config_priv_h] + files( 'xml-writer.cc', ) -subdir('include/nix') +subdir('include/nix/util') if not cxx.has_header('widechar_width.h', required : false) # use vendored widechar_width.h @@ -185,7 +185,7 @@ this_library = library( install : true, ) -install_headers(headers, subdir : 'nix', preserve_path : true) +install_headers(headers, subdir : 'nix/util', preserve_path : true) libraries_private = [] if host_machine.system() == 'windows' diff --git a/src/libutil/mounted-source-accessor.cc b/src/libutil/mounted-source-accessor.cc index aa00cbd8e..b7de2afbf 100644 --- a/src/libutil/mounted-source-accessor.cc +++ b/src/libutil/mounted-source-accessor.cc @@ -1,4 +1,4 @@ -#include "nix/source-accessor.hh" +#include "nix/util/source-accessor.hh" namespace nix { diff --git a/src/libutil/package.nix b/src/libutil/package.nix index 0c410dfab..17c84ff18 100644 --- a/src/libutil/package.nix +++ b/src/libutil/package.nix @@ -34,13 +34,13 @@ mkMesonLibrary (finalAttrs: { ./widecharwidth ./meson.build ./meson.options - ./include/nix/meson.build + ./include/nix/util/meson.build ./linux/meson.build - ./linux/include/nix/meson.build + ./linux/include/nix/util/meson.build ./unix/meson.build - ./unix/include/nix/meson.build + ./unix/include/nix/util/meson.build ./windows/meson.build - ./windows/include/nix/meson.build + ./windows/include/nix/util/meson.build (fileset.fileFilter (file: file.hasExt "cc") ./.) (fileset.fileFilter (file: file.hasExt "hh") ./.) ]; diff --git a/src/libutil/pos-table.cc b/src/libutil/pos-table.cc index 59234e3fc..5a61ffbc5 100644 --- a/src/libutil/pos-table.cc +++ b/src/libutil/pos-table.cc @@ -1,4 +1,4 @@ -#include "nix/pos-table.hh" +#include "nix/util/pos-table.hh" #include diff --git a/src/libutil/position.cc b/src/libutil/position.cc index 515be245b..dfe0e2abb 100644 --- a/src/libutil/position.cc +++ b/src/libutil/position.cc @@ -1,4 +1,4 @@ -#include "nix/position.hh" +#include "nix/util/position.hh" namespace nix { diff --git a/src/libutil/posix-source-accessor.cc b/src/libutil/posix-source-accessor.cc index 5da9fa623..5c7b4654b 100644 --- a/src/libutil/posix-source-accessor.cc +++ b/src/libutil/posix-source-accessor.cc @@ -1,7 +1,7 @@ -#include "nix/posix-source-accessor.hh" -#include "nix/source-path.hh" -#include "nix/signals.hh" -#include "nix/sync.hh" +#include "nix/util/posix-source-accessor.hh" +#include "nix/util/source-path.hh" +#include "nix/util/signals.hh" +#include "nix/util/sync.hh" #include diff --git a/src/libutil/references.cc b/src/libutil/references.cc index 46c22c09c..66ad9d37c 100644 --- a/src/libutil/references.cc +++ b/src/libutil/references.cc @@ -1,6 +1,6 @@ -#include "nix/references.hh" -#include "nix/hash.hh" -#include "nix/archive.hh" +#include "nix/util/references.hh" +#include "nix/util/hash.hh" +#include "nix/util/archive.hh" #include #include diff --git a/src/libutil/serialise.cc b/src/libutil/serialise.cc index 415ccf3a0..55397c6d4 100644 --- a/src/libutil/serialise.cc +++ b/src/libutil/serialise.cc @@ -1,6 +1,6 @@ -#include "nix/serialise.hh" -#include "nix/signals.hh" -#include "nix/util.hh" +#include "nix/util/serialise.hh" +#include "nix/util/signals.hh" +#include "nix/util/util.hh" #include #include @@ -11,7 +11,7 @@ #ifdef _WIN32 # include # include -# include "nix/windows-error.hh" +# include "nix/util/windows-error.hh" #else # include #endif diff --git a/src/libutil/signature/local-keys.cc b/src/libutil/signature/local-keys.cc index 86d3dfe3c..1f7f2c7de 100644 --- a/src/libutil/signature/local-keys.cc +++ b/src/libutil/signature/local-keys.cc @@ -1,7 +1,7 @@ -#include "nix/signature/local-keys.hh" +#include "nix/util/signature/local-keys.hh" -#include "nix/file-system.hh" -#include "nix/util.hh" +#include "nix/util/file-system.hh" +#include "nix/util/util.hh" #include namespace nix { diff --git a/src/libutil/signature/signer.cc b/src/libutil/signature/signer.cc index 4a61b67eb..46445e9e9 100644 --- a/src/libutil/signature/signer.cc +++ b/src/libutil/signature/signer.cc @@ -1,5 +1,5 @@ -#include "nix/signature/signer.hh" -#include "nix/error.hh" +#include "nix/util/signature/signer.hh" +#include "nix/util/error.hh" #include diff --git a/src/libutil/source-accessor.cc b/src/libutil/source-accessor.cc index 738d7f2f1..fc0d6cff1 100644 --- a/src/libutil/source-accessor.cc +++ b/src/libutil/source-accessor.cc @@ -1,5 +1,5 @@ -#include "nix/source-accessor.hh" -#include "nix/archive.hh" +#include "nix/util/source-accessor.hh" +#include "nix/util/archive.hh" namespace nix { diff --git a/src/libutil/source-path.cc b/src/libutil/source-path.cc index 12150c223..6d42fa95f 100644 --- a/src/libutil/source-path.cc +++ b/src/libutil/source-path.cc @@ -1,4 +1,4 @@ -#include "nix/source-path.hh" +#include "nix/util/source-path.hh" namespace nix { diff --git a/src/libutil/strings.cc b/src/libutil/strings.cc index 43c9a0815..7ce37d73c 100644 --- a/src/libutil/strings.cc +++ b/src/libutil/strings.cc @@ -2,9 +2,9 @@ #include #include -#include "nix/strings-inline.hh" -#include "nix/os-string.hh" -#include "nix/error.hh" +#include "nix/util/strings-inline.hh" +#include "nix/util/os-string.hh" +#include "nix/util/error.hh" namespace nix { diff --git a/src/libutil/suggestions.cc b/src/libutil/suggestions.cc index 0f593ada0..0105c30e7 100644 --- a/src/libutil/suggestions.cc +++ b/src/libutil/suggestions.cc @@ -1,6 +1,6 @@ -#include "nix/suggestions.hh" -#include "nix/ansicolor.hh" -#include "nix/terminal.hh" +#include "nix/util/suggestions.hh" +#include "nix/util/ansicolor.hh" +#include "nix/util/terminal.hh" #include #include diff --git a/src/libutil/tarfile.cc b/src/libutil/tarfile.cc index aec05e092..eb5cd8288 100644 --- a/src/libutil/tarfile.cc +++ b/src/libutil/tarfile.cc @@ -1,10 +1,10 @@ #include #include -#include "nix/finally.hh" -#include "nix/serialise.hh" -#include "nix/tarfile.hh" -#include "nix/file-system.hh" +#include "nix/util/finally.hh" +#include "nix/util/serialise.hh" +#include "nix/util/tarfile.hh" +#include "nix/util/file-system.hh" namespace nix { diff --git a/src/libutil/terminal.cc b/src/libutil/terminal.cc index 233edabb4..77766fae1 100644 --- a/src/libutil/terminal.cc +++ b/src/libutil/terminal.cc @@ -1,6 +1,6 @@ -#include "nix/terminal.hh" -#include "nix/environment-variables.hh" -#include "nix/sync.hh" +#include "nix/util/terminal.hh" +#include "nix/util/environment-variables.hh" +#include "nix/util/sync.hh" #if _WIN32 # include diff --git a/src/libutil/thread-pool.cc b/src/libutil/thread-pool.cc index 6b7f2d017..8958bc550 100644 --- a/src/libutil/thread-pool.cc +++ b/src/libutil/thread-pool.cc @@ -1,6 +1,6 @@ -#include "nix/thread-pool.hh" -#include "nix/signals.hh" -#include "nix/util.hh" +#include "nix/util/thread-pool.hh" +#include "nix/util/signals.hh" +#include "nix/util/util.hh" namespace nix { diff --git a/src/libutil/union-source-accessor.cc b/src/libutil/union-source-accessor.cc index e24d6f2bd..9950f6049 100644 --- a/src/libutil/union-source-accessor.cc +++ b/src/libutil/union-source-accessor.cc @@ -1,4 +1,4 @@ -#include "nix/source-accessor.hh" +#include "nix/util/source-accessor.hh" namespace nix { diff --git a/src/libutil/unix-domain-socket.cc b/src/libutil/unix-domain-socket.cc index 831dd666c..8722c8f05 100644 --- a/src/libutil/unix-domain-socket.cc +++ b/src/libutil/unix-domain-socket.cc @@ -1,6 +1,6 @@ -#include "nix/file-system.hh" -#include "nix/unix-domain-socket.hh" -#include "nix/util.hh" +#include "nix/util/file-system.hh" +#include "nix/util/unix-domain-socket.hh" +#include "nix/util/util.hh" #ifdef _WIN32 # include @@ -8,7 +8,7 @@ #else # include # include -# include "nix/processes.hh" +# include "nix/util/processes.hh" #endif #include diff --git a/src/libutil/unix/environment-variables.cc b/src/libutil/unix/environment-variables.cc index 9814cbcc2..0e1ed2794 100644 --- a/src/libutil/unix/environment-variables.cc +++ b/src/libutil/unix/environment-variables.cc @@ -1,6 +1,6 @@ #include -#include "nix/environment-variables.hh" +#include "nix/util/environment-variables.hh" namespace nix { diff --git a/src/libutil/unix/file-descriptor.cc b/src/libutil/unix/file-descriptor.cc index 2911df54f..6ce307252 100644 --- a/src/libutil/unix/file-descriptor.cc +++ b/src/libutil/unix/file-descriptor.cc @@ -1,7 +1,7 @@ -#include "nix/file-system.hh" -#include "nix/signals.hh" -#include "nix/finally.hh" -#include "nix/serialise.hh" +#include "nix/util/file-system.hh" +#include "nix/util/signals.hh" +#include "nix/util/finally.hh" +#include "nix/util/serialise.hh" #include #include diff --git a/src/libutil/unix/file-path.cc b/src/libutil/unix/file-path.cc index 3dd613972..0fb1f468c 100644 --- a/src/libutil/unix/file-path.cc +++ b/src/libutil/unix/file-path.cc @@ -3,8 +3,8 @@ #include #include -#include "nix/file-path.hh" -#include "nix/util.hh" +#include "nix/util/file-path.hh" +#include "nix/util/util.hh" namespace nix { diff --git a/src/libutil/unix/file-system.cc b/src/libutil/unix/file-system.cc index d79f4c64c..e62b7d1c2 100644 --- a/src/libutil/unix/file-system.cc +++ b/src/libutil/unix/file-system.cc @@ -8,7 +8,7 @@ #include #include -#include "nix/file-system.hh" +#include "nix/util/file-system.hh" #include "util-unix-config-private.hh" diff --git a/src/libutil/unix/include/nix/meson.build b/src/libutil/unix/include/nix/util/meson.build similarity index 66% rename from src/libutil/unix/include/nix/meson.build rename to src/libutil/unix/include/nix/util/meson.build index 5f3095ab1..b6f1c40d3 100644 --- a/src/libutil/unix/include/nix/meson.build +++ b/src/libutil/unix/include/nix/util/meson.build @@ -1,6 +1,6 @@ # Public headers directory -include_dirs += include_directories('..') +include_dirs += include_directories('../..') headers += files( 'monitor-fd.hh', diff --git a/src/libutil/unix/include/nix/monitor-fd.hh b/src/libutil/unix/include/nix/util/monitor-fd.hh similarity index 99% rename from src/libutil/unix/include/nix/monitor-fd.hh rename to src/libutil/unix/include/nix/util/monitor-fd.hh index 720cbb937..c10ad96bd 100644 --- a/src/libutil/unix/include/nix/monitor-fd.hh +++ b/src/libutil/unix/include/nix/util/monitor-fd.hh @@ -10,7 +10,7 @@ #include #include -#include "nix/signals.hh" +#include "nix/util/signals.hh" namespace nix { diff --git a/src/libutil/unix/include/nix/signals-impl.hh b/src/libutil/unix/include/nix/util/signals-impl.hh similarity index 94% rename from src/libutil/unix/include/nix/signals-impl.hh rename to src/libutil/unix/include/nix/util/signals-impl.hh index a63e03725..ffa967344 100644 --- a/src/libutil/unix/include/nix/signals-impl.hh +++ b/src/libutil/unix/include/nix/util/signals-impl.hh @@ -10,11 +10,11 @@ * downstream code.) */ -#include "nix/types.hh" -#include "nix/error.hh" -#include "nix/logging.hh" -#include "nix/ansicolor.hh" -#include "nix/signals.hh" +#include "nix/util/types.hh" +#include "nix/util/error.hh" +#include "nix/util/logging.hh" +#include "nix/util/ansicolor.hh" +#include "nix/util/signals.hh" #include #include diff --git a/src/libutil/unix/meson.build b/src/libutil/unix/meson.build index ee0c19aff..ea2391d05 100644 --- a/src/libutil/unix/meson.build +++ b/src/libutil/unix/meson.build @@ -60,4 +60,4 @@ sources += files( 'users.cc', ) -subdir('include/nix') +subdir('include/nix/util') diff --git a/src/libutil/unix/muxable-pipe.cc b/src/libutil/unix/muxable-pipe.cc index e81f47bc0..57bcdb0ad 100644 --- a/src/libutil/unix/muxable-pipe.cc +++ b/src/libutil/unix/muxable-pipe.cc @@ -1,8 +1,8 @@ #include -#include "nix/logging.hh" -#include "nix/util.hh" -#include "nix/muxable-pipe.hh" +#include "nix/util/logging.hh" +#include "nix/util/util.hh" +#include "nix/util/muxable-pipe.hh" namespace nix { diff --git a/src/libutil/unix/os-string.cc b/src/libutil/unix/os-string.cc index e97308a4a..1a2be1554 100644 --- a/src/libutil/unix/os-string.cc +++ b/src/libutil/unix/os-string.cc @@ -3,8 +3,8 @@ #include #include -#include "nix/file-path.hh" -#include "nix/util.hh" +#include "nix/util/file-path.hh" +#include "nix/util/util.hh" namespace nix { diff --git a/src/libutil/unix/processes.cc b/src/libutil/unix/processes.cc index 06beacb87..c436076ee 100644 --- a/src/libutil/unix/processes.cc +++ b/src/libutil/unix/processes.cc @@ -1,10 +1,10 @@ -#include "nix/current-process.hh" -#include "nix/environment-variables.hh" -#include "nix/executable-path.hh" -#include "nix/signals.hh" -#include "nix/processes.hh" -#include "nix/finally.hh" -#include "nix/serialise.hh" +#include "nix/util/current-process.hh" +#include "nix/util/environment-variables.hh" +#include "nix/util/executable-path.hh" +#include "nix/util/signals.hh" +#include "nix/util/processes.hh" +#include "nix/util/finally.hh" +#include "nix/util/serialise.hh" #include #include diff --git a/src/libutil/unix/signals.cc b/src/libutil/unix/signals.cc index 168b33bfb..f1cb28527 100644 --- a/src/libutil/unix/signals.cc +++ b/src/libutil/unix/signals.cc @@ -1,8 +1,8 @@ -#include "nix/signals.hh" -#include "nix/util.hh" -#include "nix/error.hh" -#include "nix/sync.hh" -#include "nix/terminal.hh" +#include "nix/util/signals.hh" +#include "nix/util/util.hh" +#include "nix/util/error.hh" +#include "nix/util/sync.hh" +#include "nix/util/terminal.hh" #include diff --git a/src/libutil/unix/users.cc b/src/libutil/unix/users.cc index 1ba194d71..18df7fdf2 100644 --- a/src/libutil/unix/users.cc +++ b/src/libutil/unix/users.cc @@ -1,7 +1,7 @@ -#include "nix/util.hh" -#include "nix/users.hh" -#include "nix/environment-variables.hh" -#include "nix/file-system.hh" +#include "nix/util/util.hh" +#include "nix/util/users.hh" +#include "nix/util/environment-variables.hh" +#include "nix/util/file-system.hh" #include #include diff --git a/src/libutil/url.cc b/src/libutil/url.cc index f042d3b0f..eaa2b0682 100644 --- a/src/libutil/url.cc +++ b/src/libutil/url.cc @@ -1,8 +1,8 @@ -#include "nix/url.hh" -#include "nix/url-parts.hh" -#include "nix/util.hh" -#include "nix/split.hh" -#include "nix/canon-path.hh" +#include "nix/util/url.hh" +#include "nix/util/url-parts.hh" +#include "nix/util/util.hh" +#include "nix/util/split.hh" +#include "nix/util/canon-path.hh" namespace nix { diff --git a/src/libutil/users.cc b/src/libutil/users.cc index d4fb08ab5..5a5d740c6 100644 --- a/src/libutil/users.cc +++ b/src/libutil/users.cc @@ -1,7 +1,7 @@ -#include "nix/util.hh" -#include "nix/users.hh" -#include "nix/environment-variables.hh" -#include "nix/file-system.hh" +#include "nix/util/util.hh" +#include "nix/util/users.hh" +#include "nix/util/environment-variables.hh" +#include "nix/util/file-system.hh" namespace nix { diff --git a/src/libutil/util.cc b/src/libutil/util.cc index 37f30d91f..ffd85ffbb 100644 --- a/src/libutil/util.cc +++ b/src/libutil/util.cc @@ -1,7 +1,7 @@ -#include "nix/util.hh" -#include "nix/fmt.hh" -#include "nix/file-path.hh" -#include "nix/signals.hh" +#include "nix/util/util.hh" +#include "nix/util/fmt.hh" +#include "nix/util/file-path.hh" +#include "nix/util/signals.hh" #include #include diff --git a/src/libutil/windows/environment-variables.cc b/src/libutil/windows/environment-variables.cc index a6fadc627..f9f384a5b 100644 --- a/src/libutil/windows/environment-variables.cc +++ b/src/libutil/windows/environment-variables.cc @@ -1,4 +1,4 @@ -#include "nix/environment-variables.hh" +#include "nix/util/environment-variables.hh" #ifdef _WIN32 # include "processenv.h" diff --git a/src/libutil/windows/file-descriptor.cc b/src/libutil/windows/file-descriptor.cc index 7f77cae89..f451bc0d3 100644 --- a/src/libutil/windows/file-descriptor.cc +++ b/src/libutil/windows/file-descriptor.cc @@ -1,9 +1,9 @@ -#include "nix/file-system.hh" -#include "nix/signals.hh" -#include "nix/finally.hh" -#include "nix/serialise.hh" -#include "nix/windows-error.hh" -#include "nix/file-path.hh" +#include "nix/util/file-system.hh" +#include "nix/util/signals.hh" +#include "nix/util/finally.hh" +#include "nix/util/serialise.hh" +#include "nix/util/windows-error.hh" +#include "nix/util/file-path.hh" #ifdef _WIN32 #include diff --git a/src/libutil/windows/file-path.cc b/src/libutil/windows/file-path.cc index 5079bcbcd..03cc5afe5 100644 --- a/src/libutil/windows/file-path.cc +++ b/src/libutil/windows/file-path.cc @@ -3,9 +3,9 @@ #include #include -#include "nix/file-path.hh" -#include "nix/file-path-impl.hh" -#include "nix/util.hh" +#include "nix/util/file-path.hh" +#include "nix/util/file-path-impl.hh" +#include "nix/util/util.hh" namespace nix { diff --git a/src/libutil/windows/file-system.cc b/src/libutil/windows/file-system.cc index 3c2a57bcd..1dac7e754 100644 --- a/src/libutil/windows/file-system.cc +++ b/src/libutil/windows/file-system.cc @@ -1,4 +1,4 @@ -#include "nix/file-system.hh" +#include "nix/util/file-system.hh" #ifdef _WIN32 namespace nix { diff --git a/src/libutil/windows/include/nix/meson.build b/src/libutil/windows/include/nix/util/meson.build similarity index 72% rename from src/libutil/windows/include/nix/meson.build rename to src/libutil/windows/include/nix/util/meson.build index 898b7db89..1bd56c4bd 100644 --- a/src/libutil/windows/include/nix/meson.build +++ b/src/libutil/windows/include/nix/util/meson.build @@ -1,6 +1,6 @@ # Public headers directory -include_dirs += include_directories('..') +include_dirs += include_directories('../..') headers += files( 'signals-impl.hh', diff --git a/src/libutil/windows/include/nix/signals-impl.hh b/src/libutil/windows/include/nix/util/signals-impl.hh similarity index 94% rename from src/libutil/windows/include/nix/signals-impl.hh rename to src/libutil/windows/include/nix/util/signals-impl.hh index fcdf18276..043f39100 100644 --- a/src/libutil/windows/include/nix/signals-impl.hh +++ b/src/libutil/windows/include/nix/util/signals-impl.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "nix/types.hh" +#include "nix/util/types.hh" namespace nix { diff --git a/src/libutil/windows/include/nix/windows-async-pipe.hh b/src/libutil/windows/include/nix/util/windows-async-pipe.hh similarity index 92% rename from src/libutil/windows/include/nix/windows-async-pipe.hh rename to src/libutil/windows/include/nix/util/windows-async-pipe.hh index 55f6ea31d..5bb0c3518 100644 --- a/src/libutil/windows/include/nix/windows-async-pipe.hh +++ b/src/libutil/windows/include/nix/util/windows-async-pipe.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "nix/file-descriptor.hh" +#include "nix/util/file-descriptor.hh" #ifdef _WIN32 namespace nix::windows { diff --git a/src/libutil/windows/include/nix/windows-error.hh b/src/libutil/windows/include/nix/util/windows-error.hh similarity index 97% rename from src/libutil/windows/include/nix/windows-error.hh rename to src/libutil/windows/include/nix/util/windows-error.hh index c07d61609..abf979c6b 100644 --- a/src/libutil/windows/include/nix/windows-error.hh +++ b/src/libutil/windows/include/nix/util/windows-error.hh @@ -4,7 +4,7 @@ #ifdef _WIN32 #include -#include "nix/error.hh" +#include "nix/util/error.hh" namespace nix::windows { diff --git a/src/libutil/windows/meson.build b/src/libutil/windows/meson.build index 2423c77ea..0c1cec49c 100644 --- a/src/libutil/windows/meson.build +++ b/src/libutil/windows/meson.build @@ -11,4 +11,4 @@ sources += files( 'windows-error.cc', ) -subdir('include/nix') +subdir('include/nix/util') diff --git a/src/libutil/windows/muxable-pipe.cc b/src/libutil/windows/muxable-pipe.cc index d9a3e2ca5..82ef40665 100644 --- a/src/libutil/windows/muxable-pipe.cc +++ b/src/libutil/windows/muxable-pipe.cc @@ -1,10 +1,10 @@ #ifdef _WIN32 # include -# include "nix/windows-error.hh" +# include "nix/util/windows-error.hh" -# include "nix/logging.hh" -# include "nix/util.hh" -# include "nix/muxable-pipe.hh" +# include "nix/util/logging.hh" +# include "nix/util/util.hh" +# include "nix/util/muxable-pipe.hh" namespace nix { diff --git a/src/libutil/windows/os-string.cc b/src/libutil/windows/os-string.cc index b9aff210b..8c8a27a9f 100644 --- a/src/libutil/windows/os-string.cc +++ b/src/libutil/windows/os-string.cc @@ -3,9 +3,9 @@ #include #include -#include "nix/file-path.hh" -#include "nix/file-path-impl.hh" -#include "nix/util.hh" +#include "nix/util/file-path.hh" +#include "nix/util/file-path-impl.hh" +#include "nix/util/util.hh" #ifdef _WIN32 diff --git a/src/libutil/windows/processes.cc b/src/libutil/windows/processes.cc index cdb659a79..099dff31b 100644 --- a/src/libutil/windows/processes.cc +++ b/src/libutil/windows/processes.cc @@ -1,16 +1,16 @@ -#include "nix/current-process.hh" -#include "nix/environment-variables.hh" -#include "nix/error.hh" -#include "nix/executable-path.hh" -#include "nix/file-descriptor.hh" -#include "nix/file-path.hh" -#include "nix/signals.hh" -#include "nix/processes.hh" -#include "nix/finally.hh" -#include "nix/serialise.hh" -#include "nix/file-system.hh" -#include "nix/util.hh" -#include "nix/windows-error.hh" +#include "nix/util/current-process.hh" +#include "nix/util/environment-variables.hh" +#include "nix/util/error.hh" +#include "nix/util/executable-path.hh" +#include "nix/util/file-descriptor.hh" +#include "nix/util/file-path.hh" +#include "nix/util/signals.hh" +#include "nix/util/processes.hh" +#include "nix/util/finally.hh" +#include "nix/util/serialise.hh" +#include "nix/util/file-system.hh" +#include "nix/util/util.hh" +#include "nix/util/windows-error.hh" #include #include diff --git a/src/libutil/windows/users.cc b/src/libutil/windows/users.cc index 1d49e667b..90da0281f 100644 --- a/src/libutil/windows/users.cc +++ b/src/libutil/windows/users.cc @@ -1,8 +1,8 @@ -#include "nix/util.hh" -#include "nix/users.hh" -#include "nix/environment-variables.hh" -#include "nix/file-system.hh" -#include "nix/windows-error.hh" +#include "nix/util/util.hh" +#include "nix/util/users.hh" +#include "nix/util/environment-variables.hh" +#include "nix/util/file-system.hh" +#include "nix/util/windows-error.hh" #ifdef _WIN32 #define WIN32_LEAN_AND_MEAN diff --git a/src/libutil/windows/windows-async-pipe.cc b/src/libutil/windows/windows-async-pipe.cc index 77ccd9e3f..d47930a1b 100644 --- a/src/libutil/windows/windows-async-pipe.cc +++ b/src/libutil/windows/windows-async-pipe.cc @@ -1,5 +1,5 @@ -#include "nix/windows-async-pipe.hh" -#include "nix/windows-error.hh" +#include "nix/util/windows-async-pipe.hh" +#include "nix/util/windows-error.hh" #ifdef _WIN32 diff --git a/src/libutil/windows/windows-error.cc b/src/libutil/windows/windows-error.cc index 8c523e403..1e7aff830 100644 --- a/src/libutil/windows/windows-error.cc +++ b/src/libutil/windows/windows-error.cc @@ -1,4 +1,4 @@ -#include "nix/windows-error.hh" +#include "nix/util/windows-error.hh" #ifdef _WIN32 #include diff --git a/src/libutil/xml-writer.cc b/src/libutil/xml-writer.cc index 78a40ef64..e460dd169 100644 --- a/src/libutil/xml-writer.cc +++ b/src/libutil/xml-writer.cc @@ -1,6 +1,6 @@ #include -#include "nix/xml-writer.hh" +#include "nix/util/xml-writer.hh" namespace nix { diff --git a/src/nix-build/nix-build.cc b/src/nix-build/nix-build.cc index 065a3b3e8..45f891808 100644 --- a/src/nix-build/nix-build.cc +++ b/src/nix-build/nix-build.cc @@ -9,25 +9,25 @@ #include -#include "nix/current-process.hh" -#include "nix/parsed-derivations.hh" -#include "nix/derivation-options.hh" -#include "nix/store-api.hh" -#include "nix/local-fs-store.hh" -#include "nix/globals.hh" -#include "nix/realisation.hh" -#include "nix/derivations.hh" -#include "nix/shared.hh" -#include "nix/path-with-outputs.hh" -#include "nix/eval.hh" -#include "nix/eval-inline.hh" -#include "nix/get-drvs.hh" -#include "nix/common-eval-args.hh" -#include "nix/attr-path.hh" -#include "nix/legacy.hh" -#include "nix/users.hh" -#include "nix/network-proxy.hh" -#include "nix/compatibility-settings.hh" +#include "nix/util/current-process.hh" +#include "nix/store/parsed-derivations.hh" +#include "nix/store/derivation-options.hh" +#include "nix/store/store-api.hh" +#include "nix/store/local-fs-store.hh" +#include "nix/store/globals.hh" +#include "nix/store/realisation.hh" +#include "nix/store/derivations.hh" +#include "nix/main/shared.hh" +#include "nix/store/path-with-outputs.hh" +#include "nix/expr/eval.hh" +#include "nix/expr/eval-inline.hh" +#include "nix/expr/get-drvs.hh" +#include "nix/cmd/common-eval-args.hh" +#include "nix/expr/attr-path.hh" +#include "nix/cmd/legacy.hh" +#include "nix/util/users.hh" +#include "nix/cmd/network-proxy.hh" +#include "nix/cmd/compatibility-settings.hh" #include "man-pages.hh" using namespace nix; diff --git a/src/nix-channel/nix-channel.cc b/src/nix-channel/nix-channel.cc index 33efb8918..c0baa4aa2 100644 --- a/src/nix-channel/nix-channel.cc +++ b/src/nix-channel/nix-channel.cc @@ -1,12 +1,12 @@ -#include "nix/profiles.hh" -#include "nix/shared.hh" -#include "nix/globals.hh" -#include "nix/filetransfer.hh" -#include "nix/store-api.hh" -#include "nix/legacy.hh" -#include "nix/eval-settings.hh" // for defexpr -#include "nix/users.hh" -#include "nix/tarball.hh" +#include "nix/store/profiles.hh" +#include "nix/main/shared.hh" +#include "nix/store/globals.hh" +#include "nix/store/filetransfer.hh" +#include "nix/store/store-api.hh" +#include "nix/cmd/legacy.hh" +#include "nix/expr/eval-settings.hh" // for defexpr +#include "nix/util/users.hh" +#include "nix/fetchers/tarball.hh" #include "self-exe.hh" #include "man-pages.hh" diff --git a/src/nix-collect-garbage/nix-collect-garbage.cc b/src/nix-collect-garbage/nix-collect-garbage.cc index c6f996f20..3a84d97aa 100644 --- a/src/nix-collect-garbage/nix-collect-garbage.cc +++ b/src/nix-collect-garbage/nix-collect-garbage.cc @@ -1,12 +1,12 @@ -#include "nix/file-system.hh" -#include "nix/signals.hh" -#include "nix/store-api.hh" -#include "nix/store-cast.hh" -#include "nix/gc-store.hh" -#include "nix/profiles.hh" -#include "nix/shared.hh" -#include "nix/globals.hh" -#include "nix/legacy.hh" +#include "nix/util/file-system.hh" +#include "nix/util/signals.hh" +#include "nix/store/store-api.hh" +#include "nix/store/store-cast.hh" +#include "nix/store/gc-store.hh" +#include "nix/store/profiles.hh" +#include "nix/main/shared.hh" +#include "nix/store/globals.hh" +#include "nix/cmd/legacy.hh" #include "man-pages.hh" #include diff --git a/src/nix-copy-closure/nix-copy-closure.cc b/src/nix-copy-closure/nix-copy-closure.cc index 8094925dc..6d0db1008 100644 --- a/src/nix-copy-closure/nix-copy-closure.cc +++ b/src/nix-copy-closure/nix-copy-closure.cc @@ -1,7 +1,7 @@ -#include "nix/shared.hh" -#include "nix/realisation.hh" -#include "nix/store-api.hh" -#include "nix/legacy.hh" +#include "nix/main/shared.hh" +#include "nix/store/realisation.hh" +#include "nix/store/store-api.hh" +#include "nix/cmd/legacy.hh" #include "man-pages.hh" using namespace nix; diff --git a/src/nix-env/nix-env.cc b/src/nix-env/nix-env.cc index c02c27d36..021619ada 100644 --- a/src/nix-env/nix-env.cc +++ b/src/nix-env/nix-env.cc @@ -1,22 +1,22 @@ -#include "nix/users.hh" -#include "nix/attr-path.hh" -#include "nix/common-eval-args.hh" -#include "nix/derivations.hh" -#include "nix/eval.hh" -#include "nix/get-drvs.hh" -#include "nix/globals.hh" -#include "nix/names.hh" -#include "nix/profiles.hh" -#include "nix/path-with-outputs.hh" -#include "nix/shared.hh" -#include "nix/store-api.hh" -#include "nix/local-fs-store.hh" +#include "nix/util/users.hh" +#include "nix/expr/attr-path.hh" +#include "nix/cmd/common-eval-args.hh" +#include "nix/store/derivations.hh" +#include "nix/expr/eval.hh" +#include "nix/expr/get-drvs.hh" +#include "nix/store/globals.hh" +#include "nix/store/names.hh" +#include "nix/store/profiles.hh" +#include "nix/store/path-with-outputs.hh" +#include "nix/main/shared.hh" +#include "nix/store/store-api.hh" +#include "nix/store/local-fs-store.hh" #include "user-env.hh" -#include "nix/value-to-json.hh" -#include "nix/xml-writer.hh" -#include "nix/legacy.hh" -#include "nix/eval-settings.hh" // for defexpr -#include "nix/terminal.hh" +#include "nix/expr/value-to-json.hh" +#include "nix/util/xml-writer.hh" +#include "nix/cmd/legacy.hh" +#include "nix/expr/eval-settings.hh" // for defexpr +#include "nix/util/terminal.hh" #include "man-pages.hh" #include diff --git a/src/nix-env/user-env.cc b/src/nix-env/user-env.cc index 81abefc2f..e149b6aeb 100644 --- a/src/nix-env/user-env.cc +++ b/src/nix-env/user-env.cc @@ -1,14 +1,14 @@ #include "user-env.hh" -#include "nix/derivations.hh" -#include "nix/store-api.hh" -#include "nix/path-with-outputs.hh" -#include "nix/local-fs-store.hh" -#include "nix/globals.hh" -#include "nix/shared.hh" -#include "nix/eval.hh" -#include "nix/eval-inline.hh" -#include "nix/profiles.hh" -#include "nix/print-ambiguous.hh" +#include "nix/store/derivations.hh" +#include "nix/store/store-api.hh" +#include "nix/store/path-with-outputs.hh" +#include "nix/store/local-fs-store.hh" +#include "nix/store/globals.hh" +#include "nix/main/shared.hh" +#include "nix/expr/eval.hh" +#include "nix/expr/eval-inline.hh" +#include "nix/store/profiles.hh" +#include "nix/expr/print-ambiguous.hh" #include #include diff --git a/src/nix-env/user-env.hh b/src/nix-env/user-env.hh index 8ec124d07..0a19b8f32 100644 --- a/src/nix-env/user-env.hh +++ b/src/nix-env/user-env.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "nix/get-drvs.hh" +#include "nix/expr/get-drvs.hh" namespace nix { diff --git a/src/nix-instantiate/nix-instantiate.cc b/src/nix-instantiate/nix-instantiate.cc index d4765952b..c1b6cc66a 100644 --- a/src/nix-instantiate/nix-instantiate.cc +++ b/src/nix-instantiate/nix-instantiate.cc @@ -1,17 +1,17 @@ -#include "nix/globals.hh" -#include "nix/print-ambiguous.hh" -#include "nix/shared.hh" -#include "nix/eval.hh" -#include "nix/eval-inline.hh" -#include "nix/get-drvs.hh" -#include "nix/attr-path.hh" -#include "nix/signals.hh" -#include "nix/value-to-xml.hh" -#include "nix/value-to-json.hh" -#include "nix/store-api.hh" -#include "nix/local-fs-store.hh" -#include "nix/common-eval-args.hh" -#include "nix/legacy.hh" +#include "nix/store/globals.hh" +#include "nix/expr/print-ambiguous.hh" +#include "nix/main/shared.hh" +#include "nix/expr/eval.hh" +#include "nix/expr/eval-inline.hh" +#include "nix/expr/get-drvs.hh" +#include "nix/expr/attr-path.hh" +#include "nix/util/signals.hh" +#include "nix/expr/value-to-xml.hh" +#include "nix/expr/value-to-json.hh" +#include "nix/store/store-api.hh" +#include "nix/store/local-fs-store.hh" +#include "nix/cmd/common-eval-args.hh" +#include "nix/cmd/legacy.hh" #include "man-pages.hh" #include diff --git a/src/nix-store/dotgraph.cc b/src/nix-store/dotgraph.cc index 0cab46656..f8054b554 100644 --- a/src/nix-store/dotgraph.cc +++ b/src/nix-store/dotgraph.cc @@ -1,5 +1,5 @@ #include "dotgraph.hh" -#include "nix/store-api.hh" +#include "nix/store/store-api.hh" #include diff --git a/src/nix-store/dotgraph.hh b/src/nix-store/dotgraph.hh index cb4041f8e..b8e0721ab 100644 --- a/src/nix-store/dotgraph.hh +++ b/src/nix-store/dotgraph.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "nix/store-api.hh" +#include "nix/store/store-api.hh" namespace nix { diff --git a/src/nix-store/graphml.cc b/src/nix-store/graphml.cc index 1eb2ccdf6..3b3188a41 100644 --- a/src/nix-store/graphml.cc +++ b/src/nix-store/graphml.cc @@ -1,6 +1,6 @@ #include "graphml.hh" -#include "nix/store-api.hh" -#include "nix/derivations.hh" +#include "nix/store/store-api.hh" +#include "nix/store/derivations.hh" #include diff --git a/src/nix-store/graphml.hh b/src/nix-store/graphml.hh index 2989733d7..afcedb58e 100644 --- a/src/nix-store/graphml.hh +++ b/src/nix-store/graphml.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "nix/store-api.hh" +#include "nix/store/store-api.hh" namespace nix { diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc index 7bdf3b1a3..fbbb57f43 100644 --- a/src/nix-store/nix-store.cc +++ b/src/nix-store/nix-store.cc @@ -1,23 +1,23 @@ -#include "nix/archive.hh" -#include "nix/derivations.hh" +#include "nix/util/archive.hh" +#include "nix/store/derivations.hh" #include "dotgraph.hh" -#include "nix/globals.hh" -#include "nix/store-cast.hh" -#include "nix/local-fs-store.hh" -#include "nix/log-store.hh" -#include "nix/serve-protocol.hh" -#include "nix/serve-protocol-connection.hh" -#include "nix/shared.hh" +#include "nix/store/globals.hh" +#include "nix/store/store-cast.hh" +#include "nix/store/local-fs-store.hh" +#include "nix/store/log-store.hh" +#include "nix/store/serve-protocol.hh" +#include "nix/store/serve-protocol-connection.hh" +#include "nix/main/shared.hh" #include "graphml.hh" -#include "nix/legacy.hh" -#include "nix/posix-source-accessor.hh" -#include "nix/path-with-outputs.hh" +#include "nix/cmd/legacy.hh" +#include "nix/util/posix-source-accessor.hh" +#include "nix/store/path-with-outputs.hh" #include "man-pages.hh" #ifndef _WIN32 // TODO implement on Windows or provide allowed-to-noop interface -# include "nix/local-store.hh" -# include "nix/monitor-fd.hh" -# include "nix/posix-fs-canonicalise.hh" +# include "nix/store/local-store.hh" +# include "nix/util/monitor-fd.hh" +# include "nix/store/posix-fs-canonicalise.hh" #endif #include @@ -27,9 +27,9 @@ #include #include -#include "nix/build-result.hh" -#include "nix/exit.hh" -#include "nix/serve-protocol-impl.hh" +#include "nix/store/build-result.hh" +#include "nix/util/exit.hh" +#include "nix/store/serve-protocol-impl.hh" namespace nix_store { diff --git a/src/nix/add-to-store.cc b/src/nix/add-to-store.cc index 6c71dc69f..9b7306fdd 100644 --- a/src/nix/add-to-store.cc +++ b/src/nix/add-to-store.cc @@ -1,10 +1,10 @@ -#include "nix/command.hh" -#include "nix/common-args.hh" -#include "nix/store-api.hh" -#include "nix/archive.hh" -#include "nix/git.hh" -#include "nix/posix-source-accessor.hh" -#include "nix/misc-store-flags.hh" +#include "nix/cmd/command.hh" +#include "nix/main/common-args.hh" +#include "nix/store/store-api.hh" +#include "nix/util/archive.hh" +#include "nix/util/git.hh" +#include "nix/util/posix-source-accessor.hh" +#include "nix/cmd/misc-store-flags.hh" using namespace nix; diff --git a/src/nix/app.cc b/src/nix/app.cc index 2b6c22269..75ef874ba 100644 --- a/src/nix/app.cc +++ b/src/nix/app.cc @@ -1,13 +1,13 @@ -#include "nix/installables.hh" -#include "nix/installable-derived-path.hh" -#include "nix/installable-value.hh" -#include "nix/store-api.hh" -#include "nix/eval-inline.hh" -#include "nix/eval-cache.hh" -#include "nix/names.hh" -#include "nix/command.hh" -#include "nix/derivations.hh" -#include "nix/downstream-placeholder.hh" +#include "nix/cmd/installables.hh" +#include "nix/cmd/installable-derived-path.hh" +#include "nix/cmd/installable-value.hh" +#include "nix/store/store-api.hh" +#include "nix/expr/eval-inline.hh" +#include "nix/expr/eval-cache.hh" +#include "nix/store/names.hh" +#include "nix/cmd/command.hh" +#include "nix/store/derivations.hh" +#include "nix/store/downstream-placeholder.hh" namespace nix { diff --git a/src/nix/build.cc b/src/nix/build.cc index 9a99832b4..7cd3c7fbe 100644 --- a/src/nix/build.cc +++ b/src/nix/build.cc @@ -1,8 +1,8 @@ -#include "nix/command.hh" -#include "nix/common-args.hh" -#include "nix/shared.hh" -#include "nix/store-api.hh" -#include "nix/local-fs-store.hh" +#include "nix/cmd/command.hh" +#include "nix/main/common-args.hh" +#include "nix/main/shared.hh" +#include "nix/store/store-api.hh" +#include "nix/store/local-fs-store.hh" #include diff --git a/src/nix/bundle.cc b/src/nix/bundle.cc index 613383939..30b3003e7 100644 --- a/src/nix/bundle.cc +++ b/src/nix/bundle.cc @@ -1,10 +1,10 @@ -#include "nix/installable-flake.hh" -#include "nix/command-installable-value.hh" -#include "nix/common-args.hh" -#include "nix/shared.hh" -#include "nix/store-api.hh" -#include "nix/local-fs-store.hh" -#include "nix/eval-inline.hh" +#include "nix/cmd/installable-flake.hh" +#include "nix/cmd/command-installable-value.hh" +#include "nix/main/common-args.hh" +#include "nix/main/shared.hh" +#include "nix/store/store-api.hh" +#include "nix/store/local-fs-store.hh" +#include "nix/expr/eval-inline.hh" namespace nix::fs { using namespace std::filesystem; } diff --git a/src/nix/cat.cc b/src/nix/cat.cc index 11de32b40..a790c0301 100644 --- a/src/nix/cat.cc +++ b/src/nix/cat.cc @@ -1,6 +1,6 @@ -#include "nix/command.hh" -#include "nix/store-api.hh" -#include "nix/nar-accessor.hh" +#include "nix/cmd/command.hh" +#include "nix/store/store-api.hh" +#include "nix/store/nar-accessor.hh" using namespace nix; diff --git a/src/nix/config-check.cc b/src/nix/config-check.cc index bc23fd7be..deac8e560 100644 --- a/src/nix/config-check.cc +++ b/src/nix/config-check.cc @@ -1,14 +1,14 @@ #include -#include "nix/command.hh" -#include "nix/exit.hh" -#include "nix/logging.hh" -#include "nix/serve-protocol.hh" -#include "nix/shared.hh" -#include "nix/store-api.hh" -#include "nix/local-fs-store.hh" -#include "nix/worker-protocol.hh" -#include "nix/executable-path.hh" +#include "nix/cmd/command.hh" +#include "nix/util/exit.hh" +#include "nix/util/logging.hh" +#include "nix/store/serve-protocol.hh" +#include "nix/main/shared.hh" +#include "nix/store/store-api.hh" +#include "nix/store/local-fs-store.hh" +#include "nix/store/worker-protocol.hh" +#include "nix/util/executable-path.hh" namespace nix::fs { using namespace std::filesystem; } diff --git a/src/nix/config.cc b/src/nix/config.cc index 5d9330f03..1dc2bed20 100644 --- a/src/nix/config.cc +++ b/src/nix/config.cc @@ -1,8 +1,8 @@ -#include "nix/command.hh" -#include "nix/common-args.hh" -#include "nix/shared.hh" -#include "nix/store-api.hh" -#include "nix/config-global.hh" +#include "nix/cmd/command.hh" +#include "nix/main/common-args.hh" +#include "nix/main/shared.hh" +#include "nix/store/store-api.hh" +#include "nix/util/config-global.hh" #include diff --git a/src/nix/copy.cc b/src/nix/copy.cc index 0ed99df53..0702215fd 100644 --- a/src/nix/copy.cc +++ b/src/nix/copy.cc @@ -1,7 +1,7 @@ -#include "nix/command.hh" -#include "nix/shared.hh" -#include "nix/store-api.hh" -#include "nix/local-fs-store.hh" +#include "nix/cmd/command.hh" +#include "nix/main/shared.hh" +#include "nix/store/store-api.hh" +#include "nix/store/local-fs-store.hh" using namespace nix; diff --git a/src/nix/crash-handler.cc b/src/nix/crash-handler.cc index 65687f79e..17d346ecc 100644 --- a/src/nix/crash-handler.cc +++ b/src/nix/crash-handler.cc @@ -1,7 +1,7 @@ #include "crash-handler.hh" -#include "nix/fmt.hh" -#include "nix/logging.hh" +#include "nix/util/fmt.hh" +#include "nix/util/logging.hh" #include #include diff --git a/src/nix/derivation-add.cc b/src/nix/derivation-add.cc index da52ac14c..e99c44deb 100644 --- a/src/nix/derivation-add.cc +++ b/src/nix/derivation-add.cc @@ -1,10 +1,10 @@ // FIXME: rename to 'nix plan add' or 'nix derivation add'? -#include "nix/command.hh" -#include "nix/common-args.hh" -#include "nix/store-api.hh" -#include "nix/archive.hh" -#include "nix/derivations.hh" +#include "nix/cmd/command.hh" +#include "nix/main/common-args.hh" +#include "nix/store/store-api.hh" +#include "nix/util/archive.hh" +#include "nix/store/derivations.hh" #include using namespace nix; diff --git a/src/nix/derivation-show.cc b/src/nix/derivation-show.cc index daabdb4d6..050144ccf 100644 --- a/src/nix/derivation-show.cc +++ b/src/nix/derivation-show.cc @@ -1,11 +1,11 @@ // FIXME: integrate this with `nix path-info`? // FIXME: rename to 'nix store derivation show'? -#include "nix/command.hh" -#include "nix/common-args.hh" -#include "nix/store-api.hh" -#include "nix/archive.hh" -#include "nix/derivations.hh" +#include "nix/cmd/command.hh" +#include "nix/main/common-args.hh" +#include "nix/store/store-api.hh" +#include "nix/util/archive.hh" +#include "nix/store/derivations.hh" #include using namespace nix; diff --git a/src/nix/derivation.cc b/src/nix/derivation.cc index 6e0d28d9a..ee62ab4dc 100644 --- a/src/nix/derivation.cc +++ b/src/nix/derivation.cc @@ -1,4 +1,4 @@ -#include "nix/command.hh" +#include "nix/cmd/command.hh" using namespace nix; diff --git a/src/nix/develop.cc b/src/nix/develop.cc index 7a1e75107..e88134a78 100644 --- a/src/nix/develop.cc +++ b/src/nix/develop.cc @@ -1,12 +1,12 @@ -#include "nix/config-global.hh" -#include "nix/eval.hh" -#include "nix/installable-flake.hh" -#include "nix/command-installable-value.hh" -#include "nix/common-args.hh" -#include "nix/shared.hh" -#include "nix/store-api.hh" -#include "nix/outputs-spec.hh" -#include "nix/derivations.hh" +#include "nix/util/config-global.hh" +#include "nix/expr/eval.hh" +#include "nix/cmd/installable-flake.hh" +#include "nix/cmd/command-installable-value.hh" +#include "nix/main/common-args.hh" +#include "nix/main/shared.hh" +#include "nix/store/store-api.hh" +#include "nix/store/outputs-spec.hh" +#include "nix/store/derivations.hh" #ifndef _WIN32 // TODO re-enable on Windows # include "run.hh" @@ -18,7 +18,7 @@ #include #include -#include "nix/strings.hh" +#include "nix/util/strings.hh" namespace nix::fs { using namespace std::filesystem; } diff --git a/src/nix/diff-closures.cc b/src/nix/diff-closures.cc index 042da8d3a..c4d21db6f 100644 --- a/src/nix/diff-closures.cc +++ b/src/nix/diff-closures.cc @@ -1,12 +1,12 @@ -#include "nix/command.hh" -#include "nix/shared.hh" -#include "nix/store-api.hh" -#include "nix/common-args.hh" -#include "nix/names.hh" +#include "nix/cmd/command.hh" +#include "nix/main/shared.hh" +#include "nix/store/store-api.hh" +#include "nix/main/common-args.hh" +#include "nix/store/names.hh" #include -#include "nix/strings.hh" +#include "nix/util/strings.hh" namespace nix { diff --git a/src/nix/dump-path.cc b/src/nix/dump-path.cc index bf82de846..c883630b1 100644 --- a/src/nix/dump-path.cc +++ b/src/nix/dump-path.cc @@ -1,6 +1,6 @@ -#include "nix/command.hh" -#include "nix/store-api.hh" -#include "nix/archive.hh" +#include "nix/cmd/command.hh" +#include "nix/store/store-api.hh" +#include "nix/util/archive.hh" using namespace nix; diff --git a/src/nix/edit.cc b/src/nix/edit.cc index 770bbfc71..cfb9eb74a 100644 --- a/src/nix/edit.cc +++ b/src/nix/edit.cc @@ -1,9 +1,9 @@ -#include "nix/current-process.hh" -#include "nix/command-installable-value.hh" -#include "nix/shared.hh" -#include "nix/eval.hh" -#include "nix/attr-path.hh" -#include "nix/editor-for.hh" +#include "nix/util/current-process.hh" +#include "nix/cmd/command-installable-value.hh" +#include "nix/main/shared.hh" +#include "nix/expr/eval.hh" +#include "nix/expr/attr-path.hh" +#include "nix/cmd/editor-for.hh" #include diff --git a/src/nix/env.cc b/src/nix/env.cc index 982120252..4b00dbc7c 100644 --- a/src/nix/env.cc +++ b/src/nix/env.cc @@ -1,11 +1,11 @@ #include #include -#include "nix/command.hh" -#include "nix/eval.hh" +#include "nix/cmd/command.hh" +#include "nix/expr/eval.hh" #include "run.hh" -#include "nix/strings.hh" -#include "nix/executable-path.hh" +#include "nix/util/strings.hh" +#include "nix/util/executable-path.hh" using namespace nix; diff --git a/src/nix/eval.cc b/src/nix/eval.cc index 8d48ddbeb..24a87f140 100644 --- a/src/nix/eval.cc +++ b/src/nix/eval.cc @@ -1,10 +1,10 @@ -#include "nix/command-installable-value.hh" -#include "nix/common-args.hh" -#include "nix/shared.hh" -#include "nix/store-api.hh" -#include "nix/eval.hh" -#include "nix/eval-inline.hh" -#include "nix/value-to-json.hh" +#include "nix/cmd/command-installable-value.hh" +#include "nix/main/common-args.hh" +#include "nix/main/shared.hh" +#include "nix/store/store-api.hh" +#include "nix/expr/eval.hh" +#include "nix/expr/eval-inline.hh" +#include "nix/expr/value-to-json.hh" #include diff --git a/src/nix/flake.cc b/src/nix/flake.cc index f86b0c4a1..a7b6000e7 100644 --- a/src/nix/flake.cc +++ b/src/nix/flake.cc @@ -1,30 +1,30 @@ -#include "nix/command.hh" -#include "nix/installable-flake.hh" -#include "nix/common-args.hh" -#include "nix/shared.hh" -#include "nix/eval.hh" -#include "nix/eval-inline.hh" -#include "nix/eval-settings.hh" +#include "nix/cmd/command.hh" +#include "nix/cmd/installable-flake.hh" +#include "nix/main/common-args.hh" +#include "nix/main/shared.hh" +#include "nix/expr/eval.hh" +#include "nix/expr/eval-inline.hh" +#include "nix/expr/eval-settings.hh" #include "nix/flake/flake.hh" -#include "nix/get-drvs.hh" -#include "nix/signals.hh" -#include "nix/store-api.hh" -#include "nix/derivations.hh" -#include "nix/outputs-spec.hh" -#include "nix/attr-path.hh" -#include "nix/fetchers.hh" -#include "nix/registry.hh" -#include "nix/eval-cache.hh" -#include "nix/markdown.hh" -#include "nix/users.hh" -#include "nix/fetch-to-store.hh" -#include "nix/local-fs-store.hh" +#include "nix/expr/get-drvs.hh" +#include "nix/util/signals.hh" +#include "nix/store/store-api.hh" +#include "nix/store/derivations.hh" +#include "nix/store/outputs-spec.hh" +#include "nix/expr/attr-path.hh" +#include "nix/fetchers/fetchers.hh" +#include "nix/fetchers/registry.hh" +#include "nix/expr/eval-cache.hh" +#include "nix/cmd/markdown.hh" +#include "nix/util/users.hh" +#include "nix/fetchers/fetch-to-store.hh" +#include "nix/store/local-fs-store.hh" #include #include #include -#include "nix/strings-inline.hh" +#include "nix/util/strings-inline.hh" namespace nix::fs { using namespace std::filesystem; } diff --git a/src/nix/fmt.cc b/src/nix/fmt.cc index e49f76084..dc270fb8c 100644 --- a/src/nix/fmt.cc +++ b/src/nix/fmt.cc @@ -1,6 +1,6 @@ -#include "nix/command.hh" -#include "nix/installable-value.hh" -#include "nix/eval.hh" +#include "nix/cmd/command.hh" +#include "nix/cmd/installable-value.hh" +#include "nix/expr/eval.hh" #include "run.hh" using namespace nix; diff --git a/src/nix/hash.cc b/src/nix/hash.cc index db937283a..510cfa592 100644 --- a/src/nix/hash.cc +++ b/src/nix/hash.cc @@ -1,13 +1,13 @@ -#include "nix/command.hh" -#include "nix/hash.hh" -#include "nix/content-address.hh" -#include "nix/legacy.hh" -#include "nix/shared.hh" -#include "nix/references.hh" -#include "nix/archive.hh" -#include "nix/git.hh" -#include "nix/posix-source-accessor.hh" -#include "nix/misc-store-flags.hh" +#include "nix/cmd/command.hh" +#include "nix/util/hash.hh" +#include "nix/store/content-address.hh" +#include "nix/cmd/legacy.hh" +#include "nix/main/shared.hh" +#include "nix/util/references.hh" +#include "nix/util/archive.hh" +#include "nix/util/git.hh" +#include "nix/util/posix-source-accessor.hh" +#include "nix/cmd/misc-store-flags.hh" #include "man-pages.hh" using namespace nix; diff --git a/src/nix/log.cc b/src/nix/log.cc index e43f32829..00ab74ea6 100644 --- a/src/nix/log.cc +++ b/src/nix/log.cc @@ -1,8 +1,8 @@ -#include "nix/command.hh" -#include "nix/common-args.hh" -#include "nix/shared.hh" -#include "nix/store-api.hh" -#include "nix/log-store.hh" +#include "nix/cmd/command.hh" +#include "nix/main/common-args.hh" +#include "nix/main/shared.hh" +#include "nix/store/store-api.hh" +#include "nix/store/log-store.hh" using namespace nix; diff --git a/src/nix/ls.cc b/src/nix/ls.cc index c5a1c4504..1a90ed074 100644 --- a/src/nix/ls.cc +++ b/src/nix/ls.cc @@ -1,7 +1,7 @@ -#include "nix/command.hh" -#include "nix/store-api.hh" -#include "nix/nar-accessor.hh" -#include "nix/common-args.hh" +#include "nix/cmd/command.hh" +#include "nix/store/store-api.hh" +#include "nix/store/nar-accessor.hh" +#include "nix/main/common-args.hh" #include using namespace nix; diff --git a/src/nix/main.cc b/src/nix/main.cc index 330cafce6..6470213a2 100644 --- a/src/nix/main.cc +++ b/src/nix/main.cc @@ -1,25 +1,25 @@ -#include "nix/args/root.hh" -#include "nix/current-process.hh" -#include "nix/command.hh" -#include "nix/common-args.hh" -#include "nix/eval.hh" -#include "nix/eval-settings.hh" -#include "nix/globals.hh" -#include "nix/legacy.hh" -#include "nix/shared.hh" -#include "nix/store-api.hh" -#include "nix/filetransfer.hh" -#include "nix/finally.hh" -#include "nix/loggers.hh" -#include "nix/markdown.hh" -#include "nix/memory-source-accessor.hh" -#include "nix/terminal.hh" -#include "nix/users.hh" -#include "nix/network-proxy.hh" -#include "nix/eval-cache.hh" +#include "nix/util/args/root.hh" +#include "nix/util/current-process.hh" +#include "nix/cmd/command.hh" +#include "nix/main/common-args.hh" +#include "nix/expr/eval.hh" +#include "nix/expr/eval-settings.hh" +#include "nix/store/globals.hh" +#include "nix/cmd/legacy.hh" +#include "nix/main/shared.hh" +#include "nix/store/store-api.hh" +#include "nix/store/filetransfer.hh" +#include "nix/util/finally.hh" +#include "nix/main/loggers.hh" +#include "nix/cmd/markdown.hh" +#include "nix/util/memory-source-accessor.hh" +#include "nix/util/terminal.hh" +#include "nix/util/users.hh" +#include "nix/cmd/network-proxy.hh" +#include "nix/expr/eval-cache.hh" #include "nix/flake/flake.hh" #include "nix/flake/settings.hh" -#include "nix/json-utils.hh" +#include "nix/util/json-utils.hh" #include "self-exe.hh" #include "crash-handler.hh" @@ -37,7 +37,7 @@ #endif #if __linux__ -# include "nix/namespaces.hh" +# include "nix/util/namespaces.hh" #endif #ifndef _WIN32 @@ -46,7 +46,7 @@ extern std::string chrootHelperName; void chrootHelper(int argc, char * * argv); #endif -#include "nix/strings.hh" +#include "nix/util/strings.hh" namespace nix { diff --git a/src/nix/make-content-addressed.cc b/src/nix/make-content-addressed.cc index 0426dd5d6..f8f588ae9 100644 --- a/src/nix/make-content-addressed.cc +++ b/src/nix/make-content-addressed.cc @@ -1,7 +1,7 @@ -#include "nix/command.hh" -#include "nix/store-api.hh" -#include "nix/make-content-addressed.hh" -#include "nix/common-args.hh" +#include "nix/cmd/command.hh" +#include "nix/store/store-api.hh" +#include "nix/store/make-content-addressed.hh" +#include "nix/main/common-args.hh" #include diff --git a/src/nix/man-pages.cc b/src/nix/man-pages.cc index 993ef28e1..8da439e7b 100644 --- a/src/nix/man-pages.cc +++ b/src/nix/man-pages.cc @@ -1,7 +1,7 @@ #include "man-pages.hh" -#include "nix/file-system.hh" -#include "nix/current-process.hh" -#include "nix/environment-variables.hh" +#include "nix/util/file-system.hh" +#include "nix/util/current-process.hh" +#include "nix/util/environment-variables.hh" namespace nix { diff --git a/src/nix/nar.cc b/src/nix/nar.cc index ba815551d..debb6b95e 100644 --- a/src/nix/nar.cc +++ b/src/nix/nar.cc @@ -1,4 +1,4 @@ -#include "nix/command.hh" +#include "nix/cmd/command.hh" using namespace nix; diff --git a/src/nix/optimise-store.cc b/src/nix/optimise-store.cc index ac1b03f60..e319f5c90 100644 --- a/src/nix/optimise-store.cc +++ b/src/nix/optimise-store.cc @@ -1,6 +1,6 @@ -#include "nix/command.hh" -#include "nix/shared.hh" -#include "nix/store-api.hh" +#include "nix/cmd/command.hh" +#include "nix/main/shared.hh" +#include "nix/store/store-api.hh" #include diff --git a/src/nix/path-from-hash-part.cc b/src/nix/path-from-hash-part.cc index 060231d02..814b723f9 100644 --- a/src/nix/path-from-hash-part.cc +++ b/src/nix/path-from-hash-part.cc @@ -1,5 +1,5 @@ -#include "nix/command.hh" -#include "nix/store-api.hh" +#include "nix/cmd/command.hh" +#include "nix/store/store-api.hh" using namespace nix; diff --git a/src/nix/path-info.cc b/src/nix/path-info.cc index 994c7e7dc..329e15830 100644 --- a/src/nix/path-info.cc +++ b/src/nix/path-info.cc @@ -1,15 +1,15 @@ -#include "nix/command.hh" -#include "nix/shared.hh" -#include "nix/store-api.hh" -#include "nix/common-args.hh" -#include "nix/nar-info.hh" +#include "nix/cmd/command.hh" +#include "nix/main/shared.hh" +#include "nix/store/store-api.hh" +#include "nix/main/common-args.hh" +#include "nix/store/nar-info.hh" #include #include #include -#include "nix/strings.hh" +#include "nix/util/strings.hh" using namespace nix; using nlohmann::json; diff --git a/src/nix/prefetch.cc b/src/nix/prefetch.cc index f7acd6017..397134b03 100644 --- a/src/nix/prefetch.cc +++ b/src/nix/prefetch.cc @@ -1,17 +1,17 @@ -#include "nix/command.hh" -#include "nix/common-args.hh" -#include "nix/shared.hh" -#include "nix/store-api.hh" -#include "nix/filetransfer.hh" -#include "nix/finally.hh" -#include "nix/loggers.hh" -#include "nix/tarfile.hh" -#include "nix/attr-path.hh" -#include "nix/eval-inline.hh" -#include "nix/legacy.hh" -#include "nix/posix-source-accessor.hh" -#include "nix/misc-store-flags.hh" -#include "nix/terminal.hh" +#include "nix/cmd/command.hh" +#include "nix/main/common-args.hh" +#include "nix/main/shared.hh" +#include "nix/store/store-api.hh" +#include "nix/store/filetransfer.hh" +#include "nix/util/finally.hh" +#include "nix/main/loggers.hh" +#include "nix/util/tarfile.hh" +#include "nix/expr/attr-path.hh" +#include "nix/expr/eval-inline.hh" +#include "nix/cmd/legacy.hh" +#include "nix/util/posix-source-accessor.hh" +#include "nix/cmd/misc-store-flags.hh" +#include "nix/util/terminal.hh" #include "man-pages.hh" diff --git a/src/nix/profile.cc b/src/nix/profile.cc index 2ba3a8268..1a129d0c5 100644 --- a/src/nix/profile.cc +++ b/src/nix/profile.cc @@ -1,23 +1,23 @@ -#include "nix/command.hh" -#include "nix/installable-flake.hh" -#include "nix/common-args.hh" -#include "nix/shared.hh" -#include "nix/store-api.hh" -#include "nix/derivations.hh" -#include "nix/archive.hh" -#include "nix/builtins/buildenv.hh" +#include "nix/cmd/command.hh" +#include "nix/cmd/installable-flake.hh" +#include "nix/main/common-args.hh" +#include "nix/main/shared.hh" +#include "nix/store/store-api.hh" +#include "nix/store/derivations.hh" +#include "nix/util/archive.hh" +#include "nix/store/builtins/buildenv.hh" #include "nix/flake/flakeref.hh" #include "../nix-env/user-env.hh" -#include "nix/profiles.hh" -#include "nix/names.hh" -#include "nix/url.hh" +#include "nix/store/profiles.hh" +#include "nix/store/names.hh" +#include "nix/util/url.hh" #include "nix/flake/url-name.hh" #include #include #include -#include "nix/strings.hh" +#include "nix/util/strings.hh" using namespace nix; diff --git a/src/nix/realisation.cc b/src/nix/realisation.cc index 32e544265..77465e0b7 100644 --- a/src/nix/realisation.cc +++ b/src/nix/realisation.cc @@ -1,5 +1,5 @@ -#include "nix/command.hh" -#include "nix/common-args.hh" +#include "nix/cmd/command.hh" +#include "nix/main/common-args.hh" #include diff --git a/src/nix/registry.cc b/src/nix/registry.cc index f464ab02f..340d10ec4 100644 --- a/src/nix/registry.cc +++ b/src/nix/registry.cc @@ -1,11 +1,11 @@ -#include "nix/command.hh" -#include "nix/common-args.hh" -#include "nix/shared.hh" -#include "nix/eval.hh" +#include "nix/cmd/command.hh" +#include "nix/main/common-args.hh" +#include "nix/main/shared.hh" +#include "nix/expr/eval.hh" #include "nix/flake/flake.hh" -#include "nix/store-api.hh" -#include "nix/fetchers.hh" -#include "nix/registry.hh" +#include "nix/store/store-api.hh" +#include "nix/fetchers/fetchers.hh" +#include "nix/fetchers/registry.hh" using namespace nix; using namespace nix::flake; diff --git a/src/nix/repl.cc b/src/nix/repl.cc index fb8954455..fcce43b8f 100644 --- a/src/nix/repl.cc +++ b/src/nix/repl.cc @@ -1,11 +1,11 @@ -#include "nix/eval.hh" -#include "nix/eval-settings.hh" -#include "nix/config-global.hh" -#include "nix/globals.hh" -#include "nix/command.hh" -#include "nix/installable-value.hh" -#include "nix/repl.hh" -#include "nix/processes.hh" +#include "nix/expr/eval.hh" +#include "nix/expr/eval-settings.hh" +#include "nix/util/config-global.hh" +#include "nix/store/globals.hh" +#include "nix/cmd/command.hh" +#include "nix/cmd/installable-value.hh" +#include "nix/cmd/repl.hh" +#include "nix/util/processes.hh" #include "self-exe.hh" namespace nix { diff --git a/src/nix/run.cc b/src/nix/run.cc index 0345fab9a..64eab3ff3 100644 --- a/src/nix/run.cc +++ b/src/nix/run.cc @@ -1,20 +1,20 @@ -#include "nix/current-process.hh" +#include "nix/util/current-process.hh" #include "run.hh" -#include "nix/command-installable-value.hh" -#include "nix/common-args.hh" -#include "nix/shared.hh" -#include "nix/signals.hh" -#include "nix/store-api.hh" -#include "nix/derivations.hh" -#include "nix/local-fs-store.hh" -#include "nix/finally.hh" -#include "nix/source-accessor.hh" -#include "nix/eval.hh" +#include "nix/cmd/command-installable-value.hh" +#include "nix/main/common-args.hh" +#include "nix/main/shared.hh" +#include "nix/util/signals.hh" +#include "nix/store/store-api.hh" +#include "nix/store/derivations.hh" +#include "nix/store/local-fs-store.hh" +#include "nix/util/finally.hh" +#include "nix/util/source-accessor.hh" +#include "nix/expr/eval.hh" #include #if __linux__ # include -# include "nix/personality.hh" +# include "nix/store/personality.hh" #endif #include diff --git a/src/nix/run.hh b/src/nix/run.hh index eb670319c..9d95b8e7c 100644 --- a/src/nix/run.hh +++ b/src/nix/run.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "nix/store-api.hh" +#include "nix/store/store-api.hh" namespace nix { diff --git a/src/nix/search.cc b/src/nix/search.cc index 6a2ee1aa6..a27891c93 100644 --- a/src/nix/search.cc +++ b/src/nix/search.cc @@ -1,22 +1,22 @@ -#include "nix/command-installable-value.hh" -#include "nix/globals.hh" -#include "nix/eval.hh" -#include "nix/eval-inline.hh" -#include "nix/eval-settings.hh" -#include "nix/names.hh" -#include "nix/get-drvs.hh" -#include "nix/common-args.hh" -#include "nix/shared.hh" -#include "nix/eval-cache.hh" -#include "nix/attr-path.hh" -#include "nix/hilite.hh" -#include "nix/strings-inline.hh" +#include "nix/cmd/command-installable-value.hh" +#include "nix/store/globals.hh" +#include "nix/expr/eval.hh" +#include "nix/expr/eval-inline.hh" +#include "nix/expr/eval-settings.hh" +#include "nix/store/names.hh" +#include "nix/expr/get-drvs.hh" +#include "nix/main/common-args.hh" +#include "nix/main/shared.hh" +#include "nix/expr/eval-cache.hh" +#include "nix/expr/attr-path.hh" +#include "nix/util/hilite.hh" +#include "nix/util/strings-inline.hh" #include #include #include -#include "nix/strings.hh" +#include "nix/util/strings.hh" using namespace nix; using json = nlohmann::json; diff --git a/src/nix/self-exe.cc b/src/nix/self-exe.cc index f9439dfd9..5cc2326be 100644 --- a/src/nix/self-exe.cc +++ b/src/nix/self-exe.cc @@ -1,6 +1,6 @@ -#include "nix/current-process.hh" -#include "nix/file-system.hh" -#include "nix/globals.hh" +#include "nix/util/current-process.hh" +#include "nix/util/file-system.hh" +#include "nix/store/globals.hh" #include "self-exe.hh" #include "cli-config-private.hh" diff --git a/src/nix/sigs.cc b/src/nix/sigs.cc index bbdc33002..87d0e1edb 100644 --- a/src/nix/sigs.cc +++ b/src/nix/sigs.cc @@ -1,8 +1,8 @@ -#include "nix/signals.hh" -#include "nix/command.hh" -#include "nix/shared.hh" -#include "nix/store-api.hh" -#include "nix/thread-pool.hh" +#include "nix/util/signals.hh" +#include "nix/cmd/command.hh" +#include "nix/main/shared.hh" +#include "nix/store/store-api.hh" +#include "nix/util/thread-pool.hh" #include diff --git a/src/nix/store-copy-log.cc b/src/nix/store-copy-log.cc index 7dde15dfa..599b40edc 100644 --- a/src/nix/store-copy-log.cc +++ b/src/nix/store-copy-log.cc @@ -1,10 +1,10 @@ -#include "nix/command.hh" -#include "nix/shared.hh" -#include "nix/store-api.hh" -#include "nix/store-cast.hh" -#include "nix/log-store.hh" -#include "nix/sync.hh" -#include "nix/thread-pool.hh" +#include "nix/cmd/command.hh" +#include "nix/main/shared.hh" +#include "nix/store/store-api.hh" +#include "nix/store/store-cast.hh" +#include "nix/store/log-store.hh" +#include "nix/util/sync.hh" +#include "nix/util/thread-pool.hh" #include diff --git a/src/nix/store-delete.cc b/src/nix/store-delete.cc index 3d73b7b9a..f71a56bc7 100644 --- a/src/nix/store-delete.cc +++ b/src/nix/store-delete.cc @@ -1,9 +1,9 @@ -#include "nix/command.hh" -#include "nix/common-args.hh" -#include "nix/shared.hh" -#include "nix/store-api.hh" -#include "nix/store-cast.hh" -#include "nix/gc-store.hh" +#include "nix/cmd/command.hh" +#include "nix/main/common-args.hh" +#include "nix/main/shared.hh" +#include "nix/store/store-api.hh" +#include "nix/store/store-cast.hh" +#include "nix/store/gc-store.hh" using namespace nix; diff --git a/src/nix/store-gc.cc b/src/nix/store-gc.cc index a8ea3f2fa..e6a303874 100644 --- a/src/nix/store-gc.cc +++ b/src/nix/store-gc.cc @@ -1,9 +1,9 @@ -#include "nix/command.hh" -#include "nix/common-args.hh" -#include "nix/shared.hh" -#include "nix/store-api.hh" -#include "nix/store-cast.hh" -#include "nix/gc-store.hh" +#include "nix/cmd/command.hh" +#include "nix/main/common-args.hh" +#include "nix/main/shared.hh" +#include "nix/store/store-api.hh" +#include "nix/store/store-cast.hh" +#include "nix/store/gc-store.hh" using namespace nix; diff --git a/src/nix/store-info.cc b/src/nix/store-info.cc index 656be0d41..8b4ac9b30 100644 --- a/src/nix/store-info.cc +++ b/src/nix/store-info.cc @@ -1,7 +1,7 @@ -#include "nix/command.hh" -#include "nix/shared.hh" -#include "nix/store-api.hh" -#include "nix/finally.hh" +#include "nix/cmd/command.hh" +#include "nix/main/shared.hh" +#include "nix/store/store-api.hh" +#include "nix/util/finally.hh" #include diff --git a/src/nix/store-repair.cc b/src/nix/store-repair.cc index cd63a836a..edd699981 100644 --- a/src/nix/store-repair.cc +++ b/src/nix/store-repair.cc @@ -1,5 +1,5 @@ -#include "nix/command.hh" -#include "nix/store-api.hh" +#include "nix/cmd/command.hh" +#include "nix/store/store-api.hh" using namespace nix; diff --git a/src/nix/store.cc b/src/nix/store.cc index ccf02c22e..b40b6d068 100644 --- a/src/nix/store.cc +++ b/src/nix/store.cc @@ -1,4 +1,4 @@ -#include "nix/command.hh" +#include "nix/cmd/command.hh" using namespace nix; diff --git a/src/nix/unix/daemon.cc b/src/nix/unix/daemon.cc index 5da068a70..4e60ba102 100644 --- a/src/nix/unix/daemon.cc +++ b/src/nix/unix/daemon.cc @@ -1,20 +1,20 @@ ///@file -#include "nix/signals.hh" -#include "nix/unix-domain-socket.hh" -#include "nix/command.hh" -#include "nix/shared.hh" -#include "nix/local-store.hh" -#include "nix/remote-store.hh" -#include "nix/remote-store-connection.hh" -#include "nix/serialise.hh" -#include "nix/archive.hh" -#include "nix/globals.hh" -#include "nix/config-global.hh" -#include "nix/derivations.hh" -#include "nix/finally.hh" -#include "nix/legacy.hh" -#include "nix/daemon.hh" +#include "nix/util/signals.hh" +#include "nix/util/unix-domain-socket.hh" +#include "nix/cmd/command.hh" +#include "nix/main/shared.hh" +#include "nix/store/local-store.hh" +#include "nix/store/remote-store.hh" +#include "nix/store/remote-store-connection.hh" +#include "nix/util/serialise.hh" +#include "nix/util/archive.hh" +#include "nix/store/globals.hh" +#include "nix/util/config-global.hh" +#include "nix/store/derivations.hh" +#include "nix/util/finally.hh" +#include "nix/cmd/legacy.hh" +#include "nix/store/daemon.hh" #include "man-pages.hh" #include @@ -35,7 +35,7 @@ #include #if __linux__ -#include "nix/cgroup.hh" +#include "nix/util/cgroup.hh" #endif #if __APPLE__ || __FreeBSD__ diff --git a/src/nix/upgrade-nix.cc b/src/nix/upgrade-nix.cc index 285285856..c0a6e6827 100644 --- a/src/nix/upgrade-nix.cc +++ b/src/nix/upgrade-nix.cc @@ -1,13 +1,13 @@ -#include "nix/processes.hh" -#include "nix/command.hh" -#include "nix/common-args.hh" -#include "nix/store-api.hh" -#include "nix/filetransfer.hh" -#include "nix/eval.hh" -#include "nix/eval-settings.hh" -#include "nix/attr-path.hh" -#include "nix/names.hh" -#include "nix/executable-path.hh" +#include "nix/util/processes.hh" +#include "nix/cmd/command.hh" +#include "nix/main/common-args.hh" +#include "nix/store/store-api.hh" +#include "nix/store/filetransfer.hh" +#include "nix/expr/eval.hh" +#include "nix/expr/eval-settings.hh" +#include "nix/expr/attr-path.hh" +#include "nix/store/names.hh" +#include "nix/util/executable-path.hh" #include "self-exe.hh" using namespace nix; diff --git a/src/nix/verify.cc b/src/nix/verify.cc index 0adfec895..734387ee7 100644 --- a/src/nix/verify.cc +++ b/src/nix/verify.cc @@ -1,13 +1,13 @@ -#include "nix/command.hh" -#include "nix/shared.hh" -#include "nix/store-api.hh" -#include "nix/thread-pool.hh" -#include "nix/signals.hh" -#include "nix/keys.hh" +#include "nix/cmd/command.hh" +#include "nix/main/shared.hh" +#include "nix/store/store-api.hh" +#include "nix/util/thread-pool.hh" +#include "nix/util/signals.hh" +#include "nix/store/keys.hh" #include -#include "nix/exit.hh" +#include "nix/util/exit.hh" using namespace nix; diff --git a/src/nix/why-depends.cc b/src/nix/why-depends.cc index fe8f3ecc3..8dfd8343f 100644 --- a/src/nix/why-depends.cc +++ b/src/nix/why-depends.cc @@ -1,7 +1,7 @@ -#include "nix/command.hh" -#include "nix/store-api.hh" -#include "nix/source-accessor.hh" -#include "nix/shared.hh" +#include "nix/cmd/command.hh" +#include "nix/store/store-api.hh" +#include "nix/util/source-accessor.hh" +#include "nix/main/shared.hh" #include diff --git a/src/perl/lib/Nix/Store.xs b/src/perl/lib/Nix/Store.xs index 49bf8bd79..34ed8b5f0 100644 --- a/src/perl/lib/Nix/Store.xs +++ b/src/perl/lib/Nix/Store.xs @@ -6,11 +6,11 @@ #undef do_open #undef do_close -#include "nix/derivations.hh" -#include "nix/realisation.hh" -#include "nix/globals.hh" -#include "nix/store-api.hh" -#include "nix/posix-source-accessor.hh" +#include "nix/store/derivations.hh" +#include "nix/store/realisation.hh" +#include "nix/store/globals.hh" +#include "nix/store/store-api.hh" +#include "nix/util/posix-source-accessor.hh" #include #include diff --git a/tests/functional/plugins/plugintest.cc b/tests/functional/plugins/plugintest.cc index e3343bcbc..0b1a01a6e 100644 --- a/tests/functional/plugins/plugintest.cc +++ b/tests/functional/plugins/plugintest.cc @@ -1,5 +1,5 @@ -#include "nix/config-global.hh" -#include "nix/primops.hh" +#include "nix/util/config-global.hh" +#include "nix/expr/primops.hh" using namespace nix; diff --git a/tests/functional/test-libstoreconsumer/main.cc b/tests/functional/test-libstoreconsumer/main.cc index 7cb0da944..2c0402094 100644 --- a/tests/functional/test-libstoreconsumer/main.cc +++ b/tests/functional/test-libstoreconsumer/main.cc @@ -1,6 +1,6 @@ -#include "nix/globals.hh" -#include "nix/store-api.hh" -#include "nix/build-result.hh" +#include "nix/store/globals.hh" +#include "nix/store/store-api.hh" +#include "nix/store/build-result.hh" #include using namespace nix; From ce8b1eb2c4735b0bb6e65760c935daf0b8605a8b Mon Sep 17 00:00:00 2001 From: oldshensheep Date: Tue, 18 Mar 2025 18:01:40 +0800 Subject: [PATCH 55/84] Improve the documentation of store path # Conflicts: # doc/manual/source/protocols/store-path.md (cherry picked from commit 355a923e812f07cb6ab72776114e4d1ad2c7dacd) --- doc/manual/source/protocols/store-path.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/manual/source/protocols/store-path.md b/doc/manual/source/protocols/store-path.md index ee7fb3a12..5be235501 100644 --- a/doc/manual/source/protocols/store-path.md +++ b/doc/manual/source/protocols/store-path.md @@ -7,7 +7,7 @@ The format of this specification is close to [Extended Backus–Naur form](https Regular users do *not* need to know this information --- store paths can be treated as black boxes computed from the properties of the store objects they refer to. But for those interested in exactly how Nix works, e.g. if they are reimplementing it, this information can be useful. -[store path](@docroot@/store/store-path.md) +[store path]: @docroot@/store/store-path.md ## Store path proper @@ -30,7 +30,7 @@ the end, while base-16 processes in from the beginning. ## Fingerprint - ```ebnf - fingerprint = type ":" sha256 ":" inner-digest ":" store ":" name + fingerprint = type ":sha256:" inner-digest ":" store ":" name ``` Note that it includes the location of the store as well as the name to make sure that changes to either of those are reflected in the hash From 9fd8f5ef04f19248aa4f394264abc463e2ecfee5 Mon Sep 17 00:00:00 2001 From: Valentin Gagarin Date: Thu, 10 Oct 2024 22:40:37 +0200 Subject: [PATCH 56/84] doc: note that function bindings are accessible in default values Co-authored-by: Robert Hensing (cherry picked from commit 9c3dd34cfedeb1f7ec5fb2aacdbf855e0f8e82a6) --- doc/manual/source/language/syntax.md | 41 +++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/doc/manual/source/language/syntax.md b/doc/manual/source/language/syntax.md index 506afbea1..08a64f684 100644 --- a/doc/manual/source/language/syntax.md +++ b/doc/manual/source/language/syntax.md @@ -443,7 +443,7 @@ three kinds of patterns: This works on any set that contains at least the three named attributes. - It is possible to provide *default values* for attributes, in + - It is possible to provide *default values* for attributes, in which case they are allowed to be missing. A default value is specified by writing `name ? e`, where *e* is an arbitrary expression. For example, @@ -503,6 +503,45 @@ three kinds of patterns: > [ 23 {} ] > ``` + - All bindings introduced by the function are in scope in the entire function expression; not just in the body. + It can therefore be used in default values. + + > **Example** + > + > A parameter (`x`), is used in the default value for another parameter (`y`): + > + > ```nix + > let + > f = { x, y ? [x] }: { inherit y; }; + > in + > f { x = 3; } + > ``` + > + > This evaluates to: + > + > ```nix + > { + > y = [ 3 ]; + > } + > ``` + + > **Example** + > + > The binding of an `@` pattern, `args`, is used in the default value for a parameter, `x`: + > + > ```nix + > let + > f = args@{ x ? args.a, ... }: x; + > in + > f { a = 1; } + > ``` + > + > This evaluates to: + > + > ```nix + > 1 + > ``` + Note that functions do not have names. If you want to give them a name, you can bind them to an attribute, e.g., From 5f74cf9b7a60a26ce6695e316ab2e574186c5c0a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 1 Apr 2025 15:19:46 +0200 Subject: [PATCH 57/84] Apply makeNotAllowedError to empty repos (cherry picked from commit 67e957b636d7e038c58bb21febd3493984c61d04) --- src/libexpr/eval.cc | 2 +- src/libfetchers/filtering-source-accessor.cc | 14 +++++++++-- src/libfetchers/git-utils.cc | 12 ++++------ .../nix/fetchers/filtering-source-accessor.hh | 3 +++ tests/functional/flakes/meson.build | 3 ++- tests/functional/flakes/source-paths.sh | 23 +++++++++++++++++++ 6 files changed, 45 insertions(+), 12 deletions(-) create mode 100644 tests/functional/flakes/source-paths.sh diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index 624d7d4aa..36f2cd7d7 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -273,7 +273,7 @@ EvalState::EvalState( /* Apply access control if needed. */ if (settings.restrictEval || settings.pureEval) - accessor = AllowListSourceAccessor::create(accessor, {}, + accessor = AllowListSourceAccessor::create(accessor, {}, {}, [&settings](const CanonPath & path) -> RestrictedPathError { auto modeInformation = settings.pureEval ? "in pure evaluation mode (use '--impure' to override)" diff --git a/src/libfetchers/filtering-source-accessor.cc b/src/libfetchers/filtering-source-accessor.cc index b1ba84140..72a3fb4eb 100644 --- a/src/libfetchers/filtering-source-accessor.cc +++ b/src/libfetchers/filtering-source-accessor.cc @@ -58,18 +58,23 @@ void FilteringSourceAccessor::checkAccess(const CanonPath & path) struct AllowListSourceAccessorImpl : AllowListSourceAccessor { std::set allowedPrefixes; + std::unordered_set allowedPaths; AllowListSourceAccessorImpl( ref next, std::set && allowedPrefixes, + std::unordered_set && allowedPaths, MakeNotAllowedError && makeNotAllowedError) : AllowListSourceAccessor(SourcePath(next), std::move(makeNotAllowedError)) , allowedPrefixes(std::move(allowedPrefixes)) + , allowedPaths(std::move(allowedPaths)) { } bool isAllowed(const CanonPath & path) override { - return path.isAllowed(allowedPrefixes); + return + allowedPaths.contains(path) + || path.isAllowed(allowedPrefixes); } void allowPrefix(CanonPath prefix) override @@ -81,9 +86,14 @@ struct AllowListSourceAccessorImpl : AllowListSourceAccessor ref AllowListSourceAccessor::create( ref next, std::set && allowedPrefixes, + std::unordered_set && allowedPaths, MakeNotAllowedError && makeNotAllowedError) { - return make_ref(next, std::move(allowedPrefixes), std::move(makeNotAllowedError)); + return make_ref( + next, + std::move(allowedPrefixes), + std::move(allowedPaths), + std::move(makeNotAllowedError)); } bool CachingFilteringSourceAccessor::isAllowed(const CanonPath & path) diff --git a/src/libfetchers/git-utils.cc b/src/libfetchers/git-utils.cc index 3ffefc940..a1131af91 100644 --- a/src/libfetchers/git-utils.cc +++ b/src/libfetchers/git-utils.cc @@ -1215,16 +1215,12 @@ ref GitRepoImpl::getAccessor( ref GitRepoImpl::getAccessor(const WorkdirInfo & wd, bool exportIgnore, MakeNotAllowedError makeNotAllowedError) { auto self = ref(shared_from_this()); - /* In case of an empty workdir, return an empty in-memory tree. We - cannot use AllowListSourceAccessor because it would return an - error for the root (and we can't add the root to the allow-list - since that would allow access to all its children). */ ref fileAccessor = - wd.files.empty() - ? makeEmptySourceAccessor() - : AllowListSourceAccessor::create( + AllowListSourceAccessor::create( makeFSSourceAccessor(path), - std::set { wd.files }, + std::set{ wd.files }, + // Always allow access to the root, but not its children. + std::unordered_set{CanonPath::root}, std::move(makeNotAllowedError)).cast(); if (exportIgnore) return make_ref(self, fileAccessor, std::nullopt); diff --git a/src/libfetchers/include/nix/fetchers/filtering-source-accessor.hh b/src/libfetchers/include/nix/fetchers/filtering-source-accessor.hh index 0e6b71e9a..2b59f03ca 100644 --- a/src/libfetchers/include/nix/fetchers/filtering-source-accessor.hh +++ b/src/libfetchers/include/nix/fetchers/filtering-source-accessor.hh @@ -2,6 +2,8 @@ #include "nix/util/source-path.hh" +#include + namespace nix { /** @@ -70,6 +72,7 @@ struct AllowListSourceAccessor : public FilteringSourceAccessor static ref create( ref next, std::set && allowedPrefixes, + std::unordered_set && allowedPaths, MakeNotAllowedError && makeNotAllowedError); using FilteringSourceAccessor::FilteringSourceAccessor; diff --git a/tests/functional/flakes/meson.build b/tests/functional/flakes/meson.build index 74ff3d91d..b8c650db4 100644 --- a/tests/functional/flakes/meson.build +++ b/tests/functional/flakes/meson.build @@ -29,7 +29,8 @@ suites += { 'non-flake-inputs.sh', 'relative-paths.sh', 'symlink-paths.sh', - 'debugger.sh' + 'debugger.sh', + 'source-paths.sh', ], 'workdir': meson.current_source_dir(), } diff --git a/tests/functional/flakes/source-paths.sh b/tests/functional/flakes/source-paths.sh new file mode 100644 index 000000000..4709bf2fc --- /dev/null +++ b/tests/functional/flakes/source-paths.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +source ./common.sh + +requireGit + +repo=$TEST_ROOT/repo + +createGitRepo "$repo" + +cat > "$repo/flake.nix" < Date: Mon, 31 Mar 2025 21:35:15 -0400 Subject: [PATCH 58/84] Improve and fix the error message when a file is not tracked by Git (cherry picked from commit 62e2304891375f642ac7b52358d36455ce99171a) --- src/libfetchers/git.cc | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/libfetchers/git.cc b/src/libfetchers/git.cc index fb91f98a3..e9dc17df3 100644 --- a/src/libfetchers/git.cc +++ b/src/libfetchers/git.cc @@ -534,11 +534,21 @@ struct GitInputScheme : InputScheme static MakeNotAllowedError makeNotAllowedError(std::string url) { - return [url{std::move(url)}](const CanonPath & path) -> RestrictedPathError - { - if (nix::pathExists(path.abs())) - return RestrictedPathError("access to path '%s' is forbidden because it is not under Git control; maybe you should 'git add' it to the repository '%s'?", path, url); - else + return [url{std::move(url)}](const CanonPath & path) -> RestrictedPathError { + if (nix::pathExists(url + "/" + path.abs())) { + auto relativePath = path.rel(); // .makeRelative(CanonPath("/")); + + return RestrictedPathError( + "'%s' is not tracked by Git.\n" + "\n" + "To use '%s', stage it in the Git repository at '%s':\n" + "\n" + "git add %s", + relativePath, + relativePath, + url, + relativePath); + } else return RestrictedPathError("path '%s' does not exist in Git repository '%s'", path, url); }; } From b4813a1b559100cc8af5a40c067d2cc8551ffef5 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 1 Apr 2025 15:14:20 +0200 Subject: [PATCH 59/84] Tweak error message (cherry picked from commit 277c29a64b379d66fe17a0c68260481a63fdcdd2) --- src/libfetchers/git.cc | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/src/libfetchers/git.cc b/src/libfetchers/git.cc index e9dc17df3..849fa7abe 100644 --- a/src/libfetchers/git.cc +++ b/src/libfetchers/git.cc @@ -532,24 +532,20 @@ struct GitInputScheme : InputScheme return *head; } - static MakeNotAllowedError makeNotAllowedError(std::string url) + static MakeNotAllowedError makeNotAllowedError(std::filesystem::path repoPath) { - return [url{std::move(url)}](const CanonPath & path) -> RestrictedPathError { - if (nix::pathExists(url + "/" + path.abs())) { - auto relativePath = path.rel(); // .makeRelative(CanonPath("/")); - + return [repoPath{std::move(repoPath)}](const CanonPath & path) -> RestrictedPathError { + if (nix::pathExists(repoPath / path.rel())) return RestrictedPathError( - "'%s' is not tracked by Git.\n" + "File '%1%' in the repository %2% is not tracked by Git.\n" "\n" - "To use '%s', stage it in the Git repository at '%s':\n" + "To make it visible to Nix, run:\n" "\n" - "git add %s", - relativePath, - relativePath, - url, - relativePath); - } else - return RestrictedPathError("path '%s' does not exist in Git repository '%s'", path, url); + "git -C %2% add \"%1%\"", + path.rel(), + repoPath); + else + return RestrictedPathError("path '%s' does not exist in Git repository %s", path, repoPath); }; } @@ -757,7 +753,7 @@ struct GitInputScheme : InputScheme ref accessor = repo->getAccessor(repoInfo.workdirInfo, exportIgnore, - makeNotAllowedError(repoInfo.locationToArg())); + makeNotAllowedError(repoPath)); /* If the repo has submodules, return a mounted input accessor consisting of the accessor for the top-level repo and the From c45f97b9f44c4207bb7e3d553051cdd573a50965 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 1 Apr 2025 22:56:14 +0200 Subject: [PATCH 60/84] Make Git error messages more consistent (cherry picked from commit f15681df26bbbf246c226530d1ab814a172a7e87) --- src/libfetchers/git.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libfetchers/git.cc b/src/libfetchers/git.cc index 849fa7abe..4cc726076 100644 --- a/src/libfetchers/git.cc +++ b/src/libfetchers/git.cc @@ -537,7 +537,7 @@ struct GitInputScheme : InputScheme return [repoPath{std::move(repoPath)}](const CanonPath & path) -> RestrictedPathError { if (nix::pathExists(repoPath / path.rel())) return RestrictedPathError( - "File '%1%' in the repository %2% is not tracked by Git.\n" + "Path '%1%' in the repository %2% is not tracked by Git.\n" "\n" "To make it visible to Nix, run:\n" "\n" @@ -545,7 +545,7 @@ struct GitInputScheme : InputScheme path.rel(), repoPath); else - return RestrictedPathError("path '%s' does not exist in Git repository %s", path, repoPath); + return RestrictedPathError("Path '%s' does not exist in Git repository %s.", path.rel(), repoPath); }; } From 0b66c182213aa2e6fe8b28ae23ad3800989f6719 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 2 Apr 2025 21:39:02 +0200 Subject: [PATCH 61/84] Update meta.maintainers field for nixos-unstable (cherry picked from commit 7eb76186ba79387a5757b2e2e3f1b0d62e218221) --- flake.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index bfb2c7127..84cbd127f 100644 --- a/flake.nix +++ b/flake.nix @@ -157,9 +157,9 @@ pkgs = final; src = self; maintainers = with lib.maintainers; [ - edolstra - Ericson2314 - Mic92 + eelco + ericson2314 + mic92 roberth tomberek ]; From b3b4fc21dae59d36dcf59c3905f84d2a6bd6f51f Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 2 Apr 2025 21:40:03 +0200 Subject: [PATCH 62/84] Remove meta.maintainers Some of the maintainer attribute names got changed in nixos-unstable (e.g. "edolstra" is now "eelco") but we want this flake to work on nixos-24.11. So just get rid of them. (cherry picked from commit 93d8f620575cb6e5d5403b2654af81f31f16b338) --- flake.nix | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/flake.nix b/flake.nix index 84cbd127f..32c9975f1 100644 --- a/flake.nix +++ b/flake.nix @@ -156,13 +156,7 @@ inherit officialRelease; pkgs = final; src = self; - maintainers = with lib.maintainers; [ - eelco - ericson2314 - mic92 - roberth - tomberek - ]; + maintainers = [ ]; }; }; From 9c7f662586c437a361f062d58a9cf99a85b6fd81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 1 Apr 2025 19:04:45 +0200 Subject: [PATCH 63/84] libgit2: use upstream version if possible we don't seem to use libgit2 for fetching via ssh, hence it shouldn't matter if it's using libssh or the ssh binary. (cherry picked from commit 0b61b758fb6c26f0cd3052ccbd442247c0bbb86d) --- packaging/dependencies.nix | 68 ++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 35 deletions(-) diff --git a/packaging/dependencies.nix b/packaging/dependencies.nix index 535b3ff37..0af670bfb 100644 --- a/packaging/dependencies.nix +++ b/packaging/dependencies.nix @@ -65,39 +65,37 @@ scope: { installPhase = lib.replaceStrings [ "--without-python" ] [ "" ] old.installPhase; }); - libgit2 = pkgs.libgit2.overrideAttrs ( - attrs: - { - cmakeFlags = attrs.cmakeFlags or [ ] ++ [ "-DUSE_SSH=exec" ]; - } - # libgit2: Nixpkgs 24.11 has < 1.9.0, which needs our patches - // lib.optionalAttrs (!lib.versionAtLeast pkgs.libgit2.version "1.9.0") { - nativeBuildInputs = - attrs.nativeBuildInputs or [ ] - # gitMinimal does not build on Windows. See packbuilder patch. - ++ lib.optionals (!stdenv.hostPlatform.isWindows) [ - # Needed for `git apply`; see `prePatch` - pkgs.buildPackages.gitMinimal - ]; - # Only `git apply` can handle git binary patches - prePatch = - attrs.prePatch or "" - + lib.optionalString (!stdenv.hostPlatform.isWindows) '' - patch() { - git apply - } - ''; - patches = - attrs.patches or [ ] - ++ [ - ./patches/libgit2-mempack-thin-packfile.patch - ] - # gitMinimal does not build on Windows, but fortunately this patch only - # impacts interruptibility - ++ lib.optionals (!stdenv.hostPlatform.isWindows) [ - # binary patch; see `prePatch` - ./patches/libgit2-packbuilder-callback-interruptible.patch - ]; - } - ); + libgit2 = + if lib.versionAtLeast pkgs.libgit2.version "1.9.0" then + pkgs.libgit2 + else + pkgs.libgit2.overrideAttrs (attrs: { + # libgit2: Nixpkgs 24.11 has < 1.9.0, which needs our patches + nativeBuildInputs = + attrs.nativeBuildInputs or [ ] + # gitMinimal does not build on Windows. See packbuilder patch. + ++ lib.optionals (!stdenv.hostPlatform.isWindows) [ + # Needed for `git apply`; see `prePatch` + pkgs.buildPackages.gitMinimal + ]; + # Only `git apply` can handle git binary patches + prePatch = + attrs.prePatch or "" + + lib.optionalString (!stdenv.hostPlatform.isWindows) '' + patch() { + git apply + } + ''; + patches = + attrs.patches or [ ] + ++ [ + ./patches/libgit2-mempack-thin-packfile.patch + ] + # gitMinimal does not build on Windows, but fortunately this patch only + # impacts interruptibility + ++ lib.optionals (!stdenv.hostPlatform.isWindows) [ + # binary patch; see `prePatch` + ./patches/libgit2-packbuilder-callback-interruptible.patch + ]; + }); } From 9f488312985f59bfc00e0f5a5697298f6517cdd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 1 Apr 2025 19:17:05 +0200 Subject: [PATCH 64/84] remove obsolete stdenv darwinMinVersion override we are more up-to-date now: nix-repl> stdenv.hostPlatform.darwinMinVersion "11.3" (cherry picked from commit d91310bb32b9efca2f1e1a6a767cbe5b0a7f072c) --- flake.nix | 2 +- packaging/dependencies.nix | 19 ------------------- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/flake.nix b/flake.nix index bfb2c7127..f956646b7 100644 --- a/flake.nix +++ b/flake.nix @@ -177,7 +177,7 @@ { otherSplices = final.generateSplicesForMkScope "nixDependencies"; f = import ./packaging/dependencies.nix { - inherit inputs stdenv; + inherit stdenv; pkgs = final; }; }; diff --git a/packaging/dependencies.nix b/packaging/dependencies.nix index 0af670bfb..f06b65dee 100644 --- a/packaging/dependencies.nix +++ b/packaging/dependencies.nix @@ -1,33 +1,14 @@ # These overrides are applied to the dependencies of the Nix components. { - # Flake inputs; used for sources - inputs, - # The raw Nixpkgs, not affected by this scope pkgs, stdenv, }: -let - prevStdenv = stdenv; -in - let inherit (pkgs) lib; - - stdenv = if prevStdenv.isDarwin && prevStdenv.isx86_64 then darwinStdenv else prevStdenv; - - # Fix the following error with the default x86_64-darwin SDK: - # - # error: aligned allocation function of type 'void *(std::size_t, std::align_val_t)' is only available on macOS 10.13 or newer - # - # Despite the use of the 10.13 deployment target here, the aligned - # allocation function Clang uses with this setting actually works - # all the way back to 10.6. - darwinStdenv = pkgs.overrideSDK prevStdenv { darwinMinVersion = "10.13"; }; - in scope: { inherit stdenv; From 703f0fbe74bbc54532d19895bb32932b6fd77eb4 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Wed, 2 Apr 2025 15:20:47 -0400 Subject: [PATCH 65/84] release notes: 2.28.0 --- doc/manual/rl-next/c-api-flake-init.md | 20 ----- doc/manual/source/SUMMARY.md.in | 1 + doc/manual/source/release-notes/rl-2.28.md | 91 ++++++++++++++++++++++ 3 files changed, 92 insertions(+), 20 deletions(-) delete mode 100644 doc/manual/rl-next/c-api-flake-init.md create mode 100644 doc/manual/source/release-notes/rl-2.28.md diff --git a/doc/manual/rl-next/c-api-flake-init.md b/doc/manual/rl-next/c-api-flake-init.md deleted file mode 100644 index d6e7c3890..000000000 --- a/doc/manual/rl-next/c-api-flake-init.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -synopsis: C API `nix_flake_init_global` removed -prs: 12759 -issues: 5638 ---- - -In order to improve the modularity of the code base, we are removing a use of global state, and therefore the `nix_flake_init_global` function. - -Instead, use `nix_flake_settings_add_to_eval_state_builder`. For example: - -```diff -- nix_flake_init_global(ctx, settings); -- HANDLE_ERROR(ctx); -- - nix_eval_state_builder * builder = nix_eval_state_builder_new(ctx, store); - HANDLE_ERROR(ctx); - -+ nix_flake_settings_add_to_eval_state_builder(ctx, settings, builder); -+ HANDLE_ERROR(ctx); -``` diff --git a/doc/manual/source/SUMMARY.md.in b/doc/manual/source/SUMMARY.md.in index 3e7e961cb..5932e0999 100644 --- a/doc/manual/source/SUMMARY.md.in +++ b/doc/manual/source/SUMMARY.md.in @@ -135,6 +135,7 @@ - [Contributing](development/contributing.md) - [Releases](release-notes/index.md) {{#include ./SUMMARY-rl-next.md}} + - [Release 2.28 (2025-04-02)](release-notes/rl-2.28.md) - [Release 2.27 (2025-03-03)](release-notes/rl-2.27.md) - [Release 2.26 (2025-01-22)](release-notes/rl-2.26.md) - [Release 2.25 (2024-11-07)](release-notes/rl-2.25.md) diff --git a/doc/manual/source/release-notes/rl-2.28.md b/doc/manual/source/release-notes/rl-2.28.md new file mode 100644 index 000000000..701b40590 --- /dev/null +++ b/doc/manual/source/release-notes/rl-2.28.md @@ -0,0 +1,91 @@ +# Release 2.28.0 (2025-04-02) + +This is an atypical release -- instead of being branched off from `master`, it is branched off from the 2.27.x maintenance branch. +The purpose of this is to satisfy both these goals: + +- Release with number of API-breaking changes that are not suitable to backport to 2.27 + +- Do not Release with arbitrary new commits from master + +The reason for the combinations of these goals is that we would like this version of Nix to the default in Nixpkgs 25.05, yet, we are getting close to the Nixpkgs 25.05 version freeze. +These API changes complete the big infrastructure rework that accompanies the switch to Meson --- we want to batch all these changes together so there is one round of breakage. +But we don't want to to release with arbitrary new changes form master, so close to a major release, before those changes have had time to "incubate". + +## Major changes + +- Unstable C++ API reworked + [#12836](https://github.com/NixOS/nix/pull/12836) + [#12798](https://github.com/NixOS/nix/pull/12798) + [#12773](https://github.com/NixOS/nix/pull/12773) + + Now the C++ interface confirms to common conventions much better than before: + + - All headers are expected to be included with the initial `nix/`, e.g. as `#include "nix/....hh"` (what Nix's headers now do) or `#include ` (what downstream projects may choose to do). + Likewise, the pkg-config files have `-I${includedir}` not `-I${includedir}/nix` or similar. + + Including without the `nix/` like before sometimes worked because of how for `#include` C pre-process checks the directory containing the current file, not just the lookup path, but this was not reliable. + + - All configuration headers are included explicitly by the (regular) headers that need them. + There is no more need to pass `-include` to force additional files to be included. + + - The public, installed configuration headers no longer contain implementation-specific details that are not relevant to the API. + The vast majority of definitions that were previously in there are now moved to new private, non-installed configuration headers. + The renaming definitions now all start with `NIX_`. + + - The name of the Nix component the header comes from + (e.g. `util`, `store`, `expr`, `flake`, etc.) + is now part of the path to the header, coming after `nix` and before the header name + (or rest of the header path, if it is already in a directory). + + Here is a contrived diff showing a few of these changes at once: + + ```diff + @@ @@ + -#include "derived-path.hh" + +#include "nix/store/derived-path.hh" + @@ @@ + +// Would include for the variables used before. But when other headers + +// need these variables. those will include these config themselves. + +#include "nix/store/config.hh" + +#include "nix/expr/config.hh" + @@ @@ + -#include "config.hh" + +// Additionally renamed to distinguish from components' config headers. + +#include "nix/util/configuration.hh" + @@ @@ + -#if HAVE_ACL_SUPPORT + +#if NIX_SUPPORT_ACL + @@ @@ + -#if HAVE_BOEHMGC + +#if NIX_USE_BOEHMGC + @@ @@ + #endif + #endif + @@ @@ + -const char *s = "hi from " SYSTEM; + +const char *s = "hi from " NIX_LOCAL_SYSTEM; + ``` + +- C API `nix_flake_init_global` removed [#5638](https://github.com/NixOS/nix/issues/5638) [#12759](https://github.com/NixOS/nix/pull/12759) + + In order to improve the modularity of the code base, we are removing a use of global state, and therefore the `nix_flake_init_global` function. + + Instead, use `nix_flake_settings_add_to_eval_state_builder`. + For example: + + ```diff + - nix_flake_init_global(ctx, settings); + - HANDLE_ERROR(ctx); + - + nix_eval_state_builder * builder = nix_eval_state_builder_new(ctx, store); + HANDLE_ERROR(ctx); + + + nix_flake_settings_add_to_eval_state_builder(ctx, settings, builder); + + HANDLE_ERROR(ctx); + ``` + + We figured it would be good to do this API change at the same time, also. + +# Contributors + +Querying GitHub API for ce8b1eb2c4735b0bb6e65760c935daf0b8605a8b, to get handle for oldshensheep@gmail.com From 6687ce2a6dcddda457438228ffdc84f300393759 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 2 Apr 2025 22:59:58 +0200 Subject: [PATCH 66/84] chore: Update contributor handle caches --- maintainers/data/release-credits-email-to-handle.json | 9 ++++++++- maintainers/data/release-credits-handle-to-name.json | 6 +++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/maintainers/data/release-credits-email-to-handle.json b/maintainers/data/release-credits-email-to-handle.json index 8f5031474..977555278 100644 --- a/maintainers/data/release-credits-email-to-handle.json +++ b/maintainers/data/release-credits-email-to-handle.json @@ -145,5 +145,12 @@ "thebenmachine+git@gmail.com": "bmillwood", "leandro@kip93.net": "kip93", "hello@briancamacho.me": "b-camacho", - "bcamacho@anduril.com": "bcamacho2" + "bcamacho@anduril.com": "bcamacho2", + "oldshensheep@gmail.com": "oldshensheep", + "thomasmiedema@gmail.com": "thomie", + "xokdvium@proton.me": "xokdvium", + "kaction@disroot.org": "KAction", + "serenity@kaction.cc": null, + "dev@erik.work": "Kirens", + "felix@alternativebit.fr": "picnoir" } \ No newline at end of file diff --git a/maintainers/data/release-credits-handle-to-name.json b/maintainers/data/release-credits-handle-to-name.json index 7149149c0..a03a811d4 100644 --- a/maintainers/data/release-credits-handle-to-name.json +++ b/maintainers/data/release-credits-handle-to-name.json @@ -129,5 +129,9 @@ "SomeoneSerge": "Someone", "b-camacho": "Brian Camacho", "MaxHearnden": null, - "kip93": "Leandro Emmanuel Reina Kiperman" + "kip93": "Leandro Emmanuel Reina Kiperman", + "oldshensheep": "Ruby Rose", + "KAction": "Dmitry Bogatov", + "thomie": "Thomas Miedema", + "Kirens": "Erik Nygren" } \ No newline at end of file From fea87a94e61e15c8939f912c9ac3647e4947bf64 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 2 Apr 2025 23:02:27 +0200 Subject: [PATCH 67/84] doc/rl-2.28: Add contributors --- doc/manual/source/release-notes/rl-2.28.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/doc/manual/source/release-notes/rl-2.28.md b/doc/manual/source/release-notes/rl-2.28.md index 701b40590..90f4f1d68 100644 --- a/doc/manual/source/release-notes/rl-2.28.md +++ b/doc/manual/source/release-notes/rl-2.28.md @@ -88,4 +88,22 @@ But we don't want to to release with arbitrary new changes form master, so close # Contributors -Querying GitHub API for ce8b1eb2c4735b0bb6e65760c935daf0b8605a8b, to get handle for oldshensheep@gmail.com +This earlier-than-usual release was made possible by the following 16 contributors: + +- Farid Zakaria [**(@fzakaria)**](https://github.com/fzakaria) +- Jörg Thalheim [**(@Mic92)**](https://github.com/Mic92) +- Eelco Dolstra [**(@edolstra)**](https://github.com/edolstra) +- Graham Christensen [**(@grahamc)**](https://github.com/grahamc) +- Thomas Miedema [**(@thomie)**](https://github.com/thomie) +- Brian McKenna [**(@puffnfresh)**](https://github.com/puffnfresh) +- Sergei Trofimovich [**(@trofi)**](https://github.com/trofi) +- Dmitry Bogatov [**(@KAction)**](https://github.com/KAction) +- Erik Nygren [**(@Kirens)**](https://github.com/Kirens) +- John Ericson [**(@Ericson2314)**](https://github.com/Ericson2314) +- Sergei Zimmerman [**(@xokdvium)**](https://github.com/xokdvium) +- Ruby Rose [**(@oldshensheep)**](https://github.com/oldshensheep) +- Robert Hensing [**(@roberth)**](https://github.com/roberth) +- jade [**(@lf-)**](https://github.com/lf-) +- Félix [**(@picnoir)**](https://github.com/picnoir) +- Valentin Gagarin [**(@fricklerhandwerk)**](https://github.com/fricklerhandwerk) +- Dmitry Bogatov From b87b3d79f24581ef11cbdc0f09aab14d1cdd62e7 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 2 Apr 2025 23:05:37 +0200 Subject: [PATCH 68/84] Fix maintainers/release-credits output --- maintainers/release-credits | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/maintainers/release-credits b/maintainers/release-credits index 7a5c87d7d..10ffd48b5 100755 --- a/maintainers/release-credits +++ b/maintainers/release-credits @@ -109,15 +109,15 @@ for sample in samples: s = samples[sample] email = s["email"] if not email in email_to_handle_cache.values: - print(f"Querying GitHub API for {s['hash']}, to get handle for {s['email']}") + print(f"Querying GitHub API for {s['hash']}, to get handle for {s['email']}", file=sys.stderr) ghc = get_github_commit(samples[sample]) gha = ghc["author"] if gha and gha["login"]: handle = gha["login"] - print(f"Handle: {handle}") + print(f"Handle: {handle}", file=sys.stderr) email_to_handle_cache.values[email] = handle else: - print(f"Found no handle for {s['email']}") + print(f"Found no handle for {s['email']}", file=sys.stderr) email_to_handle_cache.values[email] = None handle = email_to_handle_cache.values[email] if handle is not None: From 1ca3ee12873cf19579fbecd264c8bca4fee251df Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 2 Apr 2025 23:44:30 +0200 Subject: [PATCH 69/84] Edit rl-2.28 --- doc/manual/source/release-notes/rl-2.28.md | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/doc/manual/source/release-notes/rl-2.28.md b/doc/manual/source/release-notes/rl-2.28.md index 90f4f1d68..6da09546e 100644 --- a/doc/manual/source/release-notes/rl-2.28.md +++ b/doc/manual/source/release-notes/rl-2.28.md @@ -1,15 +1,10 @@ # Release 2.28.0 (2025-04-02) -This is an atypical release -- instead of being branched off from `master`, it is branched off from the 2.27.x maintenance branch. -The purpose of this is to satisfy both these goals: +This is an atypical release, and for almost all intents and purposes, it is just a continuation of 2.27; not a feature release. -- Release with number of API-breaking changes that are not suitable to backport to 2.27 +We had originally set the goal of making 2.27 the Nixpkgs default for NixOS 25.05, but dependents that link to Nix need certain _interface breaking_ changes in the C++ headers. This is not something we should do in a patch release, so this is why we branched 2.28 right off 2.27 instead of `master`. -- Do not Release with arbitrary new commits from master - -The reason for the combinations of these goals is that we would like this version of Nix to the default in Nixpkgs 25.05, yet, we are getting close to the Nixpkgs 25.05 version freeze. -These API changes complete the big infrastructure rework that accompanies the switch to Meson --- we want to batch all these changes together so there is one round of breakage. -But we don't want to to release with arbitrary new changes form master, so close to a major release, before those changes have had time to "incubate". +This completes the infrastructure overhaul for the [RFC 132](https://github.com/NixOS/rfcs/blob/master/rfcs/0132-meson-builds-nix.md) switchover to meson as our build system. ## Major changes @@ -29,8 +24,8 @@ But we don't want to to release with arbitrary new changes form master, so close There is no more need to pass `-include` to force additional files to be included. - The public, installed configuration headers no longer contain implementation-specific details that are not relevant to the API. - The vast majority of definitions that were previously in there are now moved to new private, non-installed configuration headers. - The renaming definitions now all start with `NIX_`. + The vast majority of definitions that were previously in there are now moved to new headers that are not installed, but used during Nix's own compilation only. + The remaining macro definitions are renamed to have `NIX_` as a prefix. - The name of the Nix component the header comes from (e.g. `util`, `store`, `expr`, `flake`, etc.) @@ -84,7 +79,8 @@ But we don't want to to release with arbitrary new changes form master, so close + HANDLE_ERROR(ctx); ``` - We figured it would be good to do this API change at the same time, also. + Although this change is not as critical, we figured it would be good to do this API change at the same time, also. + Also note that we try to keep the C API compatible, but we decided to break this function because it was young and likely not in widespread use yet. This frees up time to make important progress on the rest of the C API. # Contributors From d73ed6f3106ef035a17b0fa6bbe4580707663c64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Wed, 2 Apr 2025 21:22:43 +0200 Subject: [PATCH 70/84] symlink_exists: wrap exceptions into nix exception (cherry picked from commit 779687854f62adfdf448f4ccb37b33887f368621) --- src/libutil/file-system.cc | 12 +++++++++++- src/libutil/include/nix/util/file-system.hh | 5 ++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/libutil/file-system.cc b/src/libutil/file-system.cc index ebc9a9663..c8161d270 100644 --- a/src/libutil/file-system.cc +++ b/src/libutil/file-system.cc @@ -31,7 +31,17 @@ namespace nix { -namespace fs { using namespace std::filesystem; } +namespace fs { + using namespace std::filesystem; + + bool symlink_exists(const std::filesystem::path & path) { + try { + return std::filesystem::exists(std::filesystem::symlink_status(path)); + } catch (const std::filesystem::filesystem_error & e) { + throw SysError("cannot check existence of %1%", path); + } + } +} bool isAbsolute(PathView path) { diff --git a/src/libutil/include/nix/util/file-system.hh b/src/libutil/include/nix/util/file-system.hh index 78b1cb46c..acae88306 100644 --- a/src/libutil/include/nix/util/file-system.hh +++ b/src/libutil/include/nix/util/file-system.hh @@ -134,6 +134,7 @@ bool pathExists(const Path & path); namespace fs { /** + * TODO: we may actually want to use pathExists instead of this function * ``` * symlink_exists(p) = std::filesystem::exists(std::filesystem::symlink_status(p)) * ``` @@ -142,9 +143,7 @@ namespace fs { * std::filesystem::exists(p) = std::filesystem::exists(std::filesystem::status(p)) * ``` */ -inline bool symlink_exists(const std::filesystem::path & path) { - return std::filesystem::exists(std::filesystem::symlink_status(path)); -} +bool symlink_exists(const std::filesystem::path & path); } // namespace fs From f48a72afc5da3d502a258e47042460f8d4b77d5b Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 3 Apr 2025 10:05:58 +0200 Subject: [PATCH 71/84] Revert "Merge pull request #12862 from NixOS/mergify/bp/2.28-maintenance/pr-12853" This reverts commit aff0058b8225fdcd58f45b787dca65ca71a5f657, reversing changes made to cb50eb0370f02ac21c17c5334249366b13bee3fd. --- flake.lock | 8 ++++---- flake.nix | 2 +- src/libfetchers/git-lfs-fetch.cc | 9 ++++----- src/libstore-test-support/outputs-spec.cc | 5 ++--- tests/nixos/git-submodules.nix | 6 +++--- tests/nixos/github-flakes.nix | 4 ++-- tests/nixos/nix-copy-closure.nix | 4 ++-- tests/nixos/nix-copy.nix | 4 ++-- tests/nixos/nix-docker.nix | 2 +- tests/nixos/nss-preload.nix | 4 ++-- tests/nixos/remote-builds-ssh-ng.nix | 4 ++-- tests/nixos/remote-builds.nix | 4 ++-- tests/nixos/s3-binary-cache-store.nix | 4 ++-- tests/nixos/sourcehut-flakes.nix | 4 ++-- 14 files changed, 31 insertions(+), 33 deletions(-) diff --git a/flake.lock b/flake.lock index 7e008fadc..ce484a67a 100644 --- a/flake.lock +++ b/flake.lock @@ -63,16 +63,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1743315132, - "narHash": "sha256-6hl6L/tRnwubHcA4pfUUtk542wn2Om+D4UnDhlDW9BE=", + "lastModified": 1734359947, + "narHash": "sha256-1Noao/H+N8nFB4Beoy8fgwrcOQLVm9o4zKW1ODaqK9E=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "52faf482a3889b7619003c0daec593a1912fddc1", + "rev": "48d12d5e70ee91fe8481378e540433a7303dbf6a", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-unstable", + "ref": "release-24.11", "repo": "nixpkgs", "type": "github" } diff --git a/flake.nix b/flake.nix index 41bcf7263..f2fac4f43 100644 --- a/flake.nix +++ b/flake.nix @@ -1,7 +1,7 @@ { description = "The purely functional package manager"; - inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + inputs.nixpkgs.url = "github:NixOS/nixpkgs/release-24.11"; inputs.nixpkgs-regression.url = "github:NixOS/nixpkgs/215d4d0fd80ca5163643b03a33fde804a29cc1e2"; inputs.nixpkgs-23-11.url = "github:NixOS/nixpkgs/a62e6edd6d5e1fa0329b8653c801147986f8d446"; diff --git a/src/libfetchers/git-lfs-fetch.cc b/src/libfetchers/git-lfs-fetch.cc index 97f10f0c6..dbf4b1eb9 100644 --- a/src/libfetchers/git-lfs-fetch.cc +++ b/src/libfetchers/git-lfs-fetch.cc @@ -44,11 +44,10 @@ static void downloadToSink( static std::string getLfsApiToken(const ParsedURL & url) { - auto [status, output] = runProgram( - RunOptions{ - .program = "ssh", - .args = {*url.authority, "git-lfs-authenticate", url.path, "download"}, - }); + auto [status, output] = runProgram(RunOptions{ + .program = "ssh", + .args = {*url.authority, "git-lfs-authenticate", url.path, "download"}, + }); if (output.empty()) throw Error( diff --git a/src/libstore-test-support/outputs-spec.cc b/src/libstore-test-support/outputs-spec.cc index 5b5251361..e186ad8ae 100644 --- a/src/libstore-test-support/outputs-spec.cc +++ b/src/libstore-test-support/outputs-spec.cc @@ -14,9 +14,8 @@ Gen Arbitrary::arbitrary() return gen::just((OutputsSpec) OutputsSpec::All{}); case 1: return gen::map( - gen::nonEmpty( - gen::container( - gen::map(gen::arbitrary(), [](StorePathName n) { return n.name; }))), + gen::nonEmpty(gen::container( + gen::map(gen::arbitrary(), [](StorePathName n) { return n.name; }))), [](StringSet names) { return (OutputsSpec) OutputsSpec::Names{names}; }); default: assert(false); diff --git a/tests/nixos/git-submodules.nix b/tests/nixos/git-submodules.nix index c6f53ada2..5b1d9ed5f 100644 --- a/tests/nixos/git-submodules.nix +++ b/tests/nixos/git-submodules.nix @@ -45,14 +45,14 @@ client.succeed("chmod 600 /root/.ssh/id_ed25519") # Install the SSH key on the builders. - client.wait_for_unit("network-addresses-eth1.service") + client.wait_for_unit("network-online.target") remote.succeed("mkdir -p -m 700 /root/.ssh") remote.copy_from_host("key.pub", "/root/.ssh/authorized_keys") remote.wait_for_unit("sshd") remote.wait_for_unit("multi-user.target") - remote.wait_for_unit("network-addresses-eth1.service") - client.wait_for_unit("network-addresses-eth1.service") + remote.wait_for_unit("network-online.target") + client.wait_for_unit("network-online.target") client.succeed(f"ssh -o StrictHostKeyChecking=no {remote.name} 'echo hello world'") remote.succeed(""" diff --git a/tests/nixos/github-flakes.nix b/tests/nixos/github-flakes.nix index 30ab1f333..dcba464a3 100644 --- a/tests/nixos/github-flakes.nix +++ b/tests/nixos/github-flakes.nix @@ -187,9 +187,9 @@ in github.succeed("cat /var/log/httpd/*.log >&2") github.wait_for_unit("httpd.service") - github.wait_for_unit("network-addresses-eth1.service") + github.wait_for_unit("network-online.target") - client.wait_for_unit("network-addresses-eth1.service") + client.wait_for_unit("network-online.target") client.succeed("curl -v https://github.com/ >&2") out = client.succeed("nix registry list") print(out) diff --git a/tests/nixos/nix-copy-closure.nix b/tests/nixos/nix-copy-closure.nix index 34e3a2c7d..b6ec856e0 100644 --- a/tests/nixos/nix-copy-closure.nix +++ b/tests/nixos/nix-copy-closure.nix @@ -70,9 +70,9 @@ in server.copy_from_host("key.pub", "/root/.ssh/authorized_keys") server.wait_for_unit("sshd") server.wait_for_unit("multi-user.target") - server.wait_for_unit("network-addresses-eth1.service") + server.wait_for_unit("network-online.target") - client.wait_for_unit("network-addresses-eth1.service") + client.wait_for_unit("network-online.target") client.succeed(f"ssh -o StrictHostKeyChecking=no {server.name} 'echo hello world'") # Copy the closure of package A from the client to the server. diff --git a/tests/nixos/nix-copy.nix b/tests/nixos/nix-copy.nix index 64de622de..3565e83e7 100644 --- a/tests/nixos/nix-copy.nix +++ b/tests/nixos/nix-copy.nix @@ -79,9 +79,9 @@ in server.wait_for_unit("sshd") server.wait_for_unit("multi-user.target") - server.wait_for_unit("network-addresses-eth1.service") + server.wait_for_unit("network-online.target") - client.wait_for_unit("network-addresses-eth1.service") + client.wait_for_unit("network-online.target") client.wait_for_unit("getty@tty1.service") # Either the prompt: ]# # or an OCR misreading of it: 1# diff --git a/tests/nixos/nix-docker.nix b/tests/nixos/nix-docker.nix index c58a00cdd..bd77b25c8 100644 --- a/tests/nixos/nix-docker.nix +++ b/tests/nixos/nix-docker.nix @@ -61,7 +61,7 @@ in { nodes }: '' cache.wait_for_unit("harmonia.service") - cache.wait_for_unit("network-addresses-eth1.service") + cache.wait_for_unit("network-online.target") machine.succeed("mkdir -p /etc/containers") machine.succeed("""echo '{"default":[{"type":"insecureAcceptAnything"}]}' > /etc/containers/policy.json""") diff --git a/tests/nixos/nss-preload.nix b/tests/nixos/nss-preload.nix index d99f22208..29cd5e6a2 100644 --- a/tests/nixos/nss-preload.nix +++ b/tests/nixos/nss-preload.nix @@ -145,7 +145,7 @@ in testScript = { nodes, ... }: '' - http_dns.wait_for_unit("network-addresses-eth1.service") + http_dns.wait_for_unit("network-online.target") http_dns.wait_for_unit("nginx") http_dns.wait_for_open_port(80) http_dns.wait_for_unit("unbound") @@ -153,7 +153,7 @@ in client.start() client.wait_for_unit('multi-user.target') - client.wait_for_unit('network-addresses-eth1.service') + client.wait_for_unit('network-online.target') with subtest("can fetch data from a remote server outside sandbox"): client.succeed("nix --version >&2") diff --git a/tests/nixos/remote-builds-ssh-ng.nix b/tests/nixos/remote-builds-ssh-ng.nix index c298ab92d..726522029 100644 --- a/tests/nixos/remote-builds-ssh-ng.nix +++ b/tests/nixos/remote-builds-ssh-ng.nix @@ -102,12 +102,12 @@ in client.succeed("chmod 600 /root/.ssh/id_ed25519") # Install the SSH key on the builder. - client.wait_for_unit("network-addresses-eth1.service") + client.wait_for_unit("network-online.target") builder.succeed("mkdir -p -m 700 /root/.ssh") builder.copy_from_host("key.pub", "/root/.ssh/authorized_keys") builder.wait_for_unit("sshd") builder.wait_for_unit("multi-user.target") - builder.wait_for_unit("network-addresses-eth1.service") + builder.wait_for_unit("network-online.target") client.succeed(f"ssh -o StrictHostKeyChecking=no {builder.name} 'echo hello world'") diff --git a/tests/nixos/remote-builds.nix b/tests/nixos/remote-builds.nix index fbfff9a7d..3251984db 100644 --- a/tests/nixos/remote-builds.nix +++ b/tests/nixos/remote-builds.nix @@ -123,12 +123,12 @@ in client.succeed("chmod 600 /root/.ssh/id_ed25519") # Install the SSH key on the builders. - client.wait_for_unit("network-addresses-eth1.service") + client.wait_for_unit("network-online.target") for builder in [builder1, builder2]: builder.succeed("mkdir -p -m 700 /root/.ssh") builder.copy_from_host("key.pub", "/root/.ssh/authorized_keys") builder.wait_for_unit("sshd") - builder.wait_for_unit("network-addresses-eth1.service") + builder.wait_for_unit("network-online.target") # Make sure the builder can handle our login correctly builder.wait_for_unit("multi-user.target") # Make sure there's no funny business on the client either diff --git a/tests/nixos/s3-binary-cache-store.nix b/tests/nixos/s3-binary-cache-store.nix index fc55a27ae..8e4808660 100644 --- a/tests/nixos/s3-binary-cache-store.nix +++ b/tests/nixos/s3-binary-cache-store.nix @@ -67,14 +67,14 @@ in # Create a binary cache. server.wait_for_unit("minio") - server.wait_for_unit("network-addresses-eth1.service") + server.wait_for_unit("network-online.target") server.succeed("mc config host add minio http://localhost:9000 ${accessKey} ${secretKey} --api s3v4") server.succeed("mc mb minio/my-cache") server.succeed("${env} nix copy --to '${storeUrl}' ${pkgA}") - client.wait_for_unit("network-addresses-eth1.service") + client.wait_for_unit("network-online.target") # Test fetchurl on s3:// URLs while we're at it. client.succeed("${env} nix eval --impure --expr 'builtins.fetchurl { name = \"foo\"; url = \"s3://my-cache/nix-cache-info?endpoint=http://server:9000®ion=eu-west-1\"; }'") diff --git a/tests/nixos/sourcehut-flakes.nix b/tests/nixos/sourcehut-flakes.nix index 61670ccf3..bb26b7ebb 100644 --- a/tests/nixos/sourcehut-flakes.nix +++ b/tests/nixos/sourcehut-flakes.nix @@ -139,8 +139,8 @@ in start_all() sourcehut.wait_for_unit("httpd.service") - sourcehut.wait_for_unit("network-addresses-eth1.service") - client.wait_for_unit("network-addresses-eth1.service") + sourcehut.wait_for_unit("network-online.target") + client.wait_for_unit("network-online.target") client.succeed("curl -v https://git.sr.ht/ >&2") client.succeed("nix registry list | grep nixpkgs") From 994c8b6a7aa5ac303d651a5bd882c6bde1cfa21c Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 20 Feb 2025 01:42:29 +0100 Subject: [PATCH 72/84] Set path display for substituted inputs (cherry picked from commit 4a397cfb808c6e4112ae670589ce10d36239bc7d) --- src/libfetchers/fetchers.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libfetchers/fetchers.cc b/src/libfetchers/fetchers.cc index 8b1b2b0cb..3ae45dcf8 100644 --- a/src/libfetchers/fetchers.cc +++ b/src/libfetchers/fetchers.cc @@ -323,6 +323,8 @@ std::pair, Input> Input::getAccessorUnchecked(ref sto accessor->fingerprint = getFingerprint(store); + accessor->setPathDisplay("«" + to_string() + "»"); + return {accessor, *this}; } catch (Error & e) { debug("substitution of input '%s' failed: %s", to_string(), e.what()); From 36ce86dfb6cb2ebfdefa209483638360799c79d4 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Thu, 3 Apr 2025 23:15:24 +0200 Subject: [PATCH 73/84] Revert "remove obsolete stdenv darwinMinVersion override" This reverts commit d91310bb32b9efca2f1e1a6a767cbe5b0a7f072c. > Some packages require setting a non-default deployment target > (or minimum version) to gain access to certain APIs. You do > that using the darwinMinVersionHook, which takes the deployment > target version as a parameter. -- https://github.com/NixOS/nixpkgs/blob/60b54c7aee3c0cefde72d1a151bb7d3a46361ca2/doc/stdenv/platform-notes.chapter.md#what-is-a-deployment-target-or-minimum-version-sec-darwin-troubleshooting-using-deployment-targets This will again solve error: ../nix_api_expr.cc:38:18: error: aligned allocation function of type 'void *(std::size_t, std::align_val_t)' is only available on macOS 10.13 or newer -- https://hydra.nixos.org/build/294088946 (cherry picked from commit 5c4a4aeed7aeb808b5c3c6edc89b8f35d640f40b) --- flake.nix | 2 +- packaging/dependencies.nix | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index f2fac4f43..674326925 100644 --- a/flake.nix +++ b/flake.nix @@ -171,7 +171,7 @@ { otherSplices = final.generateSplicesForMkScope "nixDependencies"; f = import ./packaging/dependencies.nix { - inherit stdenv; + inherit inputs stdenv; pkgs = final; }; }; diff --git a/packaging/dependencies.nix b/packaging/dependencies.nix index f06b65dee..0af670bfb 100644 --- a/packaging/dependencies.nix +++ b/packaging/dependencies.nix @@ -1,14 +1,33 @@ # These overrides are applied to the dependencies of the Nix components. { + # Flake inputs; used for sources + inputs, + # The raw Nixpkgs, not affected by this scope pkgs, stdenv, }: +let + prevStdenv = stdenv; +in + let inherit (pkgs) lib; + + stdenv = if prevStdenv.isDarwin && prevStdenv.isx86_64 then darwinStdenv else prevStdenv; + + # Fix the following error with the default x86_64-darwin SDK: + # + # error: aligned allocation function of type 'void *(std::size_t, std::align_val_t)' is only available on macOS 10.13 or newer + # + # Despite the use of the 10.13 deployment target here, the aligned + # allocation function Clang uses with this setting actually works + # all the way back to 10.6. + darwinStdenv = pkgs.overrideSDK prevStdenv { darwinMinVersion = "10.13"; }; + in scope: { inherit stdenv; From b9fc326a9ab4c5bd1cdc112157c627d564ed0d46 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Thu, 3 Apr 2025 23:21:11 +0200 Subject: [PATCH 74/84] packaging/dependency: Clarify darwinMinVersion (cherry picked from commit 4be92e7b82376a76e78622d61c7db047f6bbf402) --- packaging/dependencies.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packaging/dependencies.nix b/packaging/dependencies.nix index 0af670bfb..ed05843c7 100644 --- a/packaging/dependencies.nix +++ b/packaging/dependencies.nix @@ -26,6 +26,9 @@ let # Despite the use of the 10.13 deployment target here, the aligned # allocation function Clang uses with this setting actually works # all the way back to 10.6. + # NOTE: this is not just a version constraint, but a request to make Darwin + # provide this version level of support. Removing this minimum version + # request will regress the above error. darwinStdenv = pkgs.overrideSDK prevStdenv { darwinMinVersion = "10.13"; }; in From 651df5099608e19bbbaa739c1843bd6211700a7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 3 Apr 2025 13:27:39 +0200 Subject: [PATCH 75/84] create cache entry for paths already in the nix store This allows path:/nix/store/* paths to not be copied twice to the nix store. (cherry picked from commit 61c6210dbf2096b89d1c4bc963bc3a044042fed4) --- src/libfetchers/fetch-to-store.cc | 23 +++++++++++++------ .../include/nix/fetchers/fetch-to-store.hh | 4 ++++ src/libfetchers/path.cc | 10 ++++++++ 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/src/libfetchers/fetch-to-store.cc b/src/libfetchers/fetch-to-store.cc index ea33922b6..f1b02f4e0 100644 --- a/src/libfetchers/fetch-to-store.cc +++ b/src/libfetchers/fetch-to-store.cc @@ -1,9 +1,23 @@ #include "nix/fetchers/fetch-to-store.hh" #include "nix/fetchers/fetchers.hh" -#include "nix/fetchers/cache.hh" namespace nix { +fetchers::Cache::Key makeFetchToStoreCacheKey( + const std::string &name, + const std::string &fingerprint, + ContentAddressMethod method, + const std::string &path) +{ + return fetchers::Cache::Key{"fetchToStore", { + {"name", name}, + {"fingerprint", fingerprint}, + {"method", std::string{method.render()}}, + {"path", path} + }}; + +} + StorePath fetchToStore( Store & store, const SourcePath & path, @@ -19,12 +33,7 @@ StorePath fetchToStore( std::optional cacheKey; if (!filter && path.accessor->fingerprint) { - cacheKey = fetchers::Cache::Key{"fetchToStore", { - {"name", std::string{name}}, - {"fingerprint", *path.accessor->fingerprint}, - {"method", std::string{method.render()}}, - {"path", path.path.abs()} - }}; + cacheKey = makeFetchToStoreCacheKey(std::string{name}, *path.accessor->fingerprint, method, path.path.abs()); if (auto res = fetchers::getCache()->lookupStorePath(*cacheKey, store)) { debug("store path cache hit for '%s'", path); return res->storePath; diff --git a/src/libfetchers/include/nix/fetchers/fetch-to-store.hh b/src/libfetchers/include/nix/fetchers/fetch-to-store.hh index a0144cb76..44c33c147 100644 --- a/src/libfetchers/include/nix/fetchers/fetch-to-store.hh +++ b/src/libfetchers/include/nix/fetchers/fetch-to-store.hh @@ -5,6 +5,7 @@ #include "nix/util/file-system.hh" #include "nix/util/repair-flag.hh" #include "nix/util/file-content-address.hh" +#include "nix/fetchers/cache.hh" namespace nix { @@ -22,4 +23,7 @@ StorePath fetchToStore( PathFilter * filter = nullptr, RepairFlag repair = NoRepair); +fetchers::Cache::Key makeFetchToStoreCacheKey( + const std::string & name, const std::string & fingerprint, ContentAddressMethod method, const std::string & path); + } diff --git a/src/libfetchers/path.cc b/src/libfetchers/path.cc index 173368dcc..670397cb6 100644 --- a/src/libfetchers/path.cc +++ b/src/libfetchers/path.cc @@ -2,6 +2,8 @@ #include "nix/store/store-api.hh" #include "nix/util/archive.hh" #include "nix/fetchers/store-path-accessor.hh" +#include "nix/fetchers/cache.hh" +#include "nix/fetchers/fetch-to-store.hh" namespace nix::fetchers { @@ -142,6 +144,14 @@ struct PathInputScheme : InputScheme storePath = store->addToStoreFromDump(*src, "source"); } + // To avoid copying the path again to the /nix/store, we need to add a cache entry. + ContentAddressMethod method = ContentAddressMethod::Raw::NixArchive; + auto fp = getFingerprint(store, input); + if (fp) { + auto cacheKey = makeFetchToStoreCacheKey(input.getName(), *fp, method, "/"); + fetchers::getCache()->upsert(cacheKey, *store, {}, *storePath); + } + /* Trust the lastModified value supplied by the user, if any. It's not a "secure" attribute so we don't care. */ if (!input.getLastModified()) From 0b4fea787232ab009dac7e6eeda46a967df64730 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Wed, 2 Apr 2025 15:17:26 -0400 Subject: [PATCH 76/84] Fix windows build (cherry picked from commit 652a628d1c49c4ec11018a4cce775a48383ca307) --- src/libfetchers/git.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libfetchers/git.cc b/src/libfetchers/git.cc index 4cc726076..71bb8c0b7 100644 --- a/src/libfetchers/git.cc +++ b/src/libfetchers/git.cc @@ -535,7 +535,7 @@ struct GitInputScheme : InputScheme static MakeNotAllowedError makeNotAllowedError(std::filesystem::path repoPath) { return [repoPath{std::move(repoPath)}](const CanonPath & path) -> RestrictedPathError { - if (nix::pathExists(repoPath / path.rel())) + if (fs::symlink_exists(repoPath / path.rel())) return RestrictedPathError( "Path '%1%' in the repository %2% is not tracked by Git.\n" "\n" From d81cd04d232aef91e0c367c2de52a79272d77272 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 4 Apr 2025 18:03:19 +0200 Subject: [PATCH 77/84] Bump version --- .version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.version b/.version index 90efbd4e3..9738a24f6 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -2.28.0 +2.28.1 From 5c90b41715261120f69f7dd171bc2e6691ceab10 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sat, 5 Apr 2025 00:45:19 +0200 Subject: [PATCH 78/84] Add -Wundef to make #if FOO an error if not defined This commit has all the straightforward stuff. --- nix-meson-build-support/common/meson.build | 1 + src/build-remote/build-remote.cc | 4 ++-- src/libexpr-tests/main.cc | 2 +- src/libexpr/eval-gc.cc | 2 +- src/libmain/shared.cc | 4 ++-- src/libstore-tests/s3-binary-cache-store.cc | 1 + src/libstore/filetransfer.cc | 1 + src/libstore/globals.cc | 10 +++++----- src/libstore/include/nix/store/globals.hh | 2 +- src/libstore/include/nix/store/s3.hh | 2 +- src/libstore/optimise-store.cc | 3 ++- src/libstore/posix-fs-canonicalise.cc | 2 +- src/libstore/s3-binary-cache-store.cc | 1 + .../unix/build/local-derivation-goal.cc | 18 ++++++++++-------- src/libutil/archive.cc | 2 +- src/libutil/file-descriptor.cc | 2 +- src/libutil/file-system.cc | 2 +- src/libutil/fs-sink.cc | 2 +- .../include/nix/util/file-descriptor.hh | 4 ++-- src/libutil/terminal.cc | 2 +- src/libutil/unix/processes.cc | 2 +- src/nix/crash-handler.cc | 2 +- src/nix/unix/daemon.cc | 2 +- 23 files changed, 40 insertions(+), 33 deletions(-) diff --git a/nix-meson-build-support/common/meson.build b/nix-meson-build-support/common/meson.build index 67b6658f5..9d77831b3 100644 --- a/nix-meson-build-support/common/meson.build +++ b/nix-meson-build-support/common/meson.build @@ -10,6 +10,7 @@ add_project_arguments( '-Werror=suggest-override', '-Werror=switch', '-Werror=switch-enum', + '-Werror=undef', '-Werror=unused-result', '-Wignored-qualifiers', '-Wimplicit-fallthrough', diff --git a/src/build-remote/build-remote.cc b/src/build-remote/build-remote.cc index b4eaa389b..60247b735 100644 --- a/src/build-remote/build-remote.cc +++ b/src/build-remote/build-remote.cc @@ -5,7 +5,7 @@ #include #include #include -#if __APPLE__ +#ifdef __APPLE__ #include #endif @@ -225,7 +225,7 @@ static int main_build_remote(int argc, char * * argv) break; } -#if __APPLE__ +#ifdef __APPLE__ futimes(bestSlotLock.get(), NULL); #else futimens(bestSlotLock.get(), NULL); diff --git a/src/libexpr-tests/main.cc b/src/libexpr-tests/main.cc index 6fdaa9178..66afc2272 100644 --- a/src/libexpr-tests/main.cc +++ b/src/libexpr-tests/main.cc @@ -27,7 +27,7 @@ int main (int argc, char **argv) { settings.sandboxBuildDir = "/test-build-dir-instead-of-usual-build-dir"; #endif - #if __APPLE__ + #ifdef __APPLE__ // Avoid this error, when already running in a sandbox: // sandbox-exec: sandbox_apply: Operation not permitted settings.sandboxMode = smDisabled; diff --git a/src/libexpr/eval-gc.cc b/src/libexpr/eval-gc.cc index 6fc5ac334..bec668001 100644 --- a/src/libexpr/eval-gc.cc +++ b/src/libexpr/eval-gc.cc @@ -10,7 +10,7 @@ #if NIX_USE_BOEHMGC # include -# if __FreeBSD__ +# ifdef __FreeBSD__ # include # endif diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc index 65bfcfbd5..7ff93f6d9 100644 --- a/src/libmain/shared.cc +++ b/src/libmain/shared.cc @@ -26,7 +26,7 @@ #include "nix/util/strings.hh" #include "main-config-private.hh" - +#include "nix/expr/config.hh" namespace nix { @@ -144,7 +144,7 @@ void initNix(bool loadConfig) if (sigaction(SIGUSR1, &act, 0)) throw SysError("handling SIGUSR1"); #endif -#if __APPLE__ +#ifdef __APPLE__ /* HACK: on darwin, we need can’t use sigprocmask with SIGWINCH. * Instead, add a dummy sigaction handler, and signalHandlerThread * can handle the rest. */ diff --git a/src/libstore-tests/s3-binary-cache-store.cc b/src/libstore-tests/s3-binary-cache-store.cc index be338084f..dbb414f2b 100644 --- a/src/libstore-tests/s3-binary-cache-store.cc +++ b/src/libstore-tests/s3-binary-cache-store.cc @@ -1,3 +1,4 @@ +#include "store-tests-config.hh" #if ENABLE_S3 # include diff --git a/src/libstore/filetransfer.cc b/src/libstore/filetransfer.cc index 9d83bfa13..2851ab048 100644 --- a/src/libstore/filetransfer.cc +++ b/src/libstore/filetransfer.cc @@ -8,6 +8,7 @@ #include "nix/util/callback.hh" #include "nix/util/signals.hh" +#include "store-config-private.hh" #if ENABLE_S3 #include #endif diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc index a3633b084..6b93e34bb 100644 --- a/src/libstore/globals.cc +++ b/src/libstore/globals.cc @@ -25,7 +25,7 @@ # include #endif -#if __APPLE__ +#ifdef __APPLE__ # include "nix/util/processes.hh" #endif @@ -90,7 +90,7 @@ Settings::Settings() #endif /* chroot-like behavior from Apple's sandbox */ -#if __APPLE__ +#ifdef __APPLE__ sandboxPaths = tokenizeString("/System/Library/Frameworks /System/Library/PrivateFrameworks /bin/sh /bin/bash /private/tmp /private/var/tmp /usr/lib"); allowedImpureHostPrefixes = tokenizeString("/System/Library /usr/lib /dev /bin/sh"); #endif @@ -151,7 +151,7 @@ unsigned int Settings::getDefaultCores() return concurrency; } -#if __APPLE__ +#ifdef __APPLE__ static bool hasVirt() { int hasVMM; @@ -190,7 +190,7 @@ StringSet Settings::getDefaultSystemFeatures() features.insert("kvm"); #endif - #if __APPLE__ + #ifdef __APPLE__ if (hasVirt()) features.insert("apple-virt"); #endif @@ -374,7 +374,7 @@ void initLibStore(bool loadConfig) { [1] https://github.com/apple-oss-distributions/objc4/blob/01edf1705fbc3ff78a423cd21e03dfc21eb4d780/runtime/objc-initialize.mm#L614-L636 */ curl_global_init(CURL_GLOBAL_ALL); -#if __APPLE__ +#ifdef __APPLE__ /* On macOS, don't use the per-session TMPDIR (as set e.g. by sshd). This breaks build users because they don't have access to the TMPDIR, in particular in ‘nix-store --serve’. */ diff --git a/src/libstore/include/nix/store/globals.hh b/src/libstore/include/nix/store/globals.hh index 4c4395e05..38757bcd4 100644 --- a/src/libstore/include/nix/store/globals.hh +++ b/src/libstore/include/nix/store/globals.hh @@ -708,7 +708,7 @@ public: Setting allowedImpureHostPrefixes{this, {}, "allowed-impure-host-deps", "Which prefixes to allow derivations to ask for access to (primarily for Darwin)."}; -#if __APPLE__ +#ifdef __APPLE__ Setting darwinLogSandboxViolations{this, false, "darwin-log-sandbox-violations", "Whether to log Darwin sandbox access violations to the system log."}; #endif diff --git a/src/libstore/include/nix/store/s3.hh b/src/libstore/include/nix/store/s3.hh index c49fa3fb8..5ac5b9a9f 100644 --- a/src/libstore/include/nix/store/s3.hh +++ b/src/libstore/include/nix/store/s3.hh @@ -1,6 +1,6 @@ #pragma once ///@file - +#include "store-config-private.hh" #if ENABLE_S3 #include "nix/util/ref.hh" diff --git a/src/libstore/optimise-store.cc b/src/libstore/optimise-store.cc index 17e13758b..277795053 100644 --- a/src/libstore/optimise-store.cc +++ b/src/libstore/optimise-store.cc @@ -13,6 +13,7 @@ #include #include +#include "store-config-private.hh" namespace nix { @@ -96,7 +97,7 @@ void LocalStore::optimisePath_(Activity * act, OptimiseStats & stats, auto st = lstat(path); -#if __APPLE__ +#ifdef __APPLE__ /* HFS/macOS has some undocumented security feature disabling hardlinking for special files within .app dirs. Known affected paths include *.app/Contents/{PkgInfo,Resources/\*.lproj,_CodeSignature} and .DS_Store. diff --git a/src/libstore/posix-fs-canonicalise.cc b/src/libstore/posix-fs-canonicalise.cc index df51ba307..aeb35eab5 100644 --- a/src/libstore/posix-fs-canonicalise.cc +++ b/src/libstore/posix-fs-canonicalise.cc @@ -58,7 +58,7 @@ static void canonicalisePathMetaData_( { checkInterrupt(); -#if __APPLE__ +#ifdef __APPLE__ /* Remove flags, in particular UF_IMMUTABLE which would prevent the file from being garbage-collected. FIXME: Use setattrlist() to remove other attributes as well. */ diff --git a/src/libstore/s3-binary-cache-store.cc b/src/libstore/s3-binary-cache-store.cc index e76a508ba..4e51e728a 100644 --- a/src/libstore/s3-binary-cache-store.cc +++ b/src/libstore/s3-binary-cache-store.cc @@ -1,3 +1,4 @@ +#include "store-config-private.hh" #if ENABLE_S3 #include diff --git a/src/libstore/unix/build/local-derivation-goal.cc b/src/libstore/unix/build/local-derivation-goal.cc index 302569ac6..c7a0e3ccb 100644 --- a/src/libstore/unix/build/local-derivation-goal.cc +++ b/src/libstore/unix/build/local-derivation-goal.cc @@ -60,7 +60,7 @@ # include "nix/store/personality.hh" #endif -#if __APPLE__ +#ifdef __APPLE__ #include #include #include @@ -76,6 +76,8 @@ extern "C" int sandbox_init_with_parameters(const char *profile, uint64_t flags, #include "nix/util/strings.hh" #include "nix/util/signals.hh" +#include "store-config-private.hh" + namespace nix { void handleDiffHook( @@ -205,7 +207,7 @@ Goal::Co LocalDerivationGoal::tryLocalBuild() if (drvOptions->noChroot) throw Error("derivation '%s' has '__noChroot' set, " "but that's not allowed when 'sandbox' is 'true'", worker.store.printStorePath(drvPath)); -#if __APPLE__ +#ifdef __APPLE__ if (drvOptions->additionalSandboxProfile != "") throw Error("derivation '%s' specifies a sandbox profile, " "but this is only allowed when 'sandbox' is 'relaxed'", worker.store.printStorePath(drvPath)); @@ -548,7 +550,7 @@ void LocalDerivationGoal::startBuilder() /* Create a temporary directory where the build will take place. */ topTmpDir = createTempDir(settings.buildDir.get().value_or(""), "nix-build-" + std::string(drvPath.name()), false, false, 0700); -#if __APPLE__ +#ifdef __APPLE__ if (false) { #else if (useChroot) { @@ -826,7 +828,7 @@ void LocalDerivationGoal::startBuilder() #else if (drvOptions->useUidRange(*drv)) throw Error("feature 'uid-range' is not supported on this platform"); - #if __APPLE__ + #ifdef __APPLE__ /* We don't really have any parent prep work to do (yet?) All work happens in the child, instead. */ #else @@ -906,7 +908,7 @@ void LocalDerivationGoal::startBuilder() if (chown(slaveName.c_str(), buildUser->getUID(), 0)) throw SysError("changing owner of pseudoterminal slave"); } -#if __APPLE__ +#ifdef __APPLE__ else { if (grantpt(builderOut.get())) throw SysError("granting access to pseudoterminal slave"); @@ -1933,7 +1935,7 @@ void LocalDerivationGoal::runChild() for (auto & i : pathsInChroot) { if (i.second.source == "/proc") continue; // backwards compatibility - #if HAVE_EMBEDDED_SANDBOX_SHELL + #ifdef HAVE_EMBEDDED_SANDBOX_SHELL if (i.second.source == "__embedded_sandbox_shell__") { static unsigned char sh[] = { #include "embedded-sandbox-shell.gen.hh" @@ -2087,7 +2089,7 @@ void LocalDerivationGoal::runChild() throw SysError("setuid failed"); } -#if __APPLE__ +#ifdef __APPLE__ /* This has to appear before import statements. */ std::string sandboxProfile = "(version 1)\n"; @@ -2258,7 +2260,7 @@ void LocalDerivationGoal::runChild() for (auto & i : drv->args) args.push_back(rewriteStrings(i, inputRewrites)); -#if __APPLE__ +#ifdef __APPLE__ posix_spawnattr_t attrp; if (posix_spawnattr_init(&attrp)) diff --git a/src/libutil/archive.cc b/src/libutil/archive.cc index 143d01085..487873ce6 100644 --- a/src/libutil/archive.cc +++ b/src/libutil/archive.cc @@ -17,7 +17,7 @@ namespace nix { struct ArchiveSettings : Config { Setting useCaseHack{this, - #if __APPLE__ + #ifdef __APPLE__ true, #else false, diff --git a/src/libutil/file-descriptor.cc b/src/libutil/file-descriptor.cc index 042edbf55..4fc0f06cd 100644 --- a/src/libutil/file-descriptor.cc +++ b/src/libutil/file-descriptor.cc @@ -98,7 +98,7 @@ void AutoCloseFD::fsync() const result = #ifdef _WIN32 ::FlushFileBuffers(fd) -#elif __APPLE__ +#elif defined(__APPLE__) ::fcntl(fd, F_FULLFSYNC) #else ::fsync(fd) diff --git a/src/libutil/file-system.cc b/src/libutil/file-system.cc index c8161d270..c7cea4b58 100644 --- a/src/libutil/file-system.cc +++ b/src/libutil/file-system.cc @@ -574,7 +574,7 @@ Path createTempDir(const Path & tmpRoot, const Path & prefix, , mode #endif ) == 0) { -#if __FreeBSD__ +#ifdef __FreeBSD__ /* Explicitly set the group of the directory. This is to work around around problems caused by BSD's group ownership semantics (directories inherit the group of diff --git a/src/libutil/fs-sink.cc b/src/libutil/fs-sink.cc index aa46b3cd2..7b8fc3b2a 100644 --- a/src/libutil/fs-sink.cc +++ b/src/libutil/fs-sink.cc @@ -4,7 +4,7 @@ #include "nix/util/config-global.hh" #include "nix/util/fs-sink.hh" -#if _WIN32 +#ifdef _WIN32 # include # include "nix/util/file-path.hh" # include "nix/util/windows-error.hh" diff --git a/src/libutil/include/nix/util/file-descriptor.hh b/src/libutil/include/nix/util/file-descriptor.hh index 2e8b4ce10..4f13a9a8f 100644 --- a/src/libutil/include/nix/util/file-descriptor.hh +++ b/src/libutil/include/nix/util/file-descriptor.hh @@ -18,7 +18,7 @@ struct Source; * Operating System capability */ using Descriptor = -#if _WIN32 +#ifdef _WIN32 HANDLE #else int @@ -26,7 +26,7 @@ using Descriptor = ; const Descriptor INVALID_DESCRIPTOR = -#if _WIN32 +#ifdef _WIN32 INVALID_HANDLE_VALUE #else -1 diff --git a/src/libutil/terminal.cc b/src/libutil/terminal.cc index 77766fae1..fa0f7e871 100644 --- a/src/libutil/terminal.cc +++ b/src/libutil/terminal.cc @@ -2,7 +2,7 @@ #include "nix/util/environment-variables.hh" #include "nix/util/sync.hh" -#if _WIN32 +#ifdef _WIN32 # include # define WIN32_LEAN_AND_MEAN # include diff --git a/src/libutil/unix/processes.cc b/src/libutil/unix/processes.cc index c436076ee..4df0a7777 100644 --- a/src/libutil/unix/processes.cc +++ b/src/libutil/unix/processes.cc @@ -78,7 +78,7 @@ int Pid::kill() /* On BSDs, killing a process group will return EPERM if all processes in the group are zombies (or something like that). So try to detect and ignore that situation. */ -#if __FreeBSD__ || __APPLE__ +#if defined(__FreeBSD__) || defined(__APPLE__) if (errno != EPERM || ::kill(pid, 0) != 0) #endif logError(SysError("killing process %d", pid).info()); diff --git a/src/nix/crash-handler.cc b/src/nix/crash-handler.cc index 17d346ecc..d65773fa0 100644 --- a/src/nix/crash-handler.cc +++ b/src/nix/crash-handler.cc @@ -8,7 +8,7 @@ #include // Darwin and FreeBSD stdenv do not define _GNU_SOURCE but do have _Unwind_Backtrace. -#if __APPLE__ || __FreeBSD__ +#if defined(__APPLE__) || defined(__FreeBSD__) # define BOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED #endif diff --git a/src/nix/unix/daemon.cc b/src/nix/unix/daemon.cc index 4e60ba102..1acf2bd5b 100644 --- a/src/nix/unix/daemon.cc +++ b/src/nix/unix/daemon.cc @@ -38,7 +38,7 @@ #include "nix/util/cgroup.hh" #endif -#if __APPLE__ || __FreeBSD__ +#if defined(__APPLE__) || defined(__FreeBSD__) #include #endif From bd2d5b7335ea1c3e756bf27b775729e580b0b27b Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sat, 5 Apr 2025 00:46:06 +0200 Subject: [PATCH 79/84] Hack together a fix for the public headers Please fix this. --- src/libexpr/expr-config.hh | 3 +++ src/libexpr/include/nix/expr/config.hh | 1 + src/libexpr/include/nix/expr/meson.build | 1 + src/libexpr/meson.build | 11 +++++++++++ src/libmain/meson.build | 2 ++ src/libmain/package.nix | 5 +++++ src/libstore-tests/meson.build | 3 +++ src/libstore/meson.build | 8 +++++++- 8 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 src/libexpr/expr-config.hh create mode 120000 src/libexpr/include/nix/expr/config.hh diff --git a/src/libexpr/expr-config.hh b/src/libexpr/expr-config.hh new file mode 100644 index 000000000..e28b461c0 --- /dev/null +++ b/src/libexpr/expr-config.hh @@ -0,0 +1,3 @@ +// TODO: Remove this damn file while keeping public config headers working +#error \ + "This file is a placeholder. It only exists so that meson accepts the symbolic link include/nix/expr/config.hh to this file, but we expect meson to overwrite it with the real file. Apparently that did not happen. I deeply apologize for this mess." diff --git a/src/libexpr/include/nix/expr/config.hh b/src/libexpr/include/nix/expr/config.hh new file mode 120000 index 000000000..45d3ca29d --- /dev/null +++ b/src/libexpr/include/nix/expr/config.hh @@ -0,0 +1 @@ +../../../expr-config.hh \ No newline at end of file diff --git a/src/libexpr/include/nix/expr/meson.build b/src/libexpr/include/nix/expr/meson.build index 01275e52e..3eb80de68 100644 --- a/src/libexpr/include/nix/expr/meson.build +++ b/src/libexpr/include/nix/expr/meson.build @@ -10,6 +10,7 @@ config_pub_h = configure_file( headers = [config_pub_h] + files( 'attr-path.hh', 'attr-set.hh', + 'config.hh', 'eval-cache.hh', 'eval-error.hh', 'eval-gc.hh', diff --git a/src/libexpr/meson.build b/src/libexpr/meson.build index 2e773938d..402bca0e1 100644 --- a/src/libexpr/meson.build +++ b/src/libexpr/meson.build @@ -79,6 +79,11 @@ config_priv_h = configure_file( output : 'expr-config-private.hh', ) +config_pub_h = configure_file( + configuration : configdata_pub, + output : 'expr-config.hh', +) + subdir('nix-meson-build-support/common') parser_tab = custom_target( @@ -163,6 +168,8 @@ subdir('primops') subdir('nix-meson-build-support/export-all-symbols') subdir('nix-meson-build-support/windows-version') +headers += [config_pub_h] + this_library = library( 'nixexpr', sources, @@ -181,4 +188,8 @@ install_headers(headers, subdir : 'nix/expr', preserve_path : true) libraries_private = [] +nixexpr_dep = declare_dependency( + include_directories : include_directories('.'), + link_with : this_library, +) subdir('nix-meson-build-support/export') diff --git a/src/libmain/meson.build b/src/libmain/meson.build index 414fc679f..4f78d265b 100644 --- a/src/libmain/meson.build +++ b/src/libmain/meson.build @@ -17,6 +17,8 @@ subdir('nix-meson-build-support/deps-lists') configdata = configuration_data() deps_private_maybe_subproject = [ + # This dependency may be very limited; was introduced for NIX_USE_BOEHMGC macro dependency + dependency('nix-expr'), ] deps_public_maybe_subproject = [ dependency('nix-util'), diff --git a/src/libmain/package.nix b/src/libmain/package.nix index 949603464..7b0a4dee7 100644 --- a/src/libmain/package.nix +++ b/src/libmain/package.nix @@ -6,6 +6,7 @@ nix-util, nix-store, + nix-expr, # Configuration Options @@ -33,6 +34,10 @@ mkMesonLibrary (finalAttrs: { ]; propagatedBuildInputs = [ + # FIXME: This is only here for the NIX_USE_BOEHMGC macro dependency + # Removing nix-expr will make the build more concurrent and is + # architecturally nice, perhaps. + nix-expr nix-util nix-store openssl diff --git a/src/libstore-tests/meson.build b/src/libstore-tests/meson.build index 1822a3520..eb3d14530 100644 --- a/src/libstore-tests/meson.build +++ b/src/libstore-tests/meson.build @@ -40,6 +40,9 @@ deps_private += gtest configdata = configuration_data() configdata.set_quoted('PACKAGE_VERSION', meson.project_version()) +aws_s3 = dependency('aws-cpp-sdk-s3', required : false) +configdata.set('ENABLE_S3', aws_s3.found().to_int()) + config_priv_h = configure_file( configuration : configdata, output : 'store-tests-config.hh', diff --git a/src/libstore/meson.build b/src/libstore/meson.build index 1ee11ec11..fecf2f449 100644 --- a/src/libstore/meson.build +++ b/src/libstore/meson.build @@ -158,6 +158,7 @@ if get_option('embedded-sandbox-shell') # The path to busybox is passed as a -D flag when compiling this_library. # This solution is inherited from the old make buildsystem # TODO: do this differently? + # TODO: at least define it unconditionally, so we get checking from -Wundef configdata_priv.set('HAVE_EMBEDDED_SANDBOX_SHELL', 1) hexdump = find_program('hexdump', native : true) embedded_sandbox_shell_gen = custom_target( @@ -181,6 +182,11 @@ config_priv_h = configure_file( output : 'store-config-private.hh', ) +config_pub_h = configure_file( + configuration : configdata_pub, + output : 'store-config.hh', +) + subdir('nix-meson-build-support/common') sources = files( @@ -362,7 +368,7 @@ this_library = library( install : true, ) -install_headers(headers, subdir : 'nix/store', preserve_path : true) +install_headers(headers + [ config_pub_h ], subdir : 'nix/store', preserve_path : true) libraries_private = [] From 615344fdf05334ffc25a85f30080ee970f0e1426 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sat, 5 Apr 2025 00:58:07 +0200 Subject: [PATCH 80/84] Fix more -Wundef, in darwin context --- src/libexpr-tests/main.cc | 2 +- src/libstore/filetransfer.cc | 4 +-- src/libstore/gc.cc | 4 +-- src/libstore/globals.cc | 8 ++--- src/libstore/include/nix/store/globals.hh | 14 ++++----- src/libstore/local-store.cc | 4 +-- src/libstore/store-api.cc | 2 +- .../unix/build/local-derivation-goal.cc | 30 +++++++++---------- src/libstore/unix/user-lock.cc | 6 ++-- src/libutil/current-process.cc | 8 ++--- src/libutil/file-descriptor.cc | 2 +- src/libutil/unix/file-descriptor.cc | 6 ++-- src/libutil/unix/processes.cc | 4 +-- src/libutil/unix/signals.cc | 2 +- src/nix/main.cc | 4 +-- src/nix/run.cc | 8 ++--- src/nix/unix/daemon.cc | 4 +-- 17 files changed, 56 insertions(+), 56 deletions(-) diff --git a/src/libexpr-tests/main.cc b/src/libexpr-tests/main.cc index 66afc2272..52cca53c4 100644 --- a/src/libexpr-tests/main.cc +++ b/src/libexpr-tests/main.cc @@ -14,7 +14,7 @@ int main (int argc, char **argv) { // Disable build hook. We won't be testing remote builds in these unit tests. If we do, fix the above build hook. settings.buildHook = {}; - #if __linux__ // should match the conditional around sandboxBuildDir declaration. + #ifdef __linux__ // should match the conditional around sandboxBuildDir declaration. // When building and testing nix within the host's Nix sandbox, our store dir will be located in the host's sandboxBuildDir, e.g.: // Host diff --git a/src/libstore/filetransfer.cc b/src/libstore/filetransfer.cc index 2851ab048..e85896224 100644 --- a/src/libstore/filetransfer.cc +++ b/src/libstore/filetransfer.cc @@ -13,7 +13,7 @@ #include #endif -#if __linux__ +#ifdef __linux__ # include "nix/util/namespaces.hh" #endif @@ -622,7 +622,7 @@ struct curlFileTransfer : public FileTransfer }); #endif - #if __linux__ + #ifdef __linux__ try { tryUnshareFilesystem(); } catch (nix::Error & e) { diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc index cb3a3c1cd..dabfa4a5f 100644 --- a/src/libstore/gc.cc +++ b/src/libstore/gc.cc @@ -335,7 +335,7 @@ static std::string quoteRegexChars(const std::string & raw) return std::regex_replace(raw, specialRegex, R"(\$&)"); } -#if __linux__ +#ifdef __linux__ static void readFileRoots(const std::filesystem::path & path, UncheckedRoots & roots) { try { @@ -427,7 +427,7 @@ void LocalStore::findRuntimeRoots(Roots & roots, bool censor) } #endif -#if __linux__ +#ifdef __linux__ readFileRoots("/proc/sys/kernel/modprobe", unchecked); readFileRoots("/proc/sys/kernel/fbsplash", unchecked); readFileRoots("/proc/sys/kernel/poweroff_cmd", unchecked); diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc index 6b93e34bb..1df0a846e 100644 --- a/src/libstore/globals.cc +++ b/src/libstore/globals.cc @@ -181,11 +181,11 @@ StringSet Settings::getDefaultSystemFeatures() actually require anything special on the machines. */ StringSet features{"nixos-test", "benchmark", "big-parallel"}; - #if __linux__ + #ifdef __linux__ features.insert("uid-range"); #endif - #if __linux__ + #ifdef __linux__ if (access("/dev/kvm", R_OK | W_OK) == 0) features.insert("kvm"); #endif @@ -205,7 +205,7 @@ StringSet Settings::getDefaultExtraPlatforms() if (std::string{NIX_LOCAL_SYSTEM} == "x86_64-linux" && !isWSL1()) extraPlatforms.insert("i686-linux"); -#if __linux__ +#ifdef __linux__ StringSet levels = computeLevels(); for (auto iter = levels.begin(); iter != levels.end(); ++iter) extraPlatforms.insert(*iter + "-linux"); @@ -224,7 +224,7 @@ StringSet Settings::getDefaultExtraPlatforms() bool Settings::isWSL1() { -#if __linux__ +#ifdef __linux__ struct utsname utsbuf; uname(&utsbuf); // WSL1 uses -Microsoft suffix diff --git a/src/libstore/include/nix/store/globals.hh b/src/libstore/include/nix/store/globals.hh index 38757bcd4..82211d8dc 100644 --- a/src/libstore/include/nix/store/globals.hh +++ b/src/libstore/include/nix/store/globals.hh @@ -34,7 +34,7 @@ struct MaxBuildJobsSetting : public BaseSetting }; const uint32_t maxIdsPerBuild = - #if __linux__ + #ifdef __linux__ 1 << 16 #else 1 @@ -467,7 +467,7 @@ public: )", {}, true, Xp::AutoAllocateUids}; Setting startId{this, - #if __linux__ + #ifdef __linux__ 0x34000000, #else 56930, @@ -476,7 +476,7 @@ public: "The first UID and GID to use for dynamic ID allocation."}; Setting uidCount{this, - #if __linux__ + #ifdef __linux__ maxIdsPerBuild * 128, #else 128, @@ -484,7 +484,7 @@ public: "id-count", "The number of UIDs/GIDs to use for dynamic ID allocation."}; - #if __linux__ + #ifdef __linux__ Setting useCgroups{ this, false, "use-cgroups", R"( @@ -596,7 +596,7 @@ public: Setting sandboxMode{ this, - #if __linux__ + #ifdef __linux__ smEnabled #else smDisabled @@ -671,7 +671,7 @@ public: )"}; #endif -#if __linux__ +#ifdef __linux__ Setting sandboxShmSize{ this, "50%", "sandbox-dev-shm-size", R"( @@ -1066,7 +1066,7 @@ public: // Don't document the machine-specific default value false}; -#if __linux__ +#ifdef __linux__ Setting filterSyscalls{ this, true, "filter-syscalls", R"( diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index e0699fac0..949f0f74f 100644 --- a/src/libstore/local-store.cc +++ b/src/libstore/local-store.cc @@ -38,7 +38,7 @@ # include #endif -#if __linux__ +#ifdef __linux__ # include # include # include @@ -575,7 +575,7 @@ void LocalStore::upgradeDBSchema(State & state) bind mount. So make the Nix store writable for this process. */ void LocalStore::makeStoreWritable() { -#if __linux__ +#ifdef __linux__ if (!isRootUser()) return; /* Check if /nix/store is on a read-only mount. */ struct statvfs stat; diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc index a0104b96a..d3bccd7af 100644 --- a/src/libstore/store-api.cc +++ b/src/libstore/store-api.cc @@ -1300,7 +1300,7 @@ ref openStore(StoreReference && storeURI) return std::make_shared(params); else if (pathExists(settings.nixDaemonSocketFile)) return std::make_shared(params); - #if __linux__ + #ifdef __linux__ else if (!pathExists(stateDir) && params.empty() && !isRootUser() diff --git a/src/libstore/unix/build/local-derivation-goal.cc b/src/libstore/unix/build/local-derivation-goal.cc index c7a0e3ccb..b521e23bb 100644 --- a/src/libstore/unix/build/local-derivation-goal.cc +++ b/src/libstore/unix/build/local-derivation-goal.cc @@ -41,7 +41,7 @@ #endif /* Includes required for chroot support. */ -#if __linux__ +#ifdef __linux__ # include "nix/store/fchmodat2-compat.hh" # include # include @@ -129,7 +129,7 @@ LocalDerivationGoal::~LocalDerivationGoal() inline bool LocalDerivationGoal::needsHashRewrite() { -#if __linux__ +#ifdef __linux__ return !useChroot; #else /* Darwin requires hash rewriting even when sandboxing is enabled. */ @@ -170,7 +170,7 @@ void LocalDerivationGoal::killChild() void LocalDerivationGoal::killSandbox(bool getStats) { if (cgroup) { - #if __linux__ + #ifdef __linux__ auto stats = destroyCgroup(*cgroup); if (getStats) { buildResult.cpuUser = stats.cpuUser; @@ -222,14 +222,14 @@ Goal::Co LocalDerivationGoal::tryLocalBuild() auto & localStore = getLocalStore(); if (localStore.storeDir != localStore.realStoreDir.get()) { - #if __linux__ + #ifdef __linux__ useChroot = true; #else throw Error("building using a diverted store is not supported on this platform"); #endif } - #if __linux__ + #ifdef __linux__ if (useChroot) { if (!mountAndPidNamespacesSupported()) { if (!settings.sandboxFallback) @@ -405,7 +405,7 @@ void LocalDerivationGoal::cleanupPostOutputsRegisteredModeNonCheck() cleanupPostOutputsRegisteredModeCheck(); } -#if __linux__ +#ifdef __linux__ static void doBind(const Path & source, const Path & target, bool optional = false) { debug("bind mounting '%1%' to '%2%'", source, target); @@ -478,12 +478,12 @@ static void handleChildException(bool sendException) void LocalDerivationGoal::startBuilder() { if ((buildUser && buildUser->getUIDCount() != 1) - #if __linux__ + #ifdef __linux__ || settings.useCgroups #endif ) { - #if __linux__ + #ifdef __linux__ experimentalFeatureSettings.require(Xp::Cgroups); /* If we're running from the daemon, then this will return the @@ -729,7 +729,7 @@ void LocalDerivationGoal::startBuilder() pathsInChroot[i] = {i, true}; } -#if __linux__ +#ifdef __linux__ /* Create a temporary directory in which we set up the chroot environment using bind-mounts. We put it in the Nix store so that the build outputs can be moved efficiently from the @@ -943,7 +943,7 @@ void LocalDerivationGoal::startBuilder() /* Fork a child to build the package. */ -#if __linux__ +#ifdef __linux__ if (useChroot) { /* Set up private namespaces for the build: @@ -1143,7 +1143,7 @@ void LocalDerivationGoal::initTmpDir() { /* In a sandbox, for determinism, always use the same temporary directory. */ -#if __linux__ +#ifdef __linux__ tmpDirInSandbox = useChroot ? settings.sandboxBuildDir : tmpDir; #else tmpDirInSandbox = tmpDir; @@ -1646,7 +1646,7 @@ void LocalDerivationGoal::addDependency(const StorePath & path) debug("materialising '%s' in the sandbox", worker.store.printStorePath(path)); - #if __linux__ + #ifdef __linux__ Path source = worker.store.Store::toRealPath(path); Path target = chrootRootDir + worker.store.printStorePath(path); @@ -1696,7 +1696,7 @@ void LocalDerivationGoal::chownToBuilder(const Path & path) void setupSeccomp() { -#if __linux__ +#ifdef __linux__ if (!settings.filterSyscalls) return; #if HAVE_SECCOMP scmp_filter_ctx ctx; @@ -1816,7 +1816,7 @@ void LocalDerivationGoal::runChild() } catch (SystemError &) { } } -#if __linux__ +#ifdef __linux__ if (useChroot) { userNamespaceSync.writeSide = -1; @@ -2050,7 +2050,7 @@ void LocalDerivationGoal::runChild() /* Close all other file descriptors. */ unix::closeExtraFDs(); -#if __linux__ +#ifdef __linux__ linux::setPersonality(drv->platform); #endif diff --git a/src/libstore/unix/user-lock.cc b/src/libstore/unix/user-lock.cc index 770b00e2d..eb0bac887 100644 --- a/src/libstore/unix/user-lock.cc +++ b/src/libstore/unix/user-lock.cc @@ -10,7 +10,7 @@ namespace nix { -#if __linux__ +#ifdef __linux__ static std::vector get_group_list(const char *username, gid_t group_id) { @@ -94,7 +94,7 @@ struct SimpleUserLock : UserLock if (lock->uid == getuid() || lock->uid == geteuid()) throw Error("the Nix user should not be a member of '%s'", settings.buildUsersGroup); - #if __linux__ + #ifdef __linux__ /* Get the list of supplementary groups of this user. This is * usually either empty or contains a group such as "kvm". */ @@ -193,7 +193,7 @@ std::unique_ptr acquireUserLock(uid_t nrIds, bool useUserNamespace) bool useBuildUsers() { - #if __linux__ + #ifdef __linux__ static bool b = (settings.buildUsersGroup != "" || settings.autoAllocateUids) && isRootUser(); return b; #elif __APPLE__ diff --git a/src/libutil/current-process.cc b/src/libutil/current-process.cc index 4103c0515..8aef47146 100644 --- a/src/libutil/current-process.cc +++ b/src/libutil/current-process.cc @@ -13,7 +13,7 @@ # include #endif -#if __linux__ +#ifdef __linux__ # include # include "nix/util/cgroup.hh" # include "nix/util/namespaces.hh" @@ -23,7 +23,7 @@ namespace nix { unsigned int getMaxCPU() { - #if __linux__ + #ifdef __linux__ try { auto cgroupFS = getCgroupFS(); if (!cgroupFS) return 0; @@ -82,7 +82,7 @@ void restoreProcessContext(bool restoreMounts) unix::restoreSignals(); #endif if (restoreMounts) { - #if __linux__ + #ifdef __linux__ restoreMountNamespace(); #endif } @@ -106,7 +106,7 @@ std::optional getSelfExe() { static auto cached = []() -> std::optional { - #if __linux__ || __GNU__ + #if defined(__linux__) || defined(__GNU__) return readLink("/proc/self/exe"); #elif __APPLE__ char buf[1024]; diff --git a/src/libutil/file-descriptor.cc b/src/libutil/file-descriptor.cc index 4fc0f06cd..9e0827442 100644 --- a/src/libutil/file-descriptor.cc +++ b/src/libutil/file-descriptor.cc @@ -113,7 +113,7 @@ void AutoCloseFD::fsync() const void AutoCloseFD::startFsync() const { -#if __linux__ +#ifdef __linux__ if (fd != -1) { /* Ignore failure, since fsync must be run later anyway. This is just a performance optimization. */ ::sync_file_range(fd, 0, 0, SYNC_FILE_RANGE_WRITE); diff --git a/src/libutil/unix/file-descriptor.cc b/src/libutil/unix/file-descriptor.cc index 6ce307252..73ee49982 100644 --- a/src/libutil/unix/file-descriptor.cc +++ b/src/libutil/unix/file-descriptor.cc @@ -163,7 +163,7 @@ void Pipe::create() ////////////////////////////////////////////////////////////////////// -#if __linux__ || __FreeBSD__ +#if defined(__linux__) || defined(__FreeBSD__) static int unix_close_range(unsigned int first, unsigned int last, int flags) { #if !HAVE_CLOSE_RANGE @@ -179,7 +179,7 @@ void unix::closeExtraFDs() constexpr int MAX_KEPT_FD = 2; static_assert(std::max({STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO}) == MAX_KEPT_FD); -#if __linux__ || __FreeBSD__ +#if defined(__linux__) || defined(__FreeBSD__) // first try to close_range everything we don't care about. if this // returns an error with these parameters we're running on a kernel // that does not implement close_range (i.e. pre 5.9) and fall back @@ -189,7 +189,7 @@ void unix::closeExtraFDs() } #endif -#if __linux__ +#ifdef __linux__ try { for (auto & s : std::filesystem::directory_iterator{"/proc/self/fd"}) { checkInterrupt(); diff --git a/src/libutil/unix/processes.cc b/src/libutil/unix/processes.cc index 4df0a7777..198243c20 100644 --- a/src/libutil/unix/processes.cc +++ b/src/libutil/unix/processes.cc @@ -190,7 +190,7 @@ static pid_t doFork(bool allowVfork, ChildWrapperFunction & fun) } -#if __linux__ +#ifdef __linux__ static int childEntry(void * arg) { auto & fun = *reinterpret_cast(arg); @@ -213,7 +213,7 @@ pid_t startProcess(std::function fun, const ProcessOptions & options) logger = makeSimpleLogger(); } try { -#if __linux__ +#ifdef __linux__ if (options.dieWithParent && prctl(PR_SET_PDEATHSIG, SIGKILL) == -1) throw SysError("setting death signal"); #endif diff --git a/src/libutil/unix/signals.cc b/src/libutil/unix/signals.cc index f1cb28527..665b9b096 100644 --- a/src/libutil/unix/signals.cc +++ b/src/libutil/unix/signals.cc @@ -105,7 +105,7 @@ void unix::setChildSignalMask(sigset_t * sigs) { assert(sigs); // C style function, but think of sigs as a reference -#if _POSIX_C_SOURCE >= 1 || _XOPEN_SOURCE || _POSIX_SOURCE +#if (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 1) || (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE) || (defined(_POSIX_SOURCE) && _POSIX_SOURCE) sigemptyset(&savedSignalMask); // There's no "assign" or "copy" function, so we rely on (math) idempotence // of the or operator: a or a = a. diff --git a/src/nix/main.cc b/src/nix/main.cc index 6470213a2..a2c9dcf68 100644 --- a/src/nix/main.cc +++ b/src/nix/main.cc @@ -36,7 +36,7 @@ # include #endif -#if __linux__ +#ifdef __linux__ # include "nix/util/namespaces.hh" #endif @@ -384,7 +384,7 @@ void mainWrapped(int argc, char * * argv) "__build-remote", }); - #if __linux__ + #ifdef __linux__ if (isRootUser()) { try { saveMountNamespace(); diff --git a/src/nix/run.cc b/src/nix/run.cc index 64eab3ff3..146ae9ec9 100644 --- a/src/nix/run.cc +++ b/src/nix/run.cc @@ -12,7 +12,7 @@ #include "nix/expr/eval.hh" #include -#if __linux__ +#ifdef __linux__ # include # include "nix/store/personality.hh" #endif @@ -59,7 +59,7 @@ void execProgramInStore(ref store, throw SysError("could not execute chroot helper"); } -#if __linux__ +#ifdef __linux__ if (system) linux::setPersonality(*system); #endif @@ -153,7 +153,7 @@ void chrootHelper(int argc, char * * argv) while (p < argc) args.push_back(argv[p++]); -#if __linux__ +#ifdef __linux__ uid_t uid = getuid(); uid_t gid = getgid(); @@ -212,7 +212,7 @@ void chrootHelper(int argc, char * * argv) writeFile(fs::path{"/proc/self/uid_map"}, fmt("%d %d %d", uid, uid, 1)); writeFile(fs::path{"/proc/self/gid_map"}, fmt("%d %d %d", gid, gid, 1)); -#if __linux__ +#ifdef __linux__ if (system != "") linux::setPersonality(system); #endif diff --git a/src/nix/unix/daemon.cc b/src/nix/unix/daemon.cc index 1acf2bd5b..607a7bb01 100644 --- a/src/nix/unix/daemon.cc +++ b/src/nix/unix/daemon.cc @@ -34,7 +34,7 @@ #include #include -#if __linux__ +#ifdef __linux__ #include "nix/util/cgroup.hh" #endif @@ -317,7 +317,7 @@ static void daemonLoop(std::optional forceTrustClientOpt) // Get rid of children automatically; don't let them become zombies. setSigChldAction(true); - #if __linux__ + #ifdef __linux__ if (settings.useCgroups) { experimentalFeatureSettings.require(Xp::Cgroups); From 3bb46b73a80cebc4f66086505cc2cb4abe33b89b Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sun, 6 Apr 2025 17:43:10 +0200 Subject: [PATCH 81/84] Fix undefined macro errors (cherry picked from commit 77b4bb74d54edf1597cad73a49b024ff82a30ee8) --- src/libstore/globals.cc | 2 +- src/libstore/unix/user-lock.cc | 2 +- src/libutil/current-process.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc index 1df0a846e..c590ccf28 100644 --- a/src/libstore/globals.cc +++ b/src/libstore/globals.cc @@ -209,7 +209,7 @@ StringSet Settings::getDefaultExtraPlatforms() StringSet levels = computeLevels(); for (auto iter = levels.begin(); iter != levels.end(); ++iter) extraPlatforms.insert(*iter + "-linux"); -#elif __APPLE__ +#elif defined(__APPLE__) // Rosetta 2 emulation layer can run x86_64 binaries on aarch64 // machines. Note that we can’t force processes from executing // x86_64 in aarch64 environments or vice versa since they can diff --git a/src/libstore/unix/user-lock.cc b/src/libstore/unix/user-lock.cc index eb0bac887..2bee277f9 100644 --- a/src/libstore/unix/user-lock.cc +++ b/src/libstore/unix/user-lock.cc @@ -196,7 +196,7 @@ bool useBuildUsers() #ifdef __linux__ static bool b = (settings.buildUsersGroup != "" || settings.autoAllocateUids) && isRootUser(); return b; - #elif __APPLE__ + #elif defined(__APPLE__) static bool b = settings.buildUsersGroup != "" && isRootUser(); return b; #else diff --git a/src/libutil/current-process.cc b/src/libutil/current-process.cc index 8aef47146..926714ae8 100644 --- a/src/libutil/current-process.cc +++ b/src/libutil/current-process.cc @@ -108,7 +108,7 @@ std::optional getSelfExe() { #if defined(__linux__) || defined(__GNU__) return readLink("/proc/self/exe"); - #elif __APPLE__ + #elif defined(__APPLE__) char buf[1024]; uint32_t size = sizeof(buf); if (_NSGetExecutablePath(buf, &size) == 0) From 49b6766332e7754cd8cc2ee1dd2ccc958b284e54 Mon Sep 17 00:00:00 2001 From: Alexander Romanov Date: Sun, 6 Apr 2025 22:52:46 +0300 Subject: [PATCH 82/84] libflake: add lock file path to invalid json error Previously, when lock file contained invalid JSON nix reported a parser error without specifying the file it came from. This change adds flake.lock file path to the error message to avoid confusion. (cherry picked from commit e3873aa1a0b1881f4380dd53ceb5dbd49c69e2c4) --- src/libflake/flake/lockfile.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/libflake/flake/lockfile.cc b/src/libflake/flake/lockfile.cc index ba6f18c57..646516caf 100644 --- a/src/libflake/flake/lockfile.cc +++ b/src/libflake/flake/lockfile.cc @@ -108,8 +108,13 @@ LockFile::LockFile( const fetchers::Settings & fetchSettings, std::string_view contents, std::string_view path) { - auto json = nlohmann::json::parse(contents); - + auto json = [=] { + try { + return nlohmann::json::parse(contents); + } catch (const nlohmann::json::parse_error & e) { + throw Error("Could not parse '%s': %s", path, e.what()); + } + }(); auto version = json.value("version", 0); if (version < 5 || version > 7) throw Error("lock file '%s' has unsupported version %d", path, version); From 7e96f317536605882388a4ec507ef761ff490e51 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sun, 6 Apr 2025 17:17:54 -0400 Subject: [PATCH 83/84] Clean some header related things. Revert most of "Hack together a fix for the public headers" - The `libmain` change is kept, and one more libmain change is made. (Need to update Meson and Nix per the package alike). - The S3 situation is fixed in a different way: the variable is public now, used in the header, and fixed accordingly. - Fix TODO for `HAVE_EMBEDDED_SANDBOX_SHELL` This reverts commit 2b51250534899329906273ae80463ccfe8455d08. (cherry picked from commit 3294b22a6845f08daf095ed425f16877da8ab040) --- src/libexpr/expr-config.hh | 3 --- src/libexpr/include/nix/expr/config.hh | 1 - src/libexpr/include/nix/expr/meson.build | 1 - src/libexpr/meson.build | 11 ---------- src/libmain/meson.build | 6 +++-- src/libstore-tests/meson.build | 3 --- src/libstore-tests/s3-binary-cache-store.cc | 7 +++--- src/libstore/filetransfer.cc | 6 ++--- .../nix/store/s3-binary-cache-store.hh | 10 +++++++-- src/libstore/include/nix/store/s3.hh | 2 +- src/libstore/meson.build | 22 ++++++++----------- src/libstore/s3-binary-cache-store.cc | 6 ++--- .../unix/build/local-derivation-goal.cc | 2 +- 13 files changed, 32 insertions(+), 48 deletions(-) delete mode 100644 src/libexpr/expr-config.hh delete mode 120000 src/libexpr/include/nix/expr/config.hh diff --git a/src/libexpr/expr-config.hh b/src/libexpr/expr-config.hh deleted file mode 100644 index e28b461c0..000000000 --- a/src/libexpr/expr-config.hh +++ /dev/null @@ -1,3 +0,0 @@ -// TODO: Remove this damn file while keeping public config headers working -#error \ - "This file is a placeholder. It only exists so that meson accepts the symbolic link include/nix/expr/config.hh to this file, but we expect meson to overwrite it with the real file. Apparently that did not happen. I deeply apologize for this mess." diff --git a/src/libexpr/include/nix/expr/config.hh b/src/libexpr/include/nix/expr/config.hh deleted file mode 120000 index 45d3ca29d..000000000 --- a/src/libexpr/include/nix/expr/config.hh +++ /dev/null @@ -1 +0,0 @@ -../../../expr-config.hh \ No newline at end of file diff --git a/src/libexpr/include/nix/expr/meson.build b/src/libexpr/include/nix/expr/meson.build index 3eb80de68..01275e52e 100644 --- a/src/libexpr/include/nix/expr/meson.build +++ b/src/libexpr/include/nix/expr/meson.build @@ -10,7 +10,6 @@ config_pub_h = configure_file( headers = [config_pub_h] + files( 'attr-path.hh', 'attr-set.hh', - 'config.hh', 'eval-cache.hh', 'eval-error.hh', 'eval-gc.hh', diff --git a/src/libexpr/meson.build b/src/libexpr/meson.build index 402bca0e1..2e773938d 100644 --- a/src/libexpr/meson.build +++ b/src/libexpr/meson.build @@ -79,11 +79,6 @@ config_priv_h = configure_file( output : 'expr-config-private.hh', ) -config_pub_h = configure_file( - configuration : configdata_pub, - output : 'expr-config.hh', -) - subdir('nix-meson-build-support/common') parser_tab = custom_target( @@ -168,8 +163,6 @@ subdir('primops') subdir('nix-meson-build-support/export-all-symbols') subdir('nix-meson-build-support/windows-version') -headers += [config_pub_h] - this_library = library( 'nixexpr', sources, @@ -188,8 +181,4 @@ install_headers(headers, subdir : 'nix/expr', preserve_path : true) libraries_private = [] -nixexpr_dep = declare_dependency( - include_directories : include_directories('.'), - link_with : this_library, -) subdir('nix-meson-build-support/export') diff --git a/src/libmain/meson.build b/src/libmain/meson.build index 4f78d265b..65fcb6239 100644 --- a/src/libmain/meson.build +++ b/src/libmain/meson.build @@ -17,12 +17,14 @@ subdir('nix-meson-build-support/deps-lists') configdata = configuration_data() deps_private_maybe_subproject = [ - # This dependency may be very limited; was introduced for NIX_USE_BOEHMGC macro dependency - dependency('nix-expr'), ] deps_public_maybe_subproject = [ dependency('nix-util'), dependency('nix-store'), + # FIXME: This is only here for the NIX_USE_BOEHMGC macro dependency + # Removing nix-expr will make the build more concurrent and is + # architecturally nice, perhaps. + dependency('nix-expr'), ] subdir('nix-meson-build-support/subprojects') diff --git a/src/libstore-tests/meson.build b/src/libstore-tests/meson.build index eb3d14530..1822a3520 100644 --- a/src/libstore-tests/meson.build +++ b/src/libstore-tests/meson.build @@ -40,9 +40,6 @@ deps_private += gtest configdata = configuration_data() configdata.set_quoted('PACKAGE_VERSION', meson.project_version()) -aws_s3 = dependency('aws-cpp-sdk-s3', required : false) -configdata.set('ENABLE_S3', aws_s3.found().to_int()) - config_priv_h = configure_file( configuration : configdata, output : 'store-tests-config.hh', diff --git a/src/libstore-tests/s3-binary-cache-store.cc b/src/libstore-tests/s3-binary-cache-store.cc index dbb414f2b..251e96172 100644 --- a/src/libstore-tests/s3-binary-cache-store.cc +++ b/src/libstore-tests/s3-binary-cache-store.cc @@ -1,10 +1,9 @@ -#include "store-tests-config.hh" -#if ENABLE_S3 +#include "nix/store/s3-binary-cache-store.hh" + +#if NIX_WITH_S3_SUPPORT # include -# include "nix/store/s3-binary-cache-store.hh" - namespace nix { TEST(S3BinaryCacheStore, constructConfig) diff --git a/src/libstore/filetransfer.cc b/src/libstore/filetransfer.cc index e85896224..49453f6df 100644 --- a/src/libstore/filetransfer.cc +++ b/src/libstore/filetransfer.cc @@ -9,7 +9,7 @@ #include "nix/util/signals.hh" #include "store-config-private.hh" -#if ENABLE_S3 +#if NIX_WITH_S3_SUPPORT #include #endif @@ -756,7 +756,7 @@ struct curlFileTransfer : public FileTransfer #endif } -#if ENABLE_S3 +#if NIX_WITH_S3_SUPPORT std::tuple parseS3Uri(std::string uri) { auto [path, params] = splitUriAndParams(uri); @@ -779,7 +779,7 @@ struct curlFileTransfer : public FileTransfer if (hasPrefix(request.uri, "s3://")) { // FIXME: do this on a worker thread try { -#if ENABLE_S3 +#if NIX_WITH_S3_SUPPORT auto [bucketName, key, params] = parseS3Uri(request.uri); std::string profile = getOr(params, "profile", ""); diff --git a/src/libstore/include/nix/store/s3-binary-cache-store.hh b/src/libstore/include/nix/store/s3-binary-cache-store.hh index eec2dc6ee..7bc04aa4a 100644 --- a/src/libstore/include/nix/store/s3-binary-cache-store.hh +++ b/src/libstore/include/nix/store/s3-binary-cache-store.hh @@ -1,9 +1,13 @@ #pragma once ///@file -#include "nix/store/binary-cache-store.hh" +#include "nix/store/config.hh" -#include +#if NIX_WITH_S3_SUPPORT + +# include "nix/store/binary-cache-store.hh" + +# include namespace nix { @@ -125,3 +129,5 @@ public: }; } + +#endif diff --git a/src/libstore/include/nix/store/s3.hh b/src/libstore/include/nix/store/s3.hh index 5ac5b9a9f..9c159ba0f 100644 --- a/src/libstore/include/nix/store/s3.hh +++ b/src/libstore/include/nix/store/s3.hh @@ -1,7 +1,7 @@ #pragma once ///@file #include "store-config-private.hh" -#if ENABLE_S3 +#if NIX_WITH_S3_SUPPORT #include "nix/util/ref.hh" diff --git a/src/libstore/meson.build b/src/libstore/meson.build index fecf2f449..66785e311 100644 --- a/src/libstore/meson.build +++ b/src/libstore/meson.build @@ -126,7 +126,8 @@ deps_private += sqlite # 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_priv.set('ENABLE_S3', aws_s3.found().to_int()) +# The S3 store definitions in the header will be hidden based on this variables. +configdata_pub.set('NIX_WITH_S3_SUPPORT', aws_s3.found().to_int()) if aws_s3.found() aws_s3 = declare_dependency( include_directories: include_directories(aws_s3.get_variable('includedir')), @@ -153,13 +154,13 @@ endforeach busybox = find_program(get_option('sandbox-shell'), required : false) +# This one goes in config.h +# The path to busybox is passed as a -D flag when compiling this_library. +# This solution is inherited from the old make buildsystem +# TODO: do this differently? +configdata_priv.set('HAVE_EMBEDDED_SANDBOX_SHELL', get_option('embedded-sandbox-shell').to_int()) + if get_option('embedded-sandbox-shell') - # This one goes in config.h - # The path to busybox is passed as a -D flag when compiling this_library. - # This solution is inherited from the old make buildsystem - # TODO: do this differently? - # TODO: at least define it unconditionally, so we get checking from -Wundef - configdata_priv.set('HAVE_EMBEDDED_SANDBOX_SHELL', 1) hexdump = find_program('hexdump', native : true) embedded_sandbox_shell_gen = custom_target( 'embedded-sandbox-shell.gen.hh', @@ -182,11 +183,6 @@ config_priv_h = configure_file( output : 'store-config-private.hh', ) -config_pub_h = configure_file( - configuration : configdata_pub, - output : 'store-config.hh', -) - subdir('nix-meson-build-support/common') sources = files( @@ -368,7 +364,7 @@ this_library = library( install : true, ) -install_headers(headers + [ config_pub_h ], subdir : 'nix/store', preserve_path : true) +install_headers(headers, subdir : 'nix/store', preserve_path : true) libraries_private = [] diff --git a/src/libstore/s3-binary-cache-store.cc b/src/libstore/s3-binary-cache-store.cc index 4e51e728a..87f5feb45 100644 --- a/src/libstore/s3-binary-cache-store.cc +++ b/src/libstore/s3-binary-cache-store.cc @@ -1,10 +1,10 @@ -#include "store-config-private.hh" -#if ENABLE_S3 +#include "nix/store/s3-binary-cache-store.hh" + +#if NIX_WITH_S3_SUPPORT #include #include "nix/store/s3.hh" -#include "nix/store/s3-binary-cache-store.hh" #include "nix/store/nar-info.hh" #include "nix/store/nar-info-disk-cache.hh" #include "nix/store/globals.hh" diff --git a/src/libstore/unix/build/local-derivation-goal.cc b/src/libstore/unix/build/local-derivation-goal.cc index b521e23bb..4d3813dc5 100644 --- a/src/libstore/unix/build/local-derivation-goal.cc +++ b/src/libstore/unix/build/local-derivation-goal.cc @@ -1935,7 +1935,7 @@ void LocalDerivationGoal::runChild() for (auto & i : pathsInChroot) { if (i.second.source == "/proc") continue; // backwards compatibility - #ifdef HAVE_EMBEDDED_SANDBOX_SHELL + #if HAVE_EMBEDDED_SANDBOX_SHELL if (i.second.source == "__embedded_sandbox_shell__") { static unsigned char sh[] = { #include "embedded-sandbox-shell.gen.hh" From efb0feb22b8121a6d36157764373e478db3e3968 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sun, 6 Apr 2025 17:57:43 -0400 Subject: [PATCH 84/84] Get rid of raw `-D` defines, always use private config files Now that we have the private vs public distinction, we can do this without leaking information downstream. (cherry picked from commit 7a7fe350d55803e3ff73bc0645b0c498b0a0eff9) --- src/libstore-tests/meson.build | 3 +- src/libstore/meson.build | 154 ++++++++++++++------------------- src/nix/man-pages.cc | 1 + src/nix/meson.build | 20 ++--- 4 files changed, 75 insertions(+), 103 deletions(-) diff --git a/src/libstore-tests/meson.build b/src/libstore-tests/meson.build index 1822a3520..8a1ff40f0 100644 --- a/src/libstore-tests/meson.build +++ b/src/libstore-tests/meson.build @@ -40,6 +40,8 @@ deps_private += gtest configdata = configuration_data() configdata.set_quoted('PACKAGE_VERSION', meson.project_version()) +configdata.set_quoted('NIX_STORE_DIR', nix_store.get_variable('storedir')) + config_priv_h = configure_file( configuration : configdata, output : 'store-tests-config.hh', @@ -89,7 +91,6 @@ this_exe = executable( include_directories : include_dirs, # TODO: -lrapidcheck, see ../libutil-support/build.meson link_args: linker_export_flags + ['-lrapidcheck'], - cpp_args : [ '-DNIX_STORE_DIR="' + nix_store.get_variable('storedir') + '"' ], # get main from gtest install : true, ) diff --git a/src/libstore/meson.build b/src/libstore/meson.build index 66785e311..d35cc2c0b 100644 --- a/src/libstore/meson.build +++ b/src/libstore/meson.build @@ -154,12 +154,14 @@ endforeach busybox = find_program(get_option('sandbox-shell'), required : false) -# This one goes in config.h -# The path to busybox is passed as a -D flag when compiling this_library. -# This solution is inherited from the old make buildsystem -# TODO: do this differently? configdata_priv.set('HAVE_EMBEDDED_SANDBOX_SHELL', get_option('embedded-sandbox-shell').to_int()) +if get_option('embedded-sandbox-shell') + configdata_priv.set_quoted('SANDBOX_SHELL', '__embedded_sandbox_shell__') +elif busybox.found() + configdata_priv.set_quoted('SANDBOX_SHELL', busybox.full_path()) +endif + if get_option('embedded-sandbox-shell') hexdump = find_program('hexdump', native : true) embedded_sandbox_shell_gen = custom_target( @@ -178,6 +180,66 @@ if get_option('embedded-sandbox-shell') generated_headers += embedded_sandbox_shell_gen endif +fs = import('fs') + +prefix = get_option('prefix') +# For each of these paths, assume that it is relative to the prefix unless +# it is already an absolute path (which is the default for store-dir, localstatedir, and log-dir). +path_opts = [ + # Meson built-ins. + 'datadir', + 'mandir', + 'libdir', + 'includedir', + 'libexecdir', + # Homecooked Nix directories. + 'store-dir', + 'localstatedir', + 'log-dir', +] +# For your grepping pleasure, this loop sets the following variables that aren't mentioned +# literally above: +# store_dir +# localstatedir +# log_dir +# profile_dir +foreach optname : path_opts + varname = optname.replace('-', '_') + path = get_option(optname) + if fs.is_absolute(path) + set_variable(varname, path) + else + set_variable(varname, prefix / path) + endif +endforeach + +# sysconfdir doesn't get anything installed to directly, and is only used to +# tell Nix where to look for nix.conf, so it doesn't get appended to prefix. +sysconfdir = get_option('sysconfdir') +if not fs.is_absolute(sysconfdir) + sysconfdir = '/' / sysconfdir +endif + +# Aside from prefix itself, each of these was made into an absolute path +# by joining it with prefix, unless it was already an absolute path +# (which is the default for store-dir, localstatedir, and log-dir). +configdata_priv.set_quoted('NIX_PREFIX', prefix) +configdata_priv.set_quoted('NIX_STORE_DIR', store_dir) +configdata_priv.set_quoted('NIX_DATA_DIR', datadir) +configdata_priv.set_quoted('NIX_STATE_DIR', localstatedir / 'nix') +configdata_priv.set_quoted('NIX_LOG_DIR', log_dir) +configdata_priv.set_quoted('NIX_CONF_DIR', sysconfdir / 'nix') +configdata_priv.set_quoted('NIX_MAN_DIR', mandir) + +lsof = find_program('lsof', required : false) +configdata_priv.set_quoted( + 'LSOF', + lsof.found() + ? lsof.full_path() + # Just look up on the PATH + : 'lsof', +) + config_priv_h = configure_file( configuration : configdata_priv, output : 'store-config-private.hh', @@ -265,89 +327,6 @@ else subdir('unix') endif -fs = import('fs') - -prefix = get_option('prefix') -# For each of these paths, assume that it is relative to the prefix unless -# it is already an absolute path (which is the default for store-dir, localstatedir, and log-dir). -path_opts = [ - # Meson built-ins. - 'datadir', - 'mandir', - 'libdir', - 'includedir', - 'libexecdir', - # Homecooked Nix directories. - 'store-dir', - 'localstatedir', - 'log-dir', -] -# For your grepping pleasure, this loop sets the following variables that aren't mentioned -# literally above: -# store_dir -# localstatedir -# log_dir -# profile_dir -foreach optname : path_opts - varname = optname.replace('-', '_') - path = get_option(optname) - if fs.is_absolute(path) - set_variable(varname, path) - else - set_variable(varname, prefix / path) - endif -endforeach - -# sysconfdir doesn't get anything installed to directly, and is only used to -# tell Nix where to look for nix.conf, so it doesn't get appended to prefix. -sysconfdir = get_option('sysconfdir') -if not fs.is_absolute(sysconfdir) - sysconfdir = '/' / sysconfdir -endif - -lsof = find_program('lsof', required : false) - -# Aside from prefix itself, each of these was made into an absolute path -# by joining it with prefix, unless it was already an absolute path -# (which is the default for store-dir, localstatedir, and log-dir). -cpp_str_defines = { - 'NIX_PREFIX': prefix, - 'NIX_STORE_DIR': store_dir, - 'NIX_DATA_DIR': datadir, - 'NIX_STATE_DIR': localstatedir / 'nix', - 'NIX_LOG_DIR': log_dir, - 'NIX_CONF_DIR': sysconfdir / 'nix', - 'NIX_MAN_DIR': mandir, -} - -if lsof.found() - lsof_path = lsof.full_path() -else - # Just look up on the PATH - lsof_path = 'lsof' -endif -cpp_str_defines += { - 'LSOF': lsof_path -} - -if get_option('embedded-sandbox-shell') - cpp_str_defines += { - 'SANDBOX_SHELL': '__embedded_sandbox_shell__' - } -elif busybox.found() - cpp_str_defines += { - 'SANDBOX_SHELL': busybox.full_path() - } -endif - -cpp_args = [] - -foreach name, value : cpp_str_defines - cpp_args += [ - '-D' + name + '=' + '"' + value + '"' - ] -endforeach - subdir('nix-meson-build-support/export-all-symbols') subdir('nix-meson-build-support/windows-version') @@ -358,7 +337,6 @@ this_library = library( config_priv_h, dependencies : deps_public + deps_private + deps_other, include_directories : include_dirs, - cpp_args : cpp_args, link_args: linker_export_flags, prelink : true, # For C++ static initializers install : true, diff --git a/src/nix/man-pages.cc b/src/nix/man-pages.cc index 8da439e7b..8585c164c 100644 --- a/src/nix/man-pages.cc +++ b/src/nix/man-pages.cc @@ -1,4 +1,5 @@ #include "man-pages.hh" +#include "cli-config-private.hh" #include "nix/util/file-system.hh" #include "nix/util/current-process.hh" #include "nix/util/environment-variables.hh" diff --git a/src/nix/meson.build b/src/nix/meson.build index b258778cc..3cb45f1f5 100644 --- a/src/nix/meson.build +++ b/src/nix/meson.build @@ -39,13 +39,16 @@ configdata = configuration_data() configdata.set_quoted('NIX_CLI_VERSION', meson.project_version()) fs = import('fs') +prefix = get_option('prefix') bindir = get_option('bindir') -if not fs.is_absolute(bindir) - bindir = get_option('prefix') / bindir -endif +bindir = fs.is_absolute(bindir) ? bindir : prefix / bindir configdata.set_quoted('NIX_BIN_DIR', bindir) +mandir = get_option('mandir') +mandir = fs.is_absolute(mandir) ? mandir : prefix / mandir +configdata.set_quoted('NIX_MAN_DIR', mandir) + config_priv_h = configure_file( configuration : configdata, output : 'cli-config-private.hh', @@ -174,16 +177,6 @@ if host_machine.system() != 'windows' ] endif -fs = import('fs') -prefix = get_option('prefix') - -mandir = get_option('mandir') -mandir = fs.is_absolute(mandir) ? mandir : prefix / mandir - -cpp_args= [ - '-DNIX_MAN_DIR="@0@"'.format(mandir) -] - include_dirs = [include_directories('.')] this_exe = executable( @@ -191,7 +184,6 @@ this_exe = executable( sources, dependencies : deps_private_subproject + deps_private + deps_other, include_directories : include_dirs, - cpp_args : cpp_args, link_args: linker_export_flags, install : true, )