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

Dependencies: Upgrade Scala to 3.3.3 #653

Merged
merged 34 commits into from
Mar 23, 2024
Merged

Dependencies: Upgrade Scala to 3.3.3 #653

merged 34 commits into from
Mar 23, 2024

Conversation

alexklibisz
Copy link
Owner

@alexklibisz alexklibisz commented Mar 17, 2024

Related Issue

Resolves #393

Changes

  • Migrated to Scala 3.3.3 (latest LTS)
  • Replaced dependency on circe-generic-extras with circe-generic because (1) it hasn't been published for Scala 3, (2) I fiddled with the ability to use 2.13 libraries in Scala 3, but that caused some build warnings that were causing intellij to fail to load the project; (3) we're actually only using functionality from circe-generic.
  • Removed dependency on com.klibisz.futil because it's only published for 2.13 and was easier to just replace with a couple utility methods than to cross publish that library for scala 3.
  • Some minor syntactic changes, e.g., adding type annotations, wrapping anonymous function params in parens.
  • One test in PermutationLshModelSuite required rounding some floats that I was comparing, because they were consistently no longer equal at the seventh decimal. I'm not sure how that could be related to Scala 3. I got tired of looking at it and just truncated at the sixth decimal.
  • Had to slightly restructure the VectorMapper class because it was hitting a part of the scala runtime that invoked sun.misc.Unsafe. This was by far the most confusing part of the migration. I spent several hours trying to figure out why we needed to add elevated permissions to access sun.misc.unsafe. It seems to be related to this issue: Runtime code implementing lazy val should not use sun.misc.Unsafe on Java 9+ (JEP-471) scala/scala3#9013. It was particularly confusing because the error is coming from scala.runtime.LazyVals, but I'm not using any LazyVals. Through trial and error, I figured out that converting an object inside an abstract class to a final class inside the same abstract class would circumvent the issue. The alternative would have been to add back several runtime permissions to plugin-security.policy, which I wanted to avoid.

Testing and Validation

Standard CI.

@alexklibisz alexklibisz marked this pull request as ready for review March 18, 2024 15:58
@alexklibisz alexklibisz changed the title Migrate to Scala 3 Dependencies: Upgrade Scala to 3.3.1 Mar 23, 2024
@alexklibisz alexklibisz changed the title Dependencies: Upgrade Scala to 3.3.1 Dependencies: Upgrade Scala to 3.3.3 Mar 23, 2024
@alexklibisz alexklibisz enabled auto-merge (squash) March 23, 2024 22:22
@alexklibisz alexklibisz merged commit 1bbe52c into main Mar 23, 2024
5 checks passed
@alexklibisz alexklibisz deleted the scala3 branch March 23, 2024 22:29
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.

Migrate to Scala 3
1 participant