-
Notifications
You must be signed in to change notification settings - Fork 9
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
Spring Boot Native image builds with 22.2.0 are failing #176
Comments
The latest release of this buildpack (v5.3.1) sets the environment variable The composite buildpack release |
I've had a similar issue on Apple M1 Pro. Initially I though the process hanged at step |
Update on this - the latest (dev) builds of GraalVM CE 22.3 do not seem to produce this error: https://github.com/graalvm/graalvm-ce-dev-builds/releases The GraalVM team have confirmed that the |
Apologies in advance for the tangential topic, but I am struggling with a Kotlin compilation issue that's also supposed to be fixed in 22.3 and I am wondering if the GraalVM version could be finally bumped. |
@abelsromero The latest Bellsoft Liberica & Graalvm buildpacks are shipping 22.3, so you should not see the error mentioned on this ticket (both because of that, but because we are also automatically setting the previously mentioned env variable that works around this issue). If you're not getting 22.3, check and make sure you've got the latest builder & buildpack |
This particular error shouldn't have caused slowness & I'm not sure why downgrading would impact what you're seeing there. That could be something else. What I can say is that building with the buildpacks on an M1 Mac is that it's slower. It is especially slow when doing native-image builds because they are very CPU intensive. This is because the present set of buildpacks is not published with ARM64 images thus your Mac & Docker are emulating x86_64 and that is just a slow process. We as a project are working towards ARM64 support, but a lot of work needs to happen so it won't be a fast process. We are presently at the place where you can build your own ARM64 images (takes about 20 mins) using the instructions here. We also have an amazing community member @dashaun that has put together and continues to update images using this tool. He has a multi-arch image for Java native-image buildpacks here. You might consider giving these a try. They should speed things up considerably as you'll remove all the messy/slow emulation. Hope that helps! |
@pivotal-david-osullivan Do you think we can close this out? I think the original issue has been resolved. Unless you want to keep this open as a reminder to eventually go back and remove the workaround of adding |
Indeed, thanks! I see we were hardcoding an old builder image. Latest builder still uses native 5.6 instead of 5.7 but so long is Graal 22.3 is fine |
Currently on a M1 MacBook Pro with Monterrey 12.5.1 (company issued). I have been trying a Spring Boot 3 sample project as a native image. When building with GraalVM (GraalVM CE 22.3.0 build 17.0.5+8-jvmci-22.3-b08) via
It gets stuck in there and stays in there until I kill it. I have increased memory and processors for Docker configuration (Docker Desktop v4.15.0 (93002)) and nothing changes. Is this a different issue? |
@DVader666 Please see this comment above -> #176 (comment). You have an ARM64 machine and so when you build with buildpacks that is happening by default through an emulation layer (it would be faster on an AMD64 machine, or using ARM64 images). I have an ARM64 MBP as well and sometimes builds finish, but I often see what you're seeing where the native-image build just runs forever or eventually errors for some reason. The comment above has the latest info on that topic. |
@iuliana @DVader666 I have pushed out a new builder, just for you. It works on ARM64 & AMD64 and looks a lot like |
FYI Spring Native is Spring Boot 3 is now GA! Everything you love about #springnative is included, first class, in Spring Boot 3. The AOT processing / GraalVM native image features, require Java 17 and GraalVM native image 22.3.0 or above. |
Building an spring cloud function based on spring boot v3.0 as native executable using Step to reproduce:
IT seems like the existing buildpack used is not providing the same? GLIBC version which is offered used by the aws lambda provided runtime. |
@cforce That's a different issue. Please create a new issue for it. |
@dmikusa Ok - shall i do it here or at https://github.com/paketo-buildpacks/spring-boot/issues ? continued here : #217 |
Here is fine. Go up to the top of this page & hit the "New Issue" button. |
@pivotal-david-osullivan @dmikusa The original issue is expected to be solved with GraalVM 22.3, so after local testing it works as expected, customization of |
I created #273 to track removing since this comment thread is getting long. Closing this one out. |
Expected Behavior
Build of a Spring Boot application with Liberica NIK 22.2.0 succeeds.
Current Behavior
Build of a Spring Boot application with Liberica NIK 22.2.0 fails with the following error:
Possible Solution
There are presently two workarounds. The first workaround is recommended, unless you cannot use it for some reason.
USE_NATIVE_IMAGE_JAVA_PLATFORM_MODULE_SYSTEM=false
. You can do that withpack build demo -e USE_NATIVE_IMAGE_JAVA_PLATFORM_MODULE_SYSTEM=false
or with the following change in pom.xml.pack build demo -b gcr.io/paketo-buildpacks/java:6.34.0
, or make this change in your pom.xml:Steps to Reproduce
./mvnw spring-boot:build-image
orpack build demo -e BP_NATIVE_IMAGE=true
.Motivations
Impact: this is breaking builds for anyone using the latest builders or buildpack.
The text was updated successfully, but these errors were encountered: