diff options
author | Daiderd Jordan <daiderd@gmail.com> | 2019-07-02 00:12:12 +0200 |
---|---|---|
committer | Daiderd Jordan <daiderd@gmail.com> | 2019-07-02 00:12:34 +0200 |
commit | 97baf32fbca13101f58d30bb3a601302c3d560f3 (patch) | |
tree | cae4a3c1ac75e8358e5906a6a06aba027d1c0f63 /corepkgs | |
parent | 5c8f4772836cc14393068a9adce642da224615c4 (diff) |
build: add exit code for hash and check mismatches
Makes it easier to identify the failure reason in other tooling, eg.
differentiate between a non-deterministic --check vs a failed build.
$ nix-build '<nix/fetchurl.nix>' --argstr url http://example.org --argstr sha256 0000000000000000000000000000000000000000000000000000
hash mismatch in fixed-output derivation '/nix/store/nzi9ck45rwlxzcwr25is7qlf3hs5xl83-example.org':
wanted: sha256:0000000000000000000000000000000000000000000000000000
got: sha256:08y4734bm2zahw75b16bcmcg587vvyvh0n11gwiyir70divwp1rm
$ echo $?
102
$ nix-build -E 'with import <nixpkgs> {}; runCommand "foo" {} "date +%s > $out"' --check
warning: rewriting hashes in '/nix/store/g3k47g0399fvjmbm0p0mnad74k4w8vkz-foo'; cross fingers
error: derivation '/nix/store/mggc8dz13ackb49qca6m23zq4fpq132q-foo.drv' may not be deterministic: output '/nix/store/g3k47g0399fvjmbm0p0mnad74k4w8vkz-foo' differs
$ echo $?
104
Diffstat (limited to 'corepkgs')
0 files changed, 0 insertions, 0 deletions