diff options
author | Brian McKenna <brian@brianmckenna.org> | 2019-12-21 07:40:23 +1100 |
---|---|---|
committer | Brian McKenna <brian@brianmckenna.org> | 2019-12-21 08:14:19 +1100 |
commit | d25923263e0eb70f37536e2fe5b59237f6fce5cc (patch) | |
tree | 266a545a78379a828014803ab5d6592c707d353f /src/libstore/globals.cc | |
parent | c84c843e3360459cf2c993919fb9f89474a46f38 (diff) |
Disable use-sqlite-wal under WSL
Before:
$ nix-channel --update
unpacking channels...
warning: SQLite database '/nix/var/nix/db/db.sqlite' is busy (SQLITE_PROTOCOL)
warning: SQLite database '/nix/var/nix/db/db.sqlite' is busy (SQLITE_PROTOCOL)
warning: SQLite database '/nix/var/nix/db/db.sqlite' is busy (SQLITE_PROTOCOL)
warning: SQLite database '/nix/var/nix/db/db.sqlite' is busy (SQLITE_PROTOCOL)
warning: SQLite database '/nix/var/nix/db/db.sqlite' is busy (SQLITE_PROTOCOL)
After:
$ inst/bin/nix-channel --update
unpacking channels...
created 1 symlinks in user environment
I've seen complaints that "sandbox" caused problems under WSL but I'm
having no problems. I think recent changes could have fixed the issue.
Diffstat (limited to 'src/libstore/globals.cc')
-rw-r--r-- | src/libstore/globals.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc index cec85edca..5f1ae5ab5 100644 --- a/src/libstore/globals.cc +++ b/src/libstore/globals.cc @@ -117,6 +117,15 @@ void Settings::requireExperimentalFeature(const std::string & name) throw Error("experimental Nix feature '%s' is disabled", name); } +bool Settings::isWSL1() +{ + struct utsname utsbuf; + uname(&utsbuf); + // WSL1 uses -Microsoft suffix + // WSL2 uses -microsoft-standard suffix + return hasSuffix(utsbuf.release, "-Microsoft"); +} + const string nixVersion = PACKAGE_VERSION; template<> void BaseSetting<SandboxMode>::set(const std::string & str) |