apache / lucene

Apache Lucene open-source search software
https://lucene.apache.org/
Apache License 2.0
2.61k stars 1.02k forks source link

upgrade commons codec from 1.13.0 to 1.16.0 #13269

Open rmuir opened 6 months ago

rmuir commented 6 months ago

Currently, we depend upon a pre-COVID version of commons-codec (like several other dependencies, I am working the issues).

Upgrade to 1.16.0.

NOTE: I'm unable to upgrade to 1.16.1: it causes test failures.

   $ ./gradlew -p lucene/analysis/phonetic test
   ...
   >     java.lang.ExceptionInInitializerError
   >         at org.apache.commons.codec@1.16.1/org.apache.commons.codec.language.bm.Lang.<clinit>(Lang.java:108)
   >         at org.apache.commons.codec@1.16.1/org.apache.commons.codec.language.bm.PhoneticEngine.<init>(PhoneticEngine.java:300)
   >         at org.apache.commons.codec@1.16.1/org.apache.commons.codec.language.bm.PhoneticEngine.<init>(PhoneticEngine.java:276)
             ...
   >
   >         Caused by:
   >         java.lang.IllegalArgumentException: Unable to resolve required resource: org/apache/commons/codec/language/bm/ash_languages.txt
   >             at org.apache.commons.codec@1.16.1/org.apache.commons.codec.Resources.getInputStream(Resources.java:38)
   >             at org.apache.commons.codec@1.16.1/org.apache.commons.codec.language.bm.Languages.getInstance(Languages.java:254)
   >             at org.apache.commons.codec@1.16.1/org.apache.commons.codec.language.bm.Languages.<clinit>(Languages.java:243)

Seems some resources are missing from the jar or similar. I tried to investigate a bit, by looking at their source code changes from 1.16.0 to 1.16.1, it is overwhelming, not exactly what I'd call a "patch" release :)

https://github.com/apache/commons-codec/compare/rel/commons-codec-1.16.0...rel/commons-codec-1.16.1

Either way, that isn't to be fixed here, so let's at least move from a 2019 version to a 2023 version. We can separately debug the 1.16.1 issue / report it to them / file a PR /etc.

rmuir commented 6 months ago

I think i understand the 1.16.1 issue. Looks like there is a bit of jar/maven-hell going on among the commons dependencies. I hit it when I tried to upgrade commons-compress...

Bumping both of them to the latest version is not the solution, it seems to then just cause "module-hell" and still fails the build. But for now we can get them on less ancient versions.

rmuir commented 6 months ago

I will open a separate issue for the commons-compress as there is more trouble there...

github-actions[bot] commented 5 months ago

This PR has not had activity in the past 2 weeks, labeling it as stale. If the PR is waiting for review, notify the dev@lucene.apache.org list. Thank you for your contribution!