Skip to content

👷 (feat): Add ARM64 Builds#1527

Merged
cstamas merged 7 commits intoapache:mvnd-1.xfrom
KrisJohnstone:arm64-builds
Mar 17, 2026
Merged

👷 (feat): Add ARM64 Builds#1527
cstamas merged 7 commits intoapache:mvnd-1.xfrom
KrisJohnstone:arm64-builds

Conversation

@KrisJohnstone
Copy link
Copy Markdown

@KrisJohnstone KrisJohnstone commented Feb 5, 2026

Added support for ARM64 builds using glibc 2.17.

@KrisJohnstone
Copy link
Copy Markdown
Author

Had a quick look, but this should resolve #921 and #888.

@cstamas
Copy link
Copy Markdown
Member

cstamas commented Mar 4, 2026

@gzm55 can you take a peek please?

@gzm55
Copy link
Copy Markdown
Contributor

gzm55 commented Mar 4, 2026

I chose 2.28 as RHEL8 and Ubuntu 18.04 LTS both still use this version afaik and are the oldest operating systems I know of that are still under support of some sort.

Could use 2.17 as that's when support for ARM64 was added from what I can see, but there were also test failures in versions 2.18 etc so figured best case is to choose a later version, which is when I settled on using the newest version supported by the oldest operating system.

I can't test the github actions from a fork but it should work, I've verified that the content of the steps works, its the conditionals on the steps I'm not 100% on.

  1. for aarch64, I think it is ok to begin from glibc 2.28, but when someone need, we should accept the pr to lower the version to 2.17. @KrisJohnstone @cstamas
  2. for x64, we should stick on glibc 2.12, not bump the dependency to 2.28. @KrisJohnstone

@cstamas
Copy link
Copy Markdown
Member

cstamas commented Mar 6, 2026

Release is imminent (3.9.13 is out today). Any way to apply proposed changes to PR?

@KrisJohnstone
Copy link
Copy Markdown
Author

It’s 11PM here will try to update and get it to you before I zzzz.

@cstamas
Copy link
Copy Markdown
Member

cstamas commented Mar 6, 2026

No need to rush; I can wait 24h or more. I was just interested in "is it gonna happen" or not. 😄

@cstamas cstamas added this to the 1.0.4 milestone Mar 6, 2026
@cstamas cstamas added the enhancement New feature or request label Mar 6, 2026
@KrisJohnstone
Copy link
Copy Markdown
Author

KrisJohnstone commented Mar 6, 2026

No need to rush; I can wait 24h or more. I was just interested in "is it gonna happen" or not. 😄

I've updated the PR, is that more in line with what you were thinking? I don't have access to work laptop atm so no easy access to arm64 boxes.

@cstamas
Copy link
Copy Markdown
Member

cstamas commented Mar 6, 2026

Yes, this looks more in line with what summoned @gzm55 proposed:

  • leave linux/amd64 "as is" (as it was)
  • make linux/arm64 use glibc 2.28

@cstamas
Copy link
Copy Markdown
Member

cstamas commented Mar 6, 2026

Will leave it here. Seems patching is not correct? Also, keep in mind to keep in sync the two workflows (early preview and release).

@KrisJohnstone
Copy link
Copy Markdown
Author

Will leave it here. Seems patching is not correct? Also, keep in mind to keep in sync the two workflows (early preview and release).

It worked prior to me making the suggested changes. It could be due to referencing 2.2.5 in dynamic-libc-start.c and glibc.redef which is why I made the change to start with.

@gzm55
Copy link
Copy Markdown
Contributor

gzm55 commented Mar 7, 2026

dynamic-libc-start.c

in this .c code, we can select different required GLIBC_ versions by checking arch macros, like

#if defined(__x86_64__)
...
#elif defined(__aarch64__)
...
#else
#  error("")
#endif

@KrisJohnstone
Copy link
Copy Markdown
Author

This will need to wait till Monday, QEMU just isn't playing ball on my desktop. My work laptop died last week and pick new one up Monday when I will have access to arm64 based arch to run this without emulation.

@cstamas
Copy link
Copy Markdown
Member

cstamas commented Mar 7, 2026

No problem, just ping here (or on #1500) if you are done or just want to punt on it for 1.0.4

@cstamas
Copy link
Copy Markdown
Member

cstamas commented Mar 11, 2026

Maven 3.9.14 goes out tomorrow, and from that point nothing stops the mvnd 1.0.4 release. Please ping should we wait for this or not.

@cstamas cstamas mentioned this pull request Mar 12, 2026
@cstamas cstamas removed this from the 1.0.4 milestone Mar 13, 2026
@cstamas
Copy link
Copy Markdown
Member

cstamas commented Mar 13, 2026

Punting this from 1.0.4, that is about to be released.

@HannesWell

This comment was marked as off-topic.

@cstamas
Copy link
Copy Markdown
Member

cstamas commented Mar 13, 2026

This PR is for Linux ARM but having Windows ARM would be nice thing. But, I don't think this "patching of glibc" applies to Windows ARM.... Origin and root issue #823

@KrisJohnstone
Copy link
Copy Markdown
Author

First laptop was DOA. Back on this now :)

@KrisJohnstone
Copy link
Copy Markdown
Author

KrisJohnstone commented Mar 16, 2026

Had some other stuff that needed doing so mainly got solid time after work. This should be it, tested compiling on a amd64 and arm64 box.

Fun fact <family>linux</family> isn't actually a family, drove me nuts and went around in circles today a bit, it works due to a package maven depends on having an else clause that causes a fallback. (Ref: https://github.com/codehaus-plexus/plexus-utils/blob/4d25130f1df0540676ccc17edc2d18e01f0dbed8/src/main/java/org/codehaus/plexus/util/Os.java#L309)

@cstamas
Copy link
Copy Markdown
Member

cstamas commented Mar 16, 2026

FYI, master uses Nisse:
https://github.com/apache/maven-mvnd/blob/master/.mvn/extensions.xml

It has OS detector like properties, we may backport Nisse usaget to 1.x build too....

Example of emitted (and hence, available) properties (take a peek at nisse.os. prefixed ones)
maveniverse/nisse#89

@cstamas
Copy link
Copy Markdown
Member

cstamas commented Mar 16, 2026

@gzm55 can you take a peek? I am fine to make 1.0.5 with this single change to cover linux-arm as well.

@cstamas
Copy link
Copy Markdown
Member

cstamas commented Mar 16, 2026

@KrisJohnstone that said, these are not the only changes needed... as this adds new release variant..... for example https://github.com/apache/maven-mvnd/blob/mvnd-1.x/.github/workflows/release.yaml

@KrisJohnstone
Copy link
Copy Markdown
Author

@KrisJohnstone that said, these are not the only changes needed... as this adds new release variant..... for example https://github.com/apache/maven-mvnd/blob/mvnd-1.x/.github/workflows/release.yaml

Added.

@cstamas cstamas requested a review from gnodet March 16, 2026 13:25
@gzm55
Copy link
Copy Markdown
Contributor

gzm55 commented Mar 17, 2026

@gzm55 can you take a peek? I am fine to make 1.0.5 with this single change to cover linux-arm as well.

@cstamas the pr LGTM, with only a typo

@KrisJohnstone
Copy link
Copy Markdown
Author

@gzm55 can you take a peek? I am fine to make 1.0.5 with this single change to cover linux-arm as well.

@cstamas the pr LGTM, with only a typo

Fixed the only typo I saw, which was in client/pom.xml.

Copy link
Copy Markdown
Contributor

@gnodet gnodet left a comment

Choose a reason for hiding this comment

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

Review

Overall, this PR is well-structured and follows the established patterns for glibc version pinning. The approach of targeting glibc 2.17 for aarch64 is sound (it's the earliest possible version for that architecture). Nice work!

Must Fix

BUG: Verification regex in release.yaml allows glibc up to 2.28, not 2.17

In release.yaml, the ARM64 verification step has:

objdump -T client/target/mvnd | grep GLIBC_ | grep -v 'GLIBC_\([01]\|2\.[0-9]\|2\.2[012345678]\)[^0-9]' || err=$?

This allows GLIBC versions 2.20 through 2.28 — far more permissive than the stated goal of glibc 2.17. The regex 2\.2[012345678] matches 2.20 to 2.28, which has nothing to do with 2.17.

Compare with the early-access.yaml version which is correct:

objdump -T client/target/mvnd | grep GLIBC_ | grep -v 'GLIBC_\([01]\|2\.[0-9]\|2\.1[017]\)[^0-9]' || err=$?

The release.yaml regex should match the early-access.yaml one. A release build could silently ship with symbols requiring glibc 2.18–2.28, defeating the purpose of the glibc-lowering work.

Suggestions (non-blocking)

  • Consider using 2\.1[0-7] instead of 2\.1[017] in the early-access regex to allow the full range 2.10–2.17 for robustness (any symbol versioned at 2.12–2.16 would also be acceptable).
  • A brief comment in glibc.redef.aarch64 noting that 2.17 is the minimum because it's the first glibc with aarch64 support would help future maintainers.

@KrisJohnstone
Copy link
Copy Markdown
Author

Fixed.

Copy link
Copy Markdown
Contributor

@gnodet gnodet left a comment

Choose a reason for hiding this comment

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

The release.yaml regex fix in the latest commit addresses the concern. LGTM.

@cstamas cstamas added this to the 1.0.5 milestone Mar 17, 2026
@cstamas cstamas merged commit bfa45f1 into apache:mvnd-1.x Mar 17, 2026
6 checks passed
gnodet added a commit that referenced this pull request Mar 17, 2026
Port ARM64 build support from mvnd-1.x PR #1527 to master:
- Add ubuntu-24.04-arm runner for Linux ARM64 builds
- Fix broken matrix exclude rules (macos-latest→macos-15, windows-latest→windows-2025)
- Add glibc.redef.aarch64 pinning all symbols to GLIBC_2.17
- Add #if defined(__aarch64__) conditional in dynamic-libc-start.c
- Add uname -m arch detection in gcc wrapper script
- Add linux-aarch64-image-only-require-glibc-2.17 profile in client/pom.xml
- Add ARM64 glibc patch/verify steps in CI workflows
- Add linux-aarch64 release asset upload steps

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants