Skip to content

Commit

Permalink
Move loadConfFile() to initLibStore
Browse files Browse the repository at this point in the history
Part of an effort to make it easier to initialize the right things,
by moving code into the appropriate libraries.

Using libstore without loading the config file is risky, as sqlite
may then be misconfigured. See cachix/cachix#475
  • Loading branch information
roberth committed Apr 7, 2023
1 parent 6e0b710 commit a692c43
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
1 change: 0 additions & 1 deletion perl/lib/Nix/Store.xs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ static ref<Store> store()
if (!_store) {
try {
initLibStore();
loadConfFile();
settings.lockCPU = false;
_store = openStore();
} catch (Error & e) {
Expand Down
2 changes: 0 additions & 2 deletions src/libmain/shared.cc
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,6 @@ void initNix()
if (sodium_init() == -1)
throw Error("could not initialise libsodium");

loadConfFile();

startSignalHandlerThread();

/* Reset SIGCHLD to its default. */
Expand Down
3 changes: 3 additions & 0 deletions src/libstore/globals.cc
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,9 @@ void assertLibStoreInitialized() {
}

void initLibStore() {

loadConfFile();

initLibStoreDone = true;
}

Expand Down

0 comments on commit a692c43

Please sign in to comment.