diff options
-rw-r--r-- | perl/configure.ac | 13 | ||||
-rw-r--r-- | release.nix | 1 | ||||
-rw-r--r-- | shell.nix | 5 | ||||
-rw-r--r-- | src/libstore/download.cc | 5 | ||||
-rw-r--r-- | src/libstore/download.hh | 2 | ||||
-rw-r--r-- | src/libstore/gc.cc | 2 | ||||
-rw-r--r-- | src/libstore/local-store.hh | 11 | ||||
-rw-r--r-- | src/libstore/store-api.cc | 2 | ||||
-rw-r--r-- | src/libstore/store-api.hh | 7 |
9 files changed, 14 insertions, 34 deletions
diff --git a/perl/configure.ac b/perl/configure.ac index d617c78535f6..7a6b28be23e8 100644 --- a/perl/configure.ac +++ b/perl/configure.ac @@ -52,7 +52,7 @@ PKG_CHECK_MODULES([SODIUM], [libsodium], have_sodium=1], [have_sodium=]) AC_SUBST(HAVE_SODIUM, [$have_sodium]) -# Check for the required Perl dependencies (DBI, DBD::SQLite and WWW::Curl). +# Check for the required Perl dependencies (DBI and DBD::SQLite). perlFlags="-I$perllibdir" AC_ARG_WITH(dbi, AC_HELP_STRING([--with-dbi=PATH], @@ -63,10 +63,6 @@ AC_ARG_WITH(dbd-sqlite, AC_HELP_STRING([--with-dbd-sqlite=PATH], [prefix of the Perl DBD::SQLite library]), perlFlags="$perlFlags -I$withval") -AC_ARG_WITH(www-curl, AC_HELP_STRING([--with-www-curl=PATH], - [prefix of the Perl WWW::Curl library]), - perlFlags="$perlFlags -I$withval") - AC_MSG_CHECKING([whether DBD::SQLite works]) if ! $perl $perlFlags -e 'use DBI; use DBD::SQLite;' 2>&5; then AC_MSG_RESULT(no) @@ -74,13 +70,6 @@ if ! $perl $perlFlags -e 'use DBI; use DBD::SQLite;' 2>&5; then fi AC_MSG_RESULT(yes) -AC_MSG_CHECKING([whether WWW::Curl works]) -if ! $perl $perlFlags -e 'use WWW::Curl;' 2>&5; then - AC_MSG_RESULT(no) - AC_MSG_FAILURE([The Perl module WWW::Curl is missing.]) -fi -AC_MSG_RESULT(yes) - AC_SUBST(perlFlags) PKG_CHECK_MODULES([NIX], [nix-store]) diff --git a/release.nix b/release.nix index 8727c2520b1e..6136f650d950 100644 --- a/release.nix +++ b/release.nix @@ -116,7 +116,6 @@ let configureFlags = '' --with-dbi=${perlPackages.DBI}/${pkgs.perl.libPrefix} --with-dbd-sqlite=${perlPackages.DBDSQLite}/${pkgs.perl.libPrefix} - --with-www-curl=${perlPackages.WWWCurl}/${pkgs.perl.libPrefix} ''; enableParallelBuilding = true; diff --git a/shell.nix b/shell.nix index df0ad01df583..425eb0a191f2 100644 --- a/shell.nix +++ b/shell.nix @@ -6,7 +6,7 @@ with import <nixpkgs> {}; name = "nix"; buildInputs = - [ curl bison flex perl libxml2 libxslt + [ curl bison flex libxml2 libxslt bzip2 xz brotli pkgconfig sqlite libsodium boehmgc docbook5 docbook5_xsl @@ -16,14 +16,11 @@ with import <nixpkgs> {}; customMemoryManagement = false; }) autoreconfHook - perlPackages.DBDSQLite ]; configureFlags = [ "--disable-init-state" "--enable-gc" - "--with-dbi=${perlPackages.DBI}/${perl.libPrefix}" - "--with-dbd-sqlite=${perlPackages.DBDSQLite}/${perl.libPrefix}" ]; enableParallelBuilding = true; diff --git a/src/libstore/download.cc b/src/libstore/download.cc index d1f760fdc301..f8f578695033 100644 --- a/src/libstore/download.cc +++ b/src/libstore/download.cc @@ -300,6 +300,11 @@ struct CurlDownloader : public Downloader || httpStatus == 504 || httpStatus == 522 || httpStatus == 524 || code == CURLE_COULDNT_RESOLVE_HOST || code == CURLE_RECV_ERROR + + // this seems to occur occasionally for retriable reasons, and shows up in an error like this: + // curl: (23) Failed writing body (315 != 16366) + || code == CURLE_WRITE_ERROR + // this is a generic SSL failure that in some cases (e.g., certificate error) is permanent but also appears in transient cases, so we consider it retryable || code == CURLE_SSL_CONNECT_ERROR #if LIBCURL_VERSION_NUM >= 0x073200 diff --git a/src/libstore/download.hh b/src/libstore/download.hh index e2e16b361036..62f3860b9dae 100644 --- a/src/libstore/download.hh +++ b/src/libstore/download.hh @@ -15,7 +15,7 @@ struct DownloadRequest bool verifyTLS = true; enum { yes, no, automatic } showProgress = yes; bool head = false; - size_t tries = 1; + size_t tries = 5; unsigned int baseRetryTimeMs = 250; DownloadRequest(const std::string & uri) : uri(uri) { } diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc index 8e90913cc3f1..0b03d61a789a 100644 --- a/src/libstore/gc.cc +++ b/src/libstore/gc.cc @@ -679,7 +679,7 @@ void LocalStore::removeUnusedLinks(const GCState & state) if (unlink(path.c_str()) == -1) throw SysError(format("deleting ‘%1%’") % path); - state.results.bytesFreed += st.st_blocks * 512; + state.results.bytesFreed += st.st_blocks * 512ULL; } struct stat st; diff --git a/src/libstore/local-store.hh b/src/libstore/local-store.hh index 28e9a31c9feb..750da0c142d3 100644 --- a/src/libstore/local-store.hh +++ b/src/libstore/local-store.hh @@ -26,14 +26,9 @@ struct Derivation; struct OptimiseStats { - unsigned long filesLinked; - unsigned long long bytesFreed; - unsigned long long blocksFreed; - OptimiseStats() - { - filesLinked = 0; - bytesFreed = blocksFreed = 0; - } + unsigned long filesLinked = 0; + unsigned long long bytesFreed = 0; + unsigned long long blocksFreed = 0; }; diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc index 59348c5d0b5f..53c802044ea6 100644 --- a/src/libstore/store-api.cc +++ b/src/libstore/store-api.cc @@ -731,7 +731,7 @@ StoreType getStoreType(const std::string & uri, const std::string & stateDir) return tDaemon; } else if (uri == "local") { return tLocal; - } else if (uri == "") { + } else if (uri == "" || uri == "auto") { if (access(stateDir.c_str(), R_OK | W_OK) == 0) return tLocal; else if (pathExists(settings.nixDaemonSocketFile)) diff --git a/src/libstore/store-api.hh b/src/libstore/store-api.hh index 68c59a9f2922..c0a52145af53 100644 --- a/src/libstore/store-api.hh +++ b/src/libstore/store-api.hh @@ -81,12 +81,7 @@ struct GCResults /* For `gcReturnDead', `gcDeleteDead' and `gcDeleteSpecific', the number of bytes that would be or was freed. */ - unsigned long long bytesFreed; - - GCResults() - { - bytesFreed = 0; - } + unsigned long long bytesFreed = 0; }; |