Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nix
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: c7346a275c4c
Choose a base ref
...
head repository: NixOS/nix
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 63d6e0ad3f0a
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Jun 20, 2017

  1. Call SetDllDirectory("") after sqlite3 init on cygwin

    Cygwin sqlite3 is patched to call SetDllDirectory("/usr/bin") on init, which
    affects the current process and is inherited by child processes.  It causes
    DLLs to be loaded from /usr/bin/ before $PATH, which breaks all sorts of
    things.  A typical failures would be header/lib version mismatches (e.g.
    openssl when running checkPhase on openssh).  We'll just set it back to the
    default value.
    
    Note that this is a problem with the cygwin version of sqlite3 (currently
    3.18.0).  nixpkgs doesn't have the problematic patch.
    corngood committed Jun 20, 2017
    Copy the full SHA
    596b0e0 View commit details

Commits on Jun 30, 2017

  1. Merge pull request #1417 from corngood/cygwin-fix

    Call SetDllDirectory("") after sqlite3 init on cygwin
    edolstra authored Jun 30, 2017
    Copy the full SHA
    63d6e0a View commit details
Showing with 14 additions and 0 deletions.
  1. +14 −0 src/libstore/local-store.cc
14 changes: 14 additions & 0 deletions src/libstore/local-store.cc
Original file line number Diff line number Diff line change
@@ -30,6 +30,10 @@
#include <sys/xattr.h>
#endif

#ifdef __CYGWIN__
#include <windows.h>
#endif

#include <sqlite3.h>


@@ -281,6 +285,16 @@ void LocalStore::openDB(State & state, bool create)
SQLITE_OPEN_READWRITE | (create ? SQLITE_OPEN_CREATE : 0), 0) != SQLITE_OK)
throw Error(format("cannot open Nix database ‘%1%’") % dbPath);

#ifdef __CYGWIN__
/* The cygwin version of sqlite3 has a patch which calls
SetDllDirectory("/usr/bin") on init. It was intended to fix extension
loading, which we don't use, and the effect of SetDllDirectory is
inherited by child processes, and causes libraries to be loaded from
/usr/bin instead of $PATH. This breaks quite a few things (e.g.
checkPhase on openssh), so we set it back to default behaviour. */
SetDllDirectoryW(L"");
#endif

if (sqlite3_busy_timeout(db, 60 * 60 * 1000) != SQLITE_OK)
throwSQLiteError(db, "setting timeout");