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.4.0 #751

Merged
merged 4 commits into from
Jan 22, 2021
Merged

Scala Native 0.4.0 #751

merged 4 commits into from
Jan 22, 2021

Conversation

larsrh
Copy link
Contributor

@larsrh larsrh commented Jan 19, 2021

If this PR goes through, I'll back-publish for the last ScalaCheck release.

Should we drop 0.3.9 support then, too?

@SethTisue
Copy link
Member

SethTisue commented Jan 20, 2021

I vote for dropping 0.3.9. Additional targets are enough of a maintenance burden as-is, without also having to worry about multiple versions of those targets.

Even if you don't buy that general argument, I would argue re 0.3.9 specifically that 0.3.9 is so old and remained 2.11-only for so long that it really isn't worth supporting.

@larsrh
Copy link
Contributor Author

larsrh commented Jan 20, 2021

Turns out they aren't even source compatible:

[error] /home/runner/work/scalacheck/scalacheck/native/src/main/scala/org/scalacheck/Platform.scala:14:8: object PreloadedClassLoader is not a member of package scala.scalanative.testinterface
[error] import scala.scalanative.testinterface.PreloadedClassLoader
[error]        ^
[error] /home/runner/work/scalacheck/scalacheck/native/src/main/scala/org/scalacheck/Platform.scala:27:25: not found: type PreloadedClassLoader
[error]     loader.asInstanceOf[PreloadedClassLoader].loadPreloaded(name)
[error]                         ^
[error] /home/runner/work/scalacheck/scalacheck/native/src/main/scala/org/scalacheck/Platform.scala:14:40: Unused import
[error] import scala.scalanative.testinterface.PreloadedClassLoader
[error]                                        ^

So either I'll have to cheat when back-publishing, or cry.

@gabro
Copy link
Contributor

gabro commented Jan 20, 2021

Thanks @larsrh for working on this, this should also unblock support for 0.4.0 support in MUnit (across 2.11, 2.12 and 2.13)!

About dropping 0.3.9, I think it would be great to nudge people out of the 2.11 ecosystem, so that we can finally move on (like in Metals, for example, where 2.11 support is largely there for Scala Native projects)

@larsrh
Copy link
Contributor Author

larsrh commented Jan 20, 2021

@WojciechMazur if you could give us some pointers how this code should look like nowadays, it would be much appreciated!

@gabro
Copy link
Contributor

gabro commented Jan 20, 2021

@larsrh I'm looking at similar errors in MUnit and probably this helps scala-native/scala-native@3077e74

@gabro
Copy link
Contributor

gabro commented Jan 20, 2021

For reference, here's the equivalent fix in MUnit (just tested, it runs correctly) https://github.com/scalameta/munit/pull/298/files#diff-16de51ca52ec70a26d1950ea7aa6c11432074b200e28d9316cba1077dbaadf3a

@WojciechMazur
Copy link

WojciechMazur commented Jan 20, 2021

I also personally would suggest dropping 0.3.x. Instead of using PreloadedClassLoader directly in 0.3.9 you could use org.scalajs.testinterface.TestUtils (deprecated since 0.4.0), it's boundled in test-interface
You can check TestUtils API in this link

@larsrh
Copy link
Contributor Author

larsrh commented Jan 21, 2021

I've dropped Scala Native 0.3.9, Scala 2.11, changed the build accordingly, but left the broken code intact. To be honest, I don't understand what I need to change in there. If anyone could give me a patch, that'd be much appreciated.

@gabro
Copy link
Contributor

gabro commented Jan 21, 2021

I can take a look.

About 2.11, why the drop?

@larsrh
Copy link
Contributor Author

larsrh commented Jan 21, 2021

Why not? Scala Native is the only reason why anyone still supports it, and that reason just got void.

@gabro
Copy link
Contributor

gabro commented Jan 21, 2021 via email

@larsrh
Copy link
Contributor Author

larsrh commented Jan 21, 2021

Sounds plausible, but I was hoping to sneakily back-publish Scala Native support for the latest ScalaCheck release, so you won't even notice downstream 😉

@SethTisue
Copy link
Member

About 2.11, why the drop?

my take on this is: because supporting old versions of things is death by a thousand papercuts for unpaid OSS maintainers

@gabro
Copy link
Contributor

gabro commented Jan 22, 2021

@SethTisue 100% agree, I was just wondering on the opportunity of doing so while also dropping a target version at the same time.

But back-publishing resolves this, so no objections on my end 🚀

@larsrh in the meantime, I made it compile, but I'm hitting a runtime crash when running the tests due to how the new reflective instantiation works.

I'll dig a bit more into it later today

@gabro gabro mentioned this pull request Jan 22, 2021
@gabro
Copy link
Contributor

gabro commented Jan 22, 2021

All green ✅ 🎉

@larsrh larsrh merged commit ef4ac19 into master Jan 22, 2021
@larsrh larsrh deleted the topic/native-0.4 branch January 22, 2021 11:59
@larsrh
Copy link
Contributor Author

larsrh commented Jan 22, 2021

Thanks a ton @gabro!

@larsrh
Copy link
Contributor Author

larsrh commented Jan 22, 2021

Seems like it also builds for 1.15.2. Running the release right now.

@larsrh
Copy link
Contributor Author

larsrh commented Jan 22, 2021

Finally the artifacts appear to have been released. Sonatype was exceptionally slow today.

@gabro
Copy link
Contributor

gabro commented Jan 22, 2021

Yep, I can confirm I've successfully downloaded them in MUnit, thanks!

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.

4 participants