Fixes scala-reflect issue with GitHub pureconfig (https://github.com/opalj/JCG/issues/17)#362
Conversation
|
/it:test |
| // Implement ConfigReader manually to avoid issue with scala-reflect: https://github.com/opalj/JCG/issues/17 | ||
| implicit private val entryPointContainerReader: ConfigReader[EntryPointContainer] = | ||
| ConfigReader.forProduct3("declaring-class", "name", "descriptor")(EntryPointContainer.apply) | ||
| .orElse(ConfigReader.forProduct3("declaringClass", "name", "descriptor")(EntryPointContainer.apply)) |
There was a problem hiding this comment.
Why this? There should only be one way to write the keys that is valid now.
There was a problem hiding this comment.
-
reference.confuses "declaring-class":
opal/OPAL/br/src/main/resources/reference.conf
Lines 96 to 111 in 55085cf
-
org.opalj.br.analyses.cg.InitialEntryPointsKey.entryPointsuses "declaringClass": https://github.com/opalj/JCG/blob/master/jcg_opal_testadapter/src/main/scala/OpalJCGAdatper.scala#L82-L83
There was a problem hiding this comment.
The latter is because JCG has not been updated to recent Scala-3 based OPAL which, due to changes in the config library, had to change to "declaring-class". I.e., I think JCG has to be changed here instead of supporting different keys in OPAL.
There was a problem hiding this comment.
Documentation uses "declaringClass" too:
opal/OPAL/br/src/main/scala/org/opalj/br/analyses/cg/EntryPointFinder.scala
Lines 233 to 243 in 55085cf
Probably should be updated as well.
There was a problem hiding this comment.
Absolutely. Want to do that in this PR?
|
Done. |
Hi,
This fixes opalj/JCG#17.
The issue is that Opal depends on scala-reflect, which is binary incompatible with Scala 3 classes.
The problem is that Githubs pureconfig generates Scala 3 code that crashes scala-reflect searches for
ConfigurationEntryPointsFinder.The fix reimplements the
ConfigurationEntryPointsFinder.EntryPointContainerconfiguration reader to avoid the generation of problematic Scala 3 classes.I tested the fix in JCG and it works.
Sven