-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
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
rustc: add support for armv7l targets #72480
Conversation
b5b9ee4
to
09d24d1
Compare
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.
Have not tested, but code seems fine.
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.
Haven't tested it either, but diff LGTM.
BTW Rust 1.39.0 was released today so it might worth updating it here as well. |
That's already done in #72980. |
@GrahamcOfBorg build rustc |
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.
I wrote a similar patch a while ago to add support for armv7l and armv6l, see: lopsided98@d6d2c1c. My patch fixes the target in a few more places that you missed, but I missed the one in build-crate.nix.
x86_64-pc-mingw32 = "x86_64-pc-windows-gnu"; | ||
}.${nixTarget} or ( | ||
let | ||
armMatch = builtins.match "armv7[al]-(.*)" nixTarget; |
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 seems like you could make this simpler if you passed in the entire platform instead of just the config string. The platform elaboration logic has already parsed out all the components you need, so you don't need to do it again. You could then make your function more like the one previously used in build-crate.nix
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.
Something like this: lopsided98@249d11c#diff-4100057d032c0d790107c2739448233cR8
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.
My fixes look extremely similar to yours. I also see they well predate mine. I am sorry, I wasn't aware of them.
Btw, I also agree with your suggestions. I can fix this PR. However, I can also retract this pull request so you can go ahead and create yours. Let me know which way you'd prefer.
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.
How will you continue?
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.
I'll apply the fixes @lopsided98 recommended.
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.
I now applied the fixes.
09d24d1
to
16a73c0
Compare
f4b514d
to
a3cc991
Compare
Addresses issue NixOS#72473 `rustc` and Rust packages would not compile on Raspbian on a Raspberry Pi. It turns out that Rust's ARMv7 targets are slightly different from Nix's. This change adds a function that maps `armv7a` and `armv7l` architectures to `armv7`. The former are used in Raspbian on Raspberry Pi but are unknown to rustc. Rust knows only `armv7`.
a3cc991
to
cfc9800
Compare
Sorry for not responding, but I can submit my own version of the PR if you want. I see that you integrated most of it already, but I noticed a couple of things still missing (in Also, we put our mapping functions inside different attrsets ( |
I submitted it: #73472 |
Yes, I intentionally left some things out because they caused errors in CI.
I recommend we attack this problem in 2 steps. This PR goes in first (since
it has already been reviewed and approved) and then the second PR (where
you'll put in the improvements) can be much smaller and easier to review.
Does that sound reasonable?
…On Fri, 15 Nov 2019, 21:02 Ben Wolsieffer, ***@***.***> wrote:
I submitted it: #73472 <#73472>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#72480?email_source=notifications&email_token=AAF4I6M7MPJGWTOT42NIWDTQT4E43A5CNFSM4JH7VYFKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEEGWRTI#issuecomment-554526925>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAF4I6JFWUSG2VWH5XHSSQDQT4E43ANCNFSM4JH7VYFA>
.
|
This PR has the same problem, ofborg just doesn't catch it. On x86_64 macOS, the |
Here is my updated mapping function: https://github.com/NixOS/nixpkgs/pull/73472/files#diff-4100057d032c0d790107c2739448233cR14 It is not the most elegant, but it works for all the platforms that we have bootstrap tarballs for, as well as MinGW (which actually did not need a special case) and armv7a. |
@lopsided98: Sounds much better. I'm throwing this PR out in favour of #73472 |
Motivation for this change
rustc and Rust packages would not compile on Raspbian on a Raspberry Pi. It turns out that Rust's ARMv7 targets are slightly different from Nix's.
Addresses issue #72473
Things done
This change adds a function that maps
armv7a
andarmv7l
architectures toarmv7
. The former are used in Raspbian on Raspberry Pi but are unknown to rustc. Rust knows onlyarmv7
.In addition, this change also disables the
m_hugefile
test ine2fsprogs
as it was failing on ARMv7 Raspbian on the Raspberry Pi.sandbox
innix.conf
on non-NixOS linux)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)Notify maintainers
cc @edolstra @madjar @cstrahan @globin @Havvy