1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-09 02:21:02 +01:00

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.

(cherry picked from commit d25923263e)
Signed-off-by: Domen Kožar <domen@dev.si>
This commit is contained in:
Brian McKenna 2019-12-21 07:40:23 +11:00 committed by Domen Kožar
parent a729883bf1
commit 35f5da530a
No known key found for this signature in database
GPG key ID: C2FFBCAFD2C24246
2 changed files with 12 additions and 1 deletions

View file

@ -103,6 +103,15 @@ StringSet Settings::getDefaultSystemFeatures()
return features;
}
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)