about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2017-03-01 TeeSink: Pre-reserve string spaceEelco Dolstra3-10/+21
When receiving a very large file, this can prevent the string from having tobe copied, which temporarily doubles memory consumption.
2017-03-01 RemoteStore::addToStore(): Send NAR rather than string containing NAREelco Dolstra5-37/+21
This allows the NAR to be streamed in the future (though we're not doing that yet).
2017-03-01 readString(): Read directly into std::stringEelco Dolstra1-3/+3
When reading a huge string, this halves memory consumption. (Strictly speaking, this appears only valid in C++17, but who cares...)
2017-03-01 Tweak messageEelco Dolstra1-1/+1
2017-03-01 nix-store --import: Fix importing unsigned pathsEelco Dolstra1-1/+1
2017-03-01 Fix assertion failure in nix-store --exportEelco Dolstra1-0/+3
Fixes #1173.
2017-03-01 Handle importing NARs containing files greater than 4 GiBEelco Dolstra7-81/+84
Also templatize readInt() to work for various integer types.
2017-02-28 Fix building against older curl versionsEelco Dolstra1-1/+4
http://hydra.nixos.org/build/49490928
2017-02-28 Improve SQLite busy handlingEelco Dolstra2-30/+42
2017-02-28 NarInfoDiskCache: Handle SQLite busy errorsEelco Dolstra1-104/+115
2017-02-28 In SQLite errors, include the database pathEelco Dolstra1-4/+8
This is necessary because we have multiple SQLite databases (e.g. the binary cache cache).
2017-02-28 Support auto-configuration of build-max-jobsEelco Dolstra2-2/+12
"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 Dolstra1-7/+3
2017-02-27 Retry downloads on HTTP/2 stream errorsEelco Dolstra1-1/+3
Issue #1254.
2017-02-24 nix-shell: Better error message when the shell can't be startedEelco Dolstra1-2/+4
2017-02-24 Register content-addressability assertion for fixed outputsEelco Dolstra1-1/+4
2017-02-24 Verify content-addressability assertions at registration timeEelco Dolstra1-0/+2
2017-02-24 nix-shell: Overwrite environment variablesEelco Dolstra1-1/+1
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-22 RemoteStore::addToStore(): Pass content-addressability assertionEelco Dolstra6-3/+16
... 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-21 Handle CURLE_RECV_ERROR as a transient errorEelco Dolstra1-1/+1
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-21 Fix building without S3 supportEelco Dolstra2-2/+2
http://hydra.nixos.org/build/49031196/nixlog/2/raw
2017-02-21 Log AWS retriesEelco Dolstra1-0/+14
2017-02-16 Support netrc in <nix/fetchurl.nix>Eelco Dolstra5-7/+25
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-16 Move netrcFile to SettingsEelco Dolstra4-27/+23
Also get rid of Settings::processEnvironment(), it appears to be useless.
2017-02-16 Include "curl" in the User-Agent headerEelco Dolstra1-1/+1
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-16 Merge pull request #1215 from k0001/netrc-1Eelco Dolstra1-0/+8
Add netrc-file support
2017-02-14 Add support for s3:// URIsEelco Dolstra5-63/+142
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-13 Merge pull request #1224 from dezgeg/confighEelco Dolstra14-24/+0
Unbreak 32-bit builds by always implicitly including config.h
2017-02-13 nix-daemon: Don't splice with len=SIZE_MAXTuomas Tynkkynen1-2/+3
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-09 Documentation.Renzo Carbonara1-0/+3
2017-02-08 Include config.h implicitly with '-include config.h' in CFLAGSTuomas Tynkkynen14-24/+0
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-07 nix-copy-closure: Use computeFSClosure() and LegacySSHStoreEelco Dolstra1-12/+11
2017-02-07 Merge branch 'nix-copy-closure-c++' of https://github.com/shlevy/nixEelco Dolstra7-5/+94
2017-02-07 Add a LegacySSHStore that uses nix-store --serveEelco Dolstra2-0/+248
This is useful for nix-copy-closure.
2017-02-07 copyStorePath(): Don't require signatures for "trusted" storesEelco Dolstra2-0/+13
For example, SSH stores could be trusted.
2017-02-07 Provide default implementations for a couple of Store methodsEelco Dolstra4-26/+20
2017-02-07 Move SavingSourceAdapter to serialise.hhEelco Dolstra2-15/+15
2017-02-07 Remove unnecessary call to topoSortPaths()Eelco Dolstra1-3/+1
exportPaths() already does this.
2017-02-07 SSHStore: uri -> hostEelco Dolstra1-10/+12
2017-02-07 CleanupEelco Dolstra1-2/+0
2017-02-07 Remove download-via-sshEelco Dolstra2-153/+0
Replaced by SSHStore.
2017-02-02 Add netrc-file supportRenzo Carbonara1-0/+5
2017-02-02 exportReferencesGraph: Only export in JSON format when in structured modeEelco Dolstra1-10/+16
This prevents breaking compatibility with builders that read "closure.*", since they would accidentally pick up the new JSON files.
2017-02-01 Restore default signal handling in child processesEelco Dolstra7-35/+33
In particular, this fixes Ctrl-C in nix-shell sessions.
2017-01-27 Periodically purge binary-cache.sqliteEelco Dolstra2-1/+31
2017-01-27 Implement TTL for binary cache lookupsEelco Dolstra1-5/+10
2017-01-27 Remove unused NARExistence tableEelco Dolstra1-10/+0
2017-01-26 exportReferencesGraph: Export more complete info in JSON formatEelco Dolstra4-50/+90
This writes info about every path in the closure in the same format as ‘nix path-info --json’. Thus it also includes NAR hashes and sizes. Example: [ { "path": "/nix/store/10h6li26i7g6z3mdpvra09yyf10mmzdr-hello-2.10", "narHash": "sha256:0ckdc4z20kkmpqdilx0wl6cricxv90lh85xpv2qljppcmz6vzcxl", "narSize": 197648, "references": [ "/nix/store/10h6li26i7g6z3mdpvra09yyf10mmzdr-hello-2.10", "/nix/store/27binbdy296qvjycdgr1535v8872vz3z-glibc-2.24" ], "closureSize": 20939776 }, { "path": "/nix/store/27binbdy296qvjycdgr1535v8872vz3z-glibc-2.24", "narHash": "sha256:1nfn3m3p98y1c0kd0brp80dn9n5mycwgrk183j17rajya0h7gax3", "narSize": 20742128, "references": [ "/nix/store/27binbdy296qvjycdgr1535v8872vz3z-glibc-2.24" ], "closureSize": 20742128 } ] Fixes #1134.
2017-01-26 Add support for passing structured data to buildersEelco Dolstra4-58/+130
Previously, all derivation attributes had to be coerced into strings so that they could be passed via the environment. This is lossy (e.g. lists get flattened, necessitating configureFlags vs. configureFlagsArray, of which the latter cannot be specified as an attribute), doesn't support attribute sets at all, and has size limitations (necessitating hacks like passAsFile). This patch adds a new mode for passing attributes to builders, namely encoded as a JSON file ".attrs.json" in the current directory of the builder. This mode is activated via the special attribute __structuredAttrs = true; (The idea is that one day we can set this in stdenv.mkDerivation.) For example, stdenv.mkDerivation { __structuredAttrs = true; name = "foo"; buildInputs = [ pkgs.hello pkgs.cowsay ]; doCheck = true; hardening.format = false; } results in a ".attrs.json" file containing (sans the indentation): { "buildInputs": [], "builder": "/nix/store/ygl61ycpr2vjqrx775l1r2mw1g2rb754-bash-4.3-p48/bin/bash", "configureFlags": [ "--with-foo", "--with-bar=1 2" ], "doCheck": true, "hardening": { "format": false }, "name": "foo", "nativeBuildInputs": [ "/nix/store/10h6li26i7g6z3mdpvra09yyf10mmzdr-hello-2.10", "/nix/store/4jnvjin0r6wp6cv1hdm5jbkx3vinlcvk-cowsay-3.03" ], "propagatedBuildInputs": [], "propagatedNativeBuildInputs": [], "stdenv": "/nix/store/f3hw3p8armnzy6xhd4h8s7anfjrs15n2-stdenv", "system": "x86_64-linux" } "passAsFile" is ignored in this mode because it's not needed - large strings are included directly in the JSON representation. It is up to the builder to do something with the JSON representation. For example, in bash-based builders, lists/attrsets of string values could be mapped to bash (associative) arrays.
2017-01-26 Bindings: Add a method for iterating in lexicographically sorted orderEelco Dolstra4-28/+28