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

Update deny list to all system packages for ARMv6 HF. #1018

Merged
merged 1 commit into from
Sep 12, 2022

Conversation

Alexhuszagh
Copy link
Contributor

Currently, when using arm-unknown-linux-gnueabihf, users frequently try to install packages for the armhf Debian architecture, objects which are compiled for ARMv7-A, and therefore are not compatibility with ARMv6 platforms such as the Raspberry Pi 0. This differs from the soft-float targets, where packages for the armel architecture are compiled for the ARMv5TE architecture, and therefore are compatible with ARMv5TE, ARMv6, and ARMv7 soft-float targets.

Deny-listing all packages for the armhf architecture prevents issues such as in #1017, where the use of ARMv7 system packages are linked to the binary, so the resulting binary can no longer be executed on an ARMv6 platform. This is difficult to detect until the user attempts to use the generated objects (binaries, libraries) on native hardware.

Also linked is #426.

@Alexhuszagh
Copy link
Contributor Author

Alexhuszagh commented Sep 12, 2022

Marking as a draft since I haven't tested this logic extensively, and denylists an entire architecture, so it's likely a good idea to be careful. Also, we might want to do this for a few musl targets in case if installing system packages can affect their dynamic linking (since this has been an issue with x86_64, see #902).

Note that this currently only affects the hard-float, ARMv6 glibc target. However, it may not be a bad idea to also deny the musl target as well (let me test to see if there can be cross-contamination like with x86_64). No other target has such a confusing overlap with system packages.

@tmayoff
Copy link

tmayoff commented Sep 12, 2022

This seems like a decent solution, as long as it's mentioned in docs somewhere (in case I forget about this and try installing a package that I know exists but it can't find), also I'm not sure if it is mentioned somewhere but a note that at least the :armhf packages are built for armv7 and that for armv6 might need to be compiled from source would also be good.

@Alexhuszagh
Copy link
Contributor Author

This seems like a decent solution, as long as it's mentioned in docs somewhere (in case I forget about this and try installing a package that I know exists but it can't find), also I'm not sure if it is mentioned somewhere but a note that at least the :armhf packages are built for armv7 and that for armv6 might need to be compiled from source would also be good.

This needs to be added to the Wiki then as well, under the FAQ section then:
https://github.com/cross-rs/cross/wiki/FAQ

I'll do that later, thank you.

@Emilgardis
Copy link
Member

we don't have mentions for the other pins, probably a good idea to document it

@Alexhuszagh
Copy link
Contributor Author

Alexhuszagh commented Sep 12, 2022

I've added documentation on the pinned packages on the wiki, and where we use them. I added the arm-unknown-linux-gnueabihf example as well since I'm assuming this will be merged: if not, we should still document this lack of compatibility somewhere.

@Alexhuszagh Alexhuszagh marked this pull request as ready for review September 12, 2022 18:46
@Alexhuszagh Alexhuszagh requested a review from a team as a code owner September 12, 2022 18:46
@Alexhuszagh Alexhuszagh added no changelog A valid PR without changelog (no-changelog) and removed no changelog A valid PR without changelog (no-changelog) labels Sep 12, 2022
@Alexhuszagh Alexhuszagh marked this pull request as draft September 12, 2022 18:49
@Alexhuszagh Alexhuszagh marked this pull request as ready for review September 12, 2022 19:25
@Alexhuszagh
Copy link
Contributor Author

The musl images don't need to deny the Debian system packages as expected since the musl sysroot is different, and the compiler doesn't try to link to those packages.

Copy link
Member

@Emilgardis Emilgardis left a comment

Choose a reason for hiding this comment

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

awesome!

bors r+

@bors
Copy link
Contributor

bors bot commented Sep 12, 2022

Canceled.

@Alexhuszagh
Copy link
Contributor Author

bors r=Emilgardis

@Emilgardis
Copy link
Member

Emilgardis commented Sep 12, 2022

haha nice catch on the double commits 😅

@bors
Copy link
Contributor

bors bot commented Sep 12, 2022

Build succeeded:

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.

3 participants