paketo-buildpacks / native-image

A Cloud Native Buildpack that creates native images from Java applications
Apache License 2.0
49 stars 9 forks source link

Fix #195 --no-fallback by default #255

Closed anthonydahanne closed 1 year ago

anthonydahanne commented 1 year ago

Summary

Usage:

> pack build -p ~/workspaces/paketo-buildpacks/samples/java/native-image/java-native-image-sample my-native   --env BP_NATIVE_IMAGE=true  --env BP_MAVEN_BUILD_ARGUMENTS="-Dmaven.test.skip=true --no-transfer-progress package -Pnative" -b paketo-buildpacks/syft \
-b paketo-buildpacks/bellsoft-liberica -b paketo-buildpacks/maven \
-b paketo-buildpacks/executable-jar -b . \
 --builder paketobuildpacks/builder:base --verbose --clear-cache
[...]
  Native Image: Contributing to layer
    Executing native-image --no-fallback -H:Name=/layers/paketo-buildpacks_native-image/native-image/io.paketo.demo.DemoApplication -cp /workspace io.paketo.demo.DemoApplication
[...]
pack build -p ~/workspaces/paketo-buildpacks/samples/java/native-image/java-native-image-sample plop   --env BP_
NATIVE_IMAGE=true  --env BP_MAVEN_BUILD_ARGUMENTS="-Dmaven.test.skip=true --no-transfer-progress package -Pnative" --env BP_NATIVE_IMAGE_BUILD_ARGUMENTS="--auto-fallback"  -b paketo-buildpacks/syft \ 
-b paketo-buildpacks/bellsoft-liberica -b paketo-buildpacks/maven \
-b paketo-buildpacks/executable-jar -b . \
 --builder paketobuildpacks/builder:base --verbose --clear-cache
[...]
  Native Image: Contributing to layer
    Executing native-image --auto-fallback -H:Name=/layers/paketo-buildpacks_native-image/native-image/io.paketo.demo.DemoApplication -cp /workspace io.paketo.demo.DemoApplication
[...]

Checklist

anthonydahanne commented 1 year ago

@dmikusa hey there 👋 I'm wondering about 2 things:

dmikusa commented 1 year ago

I've just set minor version upgrade; even though I have removed some deprecated flags - let me know if I have to remove the deprecation removal commit of if it should be major bump

I think we've removed settings before after deprecating them for a long period of time in minor versions. If you could separate this into its own PR, then we can wait till @pivotal-david-osullivan is back and double-check with him.

I've imported a golang.org/x/exp - if you're not comfortable with this, let me know, I'll refactor

slices.Contains 🤯 I can't understand why this isn't in the go stdlib

I'm pretty sure there are at least a couple of buildpacks or modules that have implemented "Contains". I have always intended to put that into libpak, but haven't had the time. That would be my preference, if we added a slices module we could put a common Contains in there. I can understand if you would rather just implement contains here. I'm fine with that as well.

I'm not necessarily adverse to a 3rd party library if there is perhaps another one, but what I don't like about this particular one is a.) that it's listed as experimental b.) it's kind of a grab bag with all sorts of functionality some totally unrelated, I'd prefer something that's specific to just slices or at least collections c.) there's no 1.0 release.

anthonydahanne commented 1 year ago

Hello @dmikusa ! Thanks for your comments!

anthonydahanne commented 1 year ago

Yes, I forgot some tests; should be good now! please let me know!