-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Compilation to native fails, when quarkus-smallrye-openapi is included #30919
Comments
/cc @EricWittmann (openapi), @Ladicek (smallrye), @MikeEdgar (openapi), @jmartisk (smallrye), @phillip-kruger (openapi,smallrye), @radcortez (smallrye) |
@fedinskiy I tried reproducing the issue with no luck. Note that
So I used Could you please include the logs before the "Performing analysis" part as well? e.g.:
Thanks |
Also it looks like I mistyped version of GraalVM, and it is actually 17.0.6 |
I finally managed to reproduce this using
Still not clear to me why though... Also FTR, I was able to run without |
If I get this right, the issue is caused by https://github.com/quarkusio/quarkus/pull/28811/files#diff-da0096dd9784cf26970e40b6ca83158411a9c990e3e687184dd00c3590bf10b0R189 Which instead of defining the type as @GET
@Path("")
@Produces({"application/json"})
@LinkResource(
entityClassName = "io.quarkus.ts.spring.data.primitivetypes.model.Cat",
rel = "list"
)
@APIResponse(
responseCode = "200",
content = {@Content(
mediaType = "application/json",
schema = @Schema(
implementation = Cat.class,
type = "ARRAY" // <============================
)
)}
)
public Response list(@QueryParam("sort") List sort, @QueryParam("namedQuery") String namedQuery) { which should be: @GET
@Path("")
@Produces({"application/json"})
@LinkResource(
entityClassName = "io.quarkus.ts.spring.data.primitivetypes.model.Cat",
rel = "list"
)
@APIResponse(
responseCode = "200",
content = {@Content(
mediaType = "application/json",
schema = @Schema(
implementation = Cat.class,
type = SchemaType.ARRAY // <======================================
)
)}
)
public Response list(@QueryParam("sort") List sort, @QueryParam("namedQuery") String namedQuery) { This results in Quarkus generating methods wrongfully annotated that then fail native image compilation with the above error. Not sure why this is not happening in JVM-mode though, it doesn't seem like a native issue. ping @Sgitario |
This resource is autogenerated and as far as I remember, we could not use SchemaType.ARRAY directly, though I can try again. However, why this is working fine in JVM and not in Native? |
Is there some kind of constant folding going on?
…On Mon, Feb 6, 2023, 17:58 Jose Carvajal ***@***.***> wrote:
This resource is autogenerated and as far as I remember, we could not use
SchemaType.ARRAY directly, though I can try again.
However, why this is working fine in JVM and not in Native?
—
Reply to this email directly, view it on GitHub
<#30919 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABBMDP5SIIVDFKO3O6P2MW3WWENTTANCNFSM6AAAAAAUSQLMSQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
My understanding is that this doesn't have to do with constant folding or similar optimizations, |
While "ARRAY" works in JVM, it does not in Native. Fix quarkusio#30919
#30940 should address this issue. |
This MR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [com.diffplug.spotless:spotless-maven-plugin](https://github.com/diffplug/spotless) | build | minor | `2.32.0` -> `2.33.0` | | [io.quarkus:quarkus-maven-plugin](https://github.com/quarkusio/quarkus) | build | patch | `2.16.1.Final` -> `2.16.2.Final` | | [io.quarkus:quarkus-universe-bom](https://github.com/quarkusio/quarkus-platform) | import | patch | `2.16.1.Final` -> `2.16.2.Final` | --- ### Release Notes <details> <summary>diffplug/spotless</summary> ### [`v2.33.0`](https://github.com/diffplug/spotless/blob/HEAD/CHANGES.md#​2330---2023-01-26) ##### Added - `ProcessRunner` has added some convenience methods so it can be used for maven testing. ([#​1496](diffplug/spotless#1496)) - `ProcessRunner` allows to limit captured output to a certain number of bytes. ([#​1511](diffplug/spotless#1511)) - `ProcessRunner` is now capable of handling long-running tasks where waiting for exit is delegated to the caller. ([#​1511](diffplug/spotless#1511)) - Allow to specify node executable for node-based formatters using `nodeExecutable` parameter ([#​1500](diffplug/spotless#1500)) ##### Fixed - The default list of type annotations used by `formatAnnotations` has had 8 more annotations from the Checker Framework added [#​1494](diffplug/spotless#1494) ##### Changes - **POTENTIALLY BREAKING** Bump minimum JRE from 8 to 11, next release likely to bump bytecode to Java 11 ([#​1514](diffplug/spotless#1514) part 1 of [#​1337](diffplug/spotless#1337)) - Rename `YamlJacksonStep` into `JacksonYamlStep` while normalizing Jackson usage ([#​1492](diffplug/spotless#1492)) - Convert `gson` integration to use a compile-only source set ([#​1510](diffplug/spotless#1510)). - \*\* POTENTIALLY BREAKING\*\* Removed support for KtLint 0.3x and 0.45.2 ([#​1475](diffplug/spotless#1475)) - `KtLint` does not maintain a stable API - before this MR, we supported every breaking change in the API since 2019. - From now on, we will support no more than 2 breaking changes at a time. - NpmFormatterStepStateBase delays `npm install` call until the formatter is first used. This enables better integration with `gradle-node-plugin`. ([#​1522](diffplug/spotless#1522)) - Bump default `ktlint` version to latest `0.48.1` -> `0.48.2` ([#​1529](diffplug/spotless#1529)) - Bump default `scalafmt` version to latest `3.6.1` -> `3.7.1` ([#​1529](diffplug/spotless#1529)) </details> <details> <summary>quarkusio/quarkus</summary> ### [`v2.16.2.Final`](https://github.com/quarkusio/quarkus/releases/tag/2.16.2.Final) [Compare Source](quarkusio/quarkus@2.16.1.Final...2.16.2.Final) ##### Complete changelog - [#​30976](quarkusio/quarkus#30976) - Metrics - check if index contains class before attempting to use it - [#​30965](quarkusio/quarkus#30965) - JandexBeanInfoAdapter.getMetricAnnotationsThroughStereotype is not null safe - [#​30959](quarkusio/quarkus#30959) - Return text from /q/metrics when the Accept header contains html - [#​30953](quarkusio/quarkus#30953) - Fix OIDC capability string - [#​30947](quarkusio/quarkus#30947) - Ignore interface/class without default constructs fields in SB config - [#​30940](quarkusio/quarkus#30940) - Use SchemaType.ARRAY instead of "ARRAY" for native support - [#​30919](quarkusio/quarkus#30919) - Compilation to native fails, when quarkus-smallrye-openapi is included - [#​30916](quarkusio/quarkus#30916) - Add AppCDS documentation - [#​30896](quarkusio/quarkus#30896) - Quarkus spring-boot-properties extension unable to handle complex configuration. - [#​30878](quarkusio/quarkus#30878) - Bump postgresql from 42.5.2 to 42.5.3 - [#​30866](quarkusio/quarkus#30866) - Only run the quickstart compilation for main - [#​30851](quarkusio/quarkus#30851) - Fixed return type typo in smallrye graphQL guide - [#​30844](quarkusio/quarkus#30844) - Fixed greeting in getting started guide - [#​30839](quarkusio/quarkus#30839) - Fix handling of Accept header in graphQL - [#​30833](quarkusio/quarkus#30833) - Update docs to show BuildProducer use as method parameter instead of field - [#​30828](quarkusio/quarkus#30828) - Make OIDC session cookie same site lax by default - [#​30826](quarkusio/quarkus#30826) - Caffeine - Automatically register metrics cache impls if Micrometer is around - [#​30825](quarkusio/quarkus#30825) - Fix comment about Caffeine optimization - [#​30823](quarkusio/quarkus#30823) - Change accept header to valid plain text in micrometer documentation - [#​30821](quarkusio/quarkus#30821) - Packaging type -Dquarkus.package.create-appcds=true isn't documented - [#​30815](quarkusio/quarkus#30815) - Update SmallRye Config to 2.13.2 - [#​30812](quarkusio/quarkus#30812) - Manage the apache-mime4j dependency - [#​30806](quarkusio/quarkus#30806) - */* in Accept header is ignored if not listed as the first item - [#​30805](quarkusio/quarkus#30805) - MailTemplateInstance with attachments - [#​30803](quarkusio/quarkus#30803) - Support file and byte array attachments in `MailTemplateInstance` - [#​30797](quarkusio/quarkus#30797) - OIDC login not work - [#​30783](quarkusio/quarkus#30783) - <artifactId> uses 'quarkus.platform.artifact-id' property - [#​30778](quarkusio/quarkus#30778) - Avoid creating 3 Liquibase MongoDB instances for startup operations - [#​30776](quarkusio/quarkus#30776) - Ensure that AwsProxyRequestContext can be used with [@​Context](https://github.com/Context) in RESTEasy Reactive - [#​30767](quarkusio/quarkus#30767) - Remove duplicate notification of SseBroadcaster's onErrorListeners - [#​30765](quarkusio/quarkus#30765) - Bump postgresql from 42.5.1 to 42.5.2 - [#​30755](quarkusio/quarkus#30755) - Update ForwardedParser to validate the port - [#​30744](quarkusio/quarkus#30744) - \[Quarkus Native] ClassNotFoundException: com.github.benmanes.caffeine.cache.SSSW - [#​30536](quarkusio/quarkus#30536) - munitnyucontextmanager non helpful error reporting - [#​29753](quarkusio/quarkus#29753) - Introduce ConnectionFactoryWrapperBuildItem - [#​29605](quarkusio/quarkus#29605) - Update docs to reflect that injection should not - [#​27774](quarkusio/quarkus#27774) - PLANNER-1709 Avoid deprecated penalize/reward overloads - [#​23442](quarkusio/quarkus#23442) - problem using quarkus-resteasy-reactive-kotlin-serialization with AwsProxyRequestContext </details> <details> <summary>quarkusio/quarkus-platform</summary> ### [`v2.16.2.Final`](quarkusio/quarkus-platform@2.16.1.Final...2.16.2.Final) [Compare Source](quarkusio/quarkus-platform@2.16.1.Final...2.16.2.Final) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox. 👻 **Immortal**: This MR will be recreated if closed unmerged. Get [config help](https://github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4yNC4wIiwidXBkYXRlZEluVmVyIjoiMzQuMjQuMCJ9-->
While "ARRAY" works in JVM, it does not in Native. Fix quarkusio#30919 (cherry picked from commit 0bc09e7)
Describe the bug
I have an application, which uses
quarkus-smallrye-openapi
dependency. The application works flawlessly in JVM mode, but fails duringPerforming analysis
phase in Native mode. Experimenting shows, that the app fails simply when that dependency is included in pom.Expected behavior
App should work in both JVM and Native modes
Actual behavior
How to Reproduce?
git clone [email protected]:fedinskiy/quarkus-test-suite.git -b reproducer/openapi-failure
cd quarkus-test-suite/spring/spring-data
mvn clean verify -Dnative -Dquarkus.platform.version=2.16.1.Final -Pfail
mvn clean verify -Dnative -Dquarkus.platform.version=2.16.1.Final
— this compiles, but expectedly fails during test phase due to lack ofq/openapi
endpointOutput of
uname -a
orver
6.0.18-300.fc37.x86_64
Output of
java -version
17.0.6, vendor: GraalVM Community
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.16.1.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63)
Additional information
No response
The text was updated successfully, but these errors were encountered: