Skip to content

Support (force) build on platforms != meta.platforms #246

Closed

Description

@bjornfor

When trying to build a package on a system that is not listed in meta.platforms, nix throws this error:

error: the package ‘foo’ in ‘.../default.nix:50’ is not supported on ‘system-bar’

While I think this is a good default behaviour, I think that we should provide an easy way to override it and force a build. Something like nix-build --option build-unsupported-platforms true or some env var. Or both.

And then we could expand the error message to suggest the ways to force a build.

I hope this feature will stop people from feeling the need to remove meta.platforms and/or blindly replacing it with meta.hydraPlatforms, something I consider workarounds to avoid this issue.

Activity

  1. edolstra commented on Apr 29, 2014

    @edolstra
    Member

    You can already do this by setting NIXPKGS_ALLOW_BROKEN to 1, or setting allowBroken = true; in config.nix.

  2. bjornfor commented on Apr 29, 2014

    @bjornfor
    ContributorAuthor

    Great! I didn't know that it worked for this too, I thought it only worked for meta.broken = true packages.

    Still, I think it would be nice to change the error message to hint about NIXPKGS_ALLOW_BROKEN=1 and allowBroken = true. Should I create another issue for that?

  3. vcunat commented on Apr 30, 2014

    @vcunat
    Member

    +1 for user-friendlier messages. I've managed to get no response around that topic (NixOS/nixpkgs#2134).

  4. bjornfor commented on Apr 30, 2014

    @bjornfor
    ContributorAuthor

    @vcunat: We have user friendly error message for that use case now, added in NixOS/nixpkgs@ebe8fab:

    $ nix-build -A skype
    error: Package ‘skype-4.2.0.13’ in ‘/home/bfo/nixpkgs2/pkgs/applications/networking/instant-messengers/skype/default.nix:68’ has an unfree license, refusing to evaluate. You can set
      { nixpkgs.config.allowUnfree = true; }
    in configuration.nix to override this. If you use Nix standalone, you can add
      { config.allowUnfree = true; }
    to ~/.nixpkgs/config.nix or pass
      --arg config '{ allowUnfree = true; }'
    on the command line.
    
  5. bjornfor commented on Apr 30, 2014

    @bjornfor
    ContributorAuthor

    Pull request "More helpful message when refusing to evaluate "broken" package": NixOS/nixpkgs#2455

  6. vcunat commented on Apr 30, 2014

    @vcunat
    Member

    Ah, true, I see.

  7. added a commit that references this issue on Jan 1, 2024
  8. added a commit that references this issue on Feb 26, 2025
  9. added a commit that references this issue on Nov 21, 2025
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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions