Skip to content

Conversation

arashi01
Copy link

@arashi01 arashi01 commented Feb 2, 2025

  • Update to Scala Native 0.5.6
  • Update Scala JS to 1.18.2
  • Update Scala 3 to current LTS
  • Update Scala 2 to 2.13.16
  • Update algebra (now that it is within core cats repository)

Build plugins updates:

  • update sbt to 1.10.7
  • Update sbt-crossproject to 1.3.2
  • Update sbt-typelevel to 0.7.7

Resolves #1342

Enable tests with JDK 21.
@arashi01 arashi01 changed the title Scala native 0.5 WIP: Scala native 0.5 Feb 2, 2025
@arashi01 arashi01 force-pushed the scala_native_0.5 branch 3 times, most recently from dd29762 to 7b64378 Compare February 2, 2025 16:37
Use lower precision for native platform for NRootSuite
@armanbilge
Copy link
Member

Thanks for the PR! See this other PR that explains why we are struggling to make this upgrade.

Comment on lines +107 to +109
val value = x // Explicitly define. Avoids failures on certain JDKs
val closure = () => { capturedValues += value; () }
b1 += closure
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure this is related to JDK version? This is actually due to a change in Scala 3.

Copy link
Author

@arashi01 arashi01 Feb 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. It was definitely passing on older JDK's. Unless I am very confused and was running on scala 2.13!

Edit: Sorry, you are correct. I had been running those tests on Scala 2. Hadn't used the +test in that instance

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyway I believe this implementation is functionally equivalent no? Replaced the while loop with a cfor loop for b2. Can revert that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To clarify, this is test code, not implementation code. You can consider test code to be representing user code. So if we have to change our test code because the behavior of the implementation changed, that means our users will have to change their code as well. That's not good 😅 when users upgrade, they could be inadvertently introducing bugs.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@armanbilge For CforSuite I was getting similar failures to #1343 on current versions of Java 8 only. Tested with an old JDK 8 and it wasn't an issue. My guess is there is some change in Java 8's closure expansion? After a bunch of trial and error explicitly declaring a local val seems to fix it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For NRootSuite getting Munit test timeouts running on CI for Native platform. (Running on local workstation is passing). Munit's test timeout setting cannot be changed for scala-native platform. Reduced the precision for Native platform tests. If this is acceptible?

@arashi01 arashi01 changed the title WIP: Scala native 0.5 Scala native 0.5 Feb 2, 2025
@arashi01
Copy link
Author

Closing this as a duplicate of #1343

@arashi01 arashi01 closed this Apr 24, 2025
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

Successfully merging this pull request may close these issues.

Scala Native 0.5

2 participants