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

[FEATURE] Support for native image (Spring Native/GraalVM) #201

Closed
marceligrabowski opened this issue Sep 3, 2022 · 8 comments
Closed
Assignees
Labels
feature request New feature or request

Comments

@marceligrabowski
Copy link

marceligrabowski commented Sep 3, 2022

Is your feature request related to a problem? Please describe.
I was wondering if it's bug report or feature request but it would be nice to have support for native image building e.g. Spring Native. Currently skrape.it added as dependency instantly fails build process. It might be connected to usage of logback.xml here.
I did small reproduction of this problem with logback and it turned out that it can fail build while having logback.xml in classpath

Describe the solution you'd like
Skrape.it supporting native image building.

Additional context

  - Additional action of task ':generateAot' was implemented by the Java lambda 'org.springframework.aot.gradle.SpringAotGradlePlugin$$Lambda$916/0x00000008012f5230'. Reason: Using Java lambdas is not supported as task inputs. Please refer to https://docs.gradle.org/7.5/userguide/validation_problems.html#implementation_unknown for more details about this problem.
I 11:19:13.722 [ld.ContextBootstrapContributor] Detected application class: pl.something.api.ApiApplication
I 11:19:13.724 [ld.ContextBootstrapContributor] Processing application context

org.springframework.boot.logging.LogbackHints$LogbackXmlException: Embedded logback.xml file is not supported yet with Spring Native, read the support section of the documentation for more details

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':generateAot'.
> Process 'command '/Users/user/.sdkman/candidates/java/22.2.r17-grl/bin/java'' finished with non-zero exit value 1

It might be related to spring-attic/spring-native#625

@marceligrabowski marceligrabowski added the feature request New feature or request label Sep 3, 2022
@christian-draeger
Copy link
Collaborator

Hey,
Thx for pointing this out.
The library should not hinder native image compilation.
As you already mentioned logback could be the problem here.
Can you provide a pull request?

@marceligrabowski
Copy link
Author

@christian-draeger I'll try prepare something this week ;)

@christian-draeger
Copy link
Collaborator

Thank you 🙌

@marceligrabowski
Copy link
Author

Okay. For now the most obvious thing to do is to remove logback.xml but I suspect that it's not welcomed solution. I'll try with setting up logback config programatically - not through xml file

@christian-draeger
Copy link
Collaborator

christian-draeger commented Sep 9, 2022

Sounds like a good idea. I had same problem in spring projects that uses native image compilation and logback-spring.xml.
Migrating away from logback.xml fixed this problem and was easy in that case because logger can be configured via application.yaml as well.
Not sure how to do in none spring projects. But in general not using logback.xml seems to be a good and pragmatic solution.

@marceligrabowski
Copy link
Author

@christian-draeger Just added PR with changes. It looks like it works like a charm 🎉

@christian-draeger
Copy link
Collaborator

Thx a lot :) will merge it tomorrow

@marceligrabowski
Copy link
Author

As #203 is merged we can consider it as closed completed 🥳✅
Release of new version in near future would be helpful. Maybe after #202 is resolved (I can take a look at it)

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

No branches or pull requests

3 participants