Skip to content
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

Support native executables as input #192

Open
scottfrederick opened this issue Sep 20, 2022 · 1 comment
Open

Support native executables as input #192

scottfrederick opened this issue Sep 20, 2022 · 1 comment

Comments

@scottfrederick
Copy link

Describe the Enhancement

When buildpacks are building a project from source, it is possible for the project to include the Maven or Gradle Native Build Tools plugin and configure the command line for the Maven (mvn -Pnative package) or Gradle (gradle nativeCompile) build to generate a native executable instead of a jar or war archive. The native-image buildpack currently fails in this scenario, as it expects its input to be a jar or war archive. It would be nice if the native-image buildpack would detect this scenario and skip the invocation of the native-image tool.

Motivation

Building a native executable directly from the build system might not be as common as building an archive for input to buildpacks, but advances in the NBT build plugins as well as build plugins from frameworks like Spring Boot are making this easier to do. When customization of the native-image command is required, it might be easier for users to configure this customization in a Maven pom.xml or Gradle build.gradle file than by providing BP_NATIVE_IMAGE_BUILD_ARGUMENTS or BP_NATIVE_IMAGE_BUILD_ARGUMENTS_FILE environment variables to the buildpack platform.

@dmikusa
Copy link
Contributor

dmikusa commented Oct 7, 2022

Sounds totally reasonable. There might be some issues to work out around SBOM. The native-image buildpack generates the SBOM entry for the runtime image, so we'd have to figure out how to make that happen still. You'd also still need something to set process types.

I think the spring-boot buildpack might also need to adjust itself. It does have some logic specific to fetching the classpath for a Boot app that is compiled to native-image. That might break, depending on what changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants