Skip to content

nix-build --hash output isn't machine-parseable #1172

Closed as not planned
Closed as not planned

Description

@dezgeg

The last 2 lines of output of e.g. nix-build --hash -A fio.src with a random sha256 value are:

build produced path ‘/nix/store/1ddvn536mgycflb48m23r8w4d01bzvkq-fio-fio-2.12-src’ with sha256 hash ‘1m0fx0x1v2375vyxhd2i12b9w1qy4yh75f6qhwlcr78himcsmpp9’
/nix/store/bcmckd9vn7gyrdyic5lyic01b5j3a5l2-fio-fio-2.12-src

That is, the useful value, 1m0fx0x1v2375vyxhd2i12b9w1qy4yh75f6qhwlcr78himcsmpp9 is only present in the stderr/build log. The line printed to stdout (the last one) is actually useless as it's presumably the "temporary" output path used before the hash is known.

Activity

  1. copumpkin commented on Nov 15, 2017

    @copumpkin
    Member

    Also causing me much pain

  2. jtojnar commented on Feb 16, 2018

    @jtojnar
    Member

    Hmm, now it was removed and the error message changed to fixed-output derivation produced path '%s' with %s hash '%s' instead of the expected hash '%s'

  3. colemickens commented on Apr 28, 2018

    @colemickens
    Member

    Would there also be value in having another flag that would drop {--out-link}.hash file with the hash? So that other tools could pick it up without needing to parse output at all?

  4. stale commented on Feb 15, 2021

    @stale

    I marked this as stale due to inactivity. → More info

  5. tomberek commented on Sep 1, 2026

    @tomberek
    Contributor

    Closing as stale. Re-open if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions