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

treewide: Get rid of *Platform.arch #40270

Merged
merged 3 commits into from May 10, 2018

Conversation

Ericson2314
Copy link
Member

Motivation for this change

Use parsed.cpu.name or platform.gcc.arch instead.

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.

float = "hard";
fpu = "vfp";
platform = platforms.raspberrypi;
};

armv7l-hf-multiplatform = rec {
config = "arm-unknown-linux-gnueabihf";
arch = "armv7-a";
config = "armv7a-unknown-linux-gnueabihf";
Copy link
Contributor

Choose a reason for hiding this comment

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

This change doesn' seem related and how do you know this doesn't break something?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is related in that all the parsed.cpu.name stuff would get arm instead of armv7-a. This is a different string but at least means the same thing. If those build systems just pass --arch right to gcc with -march or whatever, then we should have them use hostPlatform.platform.gcc.arch instead of hostPlatform.parsed.cpu.name.

@@ -118,7 +118,7 @@ let
"--cross-prefix=${stdenv.cc.targetPrefix}"
"--enable-cross-compile"
"--target_os=linux"
"--arch=${hostPlatform.arch}"
"--arch=${hostPlatform.parsed.cpu.name}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do these attribute names contain "parsed"? Doesn't make much sense to me.

Copy link
Member Author

Choose a reason for hiding this comment

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

In trying to reconcile crossSystem, system, platform, and @nbp's previously-dead parsing code, yes I had to find some awkward unused namespace at first to avoid breaking things. (hostPlatform.arch is inconsistent, but closer to hostPlatform.platform.gcc.arch.) Once I do changes like this, I get closer to being able to drop the parsed and move everything up a level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants