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

factorio: fix darwin build #29044

Closed
wants to merge 1 commit into from
Closed

factorio: fix darwin build #29044

wants to merge 1 commit into from

Conversation

lufia
Copy link
Contributor

@lufia lufia commented Sep 6, 2017

Motivation for this change

I've fixed this package to restrict to Linux.
In macOS with latest source tree (including #29038), nix-env -qa shows attribute 'x86_64-darwin' missing error.
This error raise when reference binDists.x86_64-darwin of factorio package.

$ nix-env -qa --show-trace factorio
error: while evaluating ‘callPackageWith’ at /Users/lufia/nixpkgs/lib/customisation.nix:113:35, called from /Users/lufia/nixpkgs/pkgs/top-level/all-packages.nix:17345:14:
while evaluating ‘makeOverridable’ at /Users/lufia/nixpkgs/lib/customisation.nix:72:24, called from /Users/lufia/nixpkgs/lib/customisation.nix:117:8:
while evaluating anonymous function at /Users/lufia/nixpkgs/pkgs/games/factorio/default.nix:1:1, called from /Users/lufia/nixpkgs/lib/customisation.nix:74:12:
while evaluating ‘mkDerivation’ at /Users/lufia/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:15:5, called from /Users/lufia/nixpkgs/pkgs/games/factorio/default.nix:169:4:
while evaluating ‘addPassthru’ at /Users/lufia/nixpkgs/lib/customisation.nix:135:22, called from /Users/lufia/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:153:7:
while evaluating anonymous function at /Users/lufia/nixpkgs/pkgs/stdenv/generic/check-meta.nix:5:1, called from /Users/lufia/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:154:22:
while evaluating ‘throwEvalHelp’ at /Users/lufia/nixpkgs/pkgs/stdenv/generic/check-meta.nix:128:19, called from /Users/lufia/nixpkgs/pkgs/stdenv/generic/check-meta.nix:194:17:
while evaluating the attribute ‘name’ at /Users/lufia/nixpkgs/pkgs/games/factorio/default.nix:73:5:
attribute ‘x86_64-darwin’ missing, at /Users/lufia/nixpkgs/pkgs/games/factorio/default.nix:29:12
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@mention-bot
Copy link

@lufia, thanks for your PR! By analyzing the history of the files in this pull request, we identified @elitak, @Baughn and @layus to be potential reviewers.

@elitak
Copy link
Contributor

elitak commented Sep 6, 2017

Oops, I overlooked that possibility. Thanks for the quick catch.

@joachifm
Copy link
Contributor

joachifm commented Sep 6, 2017

An alternative is to refactor along these lines

let  # ignore, for syntax hl
binDists = {
  platform_foo = { /* ... */ };
  /* ... */
};

actual = binDists."${stdenv.system}" or (throw ("unsupported platform: ${stdenv.platform}"));

/* ... */
meta.platforms = attrNames binDists;

This way, binDists is the single source of truth for supported archs.

@@ -9,6 +9,8 @@
assert releaseType == "alpha"
|| releaseType == "headless"
|| releaseType == "demo";
assert stdenv.system == "x86_64-linux"
Copy link
Member

Choose a reason for hiding this comment

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

Why isn't this just using meta.platforms? The derivation does appear to set meta.platforms to only support x86_64-linux too.

Copy link
Member

Choose a reason for hiding this comment

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

I'm also not sure how an assertion that stdenv.system is linux would work on Darwin...

Copy link
Member

Choose a reason for hiding this comment

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

Oh, I see, sorry, I missed your intro paragraph. Nevermind!

@LnL7 LnL7 added the 6.topic: darwin Running or building packages on Darwin label Sep 6, 2017
joachifm referenced this pull request Sep 7, 2017
Otherwise if you try to listing all available packages, you will get a
hard error on platforms not supported by this package.  Consequently the
tarball job was broken.
@joachifm
Copy link
Contributor

joachifm commented Sep 7, 2017

Superceded by f9ea527.

@joachifm joachifm closed this Sep 7, 2017
@lufia lufia deleted the fix-factorio-darwin branch September 8, 2017 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: darwin Running or building packages on Darwin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants