Skip to content

Don't run tests when cross-compiling#30883

Merged
Ericson2314 merged 10 commits intoNixOS:masterfrom
bgamari:ben-cross-no-check
Nov 5, 2017
Merged

Don't run tests when cross-compiling#30883
Ericson2314 merged 10 commits intoNixOS:masterfrom
bgamari:ben-cross-no-check

Conversation

@bgamari
Copy link
Contributor

@bgamari bgamari commented Oct 28, 2017

Motivation for this change

A step towards basic cross compilation (see #30882 for the next step).

This only handles a small fraction of cases which will ultimately need to be handled. That being said, it's a large enough fraction to compile everything up to systemd.

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
    • other Linux distributions
  • 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.

@orivej
Copy link
Contributor

orivej commented Oct 28, 2017

Are there any packages whose check phase works during cross compilation?

@bgamari
Copy link
Contributor Author

bgamari commented Oct 28, 2017 via email

@bjornfor
Copy link
Contributor

What if the mkDerivation function grew a doCheck parameter which defaulted to true for host builds and false for target builds? It could be overridden per package, but would have correct default value for the common case. I think the problem now is that doCheck is just passed right to the shell. (Or perhaps the same mechanism can be implemented at shell level too.)

@Ericson2314
Copy link
Member

@bjornfor the problem is the default is always off. This would be easy to fix if the default was always on, in which we'd make it always on just for cross.

Copy link
Member

@Ericson2314 Ericson2314 left a comment

Choose a reason for hiding this comment

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

Per the above, I think this is the best we can do for now. It's easy to grep for this sort of thing later if we get better solution.

@Ericson2314 Ericson2314 merged commit 4a3e756 into NixOS:master Nov 5, 2017
@Ericson2314 Ericson2314 added the 6.topic: cross-compilation Building packages on a different platform than they will be used on label Nov 5, 2017
@dtzWill dtzWill mentioned this pull request Jan 7, 2018
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: cross-compilation Building packages on a different platform than they will be used on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants