Skip to content

Conversation

wolfgangwalther
Copy link
Contributor

Some packages require custom licenses to be accepted, but throw / assert before evaluating anything of the package. This means that not even their meta section can be evaluated. This has several drawbacks:

By moving the license check into an attribute of the derivation that is lazily evaluated, only when the full derivation is, we can eval meta separately - and fix these problems.

Part of #426629, ultimately targeting #397184.

Things done


Add a 👍 reaction to pull requests you find important.

This now errors with the "allow unfree" error first - and only when
that's passed it asserts the specific `licenseFile` option.

This ensures that CI will not produce an eval warning for the assert
once we turn that on.
Same reasoning as commit before.
This allows evaluating the package's meta attribute without triggering
the throw, thus making it possible to list the package in the search
results. It also avoids CI falling over with this attribute.
@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Jul 19, 2025
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.

Very cool.

throw ''
You must accept the Blizzard® Starcraft® II AI and Machine Learning License at
https://blzdistsc2-a.akamaihd.net/AI_AND_MACHINE_LEARNING_LICENSE.html
by setting nixpkgs config option 'sc2-headless.accept_license = true;'
Copy link
Contributor

Choose a reason for hiding this comment

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

We really need to re-do #330753. (Tracking issue: #330627)

@nixpkgs-ci nixpkgs-ci bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Jul 19, 2025
@numinit
Copy link
Contributor

numinit commented Jul 19, 2025

Nice, I agree with this approach for android.

@nixpkgs-ci nixpkgs-ci bot added 12.approvals: 2 This PR was reviewed and approved by two persons. and removed 12.approvals: 1 This PR was reviewed and approved by one person. labels Jul 19, 2025
@nixpkgs-ci nixpkgs-ci bot added 12.approvals: 3+ This PR was reviewed and approved by three or more persons. and removed 12.approvals: 2 This PR was reviewed and approved by two persons. labels Jul 19, 2025
@wolfgangwalther wolfgangwalther merged commit 186da0c into NixOS:master Jul 20, 2025
30 of 32 checks passed
@wolfgangwalther wolfgangwalther deleted the ci-eval-asserts-licenses branch July 20, 2025 08:25
@wolfgangwalther wolfgangwalther added the backport release-25.05 Backport PR automatically label Jul 22, 2025
@nixpkgs-ci
Copy link
Contributor

nixpkgs-ci bot commented Jul 22, 2025

Successfully created backport PR for release-25.05:

@github-actions github-actions bot added the 8.has: port to stable This PR already has a backport to the stable release. label Jul 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.has: port to stable This PR already has a backport to the stable release. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. 12.approvals: 3+ This PR was reviewed and approved by three or more persons. backport release-25.05 Backport PR automatically
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants