aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-03-01RemoteStore::addToStore(): Send NAR rather than string containing NAREelco Dolstra
This allows the NAR to be streamed in the future (though we're not doing that yet).
2017-03-01readString(): Read directly into std::stringEelco Dolstra
When reading a huge string, this halves memory consumption. (Strictly speaking, this appears only valid in C++17, but who cares...)
2017-03-01Tweak messageEelco Dolstra
2017-03-01nix-store --import: Fix importing unsigned pathsEelco Dolstra
2017-03-01Fix assertion failure in nix-store --exportEelco Dolstra
Fixes #1173.
2017-03-01Handle importing NARs containing files greater than 4 GiBEelco Dolstra
Also templatize readInt() to work for various integer types.
2017-02-28Fix building against older curl versionsEelco Dolstra
http://hydra.nixos.org/build/49490928
2017-02-28Improve SQLite busy handlingEelco Dolstra
2017-02-28NarInfoDiskCache: Handle SQLite busy errorsEelco Dolstra
2017-02-28In SQLite errors, include the database pathEelco Dolstra
This is necessary because we have multiple SQLite databases (e.g. the binary cache cache).
2017-02-28Support auto-configuration of build-max-jobsEelco Dolstra
"build-max-jobs" and the "-j" option can now be set to "auto" to use the number of CPUs in the system. (Unlike build-cores, it doesn't use 0 to imply auto-configuration, because a) magic values are a bad idea in general; b) 0 is a legitimate value used to disable local building.) Fixes #1198.
2017-02-27_SC_NPROCESSORS_ONLN -> std::thread::hardware_concurrency()Eelco Dolstra
2017-02-27Fix 1.8 release note about build-max-jobsEelco Dolstra
We set build-cores automatically, not build-max-jobs. (The commit message for de4cdd0d47adc70a4db12397a42c18ee50b4e662 also got this wrong.)
2017-02-27Retry downloads on HTTP/2 stream errorsEelco Dolstra
Issue #1254.
2017-02-27Merge pull request #1252 from bjornfor/channel-rename-fixDomen Kožar
unpack-channel.nix: fix 'mv' corner case
2017-02-27unpack-channel.nix: fix 'mv' corner caseBjørn Forsman
unpack-channel.nix fails if the tarball contains a directory named the same as the channel: mv: cannot move 'nixpkgs' to a subdirectory of itself, '.../nixpkgs' This commit fixes that by not moving the directory if it already has the correct name.
2017-02-24Fix nix-shell testsEelco Dolstra
The nix-shell fix in 668fef2e4f1c7758e2a55e355b4826014d5b7ba9 revealed that we had some --pure tests that incorrectly depended on PATH from config.nix's mkDerivation being overwritten by the caller's PATH. http://hydra.nixos.org/build/49242478
2017-02-24nix-shell: Better error message when the shell can't be startedEelco Dolstra
2017-02-24Register content-addressability assertion for fixed outputsEelco Dolstra
2017-02-24Verify content-addressability assertions at registration timeEelco Dolstra
2017-02-24nix-shell: Overwrite environment variablesEelco Dolstra
Need to remember that std::map::insert() and emplace() don't overwrite existing entries... This fixes a regression relative to 1.11 that in particular triggers in nested nix-shells. Before: $ nativeBuildInputs=/foo nix-shell -p hello --run 'hello' build input /foo does not exist After: $ nativeBuildInputs=/foo nix-shell -p hello --run 'hello' Hello, world!
2017-02-22Explicitly model all settings and fail on unrecognized onesDan Peebles
Previously, the Settings class allowed other code to query for string properties, which led to a proliferation of code all over the place making up new options without any sort of central registry of valid options. This commit pulls all those options back into the central Settings class and removes the public get() methods, to discourage future abuses like that. Furthermore, because we know the full set of options ahead of time, we now fail loudly if someone enters an unrecognized option, thus preventing subtle typos. With some template fun, we could probably also dump the full set of options (with documentation, defaults, etc.) to the command line, but I'm not doing that yet here.
2017-02-22RemoteStore::addToStore(): Pass content-addressability assertionEelco Dolstra
... and use this in Downloader::downloadCached(). This fixes $ nix-build https://nixos.org/channels/nixos-16.09-small/nixexprs.tar.xz -A hello error: cannot import path ‘/nix/store/csfbp1s60dkgmk9f8g0zk0mwb7hzgabd-nixexprs.tar.xz’ because it lacks a valid signature
2017-02-22DohEelco Dolstra
2017-02-22Fix 32-bit RPM/Deb buildsEelco Dolstra
http://hydra.nixos.org/build/49130529
2017-02-21Handle CURLE_RECV_ERROR as a transient errorEelco Dolstra
This fixes unable to download ‘https://cache.nixos.org/nar/077h8ji74y9b0qx7rjk71xd80vjqp6q5gy137r553jlvdlxdcdlk.nar.xz’: HTTP error 200 (curl error: Failure when receiving data from the peer)
2017-02-21useChroot -> useSandboxEelco Dolstra
2017-02-21Drop some Ubuntu releasesEelco Dolstra
2017-02-21Revert "configure.ac: We require C++14 now"Eelco Dolstra
This reverts commit 81c53fe8e56f4a4ce10088fe2d7b6a524a6dc126. This check appears to be stricter than we need (it broke a bunch of platforms that previously did build: http://hydra.nixos.org/eval/1331921#tabs-now-fail).
2017-02-21Debian build: Use parallel make and add Ubuntu 16.10Eelco Dolstra
2017-02-21RPM build: Use parallel makeEelco Dolstra
2017-02-21Build RPMs for Fedora 25Eelco Dolstra
Disabled hardened build because it makes the linker fail with messages like relocation R_X86_64_PC32 against undefined symbol `BZ2_bzWriteOpen' can not be used when making a shared object; recompile with -fPIC See https://fedoraproject.org/wiki/Changes/Harden_All_Packages.
2017-02-21Fix building without S3 supportEelco Dolstra
http://hydra.nixos.org/build/49031196/nixlog/2/raw
2017-02-21Fix XML validityEelco Dolstra
2017-02-21Log AWS retriesEelco Dolstra
2017-02-20Merge pull request #1240 from lheckemann/tostring-docDomen Kožar
Document toString better
2017-02-20Document toString betterLinus Heckemann
2017-02-16Support netrc in <nix/fetchurl.nix>Eelco Dolstra
This allows <nix/fetchurl.nix> to fetch private Git/Mercurial repositories, e.g. import <nix/fetchurl.nix> { url = https://edolstra@bitbucket.org/edolstra/my-private-repo/get/80a14018daed.tar.bz2; sha256 = "1mgqzn7biqkq3hf2697b0jc4wabkqhmzq2srdymjfa6sb9zb6qs7"; } where /etc/nix/netrc contains: machine bitbucket.org login edolstra password blabla... This works even when sandboxing is enabled. To do: add unpacking support (i.e. fetchzip functionality).
2017-02-16Move netrcFile to SettingsEelco Dolstra
Also get rid of Settings::processEnvironment(), it appears to be useless.
2017-02-16Tweak netrc docsEelco Dolstra
2017-02-16<nix/fetchurl.nix>: Remove unnecessary assertionEelco Dolstra
2017-02-16Include "curl" in the User-Agent headerEelco Dolstra
Some sites (e.g. BitBucket) give a helpful 401 error when trying to download a private archive if the User-Agent contains "curl", but give a redirect to a login page otherwise (so for instance "nix-prefetch-url" will succeed but produce useless output).
2017-02-16Merge pull request #1215 from k0001/netrc-1Eelco Dolstra
Add netrc-file support
2017-02-14Add support for s3:// URIsEelco Dolstra
This adds support for s3:// URIs in all places where Nix allows URIs, e.g. in builtins.fetchurl, builtins.fetchTarball, <nix/fetchurl.nix> and NIX_PATH. It allows fetching resources from private S3 buckets, using credentials obtained from the standard places (i.e. AWS_* environment variables, ~/.aws/credentials and the EC2 metadata server). This may not be super-useful in general, but since we already depend on aws-sdk-cpp, it's a cheap feature to add.
2017-02-13Merge pull request #1224 from dezgeg/confighEelco Dolstra
Unbreak 32-bit builds by always implicitly including config.h
2017-02-13Merge pull request #1233 from dezgeg/spliceEelco Dolstra
nix-daemon: Don't splice with len=SIZE_MAX
2017-02-13nix-daemon: Don't splice with len=SIZE_MAXTuomas Tynkkynen
Currently, 'nix-daemon --stdio' is always failing for me, due to the splice call always failing with (on a 32-bit host): splice(0, NULL, 3, NULL, 4294967295, SPLICE_F_MOVE) = -1 EINVAL (Invalid argument) With a bit of ftracing (and luck) the problem seems to be that splice() always fails with EINVAL if the len cast as ssize_t is negative: http://lxr.free-electrons.com/source/fs/read_write.c?v=4.4#L384 So use SSIZE_MAX instead of SIZE_MAX.
2017-02-09Documentation.Renzo Carbonara
2017-02-08Include config.h implicitly with '-include config.h' in CFLAGSTuomas Tynkkynen
Because config.h can #define things like _FILE_OFFSET_BITS=64 and not every compilation unit includes config.h, we currently compile half of Nix with _FILE_OFFSET_BITS=64 and other half with _FILE_OFFSET_BITS unset. This causes major havoc with the Settings class on e.g. 32-bit ARM, where different compilation units disagree with the struct layout. E.g.: diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc @@ -166,6 +166,8 @@ void Settings::update() _get(useSubstitutes, "build-use-substitutes"); + fprintf(stderr, "at Settings::update(): &useSubstitutes = %p\n", &nix::settings.useSubstitutes); _get(buildUsersGroup, "build-users-group"); diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc +++ b/src/libstore/remote-store.cc @@ -138,6 +138,8 @@ void RemoteStore::initConnection(Connection & conn) void RemoteStore::setOptions(Connection & conn) { + fprintf(stderr, "at RemoteStore::setOptions(): &useSubstitutes = %p\n", &nix::settings.useSubstitutes); conn.to << wopSetOptions Gave me: at Settings::update(): &useSubstitutes = 0xb6e5c5cb at RemoteStore::setOptions(): &useSubstitutes = 0xb6e5c5c7 That was not a fun one to debug!
2017-02-08configure.ac: We require C++14 nowTuomas Tynkkynen
At least in the main Makefile we have: GLOBAL_CXXFLAGS += -std=c++14 -g -Wall