diff options
author | eldritch horrors <pennae@lix.systems> | 2024-03-04 05:24:33 +0100 |
---|---|---|
committer | eldritch horrors <pennae@lix.systems> | 2024-03-04 05:24:33 +0100 |
commit | 559a8c44c3b59c046f4bb0bf049583ff234a095e (patch) | |
tree | 89681485d3cbfee39becc739b460807cb6c36d26 /src/libstore/local-fs-store.hh | |
parent | 7ff1dca1fad24d0e8dd83172397d952ef6cb4de5 (diff) |
Merge pull request #6258 from obsidiansystems/gcc-bug-ergonomics
Remove bug-avoiding `StoreConfig *` casts for settings
(cherry picked from commit e3febfcd532adb23ca05ac465a2b907d6f1a3529)
Change-Id: Ifeae276582fdbc781a38581df9de3da67a7e7bf9
Diffstat (limited to 'src/libstore/local-fs-store.hh')
-rw-r--r-- | src/libstore/local-fs-store.hh | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/libstore/local-fs-store.hh b/src/libstore/local-fs-store.hh index 488109501..d6bda05d1 100644 --- a/src/libstore/local-fs-store.hh +++ b/src/libstore/local-fs-store.hh @@ -11,25 +11,21 @@ struct LocalFSStoreConfig : virtual StoreConfig { using StoreConfig::StoreConfig; - // FIXME: the (StoreConfig*) cast works around a bug in gcc that causes - // it to omit the call to the Setting constructor. Clang works fine - // either way. - - const OptionalPathSetting rootDir{(StoreConfig*) this, std::nullopt, + const OptionalPathSetting rootDir{this, std::nullopt, "root", "Directory prefixed to all other paths."}; - const PathSetting stateDir{(StoreConfig*) this, + const PathSetting stateDir{this, rootDir.get() ? *rootDir.get() + "/nix/var/nix" : settings.nixStateDir, "state", "Directory where Nix will store state."}; - const PathSetting logDir{(StoreConfig*) this, + const PathSetting logDir{this, rootDir.get() ? *rootDir.get() + "/nix/var/log/nix" : settings.nixLogDir, "log", "directory where Nix will store log files."}; - const PathSetting realStoreDir{(StoreConfig*) this, + const PathSetting realStoreDir{this, rootDir.get() ? *rootDir.get() + "/nix/store" : storeDir, "real", "Physical path of the Nix store."}; }; |