Skip to content
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

Support Java 21 on Scala.js #398

Open
ekrich opened this issue Oct 1, 2024 · 1 comment
Open

Support Java 21 on Scala.js #398

ekrich opened this issue Oct 1, 2024 · 1 comment

Comments

@ekrich
Copy link
Owner

ekrich commented Oct 1, 2024

Scala.js does not work for Scala 3.3.x. Classes extending java.util.SequencedCollection cause problems. Note that Scala Native has the class added although it is just a stub at this time.

Reproduce:

  1. Run Java 21
  2. sbt
  3. ++3.3.4
  4. Run sconfigJS/test or one of the testOnly seen below.

Example error:

[info] Fast optimizing /Users/eric/workspace/sconfig/sconfig/js/target/scala-3.3.3/sconfig-test-fastopt
[error] Referring to non-existent class java.util.SequencedCollection
[error]   called from org.ekrich.config.impl.SimpleConfigList
[error]   called from org.ekrich.config.impl.ConfigValueSharedTest.valuesToString()void
[error]   called from org.ekrich.config.impl.ConfigValueSharedTest$scalajs$junit$bootstrapper$.invokeTest(java.lang.Object,java.lang.String)scala.concurrent.Future
[error]   dispatched from org.scalajs.junit.Bootstrapper.invokeTest(java.lang.Object,java.lang.String)scala.concurrent.Future
[error]   called from private org.scalajs.junit.JUnitTask.$anonfun$executeTestMethod$7(org.scalajs.junit.Bootstrapper,java.lang.Object,org.scalajs.junit.TestMetadata)scala.concurrent.Future

Now running the newest code I get the same as below.

sbt:sconfig-root> sconfigJS/testOnly ConfigValueSharedTest
[warn] multiple main classes detected: run 'show discoveredMainClasses' to see the list
[info] Fast optimizing /Users/eric/workspace/sconfig/sconfig/js/target/scala-3.3.4/sconfig-test-fastopt
[error] Referring to non-existent class java.util.SequencedCollection
[error]   called from org.ekrich.config.impl.SimpleConfigList
[error]   called from org.ekrich.config.impl.DefaultTransformer$.transform(org.ekrich.config.impl.AbstractConfigValue,org.ekrich.config.ConfigValueType)org.ekrich.config.impl.AbstractConfigValue
[error]   called from private org.ekrich.config.impl.ConfigConcatenation$.join(java.util.ArrayList,org.ekrich.config.impl.AbstractConfigValue)void
[error]   called from private static org.ekrich.config.impl.ConfigConcatenation$.consolidate$$anonfun$2(java.util.ArrayList,org.ekrich.config.impl.AbstractConfigValue)java.lang.Object
@ekrich
Copy link
Owner Author

ekrich commented Nov 8, 2024

Another place it seems to occur.

https://github.com/ekrich/sconfig/blob/main/sconfig/shared/src/main/scala/org/ekrich/config/impl/DefaultTransformer.scala#L115-L119

sbt:sconfig-root> sconfigJS/testOnly ConfigFactoryTest
[warn] multiple main classes detected: run 'show discoveredMainClasses' to see the list
[info] Fast optimizing /Users/eric/workspace/sconfig/sconfig/js/target/scala-3.3.4/sconfig-test-fastopt
[error] Referring to non-existent class java.util.SequencedCollection
[error]   called from org.ekrich.config.impl.SimpleConfigList
[error]   called from org.ekrich.config.impl.DefaultTransformer$.transform(org.ekrich.config.impl.AbstractConfigValue,org.ekrich.config.ConfigValueType)org.ekrich.config.impl.AbstractConfigValue
[error]   called from private org.ekrich.config.impl.ConfigConcatenation$.join(java.util.ArrayList,org.ekrich.config.impl.AbstractConfigValue)void
[error]   called from private static org.ekrich.config.impl.ConfigConcatenation$.consolidate$$anonfun$2(java.util.ArrayList,org.ekrich.config.impl.AbstractConfigValue)java.lang.Object

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant