-
Notifications
You must be signed in to change notification settings - Fork 75
Building in github actions for linux/arm/v7 with buildx fails due to missing module 'ant' #210
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
Comments
Have you considered eclipse-temurin:17-jre as a runtime image? It's got linux/arm/v7 and linux/arm64/v8 images. There's also a I'm not sure offhand why this is happening. The jar is in that directory.
|
Do you know of another place to test this? I'm not able to reproduce on Arm64 in Travis. https://github.com/keeganwitt/gradle-on-arm-tests |
I'm having this exact same issue when attempting to build for arm/v7. Note that it is not arm64. |
I was referring to using Temurin images as runtime image, not as a build time image. You don't need to build your own Gradle image, that's the point of this image. jdk17 and jdk17-focal images are both available for arm v7 (as well as other tags). |
If possible, can you make a PR against https://github.com/keeganwitt/gradle-on-arm-tests or create a new repo with a reproduction of this? I haven't been able to reproduce this to figure out what might be going wrong. |
I am having the same issue in buildx on all platforms as the base platform i am building on:
the . at the end referring to the Dockerfile's location FROM arm32v7/gradle:7.6-jdk19 AS builder
COPY --chown=gradle:gradle . /home/gradle/src
WORKDIR /home/gradle/src
RUN gradle build --no-daemon
FROM eclipse-temurin:19-jdk
RUN mkdir /app
COPY --from=builder /home/gradle/src/build/libs/*all.jar /app/Opal.jar
ENTRYPOINT ["java","-jar","/app/Opal.jar"] And the output when i try to build the image:
EditI tried som stuff and the ant file is there but hten the build with gradle is still failing. I don't get it. It's there but not. |
Maybe its because gradle is not searching recursively in the /opt/gradle folder and not finding the ant file which is located in the /opt/gradle/lib? |
Are you invoking Ant from Gradle? |
The default gradle is, in the image. Or I suppose |
I'm asking about what's in your build.gradle. Are you doing something like this? |
No I don't think so.
|
Are there any updates on this matter? |
@afkfish I just noticed the warning that you're running an Arm image on x86 hardware. I'm wondering if Ant has some native code in it that isn't working right when there's a platform mismatch. Could it be you need to try running the image that matches your hardware? |
I tried that the final solution was to change to arm64 (V8) and it worked just like a charm. But this is due to my lack of knowledge in raspberry pis chipset so I was able to switch to it. Still don't know why it happened on armv7 |
So I assume it's an armv7 on x64 problem |
The only other issues I found that looked related to this were these
But those were discussions about the wrapper, which shouldn't really be used with this image generally (it makes this image redundant). The Dockerfiles for this project validate the download of the Gradle archives, so I don't see how it could be an incomplete install either. |
Thanks for the quick response. What's the further plan of action here? I kinda need to be able to build armv7 images on x64, should I use a vanilla JDK image and invoke the wrapper directly? |
Eclipse Temurin, which is the base image for this image doesn't have a 64 bit arm7 image that I can see (https://hub.docker.com/_/eclipse-temurin). Nor do I see it for the Amazon Corretto images (https://hub.docker.com/_/amazoncorretto). I'm not aware of an image I could use as a base image to offer 64 bit arm7 support. Do you know of one? Or did I misunderstand the architecture you're trying to target (sorry, I don't really have any experience with ARM)? |
I'm trying to cross-compile an image for my Raspberry Pi (32-bit armv7) on my desktop (64-bit x86). To compile my software, I'm using the I apologize if my previous message caused confusion, I just now realized I wrote "x64" instead of "x86-64". |
So I am able to reproduce this on my Windows x86-64 Docker Desktop setup.
I thought maybe this was a problem with the QEMU emulation possibly, but it doesn't explain why the wrapper works
|
It also works when using the same zip I downloaded in this image. This doesn't make sense. Maybe there's an issue in the Docker Library's Jenkins setup. Lemme see if I can ask them about that.
|
Interesting - I was able to reproduce using QEMU user-mode emulation on my x86 machine, but I fired up a full system-mode emulation VM running "native" arm32v7 and it works fine there, so I'm inclined to think this has something to do with the emulation (which has been known to have issues with Java in the past). 😬 I did an Edit: here's the output from my "native" (system-mode emulation) arm32v7 system: $ docker run -it --rm gradle gradle --version
Welcome to Gradle 8.1.1!
Here are the highlights of this release:
- Stable configuration cache
- Experimental Kotlin DSL assignment syntax
- Building with Java 20
For more details see https://docs.gradle.org/8.1.1/release-notes.html
------------------------------------------------------------
Gradle 8.1.1
------------------------------------------------------------
Build time: 2023-04-21 12:31:26 UTC
Revision: 1cf537a851c635c364a4214885f8b9798051175b
Kotlin: 1.8.10
Groovy: 3.0.15
Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM: 17.0.7 (Eclipse Adoptium 17.0.7+7)
OS: Linux 4.19.0-8-armmp-lpae arm
|
Tianon pointed out I wasn't comparing apples to apples also. I forgot the latest tag is Java 17, and I was comparing that to Java 11. Java 11 appears to work, but 17 was not.
|
So, is there a solution for this? I'm also trying to build an image for Raspberry Pi 3B+, but it's failing with the same error as described in the issue.
And the command to build: Maybe worth noting that it is a Spring Boot application written in Kotlin. |
You could probably cross compile using |
I'm not sure if this is what you meant, but I changed first line in
but the same error still persists. Is there anything else I could try? |
Sorry, I meant something more like this: FROM --platform=$BUILDPLATFORM gradle:8-jdk17 AS build
...
FROM --platform=$TARGETPLATFORM eclipse-temurin:17-jre
COPY --from=build ...
... Then something like As long as all the build artifacts are platform-independent files (such as compiled JVM bytecode) and do not contain platform specific artifacts such as |
Is there now a better solution to build linux/arm/v7 systems with gradle and Java 17 (or higher)? Is this still a problem with higher versions of Gradle and Java or just Gradle 7.6 and Java 17? |
Just for Gradle 7.6. Once Adoptium added the upstream images, I started building using them, but that means it started with whatever version of Gradle was current at the time. |
Full stack trace:
Docker file
The text was updated successfully, but these errors were encountered: