Skip to content

stdenv: don't discard string context from ContentAddressed derivations#359098

Merged
philiptaron merged 1 commit intoNixOS:masterfrom
trofi:ca-restore-context
Nov 26, 2024
Merged

stdenv: don't discard string context from ContentAddressed derivations#359098
philiptaron merged 1 commit intoNixOS:masterfrom
trofi:ca-restore-context

Conversation

@trofi
Copy link
Contributor

@trofi trofi commented Nov 25, 2024

Without the change build for packages that use disallowedReferences fails in contentAddressedByDefault = true mode:

$ nix build -f. ruby_3_1 --arg config '{ contentAddressedByDefault = true; }'
...
error: derivation contains an illegal reference specifier '/0j3hif3ni7zl5zhlzzr5q2q23z66136mnzp75pyiqp5c72q14im2'
error: 1 dependencies of derivation '/nix/store/39ji7qp225pxvrm8cgvzmyjqsyis2n0h-ruby-3.1.2.drv' failed to build

Original intent of #211783 was to avoid pulling in actual derivation for reference scanning purposes.

Unfortunately CA derivations's outputPath are placeholders until they are instantiated.

Let's restore string context for CA derivations for now.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

Without the change build for packages that use `disallowedReferences`
fails in `contentAddressedByDefault = true` mode:

    $ nix build -f. ruby_3_1 --arg config '{ contentAddressedByDefault = true; }'
    ...
    error: derivation contains an illegal reference specifier '/0j3hif3ni7zl5zhlzzr5q2q23z66136mnzp75pyiqp5c72q14im2'
    error: 1 dependencies of derivation '/nix/store/39ji7qp225pxvrm8cgvzmyjqsyis2n0h-ruby-3.1.2.drv' failed to build

Original intent of NixOS#211783 was to
avoid pulling in actual derivation for reference scanning purposes.

Unfortunately CA derivations's outputPath are placeholders until they
are instantiated.

Let's restore string context for CA derivations for now.
Copy link
Contributor

@philiptaron philiptaron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's restore string context for CA derivations for now.

OK.

@trofi trofi changed the base branch from staging to master November 25, 2024 21:14
@trofi
Copy link
Contributor Author

trofi commented Nov 25, 2024

$ ./maintainers/scripts/rebuild-amount.sh HEAD^
  1 release-checks

Switched to master.

@philiptaron philiptaron merged commit 92de543 into NixOS:master Nov 26, 2024
@trofi trofi deleted the ca-restore-context branch November 26, 2024 15:11
gador added a commit to gador/nixpkgs that referenced this pull request Nov 26, 2024
reverts f3d1410

After the merge of NixOS#359098 this workarround for ca-derivations
isn't needed anymore.

Signed-off-by: Florian Brandes <[email protected]>
gador added a commit to gador/nixpkgs that referenced this pull request Nov 26, 2024
This reverts commit 43fccb0.

After the merge of NixOS#359098 this workarround for ca-derivations
isn't needed anymore.

Signed-off-by: Florian Brandes <[email protected]>
gador added a commit to gador/nixpkgs that referenced this pull request Nov 26, 2024
reverts 9305ed3

After the merge of NixOS#359098 this workarround for ca-derivations
isn't needed anymore.

Signed-off-by: Florian Brandes <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: stdenv Standard environment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants