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
treewide: Get rid of *Platform.arch
#40270
Conversation
Use `parsed.cpu.name` or `platform.gcc.arch` instead.
f509fb6
to
c17f79e
Compare
float = "hard"; | ||
fpu = "vfp"; | ||
platform = platforms.raspberrypi; | ||
}; | ||
|
||
armv7l-hf-multiplatform = rec { | ||
config = "arm-unknown-linux-gnueabihf"; | ||
arch = "armv7-a"; | ||
config = "armv7a-unknown-linux-gnueabihf"; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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}" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Motivation for this change
Use
parsed.cpu.name
orplatform.gcc.arch
instead.Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)