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

Scala Native 0.5.x #508

Merged
merged 24 commits into from
Jun 6, 2024
Merged

Scala Native 0.5.x #508

merged 24 commits into from
Jun 6, 2024

Conversation

sideeffffect
Copy link

@sideeffffect sideeffffect commented May 11, 2024

# Conflicts:
#	.github/workflows/ci.yml
#	build.sbt
#	project/plugins.sbt
@sideeffffect
Copy link
Author

Any idea why Scala Native tests are always failing with this? @cquiroz @WojciechMazur

[error] Test runner interrupted by fatal signal 11
[warn] Force close java.lang.RuntimeException: Process /home/runner/work/scala-java-time/scala-java-time/tests/native/target/scala-2.12/tests-test finished with non-zero value 139 (0x8b)

I'm getting a bit desperate here...

@cquiroz
Copy link
Owner

cquiroz commented Jun 1, 2024

Can't say much, I haven't use native before and since jvm and js run I'd think it is more on the native side.
does signal 11 mean it was interrupted by the github runner?

@WojciechMazur
Copy link

Looks like an issue on SN side, it's basically a segmentation fault. I'll try to minimize and fix it asap

@MateuszKubuszok
Copy link

Cats had the same error typelevel/cats#4585 (review). I am not sure what they did to make it go away

@WojciechMazur
Copy link

A quick update on the segmentation faults:
It was crashing in the Month.range(TemporalField): ValueRange methods when field was null. For some reason there is no null check before field.rangeRefinedBy(this) call to ensure we can call the method on given object - because of that it leads to referencing invalid memory address. Seems like most of range methods are having these kind of issues. I'll try to fix it over the weekend and publish fix in 0.5.3

@WojciechMazur
Copy link

The regression introduced in 0.5.x was fixed, we'd make a release soon - there is 1 more issue reported by the os-lib we'd like to ship as well. scala-native/scala-native#3939

@WojciechMazur
Copy link

0.5.3 with the fix has been released

@@ -160,6 +162,7 @@ lazy val core = crossProject(JVMPlatform, JSPlatform, NativePlatform)
)
)
.nativeSettings(
scalacOptions += "-P:scalanative:genStaticForwardersForNonTopLevelObjects",

Choose a reason for hiding this comment

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

Shouldn't it be different for Scala 3?

(CrossVersion.partialVersion(scalaVersion.value) match {
    case Some((2, _)) => "-P:scalanative:genStaticForwardersForNonTopLevelObjects"
    case _ => "-scalanative-genStaticForwardersForNonTopLevelObjects"
  })

Copy link
Author

Choose a reason for hiding this comment

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

Nope, that doesn't work. Has to be like it is currently in the PR. The tests being green are the proof :)

Choose a reason for hiding this comment

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

'-P' stands for prefix for compiler settings. In case of Scala.js the compiler plugin setting in Scala 2 was elevated to standalone setting in Scala 3 after Scala.js backend become a part of compiler.
Scala Native is not going to become part of compiler at least until 1.0

@sideeffffect
Copy link
Author

@cquiroz we can merge 🎉

Copy link
Owner

@cquiroz cquiroz left a comment

Choose a reason for hiding this comment

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

Thanks a lot for getting this through

@cquiroz cquiroz merged commit a19e09a into cquiroz:master Jun 6, 2024
11 checks passed
@sideeffffect sideeffffect deleted the scala-native-0.5.x branch June 7, 2024 09:22
@sideeffffect
Copy link
Author

Thanks for merging! Could you please make a release @cquiroz ? 🙏

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 release
5 participants