-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Remove the HPPC dependency from all modules and add the required classes to the hppc fork. #13422
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine; i also like that you updated the classes to latest version which may have fixed some bugs.
There is one issue which already existed: The classes are public and also have no @lucene.internal
in their javadocs. Maybe we should add this. The other suggestion was brought in by Dawid:
- Move the classes to
org.apache.lucene.internal.hppc
package which is not exported in module-info - Add qualified exports to the module-info only for the Lucene modules which actually use the classes
Not sure if the move to internal package should be part of this PR, but adding the Javadocs comment to mark them as internal should be done here (for all classes, also those not modified).
Ah I see you mentioned the missing move in the PR description, sorry! So except the |
I'll do it. |
Ok, Dawid I let you move the fork. |
Do you want to move in this PR, or in another PR once this one is merged? |
I'll push to this PR, if you don't mind? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for doing this. While there is still a little left to do in this PR, it looks like it's going in the right direction.
So compilation works, but tests won't fly with this change. Recall we run tests in "classpath mode" so even though modules compile, for tests they're on classpath and then can't access internal packages from the core. Here's an example:
Fixing this requires going down the rabbit hole of compiling and running tests with module patching and/or moving tests to a separate module and reorganizing their internals so that there are no split packages. Invasive... I wonder if the first baby step shouldn't be to move the hppc forked classes to .internal. (with proper annotation), but - sadly - export that package until we figure out how to compile and run tests in full modular mode. |
with the current infrastructure). This reverts commit 317c286.
I agree with the baby step, and this PR is already massive. |
I think the only thing missing is perhaps a changes entry and migration entry warning people that the dependency is gone and that the currently exposed internal package will be gone without a warning in the future (if we want to apply it to 9x as well). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ok as baby step.
About the test strategy: making tests modules is not a good idea, as this requires to open many more classes and it's also not the correct way for unit tests, which should run in same module.
Patching the module with test classes should work and is done by other projects, but I remember that you faced some issues.
Maybe another "hack": For running tests just pack a secondary jar file with main classes and tests including the module info? It's a duplicate but would make the tests and main classes a module with same name so all exports work.
Module patching should achieve the same, but I don't remember what your issues were.
At least for the MR-JAR compilation patching works, never tried at runtime.
I can't remember what the problem was, to be honest. Will have to return to it. |
Thank you Dawid! How long should we wait for this PR before merging it? |
I'd merge it right away, I don't see the point in waiting. If there are conflicts - they should be easy to resolve. |
Go ahead! |
… internal. (#13422) * Remove hppc dependency * Change fork version to 0.10.0 * Add @lucene.internal * Move hppc classes to oal.internal.hppc but export it. * Delete hppc license since it's no longer a dependency. --------- Co-authored-by: Dawid Weiss <dawid.weiss@carrotsearch.com>
Backport to branch_9x complete! |
It remains to move the hppc fork to oal.internal.