Update jffi dependency scope to 'provided' - #219
Merged
Merged
Conversation
JFFI should not be a hard dependency of Redline, because that disallows having the version float in projects that utilize Redline like JRuby. Moving this to "provided" makes the dependency soft, expecting that Redline users will "provide" JFFI at an appropriate level. This was previously fixed for Redline in roastedroot/chicory-redline#20 but it appears to have gotten lost along the way.
Contributor
Author
|
Example error from JRuby's dependency convergence check: |
Contributor
Author
|
Similar to the previous PR, I believe tests that consume the JFFI backend need to include an explicit JFFI dependency. |
Contributor
|
I think is fine, sorry, I missed this one, will have a look at the CI and merge soon. |
With jffi in provided scope, the dependency analyzer flags the native classifier jar as unused, since it has no classes. Its pattern filter cannot match a classifier, so exempt com.github.jnr:jffi in runner-jffi; the main jar is genuinely used there. Provided is not transitive, so runner-jffi-tests and the redline-e2e IT now declare jffi and jffi:native themselves; without them the IT fails with NoClassDefFoundError: com/kenai/jffi/MemoryIO. Document that jffi users add both artifacts, and that a missing jffi is an error rather than a silent fallback.
Restore jffi to its normal scopes in redline-runner-jffi, so an application that adds the runner gets jffi with it, and drop the analyzer exclusion and the explicit jffi dependencies that the provided scope required. The version conflict comes from libraries such as prism-parser-wasm depending on the runner at compile scope, which forces their jffi version on applications like JRuby. Document that libraries declare the runner as provided, so the application picks the runner and jffi.
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.
JFFI should not be a hard dependency of Redline, because that disallows having the version float in projects that utilize Redline like JRuby. Moving this to "provided" makes the dependency soft, expecting that Redline users will "provide" JFFI at an appropriate level.
This was previously fixed for Redline in roastedroot/chicory-redline#20 but it appears to have gotten lost along the way.