aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/build.cc
AgeCommit message (Collapse)Author
2016-06-01Skip substituters with an incompatible store directoryEelco Dolstra
2016-06-01Make the store directory a member variable of StoreEelco Dolstra
2016-05-30Check signatures before downloading the substituteEelco Dolstra
2016-05-30Fix repair during substitutionEelco Dolstra
2016-05-04Cleanup: Remove singleton()Eelco Dolstra
2016-05-04Do compression in a sinkEelco Dolstra
2016-05-04Add a copyStorePath() utility functionEelco Dolstra
2016-04-29Eliminate the substituter mechanismEelco Dolstra
Substitution is now simply a Store -> Store copy operation, most typically from BinaryCacheStore to LocalStore.
2016-04-28Really handle carriage returnEelco Dolstra
2016-04-25Handle carriage returnEelco Dolstra
2016-04-25Show the log tail when a build failsEelco Dolstra
If --no-build-output is given (which will become the default for the "nix" command at least), show the last 10 lines of the build output if the build fails.
2016-04-25Remove --print-build-traceEelco Dolstra
This was added to support Hydra, but Hydra no longer uses it.
2016-04-25Improved logging abstractionEelco Dolstra
This also gets rid of --log-type, since the nested log type isn't useful in a multi-threaded situation, and nobody cares about the "pretty" log type.
2016-04-19Move path info caching from BinaryCacheStore to StoreEelco Dolstra
Caching path info is generally useful. For instance, it speeds up "nix path-info -rS /run/current-system" (i.e. showing the closure sizes of all paths in the closure of the current system) from 5.6s to 0.15s. This also eliminates some APIs like Store::queryDeriver() and Store::queryReferences().
2016-04-16Print out all bad references/requisites at onceDan Peebles
Also updates tests to check for new information. Fixes #799
2016-04-14Set RLIMIT_CORE to 0, infinity in buildersEelco Dolstra
This prevents the builder from being affected by whatever the host system limits happen to be.
2016-04-08Remove failed build cachingEelco Dolstra
This feature was implemented for Hydra, but Hydra no longer uses it.
2016-04-08Make LocalStore thread-safeEelco Dolstra
Necessary for multi-threaded commands like "nix verify-paths".
2016-04-07Sign locally-built pathsEelco Dolstra
Locally-built paths are now signed automatically using the secret keys specified by the ‘secret-key-files’ option.
2016-03-30LocalStore: Keep track of ultimately trusted pathsEelco Dolstra
These are content-addressed paths or outputs of locally performed builds. They are trusted even if they don't have signatures, so "nix verify-paths" won't complain about them.
2016-03-04Eliminate some large string copyingEelco Dolstra
2016-03-03build.cc: fs.h doesn't appear to be necessary anymoreNathan Zadoks
2016-02-24deletePath(): Succeed if path doesn't existEelco Dolstra
Also makes it robust against concurrent deletions.
2016-02-16Rename ValidPathInfo::hash -> narHash for consistencyEelco Dolstra
2016-02-04Eliminate the "store" global variableEelco Dolstra
Also, move a few free-standing functions into StoreAPI and Derivation. Also, introduce a non-nullable smart pointer, ref<T>, which is just a wrapper around std::shared_ptr ensuring that the pointer is never null. (For reference-counted values, this is better than passing a "T&", because the latter doesn't maintain the refcount. Usually, the caller will have a shared_ptr keeping the value alive, but that's not always the case, e.g., when passing a reference to a std::thread via std::bind.)
2016-01-31Add build mode to compute fixed-output derivation hashesEelco Dolstra
For example, $ nix-build --hash -A nix-repl.src will build the fixed-output derivation nix-repl.src (a fetchFromGitHub call), but instead of *verifying* the hash given in the Nix expression, it prints out the resulting hash, and then moves the result to its content-addressed location in the Nix store. E.g build produced path ‘/nix/store/504a4k6zi69dq0yjc0bm12pa65bccxam-nix-repl-8a2f5f0607540ffe56b56d52db544373e1efb980-src’ with sha256 hash ‘0cjablz01i0g9smnavhf86imwx1f9mnh5flax75i615ml71gsr88’ The goal of this is to make all nix-prefetch-* scripts unnecessary: we can just let Nix run the real thing (i.e., the corresponding fetch* derivation). Another example: $ nix-build --hash -E 'with import <nixpkgs> {}; fetchgit { url = "https://github.com/NixOS/nix.git"; sha256 = "ffffffffffffffffffffffffffffffffffffffffffffffffffff"; }' ... git revision is 9e7c1a4bbdbe6129dd9dc385776612c307d3d1bb ... build produced path ‘/nix/store/gmsnh9i7x4mb7pyd2ns7n3c9l90jfsi1-nix’ with sha256 hash ‘1188xb621diw89n25rifqg9lxnzpz7nj5bfh4i1y3dnis0dmc0zp’ (Having to specify a fake sha256 hash is a bit annoying...)
2016-01-12--option build-repeat: Keep the differing output if -K is givenEelco Dolstra
Similar to 00903fa79961d7eb0fadeb9ed2d7cda7821dc293. Regardless of -K, we now also print which output differs.
2016-01-12--check: Keep the differing output if -K is givenEelco Dolstra
This makes it easier to investigate the non-determinism, e.g. $ nix-build pkgs/stdenv/linux -A stage1.pkgs.zlib --check -K error: derivation ‘/nix/store/l54i8wlw22656i4pk05c52ngv9rpl39q-zlib-1.2.8.drv’ may not be deterministic: output ‘/nix/store/11a27shh6n2ivi4a7s964i65ql80cf27-zlib-1.2.8’ differs from ‘/nix/store/11a27shh6n2ivi4a7s964i65ql80cf27-zlib-1.2.8-check’ $ diffoscope /nix/store/11a27shh6n2ivi4a7s964i65ql80cf27-zlib-1.2.8 /nix/store/11a27shh6n2ivi4a7s964i65ql80cf27-zlib-1.2.8-check ... ├── lib/libz.a │ ├── metadata │ │ @@ -1,15 +1,15 @@ │ │ -rw-r--r-- 30001/30000 3096 Jan 12 15:20 2016 adler32.o ... │ │ +rw-r--r-- 30001/30000 3096 Jan 12 15:28 2016 adler32.o ...
2016-01-12--check: Fix "failed to produce output path"Eelco Dolstra
This occured when sandbox building is disabled, at least one output exists, and at least one other output does not.
2016-01-12--check: Fix assertion failure when some outputs are missingEelco Dolstra
E.g. $ nix-build pkgs/stdenv/linux/ -A stage1.pkgs.perl --check nix-store: src/libstore/build.cc:1323: void nix::DerivationGoal::tryToBuild(): Assertion `buildMode != bmCheck || validPaths.size() == drv->outputs.size()' failed. when perl.out exists but perl.man doesn't. The fix is to only check the outputs that exist. Note that "nix-build -A stage1.pkgs.all --check" will still give a (proper) error in this case.
2016-01-07Fix "Bad address" executing build hookEelco Dolstra
This was observed in the deb_debian7x86_64 build: http://hydra.nixos.org/build/29973215 Calling c_str() on a temporary should be fine because the temporary shouldn't be destroyed until after the execl() call, but who knows...
2016-01-07Fix some signedness warningsEelco Dolstra
2016-01-06nix-store --repair-path: Rebuild if there is no substituterEelco Dolstra
2016-01-06Fix --repair failure on multiple-output derivationsEelco Dolstra
If repair found a corrupted/missing path that depended on a multiple-output derivation, and some of the outputs of the latter were not present, it failed with a message like error: path ‘/nix/store/cnfn9d5fjys1y93cz9shld2xwaibd7nn-bash-4.3-p42-doc’ is not valid
2016-01-05Fix non-Darwin buildEelco Dolstra
2016-01-05libstore: mmap() returns MAP_FAILED, not NULL on failureTuomas Tynkkynen
2016-01-04Don't allow sandbox profile except in relaxed modeEelco Dolstra
This makes Darwin consistent with Linux: Nix expressions can't break out of the sandbox unless relaxed sandbox mode is enabled. For the normal sandbox mode this will require fixing #759 however.
2015-12-29Fix regression in passAsFileEelco Dolstra
Caused by 8063fc497ab78fa72962b93874fe25dcca2b55ed. If tmpDir != tmpDirInSandbox (typically when there are multiple concurrent builds with the same name), the *Path attribute would not point to an existing file. This caused Nixpkgs' writeTextFile to write an empty file. In particular this showed up as hanging VM builds (because it would run an empty run-nixos-vm script and then wait for it to finish booting).
2015-12-22Handle /tmp being a symlinkEelco Dolstra
Hopefully fixes Darwin sandbox regression introduced in 8063fc497ab78fa72962b93874fe25dcca2b55ed.
2015-12-22Fix bad error message in Darwin chrootsEelco Dolstra
2015-12-10Build sandbox support etc. unconditionally on LinuxEelco Dolstra
Also, use "#if __APPLE__" instead of "#if SANDBOX_ENABLED" to prevent ambiguity.
2015-12-08Clarify error message for hash mismatches (again)Bjørn Forsman
This is arguably nitpicky, but I think this new formulation is even clearer. My thinking is that it's easier to comprehend when the calculated hash value is displayed close to the output path. (I think it is somewhat similar to eliminating double negatives in logic statements.) The formulation is inspired / copied from the OpenEmbedded build tool, bitbake.
2015-12-02Use deterministic $TMPDIR in sandboxEelco Dolstra
Rather than using $<host-TMPDIR>/nix-build-<drvname>-<number>, the temporary directory is now always /tmp/nix-build-<drvname>-0. This improves bitwise-exact reproducibility for builds that store $TMPDIR in their build output. (Of course, those should still be fixed...)
2015-11-25Merge branch 'p/sandbox-rename-minimal' of https://github.com/vcunat/nixEelco Dolstra
2015-11-25Fix build failure introduced by #704Eelco Dolstra
Also, make the FreeBSD checks conditional on FreeBSD.
2015-11-24Merge pull request #704 from ysangkok/freebsd-supportEelco Dolstra
FreeBSD support with knowledge about Linux emulation
2015-11-21reintroduce host deps in tandem with sandbox profilesJude Taylor
2015-11-19re-fix permissions for GHCJude Taylor
2015-11-19Merge branch 'sandbox-profiles' of git://github.com/pikajude/nixShea Levy
Temporarily allow derivations to describe their full sandbox profile. This will be eventually scaled back to a more secure setup, see the discussion at #695
2015-11-19src/libstore/build.cc: clarify error message for hash mismatchesPeter Simons
Nix reports a hash mismatch saying: output path ‘foo’ should have sha256 hash ‘abc’, instead has ‘xyz’ That message is slightly ambiguous and some people read that statement to mean the exact opposite of what it is supposed to mean. After this patch, the message will be: Nix expects output path ‘foo’ to have sha256 hash ‘abc’, instead it has ‘xyz’