Skip to content

Basename of current directory goes into derivation #24575

@nh2

Description

@nh2

Issue description

I found that when I build two perfectly identical directory tries (e.g. 2 clones of the same repository, e.g. myproject and myproject2) with nix-build, they get different hashes if the name of the parent directory is different.

Technical details

This is because the basename of the directory is used in the default unpackPhase here.

This creates all kinds of problems, such as build derivations on the Jenkins continuous integration (which creates random temporary directories for builds) being different from those I build on my own computer.

To me this seems wrong: Why should something above my project go into the derivation hash?

If yes, what would be a good workaround for this (how can I enforce that my dir always has the same name, independent of the parent directory's name)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions