Skip to content

Content-addressed realisations can't always be registered #5220

@Mindavi

Description

@Mindavi

Describe the bug

I keep running into issues with building content-addressed derivations using hydra. This may be related to hydra, but I can reproduce this issue with just nix-build as well.

failure building ‘/nix/store/bl38jaxgf2afjpi9ylrdk3rywv0b2dfm-glibc-aarch64-unknown-linux-gnu-2.33-49.drv’ on ‘localhost’: error: Trying to register a realisation of 'sha256:5d2cb0ce72b94b4331aea2f2c17b297472e1481e877785ddb7fd243d94ae4fb9!bin', but we already have another one locally.

  Local:  /nix/store/7506l8lijp27ppg2h7d3kp4clf20r3gn-glibc-aarch64-unknown-linux-gnu-2.33-49-bin
  Remote: /nix/store/qfhkagq1qvlfsmvg946z59qph8av65b5-glibc-aarch64-unknown-linux-gnu-2.33-49-bin

This is the diff diffoscope gives between the two glibcs: glibc-diff.html.txt

Differences I see:

  • different build-id
  • different dynamic linker path (comes from itself, I guess)

It's unclear to me why a build is rejected and how I can prevent these errors from happening. A gc helps but is a big hammer to work around this issue, since it can lead to having to do a lot of rebuilds.

Steps To Reproduce

Running a hydra instance against staging. I guess these different glibc derivations are caused by changes in the stdenv? I'm not sure.

I can't really give a clear path to full reproduction, but I can debug this further whenever it (inevitably) happens.

Expected behavior

Builds just work without having mismatches. If the derivation gives the same (ultimate) result, it could 'just' be substituted after finding out that it's the same result.

nix-env --version output

nix-env (Nix) 2.4pre20210802_47e96bb

Additional context

Using a fork from hydra by @regnat, the PR is WIP, so it may be related to that. Since I get the build error when building glibc by hand (after this happens in hydra) as well, it's unclear if this is a nix, nixpkgs or hydra issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions