Skip to content

Enable native-image builds automatically #273

@dmikusa

Description

@dmikusa

Describe the Enhancement

With #272 we are looking for a key file, filepath.Join(n.ApplicationPath, "META-INF", "native-image", "argfile"). If that file exists, we could assume that the user wants to have a native-image build and automatically enable native-image builds.

Possible Solution

I'm not sure off hand if we can tie into the BP_NATIVE_IMAGE env variable or if we'd need to modify the buildplan. The native-image buildpack says that if you set native-image-application in the buildplan, it'll trigger a native-image build. One of these two options should work.

Motivation

Right now a user has to manually set BP_NATIVE_IMAGE=true to trigger a native-image build. The presence of this file could be a trigger which we can use to infer user intent and automatically enable a native-image build (or at least flip the default from false to true, a user should still be able to opt-out by forcing BP_NATIVE_IMAGE=false).

Metadata

Metadata

Labels

Type

No type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions