Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkgs/stdenv: normalize attributes where setup.sh makes no distinction #201131

Closed
wants to merge 1 commit into from
Closed

pkgs/stdenv: normalize attributes where setup.sh makes no distinction #201131

wants to merge 1 commit into from

Commits on Nov 14, 2022

  1. pkgs/stdenv: normalize attributes where setup.sh makes no distinction

    This PR normalizes the final attrset immediately before it is passed
    to `builtins.derivation`, deleting attributes whose value is `[]`,
    `""`, or `false` if `setup.sh` treats that particular value for that
    particular attribute indentically to the attribute being absent.
    
    As a result of this PR, it is possible to add, to an existing
    derivation, an attribute with the form:
    
    ```
      hardeningFlags = lib.optionals stdenv.hostPlatform.isFrobnicator [
        ...
    ```
    
    without triggering an unnecessary mass-rebuild unless Frobnicator is
    one of the Hydra `supportedPlatforms`.  Previously it was necessary
    to either use the non-idiomatic:
    
    ```
      if !stdenv.hostPlatform.isFrobnicator then null else [
    ```
    
    or to trigger a mass-rebuild and suffer OfBorg's "red ovals of doom"
    on the PR.  The latter case tends to lead to stale and forgotten PRs.
    
    Recent example: #199978 (comment)
    Adam Joseph committed Nov 14, 2022
    Configuration menu
    Copy the full SHA
    f52545b View commit details
    Browse the repository at this point in the history