Skip to content

BP_NATIVE_IMAGE=false does not work #374

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

Open
dmikusa opened this issue Apr 10, 2025 · 0 comments
Open

BP_NATIVE_IMAGE=false does not work #374

dmikusa opened this issue Apr 10, 2025 · 0 comments
Labels
type:bug A general bug

Comments

@dmikusa
Copy link
Contributor

dmikusa commented Apr 10, 2025

Expected Behavior

I should be able to set BP_NATIVE_IMAGE=false and it should disable native image builds. This should override any automatic detection that happens in the buildpack.

Current Behavior

If you set BP_NATIVE_IMAGE=false, it is ignored. The buildpack only looks to see if this env variable is set, it does not look at the contents.

Possible Solution

I think fixing this is just a matter of looking at the value and evaluating it as a boolean. Double check the detection process though, and make sure that's sufficient.

Steps to Reproduce

Take a Spring Boot 3.4 application from start.spring.io with Native Image support. Build it with Spring Boot build tools. The build will automatically be a native image build. Now set BP_NATIVE_IMAGE=false. It will be ignored & you'll still get a native image build.

Motivations

In the cases where the buildpack detects that native image builds should occur, a user may want to be able to override this and not have a native image build. User should be able to opt-out.

@dmikusa dmikusa added the type:bug A general bug label Apr 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug A general bug
Projects
None yet
Development

No branches or pull requests

1 participant