-
Notifications
You must be signed in to change notification settings - Fork 90
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
Cross publish native #477
Cross publish native #477
Conversation
munit/non-jvm/src/main/scala/munit/internal/junitinterface/CustomFingerprint.scala
Show resolved
Hide resolved
454092b
to
32b32d2
Compare
project/plugins.sbt
Outdated
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.6.0") | ||
|
||
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.1.0") | ||
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.3-RC2") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can drop the -RC2
now 😃
@sideeffffect @gabro I'll answer to #488 here. There's a problem with scalacheck - there is no scalacheck published for Scala 3 & Native 0.4.x, see maven. I tried various tricks with @sideeffffect if you want you can play with it to get There is a PR to support scala-native Scala 3 in scalacheck repo typelevel/scalacheck#868. Unfortunately, it's waiting for maintainers to look at it. |
I see 3 options:
@gabro Are you in favor of any option? |
Well if we have a viable workaround, sure, but it really depends on whether you or someone else can find it. Reaching out to Typelevel about the status of Scalacheck and getting that PR merged upstream would be the preferable option for sure, while I'm not really keen on the idea of releasing MUnit without full Scalacheck support. |
I think I've also hit this issue [error] Modules were resolved with conflicting cross-version suffixes in ProjectRef(uri("file:/home/ondra/Projects/sbt-locales/"), "apiNative"):
[error] org.scala-native:windowslib_native0.4 _3, _2.13
... Please read more here: |
Note, there is also a problem with scala-native itself you would need to workaround: scala-native/scala-native#2543 |
For a workaround for the
issue, see cquiroz/sbt-locales#190 |
Using an inline conditional to work around issue scala-native/scala-native#2543 would be possible:
|
I spoke with Wojciech and there should be the Scala Native release at the end of this week. That release will contain fixes for problems spotted here, so I'll wait for it. |
Do you mean for When a widely-used library (such as scalacheck) is depended on with For an example of how this plays out, I strongly recommend you read this thread. tl;dr scala-js-dom and all its downstream users (very nearly the entire Scala.js ecosystem) had to do a breaking version jump. Further reading:
|
@armanbilge thanks for this information. Just to confirm, the preferable solution is waiting until scalacheck is published properly for scala-native/scala3? In every other approach, munit ends up depending on the |
Yes, exactly. Preferable, as in doesn't break the ecosystem 😉 |
I just merged some PRs in the ScalaCheck repo that may help get things moving again. |
@SethTisue this PR still needs typelevel/scalacheck#868 (or equivalent) to be merged & new version released |
@kpodsiad how would munit feel about scalacheck bumping to 3.1 on all platforms? See discussion in typelevel/scalacheck#868 (comment). |
@armanbilge I'm afraid that I'm not the right person to ask. @olafurpg @gabro could you share your opinion as creators and maintainers? |
IIUC this would only affect MUnit + Scalacheck on Scala Native. If that's the case then I think it's fine (I'm assuming we can keep using the current version of Scalacheck for jvm/js targets in order to preserve compatibility with 3.0) The only drawback is that downstream libraries targeting e.g. jvm and native would need to do the same (either depend on different versions of MUnit or break compatibility with 3.0) I'll let @olafurpg call the shots, but it wouldn't be a terrible thing in my opinion |
No objections from me to drop 3.0 support |
one would assume so (I did too), but the assumption was called into question by @armanbilge at typelevel/scalacheck#868 (comment) , where he wrote:
how strong an objection that is, I'm not sure — if we run into trouble, would it be minor trouble we could work around, or really serious trouble? anyway, I hope that clarifies why Arman chose this phrasing above:
note the "on all platforms". |
No one's talked me down, so let's escalate 😉 |
Scalacheck has now published a snapshot with Scala 3 / native support! I expect a stable release is imminent. |
Drop 3.0.x and pretend it never existed, use 3.1.x for JVM, JS and Native platforms
Scala 3 doesn't allow to call method with parentheses without them. Normally class can extends trait/interface and overwrite their def's using val/override val no matter if def was declared with or without parentheses. However for Scala 3 this is no llonger true. This PR uses a workaround with underscores.
627f807
to
0c156f0
Compare
@armanbilge Could you help me with JS tests? They suddenly started failing after I bumped scala-js to the |
You're running into the fixes with compatibility concerns about regular expressions in Scala.js 1.7.0. There are suggested strategies on how to avoid This is not my repo, but I would humbly suggest upgrading Scala.js in a separate PR to be able to address these changes independently of the larger changes in this PR. |
It seems that the problematic regular expressions is at munit/tests/shared/src/test/scala/munit/BaseFrameworkSuite.scala Lines 85 to 86 in 36aeb75
This regexp doesn't even use ^ nor $ , and is only used with replaceAll (so not any anchored situation). The MULTILINE flag has no effect in that case, so it can safely be removed without any other change.
|
@kpodsiad does Seb's suggestion fix it (thank you!)? Otherwise I'll try and looking into it a bit later, I would really like to unblock this :) |
@armanbilge I'll try to look at this tomorrow or, more probably, next week. Because of it seems like I need to either:
|
Hum, if I understand #477 (comment) correctly you just need to remove that Ok, I'll give it a try. |
Woops, I also see that this PR is targeting |
Ok, put up a PR at: |
Hum, the multiline flag is needed. The suggestion to bump the ES version for tests-only would work without affecting downstreams, but it would prevent your tests from being able to catch uses of ES2018 features in the published code. Which is not so great. scalaJSLinkerConfig ~= { _.withESFeatures(_.withESVersion(ESVersion.ES2018)) } Update: my bad, the regex was different in 0.7.29 which is why MULTILINE was required. Seb is right, as always 😉 |
@olafurpg approval will be gladly welcomed to fulfill formalities ;) |
Woops, fyi we've got conflicts now. |
Sorry, merge conflicts are my fault. I'll resolve those and then merge once CI passes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After some discussion in Discord yesterday we're going to go ahead with this targeting 1.0 and soon cut a stable v1.0
These changes look reasonable to me, and CI is a nice shade of green :)
An attempt to cross publish munit-native & rest to Scala 3.
Needs Scala 3.1.1 to be released, otherwise macro mixing in MacroCompat2 won't work. It fails with the
Experimental erased may only be used with a nightly or snapshot version of the compiler
- see scala/scala3#13795 for more details.