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

Fixed Debian platform tag for aarch64/arm64 #1775

Merged

Conversation

kamermans
Copy link
Contributor

@kamermans kamermans commented Mar 26, 2021

This PR fixes 64-bit ARM builds on Debian and its derivatives. Debian uses arm64 to describe its architecture whereas the kernel (even on a Debian machine) used the term aarch64.

This problem does not affect RPM-based distros or ArchLinux/pacman from what I can tell, although it does appear that FreeBSD uses arm64, so I've added a check there for the bit length. It looks like there is only x86 support in the code for FreeBSD though, so more might need to be done to support ARM on that platform.

I've also added a couple tests in-line with the amd64 vs x86_64 tests.

I haven't tested this yet, but the changes seem quite trivial to me.

EDIT: Also, I see there is no support for native Apple M1 binaries. These are also 64-bit ARM, and I don't recall the architecture name for them (it's arm64 in Golang).

@jordansissel
Copy link
Owner

Nice work. Thank you :)

@kamermans
Copy link
Contributor Author

No problem, happy to help!

@LINKIWI
Copy link

LINKIWI commented Jun 19, 2023

This commit introduces a regression for packaging systems that expect aarch64 as the architecture identifier, like Termux.

Can this "smart" auto-correction behavior be parameterized or otherwise made opt-in by default?

It's not really clear to me why there needs to exist special-case logic for the aarch64 string, which is not recognized as a valid Debian architecture identifier in most Linux distributions. If someone specifies aarch64 explicitly on the command line, I'd expect this to be reflected as-is in the Debian package metadata, and not silently changed by fpm to something else.

@jordansissel
Copy link
Owner

It's not really clear to me why there needs to exist special-case logic for the aarch64 string

The short version is this: On Debian systems where the kernel reports aarch64 for the hardware platform uname -m, Debian calls this "arm64" instead of "aarch64".

Example, running Debian on my m2 macbook via docker:

root@903d0a0c563c:/# uname -m
aarch64
root@903d0a0c563c:/# dpkg --print-architecture
arm64

This isn't the first time a package distributor uses a different name for a hardware platform than other projects (like the kernel, compilers, etc). For example, Red Hat calls "x86_64" what Debian calls "amd64".

Looking at Termux's packages, it seems like this distro uses Debian's packaging formats, but otherwise seems to deviate from Debian and its derivatives.

Example, OpenBSD netcat:

Termux uses 'aarch64' where Debian uses 'arm64'. Ubuntu (a Debian derivative) also uses 'arm64'

If someone specifies aarch64 explicitly on the command line, I'd expect this to be reflected as-is in the Debian package metadata, and not silently changed by fpm to something else.

This is a good point. In other areas of fpm, attempted-corrections like this are logged. Example, Example 2.

I'm open to having fpm log a message about this architecture naming conversion.

Can this "smart" auto-correction behavior be parameterized or otherwise made opt-in by default?

It feels like the right solution might be to add support specifically for Termux, such that any conversions can target Termux specifically. For example, if converting a Debian package to Termux, fpm /should/ replace "arm64" (Debian's term) with "aarch64" (Termux's term).

Where are you building packages for Termux? On an existing Termux system? Or on another system/os ?

@jordansissel
Copy link
Owner

@LINKIWI I think we can improve fpm for cases such as Termux. If you have time, please file a new issue to focus discussion on things specific to Termux.

@LINKIWI
Copy link

LINKIWI commented Jun 23, 2023

Hi, thanks for the consideration. We have deprecated fpm and migrated to another packaging solution, since this isn't the first time a minor or patch version upgrade has introduced a critical regression.

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

Successfully merging this pull request may close these issues.

3 participants