From f0eb650ee8a0eb5244c15fab3b152a1f70e1506e Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Tue, 28 May 2024 16:27:48 +0200 Subject: [PATCH] util.hh: Move nativeSystem to local-derivation-goal.cc Change-Id: I74565fbfd3aeedef8f50465808fac712b84e47ad --- src/libstore/build/local-derivation-goal.cc | 5 +++++ src/libutil/error.cc | 2 -- src/libutil/util.hh | 5 ----- 3 files changed, 5 insertions(+), 7 deletions(-) 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, diff --git a/src/libutil/error.cc b/src/libutil/error.cc index 1a294bf08..2a7fd3d0e 100644 --- a/src/libutil/error.cc +++ b/src/libutil/error.cc @@ -10,8 +10,6 @@ namespace nix { -const std::string nativeSystem = SYSTEM; - void BaseError::addTrace(std::shared_ptr && e, HintFmt hint) { err.traces.push_front(Trace { .pos = std::move(e), .hint = hint }); diff --git a/src/libutil/util.hh b/src/libutil/util.hh index 4e20550a7..1066f212a 100644 --- a/src/libutil/util.hh +++ b/src/libutil/util.hh @@ -33,11 +33,6 @@ namespace nix { struct Sink; struct Source; -/** - * The system for which Nix is compiled. - */ -extern const std::string nativeSystem; -