fix: unbreak the native image builds - #6
Merged
Conversation
Two regressions from #2 and #3, both only visible in a native build. The startup observer was package private. A consumer that extends BaseCache from another package - soon-market-api's ApplicationCache - gets an arc generated subclass because of @ActivateRequestContext, and that subclass cannot override a package private method across packages. Native image reports it as an unresolved method while parsing ApplicationCache_Subclass.populateCachesAtStartup and fails the build. It is public now, and fillSafely is protected for the same reason. commons-beanutils 1.11 pulls commons-logging 1.3.5 where 1.9.4 pulled 1.2, and 1.3 adds org.apache.commons.logging.impl.Log4jApiLogFactory. That class references log4j-api, which is not a dependency, and native image initialises it at build time - the processor image build fails with NoClassDefFoundError for org/apache/logging/log4j/spi/LoggerAdapter. commons-logging is pinned back to 1.2, keeping the beanutils bump and its CVE fix; the commons-logging api is unchanged between the two. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
mainis red insoon-market-apiandevent-processor-contract. Both are regressions from #2 and #3 in this repo, and both are visible only in a native build — which is why every PR went green.1. The startup observer was package private
soon-market-apihasApplicationCache extends BaseCache, in a different package.@ActivateRequestContextmakes Arc generate a subclass, and a generated subclass cannot override a package-private method across packages — so native image cannot resolve it and fails the build.populateCachesAtStartupis nowpublic, andfillSafelyprotectedfor the same reason.2. beanutils 1.11 drags commons-logging 1.3
Measured:
commons-logging 1.3 added
Log4jApiLogFactory, which references log4j-api. That is not a dependency here, and native image initialises the class at build time, so the processor's image build dies.commons-loggingis pinned back to 1.2 — the version beanutils 1.9.4 used, so this returns the classpath to the state that built green for a year. The beanutils bump and its CVE fix are kept; the commons-logging API is unchanged between 1.2 and 1.3, only the factory implementations differ.Verified with the processor's submodule pointed at this branch:
What I could not verify, and why this slipped through
I have neither Docker nor GraalVM available locally, so the native builds are unverified — CI on the consumer repos is the gate. Fix 2 is high confidence because it restores an exact previously-working classpath; fix 1 is the documented resolution for that error but is untested by me.
The reason this reached
main: no_validate.ymlruns a native build.-Dnativeappears only in the Dockerfiles, which run inpush.ymlon a push tomain. So a native-only regression cannot be caught by a PR in any of these repos, by construction. That is worth fixing separately — a native build in_validate.ymlwould be slow, but a native-only failure mode that only appears after merge is worse. Related: kryptokrauts/event-processor-contract#25, where the native build args are declared three times and only the last applies.After merging
The four consumers need their submodule pointers moved again — they are all at
b5c80fb, which is the broken commit.soon-market-apiandevent-processor-contractare the two that are actually red;scheduled-task-serviceandsoon-market-sse-apishare the classpath change and should be moved with them.