Skip to content

S3 cache does not provide realisations endpoint for content addressed derivations  #11748

Open

Description

@gador

Describe the bug

When I build a content addressed derivation with

nix store make-content-addressed nixpkgs#hello
nix copy --to "file://$PWD/temporary-cache?compression=zstd" /nix/store/ysk9lpkljlk6kf33rigng5hjhjvrll8i-hello-2.12.1
nix-store --delete /nix/store/ysk9lpkljlk6kf33rigng5hjhjvrll8i-hello-2.12.1
nix copy --from file://$PWD/temporary-cache /nix/store/ysk9lpkljlk6kf33rigng5hjhjvrll8i-hello-2.12.1

There is a realisations folder and I can copy the derivation from the temporary store.
However, if i use an S3 store with:

nix build --impure --expr '(import <nixpkgs> { config.contentAddressedByDefault = true; }).bash'
nix copy --to 's3://nix-cache?profile=nixbuilder&endpoint=s3.hel.lan&region=eu-central-1' /nix/store/vif5q2hs10x4cr6bb5fs8d8la9j1ygf0-bash-5.2p32
nix-store --delete /nix/store/vif5q2hs10x4cr6bb5fs8d8la9j1ygf0-bash-5.2p32
nix build --impure --expr '(import <nixpkgs> { config.contentAddressedByDefault = true; }).bash' --extra-substituters "https://s3.hel.lan/nix-cache/" -j0

it doesn't fetch bash and tries to build it. If I remove -j0 it builds bash but still does not use the cache.
All the builds are automatically signed by nix.settings.secret-key-files and the public key is used by nix.settings.trusted-public-keys

Also, there is no realisations folder in my s3 bucket.

Steps To Reproduce

See above

Expected behavior

There should be no need to rebuild bash but should be fetched from the s3 store

nix-env --version output

nix-env (Nix) 2.18.8

Additional context

AFAIK there is no cache software (nix-serve, nix-serve-ng, harmonia, attic) that provides the realisations endpoint. How does this work with hydra in light of NixOS/hydra#838 ? How does the test cache from https://discourse.nixos.org/t/content-addressed-nix-call-for-testers/12881 (https://cache.ngi0.nixos.org) get populated by ca-derivations?

Priorities

Add 👍 to issues you find important.

Activity

  1. added
    ca-derivations
    on Oct 30, 2024
  2. 24 remaining items

  3. lovesegfault commented on Oct 16, 2025

    @lovesegfault
    Member

    This should be fixed now that #13752 has landed, can you test?

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

    bugca-derivations

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions