From 6fd6795bc4faed644c5f3abafdcb21638a119342 Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Tue, 28 May 2024 10:50:54 +0200 Subject: util.{hh,cc}: Split out environment-variables.{hh,cc} Change-Id: Icff0aa33fda5147bd5dbe256a0b9d6a6c8a2c3f6 --- src/libstore/globals.cc | 1 + src/libstore/globals.hh | 2 +- src/libstore/ssh.cc | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src/libstore') diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc index 3308cad1f..897d3e8ef 100644 --- a/src/libstore/globals.cc +++ b/src/libstore/globals.cc @@ -1,3 +1,4 @@ +#include "environment-variables.hh" #include "globals.hh" #include "util.hh" #include "archive.hh" diff --git a/src/libstore/globals.hh b/src/libstore/globals.hh index 85789f6b5..581de7ff6 100644 --- a/src/libstore/globals.hh +++ b/src/libstore/globals.hh @@ -1,9 +1,9 @@ #pragma once ///@file +#include "environment-variables.hh" #include "types.hh" #include "config.hh" -#include "util.hh" #include #include diff --git a/src/libstore/ssh.cc b/src/libstore/ssh.cc index 87414fe9c..2f921e2d0 100644 --- a/src/libstore/ssh.cc +++ b/src/libstore/ssh.cc @@ -1,3 +1,4 @@ +#include "environment-variables.hh" #include "ssh.hh" #include "finally.hh" -- cgit v1.2.3 From 6b5078c81554ddb36547f8c41805cc94b7738396 Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Tue, 28 May 2024 11:52:13 +0200 Subject: util.{hh,cc}: Split out file-system.{hh,cc} Change-Id: Ifa89a529e7e34e7291eca87d802d2f569cf2493e --- src/libstore/build/hook-instance.cc | 1 + src/libstore/crypto.cc | 1 + src/libstore/lock.cc | 1 + src/libstore/ssh.hh | 1 + 4 files changed, 4 insertions(+) (limited to 'src/libstore') diff --git a/src/libstore/build/hook-instance.cc b/src/libstore/build/hook-instance.cc index ea4c2e508..108722cfb 100644 --- a/src/libstore/build/hook-instance.cc +++ b/src/libstore/build/hook-instance.cc @@ -1,3 +1,4 @@ +#include "file-system.hh" #include "globals.hh" #include "hook-instance.hh" diff --git a/src/libstore/crypto.cc b/src/libstore/crypto.cc index 1027469c9..1e29a812b 100644 --- a/src/libstore/crypto.cc +++ b/src/libstore/crypto.cc @@ -1,5 +1,6 @@ #include "crypto.hh" #include "util.hh" +#include "file-system.hh" #include "globals.hh" #include diff --git a/src/libstore/lock.cc b/src/libstore/lock.cc index 80c75eaa5..b52e87ae0 100644 --- a/src/libstore/lock.cc +++ b/src/libstore/lock.cc @@ -1,4 +1,5 @@ #include "lock.hh" +#include "file-system.hh" #include "globals.hh" #include "pathlocks.hh" diff --git a/src/libstore/ssh.hh b/src/libstore/ssh.hh index 94b952af9..0802c6cc0 100644 --- a/src/libstore/ssh.hh +++ b/src/libstore/ssh.hh @@ -1,6 +1,7 @@ #pragma once ///@file +#include "file-system.hh" #include "util.hh" #include "sync.hh" -- cgit v1.2.3 From 8cd9aa24a8d48caf22225ce32dff3c5aaa111687 Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Tue, 28 May 2024 12:25:49 +0200 Subject: util.{hh,cc}: Split out file-descriptor.{hh,cc} Change-Id: I0dd0f9a9c2003fb887e076127e7f825fd3289c76 --- src/libstore/lock.cc | 1 + src/libstore/pathlocks.hh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src/libstore') diff --git a/src/libstore/lock.cc b/src/libstore/lock.cc index b52e87ae0..05296757d 100644 --- a/src/libstore/lock.cc +++ b/src/libstore/lock.cc @@ -1,4 +1,5 @@ #include "lock.hh" +#include "logging.hh" #include "file-system.hh" #include "globals.hh" #include "pathlocks.hh" diff --git a/src/libstore/pathlocks.hh b/src/libstore/pathlocks.hh index 4921df352..7fcfa2e40 100644 --- a/src/libstore/pathlocks.hh +++ b/src/libstore/pathlocks.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "util.hh" +#include "file-descriptor.hh" namespace nix { -- cgit v1.2.3 From 9a52e4688ca265155817817f373938428f023966 Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Tue, 28 May 2024 13:14:13 +0200 Subject: util.{hh,cc}: Split out processes.{hh,cc} Change-Id: I39280dc40ca3f7f9007bc6c898ffcf760e2238b7 --- src/libstore/build/hook-instance.hh | 1 + src/libstore/build/local-derivation-goal.hh | 1 + src/libstore/gc.cc | 1 + src/libstore/globals.cc | 1 + src/libstore/ssh.cc | 1 + src/libstore/ssh.hh | 2 +- 6 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src/libstore') diff --git a/src/libstore/build/hook-instance.hh b/src/libstore/build/hook-instance.hh index d84f62877..481158296 100644 --- a/src/libstore/build/hook-instance.hh +++ b/src/libstore/build/hook-instance.hh @@ -2,6 +2,7 @@ ///@file #include "logging.hh" +#include "processes.hh" #include "serialise.hh" namespace nix { diff --git a/src/libstore/build/local-derivation-goal.hh b/src/libstore/build/local-derivation-goal.hh index b7f317fb6..f3a83d42f 100644 --- a/src/libstore/build/local-derivation-goal.hh +++ b/src/libstore/build/local-derivation-goal.hh @@ -3,6 +3,7 @@ #include "derivation-goal.hh" #include "local-store.hh" +#include "processes.hh" namespace nix { diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc index 6b37f0af3..60d88f3b2 100644 --- a/src/libstore/gc.cc +++ b/src/libstore/gc.cc @@ -1,6 +1,7 @@ #include "derivations.hh" #include "globals.hh" #include "local-store.hh" +#include "processes.hh" #include "signals.hh" #include "finally.hh" diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc index 897d3e8ef..f14e6c91f 100644 --- a/src/libstore/globals.cc +++ b/src/libstore/globals.cc @@ -26,6 +26,7 @@ #include "config-impl.hh" #ifdef __APPLE__ +#include "processes.hh" #include #include #endif diff --git a/src/libstore/ssh.cc b/src/libstore/ssh.cc index 2f921e2d0..1d8266b9d 100644 --- a/src/libstore/ssh.cc +++ b/src/libstore/ssh.cc @@ -1,6 +1,7 @@ #include "environment-variables.hh" #include "ssh.hh" #include "finally.hh" +#include "util.hh" namespace nix { diff --git a/src/libstore/ssh.hh b/src/libstore/ssh.hh index 0802c6cc0..f9c532caa 100644 --- a/src/libstore/ssh.hh +++ b/src/libstore/ssh.hh @@ -2,7 +2,7 @@ ///@file #include "file-system.hh" -#include "util.hh" +#include "processes.hh" #include "sync.hh" namespace nix { -- cgit v1.2.3 From 2473e1253d37d4bbd3f7aad2ff269ad84747d527 Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Tue, 28 May 2024 13:36:02 +0200 Subject: util.{hh,cc}: Split out current-process.{hh,cc} Change-Id: I77095b9d37e85310075bada7a076ccd482c28e47 --- src/libstore/build/local-derivation-goal.cc | 1 - src/libstore/globals.cc | 1 + src/libstore/ssh.cc | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src/libstore') diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc index 9be780212..c90910d29 100644 --- a/src/libstore/build/local-derivation-goal.cc +++ b/src/libstore/build/local-derivation-goal.cc @@ -6,7 +6,6 @@ #include "builtins/buildenv.hh" #include "path-references.hh" #include "finally.hh" -#include "util.hh" #include "archive.hh" #include "compression.hh" #include "daemon.hh" diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc index f14e6c91f..30fd4e9e3 100644 --- a/src/libstore/globals.cc +++ b/src/libstore/globals.cc @@ -5,6 +5,7 @@ #include "args.hh" #include "abstract-setting-to-json.hh" #include "compute-levels.hh" +#include "current-process.hh" #include #include diff --git a/src/libstore/ssh.cc b/src/libstore/ssh.cc index 1d8266b9d..ccf0aef7f 100644 --- a/src/libstore/ssh.cc +++ b/src/libstore/ssh.cc @@ -1,3 +1,4 @@ +#include "current-process.hh" #include "environment-variables.hh" #include "ssh.hh" #include "finally.hh" -- cgit v1.2.3 From e81ed5f12d0702ed402faa8b5ee725f2203db60c Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Tue, 28 May 2024 13:44:39 +0200 Subject: util.{hh,cc}: Split out child.{hh,cc} Change-Id: Iec4824e071f537b17dd62dbb8c01b8eec14e9783 --- src/libstore/build/child.cc | 33 +++++++++++++++++++++++++++++ src/libstore/build/child.hh | 11 ++++++++++ src/libstore/build/hook-instance.cc | 1 + src/libstore/build/local-derivation-goal.cc | 1 + src/libstore/meson.build | 2 ++ 5 files changed, 48 insertions(+) create mode 100644 src/libstore/build/child.cc create mode 100644 src/libstore/build/child.hh (limited to 'src/libstore') diff --git a/src/libstore/build/child.cc b/src/libstore/build/child.cc new file mode 100644 index 000000000..a82a5eec9 --- /dev/null +++ b/src/libstore/build/child.cc @@ -0,0 +1,33 @@ +#include "current-process.hh" +#include "logging.hh" + +namespace nix { + +void commonChildInit() +{ + logger = makeSimpleLogger(); + + const static std::string pathNullDevice = "/dev/null"; + restoreProcessContext(false); + + /* Put the child in a separate session (and thus a separate + process group) so that it has no controlling terminal (meaning + that e.g. ssh cannot open /dev/tty) and it doesn't receive + terminal signals. */ + if (setsid() == -1) + throw SysError("creating a new session"); + + /* Dup stderr to stdout. */ + if (dup2(STDERR_FILENO, STDOUT_FILENO) == -1) + throw SysError("cannot dup stderr into stdout"); + + /* Reroute stdin to /dev/null. */ + int fdDevNull = open(pathNullDevice.c_str(), O_RDWR); + if (fdDevNull == -1) + throw SysError("cannot open '%1%'", pathNullDevice); + if (dup2(fdDevNull, STDIN_FILENO) == -1) + throw SysError("cannot dup null device into stdin"); + close(fdDevNull); +} + +} diff --git a/src/libstore/build/child.hh b/src/libstore/build/child.hh new file mode 100644 index 000000000..3dfc552b9 --- /dev/null +++ b/src/libstore/build/child.hh @@ -0,0 +1,11 @@ +#pragma once +///@file + +namespace nix { + +/** + * Common initialisation performed in child processes. + */ +void commonChildInit(); + +} diff --git a/src/libstore/build/hook-instance.cc b/src/libstore/build/hook-instance.cc index 108722cfb..86f72486e 100644 --- a/src/libstore/build/hook-instance.cc +++ b/src/libstore/build/hook-instance.cc @@ -1,3 +1,4 @@ +#include "child.hh" #include "file-system.hh" #include "globals.hh" #include "hook-instance.hh" diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc index c90910d29..d385ffb34 100644 --- a/src/libstore/build/local-derivation-goal.cc +++ b/src/libstore/build/local-derivation-goal.cc @@ -14,6 +14,7 @@ #include "cgroup.hh" #include "personality.hh" #include "namespaces.hh" +#include "child.hh" #include #include diff --git a/src/libstore/meson.build b/src/libstore/meson.build index 98549f6d9..f776e9621 100644 --- a/src/libstore/meson.build +++ b/src/libstore/meson.build @@ -79,6 +79,7 @@ libstore_sources = files( 'store-api.cc', 'uds-remote-store.cc', 'worker-protocol.cc', + 'build/child.cc', 'build/derivation-goal.cc', 'build/drv-output-substitution-goal.cc', 'build/entry-points.cc', @@ -96,6 +97,7 @@ libstore_sources = files( libstore_headers = files( 'binary-cache-store.hh', + 'build/child.hh', 'build/derivation-goal.hh', 'build/drv-output-substitution-goal.hh', 'build/goal.hh', -- cgit v1.2.3 From 5b5a75979a0b954a5deefe79c8040bac1ad9c76a Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Tue, 28 May 2024 14:41:48 +0200 Subject: util.{hh,cc}: Split out unix-domain-socket.{hh,cc} Change-Id: I3f9a628e0f8998b6146f5caa8ae9842361a66b8b --- src/libstore/build/local-derivation-goal.cc | 1 + src/libstore/gc.cc | 1 + src/libstore/uds-remote-store.cc | 1 + 3 files changed, 3 insertions(+) (limited to 'src/libstore') diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc index d385ffb34..fd871e8a4 100644 --- a/src/libstore/build/local-derivation-goal.cc +++ b/src/libstore/build/local-derivation-goal.cc @@ -15,6 +15,7 @@ #include "personality.hh" #include "namespaces.hh" #include "child.hh" +#include "unix-domain-socket.hh" #include #include diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc index 60d88f3b2..722452b8d 100644 --- a/src/libstore/gc.cc +++ b/src/libstore/gc.cc @@ -4,6 +4,7 @@ #include "processes.hh" #include "signals.hh" #include "finally.hh" +#include "unix-domain-socket.hh" #include #include diff --git a/src/libstore/uds-remote-store.cc b/src/libstore/uds-remote-store.cc index 99589f8b2..226cdf717 100644 --- a/src/libstore/uds-remote-store.cc +++ b/src/libstore/uds-remote-store.cc @@ -1,4 +1,5 @@ #include "uds-remote-store.hh" +#include "unix-domain-socket.hh" #include "worker-protocol.hh" #include -- cgit v1.2.3 From b91055112035c256fffd44d77f746b977cfdf3ca Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Tue, 28 May 2024 14:57:20 +0200 Subject: util.{hh,cc}: Split out strings.{hh,cc} Change-Id: I4f642d1046d56b5db26f1b0296ee16a0e02d444a --- src/libstore/crypto.cc | 2 +- src/libstore/machines.cc | 2 +- src/libstore/names.cc | 2 +- src/libstore/outputs-spec.cc | 3 ++- src/libstore/ssh.cc | 3 ++- 5 files changed, 7 insertions(+), 5 deletions(-) (limited to 'src/libstore') diff --git a/src/libstore/crypto.cc b/src/libstore/crypto.cc index 1e29a812b..2e0fd8ca5 100644 --- a/src/libstore/crypto.cc +++ b/src/libstore/crypto.cc @@ -1,7 +1,7 @@ #include "crypto.hh" -#include "util.hh" #include "file-system.hh" #include "globals.hh" +#include "strings.hh" #include diff --git a/src/libstore/machines.cc b/src/libstore/machines.cc index 700c9b3dd..cdd1e1c2c 100644 --- a/src/libstore/machines.cc +++ b/src/libstore/machines.cc @@ -1,7 +1,7 @@ #include "machines.hh" -#include "util.hh" #include "globals.hh" #include "store-api.hh" +#include "strings.hh" #include diff --git a/src/libstore/names.cc b/src/libstore/names.cc index 277aabf0f..b903a99f0 100644 --- a/src/libstore/names.cc +++ b/src/libstore/names.cc @@ -1,5 +1,5 @@ #include "names.hh" -#include "util.hh" +#include "strings.hh" #include diff --git a/src/libstore/outputs-spec.cc b/src/libstore/outputs-spec.cc index 21c069223..4422bcd21 100644 --- a/src/libstore/outputs-spec.cc +++ b/src/libstore/outputs-spec.cc @@ -1,10 +1,11 @@ #include #include -#include "util.hh" #include "regex-combinators.hh" #include "outputs-spec.hh" #include "path-regex.hh" +#include "strings.hh" +#include "util.hh" namespace nix { diff --git a/src/libstore/ssh.cc b/src/libstore/ssh.cc index ccf0aef7f..932ebaa52 100644 --- a/src/libstore/ssh.cc +++ b/src/libstore/ssh.cc @@ -2,7 +2,8 @@ #include "environment-variables.hh" #include "ssh.hh" #include "finally.hh" -#include "util.hh" +#include "logging.hh" +#include "strings.hh" namespace nix { -- cgit v1.2.3 From f79ee66646f66e5117583bcf9a579b7f538ca8bb Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Tue, 28 May 2024 15:40:03 +0200 Subject: util.{hh,cc}: Split out users.{hh,cc} Change-Id: I1bd92479a2cb7e5c2c2e1541b80474adb05ea0df --- src/libstore/globals.cc | 2 +- src/libstore/nar-info-disk-cache.cc | 1 + src/libstore/profiles.cc | 2 +- src/libstore/store-api.cc | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src/libstore') diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc index 30fd4e9e3..8ef25c469 100644 --- a/src/libstore/globals.cc +++ b/src/libstore/globals.cc @@ -1,6 +1,6 @@ #include "environment-variables.hh" #include "globals.hh" -#include "util.hh" +#include "users.hh" #include "archive.hh" #include "args.hh" #include "abstract-setting-to-json.hh" diff --git a/src/libstore/nar-info-disk-cache.cc b/src/libstore/nar-info-disk-cache.cc index c7176d30f..0413abbf1 100644 --- a/src/libstore/nar-info-disk-cache.cc +++ b/src/libstore/nar-info-disk-cache.cc @@ -2,6 +2,7 @@ #include "sync.hh" #include "sqlite.hh" #include "globals.hh" +#include "users.hh" #include #include diff --git a/src/libstore/profiles.cc b/src/libstore/profiles.cc index 239047dd6..e8b88693d 100644 --- a/src/libstore/profiles.cc +++ b/src/libstore/profiles.cc @@ -1,7 +1,7 @@ #include "profiles.hh" #include "store-api.hh" #include "local-fs-store.hh" -#include "util.hh" +#include "users.hh" #include #include diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc index ed3566f5e..c5631dfd8 100644 --- a/src/libstore/store-api.cc +++ b/src/libstore/store-api.cc @@ -14,6 +14,7 @@ // FIXME this should not be here, see TODO below on // `addMultipleToStore`. #include "worker-protocol.hh" +#include "users.hh" #include #include -- cgit v1.2.3 From 8b6d2d39155e88250c576571a1251769b926ee83 Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Tue, 28 May 2024 16:01:11 +0200 Subject: util.{hh,cc}: Split out namespaces.{hh,cc} Change-Id: I8fd3f3b50c15ede29d489066b4e8d99c2c4636a6 --- src/libstore/filetransfer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libstore') diff --git a/src/libstore/filetransfer.cc b/src/libstore/filetransfer.cc index 492463a61..dc656f444 100644 --- a/src/libstore/filetransfer.cc +++ b/src/libstore/filetransfer.cc @@ -1,5 +1,5 @@ #include "filetransfer.hh" -#include "util.hh" +#include "namespaces.hh" #include "globals.hh" #include "store-api.hh" #include "s3.hh" -- cgit v1.2.3 From f0eb650ee8a0eb5244c15fab3b152a1f70e1506e Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Tue, 28 May 2024 16:27:48 +0200 Subject: util.hh: Move nativeSystem to local-derivation-goal.cc Change-Id: I74565fbfd3aeedef8f50465808fac712b84e47ad --- src/libstore/build/local-derivation-goal.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/libstore') diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc index fd871e8a4..479b4ffeb 100644 --- a/src/libstore/build/local-derivation-goal.cc +++ b/src/libstore/build/local-derivation-goal.cc @@ -64,6 +64,11 @@ extern "C" int sandbox_init_with_parameters(const char *profile, uint64_t flags, namespace nix { +/** + * The system for which Nix is compiled. + */ +constexpr std::string_view nativeSystem = SYSTEM; + void handleDiffHook( uid_t uid, uid_t gid, const Path & tryA, const Path & tryB, -- cgit v1.2.3 From a39ba22ff7112cd3984bbf28d8610d84dd525a0f Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Tue, 28 May 2024 16:53:21 +0200 Subject: util.hh: Delete remaining file and clean up headers Change-Id: Ic1f68e6af658e94ef7922841dd3ad4c69551ef56 --- src/libstore/build/derivation-goal.cc | 1 - src/libstore/common-protocol.cc | 3 --- src/libstore/crypto.hh | 2 +- src/libstore/derivations.cc | 1 - src/libstore/derived-path.hh | 2 +- src/libstore/filetransfer.cc | 1 - src/libstore/filetransfer.hh | 3 ++- src/libstore/gc.cc | 6 +----- src/libstore/globals.cc | 5 +++-- src/libstore/local-store.hh | 2 -- src/libstore/nar-info-disk-cache.cc | 1 + src/libstore/optimise-store.cc | 1 - src/libstore/outputs-spec.cc | 1 - src/libstore/path-references.cc | 4 ---- src/libstore/pathlocks.cc | 4 +--- src/libstore/remote-store.cc | 1 - src/libstore/serve-protocol.cc | 2 -- src/libstore/sqlite.cc | 3 +-- src/libstore/store-api.cc | 2 -- src/libstore/store-api.hh | 1 + src/libstore/worker-protocol.cc | 1 - 21 files changed, 12 insertions(+), 35 deletions(-) (limited to 'src/libstore') diff --git a/src/libstore/build/derivation-goal.cc b/src/libstore/build/derivation-goal.cc index 5fa5deb7c..97ba994ad 100644 --- a/src/libstore/build/derivation-goal.cc +++ b/src/libstore/build/derivation-goal.cc @@ -5,7 +5,6 @@ #include "builtins/buildenv.hh" #include "references.hh" #include "finally.hh" -#include "util.hh" #include "archive.hh" #include "compression.hh" #include "common-protocol.hh" diff --git a/src/libstore/common-protocol.cc b/src/libstore/common-protocol.cc index f906814bc..456ad2b1f 100644 --- a/src/libstore/common-protocol.cc +++ b/src/libstore/common-protocol.cc @@ -1,11 +1,8 @@ #include "serialise.hh" -#include "util.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 diff --git a/src/libstore/crypto.hh b/src/libstore/crypto.hh index 35216d470..22588cf97 100644 --- a/src/libstore/crypto.hh +++ b/src/libstore/crypto.hh @@ -1,9 +1,9 @@ #pragma once ///@file -#include "types.hh" #include +#include namespace nix { diff --git a/src/libstore/derivations.cc b/src/libstore/derivations.cc index fef680421..4e70804e5 100644 --- a/src/libstore/derivations.cc +++ b/src/libstore/derivations.cc @@ -3,7 +3,6 @@ #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" diff --git a/src/libstore/derived-path.hh b/src/libstore/derived-path.hh index 4d7033df2..c87cf2004 100644 --- a/src/libstore/derived-path.hh +++ b/src/libstore/derived-path.hh @@ -1,7 +1,7 @@ #pragma once ///@file -#include "util.hh" +#include "config.hh" #include "path.hh" #include "outputs-spec.hh" #include "comparator.hh" diff --git a/src/libstore/filetransfer.cc b/src/libstore/filetransfer.cc index dc656f444..cc1656a17 100644 --- a/src/libstore/filetransfer.cc +++ b/src/libstore/filetransfer.cc @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include diff --git a/src/libstore/filetransfer.hh b/src/libstore/filetransfer.hh index 3f55995ef..c692f1485 100644 --- a/src/libstore/filetransfer.hh +++ b/src/libstore/filetransfer.hh @@ -1,8 +1,9 @@ #pragma once ///@file +#include "logging.hh" +#include "serialise.hh" #include "types.hh" -#include "hash.hh" #include "config.hh" #include diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc index 722452b8d..d58e3c8eb 100644 --- a/src/libstore/gc.cc +++ b/src/libstore/gc.cc @@ -1,18 +1,14 @@ -#include "derivations.hh" #include "globals.hh" #include "local-store.hh" +#include "pathlocks.hh" #include "processes.hh" #include "signals.hh" #include "finally.hh" #include "unix-domain-socket.hh" -#include #include -#include #include -#include -#include #include #include #include diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc index 8ef25c469..993a8cfa5 100644 --- a/src/libstore/globals.cc +++ b/src/libstore/globals.cc @@ -1,14 +1,15 @@ #include "environment-variables.hh" #include "globals.hh" +#include "file-system.hh" +#include "logging.hh" +#include "strings.hh" #include "users.hh" -#include "archive.hh" #include "args.hh" #include "abstract-setting-to-json.hh" #include "compute-levels.hh" #include "current-process.hh" #include -#include #include #include #include diff --git a/src/libstore/local-store.hh b/src/libstore/local-store.hh index 14f024ca9..808fdc202 100644 --- a/src/libstore/local-store.hh +++ b/src/libstore/local-store.hh @@ -3,11 +3,9 @@ #include "sqlite.hh" -#include "pathlocks.hh" #include "store-api.hh" #include "indirect-root-store.hh" #include "sync.hh" -#include "util.hh" #include #include diff --git a/src/libstore/nar-info-disk-cache.cc b/src/libstore/nar-info-disk-cache.cc index 0413abbf1..169b63819 100644 --- a/src/libstore/nar-info-disk-cache.cc +++ b/src/libstore/nar-info-disk-cache.cc @@ -1,4 +1,5 @@ #include "nar-info-disk-cache.hh" +#include "logging.hh" #include "sync.hh" #include "sqlite.hh" #include "globals.hh" diff --git a/src/libstore/optimise-store.cc b/src/libstore/optimise-store.cc index e09072e90..4f02296c3 100644 --- a/src/libstore/optimise-store.cc +++ b/src/libstore/optimise-store.cc @@ -1,4 +1,3 @@ -#include "util.hh" #include "local-store.hh" #include "globals.hh" #include "signals.hh" diff --git a/src/libstore/outputs-spec.cc b/src/libstore/outputs-spec.cc index 4422bcd21..0d740c324 100644 --- a/src/libstore/outputs-spec.cc +++ b/src/libstore/outputs-spec.cc @@ -5,7 +5,6 @@ #include "outputs-spec.hh" #include "path-regex.hh" #include "strings.hh" -#include "util.hh" namespace nix { diff --git a/src/libstore/path-references.cc b/src/libstore/path-references.cc index 33cf66ce3..8a02e9006 100644 --- a/src/libstore/path-references.cc +++ b/src/libstore/path-references.cc @@ -1,12 +1,8 @@ #include "path-references.hh" #include "hash.hh" -#include "util.hh" #include "archive.hh" #include -#include -#include -#include namespace nix { diff --git a/src/libstore/pathlocks.cc b/src/libstore/pathlocks.cc index 3e654c1c9..ced0f30bb 100644 --- a/src/libstore/pathlocks.cc +++ b/src/libstore/pathlocks.cc @@ -1,10 +1,8 @@ #include "pathlocks.hh" -#include "util.hh" +#include "logging.hh" #include "signals.hh" -#include "sync.hh" #include -#include #include #include diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc index 22d87b027..93b1afabd 100644 --- a/src/libstore/remote-store.cc +++ b/src/libstore/remote-store.cc @@ -1,5 +1,4 @@ #include "serialise.hh" -#include "util.hh" #include "signals.hh" #include "path-with-outputs.hh" #include "gc-store.hh" diff --git a/src/libstore/serve-protocol.cc b/src/libstore/serve-protocol.cc index 2e15d28d5..603137c81 100644 --- a/src/libstore/serve-protocol.cc +++ b/src/libstore/serve-protocol.cc @@ -1,11 +1,9 @@ #include "serialise.hh" -#include "util.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 diff --git a/src/libstore/sqlite.cc b/src/libstore/sqlite.cc index 4bd425b46..f40217734 100644 --- a/src/libstore/sqlite.cc +++ b/src/libstore/sqlite.cc @@ -1,12 +1,11 @@ #include "sqlite.hh" #include "globals.hh" -#include "util.hh" +#include "logging.hh" #include "signals.hh" #include "url.hh" #include -#include namespace nix { diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc index c5631dfd8..eb9b5c3ef 100644 --- a/src/libstore/store-api.cc +++ b/src/libstore/store-api.cc @@ -1,9 +1,7 @@ -#include "crypto.hh" #include "fs-accessor.hh" #include "globals.hh" #include "derivations.hh" #include "store-api.hh" -#include "util.hh" #include "nar-info-disk-cache.hh" #include "thread-pool.hh" #include "url.hh" diff --git a/src/libstore/store-api.hh b/src/libstore/store-api.hh index 745fce594..397ebe759 100644 --- a/src/libstore/store-api.hh +++ b/src/libstore/store-api.hh @@ -1,6 +1,7 @@ #pragma once ///@file +#include "logging.hh" #include "nar-info.hh" #include "realisation.hh" #include "path.hh" diff --git a/src/libstore/worker-protocol.cc b/src/libstore/worker-protocol.cc index ad94c79ee..d76a8d2b8 100644 --- a/src/libstore/worker-protocol.cc +++ b/src/libstore/worker-protocol.cc @@ -1,5 +1,4 @@ #include "serialise.hh" -#include "util.hh" #include "path-with-outputs.hh" #include "store-api.hh" #include "build-result.hh" -- cgit v1.2.3