about summary refs log tree commit diff
path: root/src/libstore
AgeCommit message (Collapse)AuthorFilesLines
2017-02-16 Move netrcFile to SettingsEelco Dolstra3-26/+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 Dolstra4-63/+141
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-09 Documentation.Renzo Carbonara1-0/+3
2017-02-08 Include config.h implicitly with '-include config.h' in CFLAGSTuomas Tynkkynen5-9/+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 Merge branch 'nix-copy-closure-c++' of https://github.com/shlevy/nixEelco Dolstra3-3/+26
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/+43
2017-02-07 SSHStore: uri -> hostEelco Dolstra1-10/+12
2017-02-07 CleanupEelco Dolstra1-2/+0
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 Dolstra2-2/+3
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 Dolstra3-1/+84
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 Dolstra1-18/+39
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 Fix assertion failure when a path is lockedEelco Dolstra1-0/+1
Fixes: nix-store: src/libstore/build.cc:3649: void nix::Worker::run(const Goals&): Assertion `!awake.empty()' failed.
2017-01-26 UserLock: Fix multi-threaded access to a global variableEelco Dolstra1-30/+40
2017-01-26 openLockFile: Return an AutoCloseFDEelco Dolstra2-5/+5
2017-01-26 UserLock: Make more RAII-ishEelco Dolstra1-53/+38
2017-01-26 Moving more code out of DerivationGoal::startBuilder()Eelco Dolstra1-100/+111
2017-01-26 On HTTP errors, also show the curl errorEelco Dolstra1-1/+1
This is a hopefully temporary measure to diagnose the intermittent "HTTP error 200" failures.
2017-01-26 Move exportReferencesGraph into a separate methodEelco Dolstra1-44/+55
startBuilder() is getting rather obese.
2017-01-24 Enable verbose curl outputEelco Dolstra1-1/+14
Closes #1182.
2017-01-20 nix-copy-closure: Implement in C++.Shea Levy3-5/+29
Tests fail currently because the database is not given proper hashes in the VM
2017-01-19 Merge pull request #981 from shlevy/build-remote-c++Eelco Dolstra5-3/+39
build-remote: Implement in C++
2017-01-19 Kill builds when we get EOF on the log FDEelco Dolstra1-11/+10
This closes a long-time bug that allowed builds to hang Nix indefinitely (regardless of timeouts) simply by doing exec > /dev/null 2>&1; while true; do true; done Now, on EOF, we just send SIGKILL to the child to make sure it's really gone.
2017-01-19 Use std::unique_ptr for HookInstanceEelco Dolstra1-5/+4
2017-01-17 Handle SIGINT etc. via a sigwait() signal handler threadEelco Dolstra1-5/+15
This allows other threads to install callbacks that run in a regular, non-signal context. In particular, we can use this to signal the downloader thread to quit. Closes #1183.
2017-01-16 AutoCloseDir: Use std::unique_ptrEelco Dolstra2-12/+12
2017-01-16 AutoDeleteArray -> std::unique_ptrEelco Dolstra1-3/+2
Also, switch to C++14 for std::make_unique.
2017-01-09 Merge pull request #1139 from Mic92/masterEelco Dolstra1-6/+2
Simplify remouting with MS_PRIVATE in sandbox build
2017-01-02 Provide /var/run/nscd/socket in the sandboxEelco Dolstra1-0/+1
Otherwise sandbox builds can fail, e.g. $ NIX_REMOTE=local?root=/tmp/nix nix-build '<nixpkgs>' -A hello --option build-use-substitutes false ... downloading ‘http://ftpmirror.gnu.org/bash/bash-4.3-patches/bash43-047’... error: unable to download ‘http://ftpmirror.gnu.org/bash/bash-4.3-patches/bash43-047’: Couldn't resolve host name (6)
2016-12-22 Call Aws::InitAPIEelco Dolstra1-1/+17
This is required now.
2016-12-22 Add commentEelco Dolstra1-1/+2
2016-12-19 Revert "Merge branch 'seccomp' of https://github.com/aszlig/nix"Eelco Dolstra2-69/+29
This reverts commit 9f3f2e21edb17dbcd674539dff96efb6cceca10c, reversing changes made to 47f587700d646f5b03a42f2fa57c28875a31efbe.
2016-12-19 Revert "Give root a valid home directory"Eelco Dolstra1-3/+3
This reverts commit ec7d498b72b0e283814c27cbc6c064496f95445d.
2016-12-15 Give root a valid home directoryEelco Dolstra1-3/+3
Some programs barf if the current user has a non-writable home directory, e.g. http://hydra.nixos.org/build/44818144.
2016-12-15 Merge branch 'seccomp' of https://github.com/aszlig/nixEelco Dolstra2-29/+69
2016-12-09 Probably fix a segfault in PathLocksEelco Dolstra1-37/+50
2016-12-08 Don't delete .check directories of running buildsEelco Dolstra2-2/+7
We need to keep them around for diffoscope.
2016-12-08 Fix warning on 32-bit systemsEelco Dolstra1-1/+2
http://hydra.nixos.org/build/44628517
2016-12-08 Fix buildEelco Dolstra1-2/+2
http://hydra.nixos.org/build/44628517
2016-12-08 S3BinaryCacheStore: Ensure it only builds on LinuxEelco Dolstra1-0/+2
2016-12-08 Fix S3BinaryCacheStoreEelco Dolstra2-1/+10
It failed with AWS error uploading ‘6gaxphsyhg66mz0a00qghf9nqf7majs2.ls.xz’: Unable to parse ExceptionName: MissingContentLength Message: You must provide the Content-Length HTTP header. possibly because the istringstream_nocopy introduced in 0d2ebb4373e509521f27a6e8f16bfd39d05b2188 doesn't supply the seek method that the AWS library expects. So bring back the old version, but only for S3BinaryCacheStore.
2016-12-07 Add a hook to run diffoscope when non-determinism is detectedEelco Dolstra1-7/+32