Fix instaparse macro loading by excluding .clj files from relocation - #14
Open
hellolittlej wants to merge 1 commit into
Open
Fix instaparse macro loading by excluding .clj files from relocation#14hellolittlej wants to merge 1 commit into
hellolittlej wants to merge 1 commit into
Conversation
hellolittlej
force-pushed
the
fix-macros-load
branch
from
May 13, 2026 04:48
ef31c75 to
78f3c24
Compare
Contributor
|
pause/close this for now? |
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.
Context
The mql-jvm module produces a shadow JAR — a fat JAR that bundles and relocates its Clojure dependencies under the io.mantisrx.mql.shaded.* namespace to
avoid classpath conflicts. The issue is that Clojure .clj/.cljc source files were being included in the shaded JAR along with the compiled .class files.
This causes a subtle but serious problem: instaparse/macros.clj (and other Clojure source files) gets relocated into the shaded namespace path. When
Clojure's macro system tries to load instaparse/macros.clj at runtime, it looks for the file under its original path — but the shadow plugin has moved it to
io/mantisrx/mql/shaded/instaparse/macros.clj. This breaks macro loading.
We have a user putting depends on the mql library in their spark job and failed at runtime due to FileNotFoundException
I'm putting ^ into the library so we don't leak the source files to each end consumers
Checklist
./gradlew buildcompiles code correctly./gradlew testpasses all testsCONTRIBUTING.md