lampepfl / gears

A strawman for a low-level async library in Scala 3.
https://lampepfl.github.io/gears/
Apache License 2.0
256 stars 26 forks source link

Scala Native 0.5 is released, a new release of gears #64

Closed He-Pin closed 6 months ago

He-Pin commented 7 months ago

refs: https://scala-native.org/en/stable/changelog/0.5.x/0.5.0.html

natsukagami commented 7 months ago

I wonder if munit is going to migrate to 0.5.0 soon, so I no longer have to maintain a 1 line change fork :smile_cat:

He-Pin commented 7 months ago

I wonder if munit is going to migrate to 0.5.0 soon, so I no longer have to maintain a 1 line change fork :smile_cat:

Is there any particular reason you choose munit?

natsukagami commented 7 months ago

No particular reason to be honest. Maybe I could move to something simpler. Do you have any suggestions that work cross platform?

Le jeu. 11 avr. 2024 à 18:30, He-Pin(kerr) @.***> a écrit :

I wonder if munit is going to migrate to 0.5.0 soon, so I no longer have to maintain a 1 line change fork 😸

Is there any particular reason you choose munit?

— Reply to this email directly, view it on GitHub https://github.com/lampepfl/gears/issues/64#issuecomment-2050076277, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACFEK2J37645MO2465SAYJLY423CHAVCNFSM6AAAAABGCTRICWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANJQGA3TMMRXG4 . You are receiving this because you commented.Message ID: @.***>

SethTisue commented 7 months ago

I think it's safe to assume that MUnit will support Native 0.5 soon, fsvo “soon”. I've opened https://github.com/scalameta/munit/issues/760 to request it

tgodzik commented 7 months ago

I back published for 1.0.0-M11. Let me know if you need any other version.

natsukagami commented 7 months ago

@tgodzik thanks! I tried using the published version and got an error stating that the NIR output was incompatible. sbt gives org.scalameta:munit_native0.5_3:1.0.0-M11 is the package I'm depending on.

The error is

assertion failed: Can't read binary-incompatible version of NIR from 'MUnitRunner$ForeachUnsafeResult.nir' (expected compat=6, got 5; expected revision=10, got 9)

This seems like for some reason the NIR version is still from scala-native 0.4 for some reason...

Full stack trace of the error (last rootNative / Test / nativeLink from sbt)
[debug] Config(
[debug]  - baseDir:          /home/nki/Projects/gears/native/target/scala-3.3.3
[debug]  - testConfig:       true
[debug]  - workDir:          /home/nki/Projects/gears/native/target/scala-3.3.3/native-test
[debug]  - moduleName:       gears
[debug]  - baseName:         gears
[debug]  - artifactName:     gears-test
[debug]  - artifactPath:     /home/nki/Projects/gears/native/target/scala-3.3.3/gears-test
[debug]  - buildPath:        /home/nki/Projects/gears/native/target/scala-3.3.3/native-test/scala.scalanative.testinterface.TestMain-test
[debug]  - mainClass:        Some(scala.scalanative.testinterface.TestMain)
[debug]  - classPath:        List(/home/nki/Projects/gears/native/target/scala-3.3.3/test-classes
[debug]                      /home/nki/Projects/gears/native/target/scala-3.3.3/classes
[debug]                      /home/nki/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.3.3/scala3-library_3-3.3.3.jar
[debug]                      /home/nki/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-native/test-interface_native0.5_3/0.5.1/test-interface_native0.5_3-0.5.1.jar
[debug]                      /home/nki/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-native/scala3lib_native0.5_3/3.3.3%2B0.5.1/scala3lib_native0.5_3-3.3.3%2B0.5.1.jar
[debug]                      /home/nki/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-native/nativelib_native0.5_3/0.5.1/nativelib_native0.5_3-0.5.1.jar
[debug]                      /home/nki/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-native/clib_native0.5_3/0.5.1/clib_native0.5_3-0.5.1.jar
[debug]                      /home/nki/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-native/posixlib_native0.5_3/0.5.1/posixlib_native0.5_3-0.5.1.jar
[debug]                      /home/nki/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-native/windowslib_native0.5_3/0.5.1/windowslib_native0.5_3-0.5.1.jar
[debug]                      /home/nki/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-native/javalib_native0.5_3/0.5.1/javalib_native0.5_3-0.5.1.jar
[debug]                      /home/nki/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-native/auxlib_native0.5_3/0.5.1/auxlib_native0.5_3-0.5.1.jar
[debug]                      /home/nki/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scalameta/munit_native0.5_3/1.0.0-M11/munit_native0.5_3-1.0.0-M11.jar
[debug]                      /home/nki/.cache/coursier/v1/https/repo1.maven.org/maven2/com/sourcegraph/semanticdb-javac/0.9.9/semanticdb-javac-0.9.9.jar
[debug]                      /home/nki/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.13/scala-library-2.13.13.jar
[debug]                      /home/nki/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-native/test-interface-sbt-defs_native0.5_3/0.5.1/test-interface-sbt-defs_native0.5_3-0.5.1.jar
[debug]                      /home/nki/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-native/junit-runtime_native0.5_3/0.5.1/junit-runtime_native0.5_3-0.5.1.jar
[debug]                      /home/nki/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-native/scalalib_native0.5_2.13/2.13.13%2B0.5.1/scalalib_native0.5_2.13-2.13.13%2B0.5.1.jar)
[debug]  - sourcesClasspath: List()
[debug]  - compilerConfig:   NativeConfig(
[debug]  - baseName:                
[debug]  - clang:                   /nix/store/lnl2zcfs4gd0cj2mpc7744s63babv37g-clang-wrapper-16.0.6/bin/clang
[debug]  - clangPP:                 /nix/store/lnl2zcfs4gd0cj2mpc7744s63babv37g-clang-wrapper-16.0.6/bin/clang++
[debug]  - linkingOptions:          [-L/nix/store/23c1ql0y2cx4817mld3yrw05rnchv9yg-llvm-16.0.6-lib/lib]
[debug]  - compileOptions:          [-I/nix/store/cm7pff6m03irh59rygj6v76jvcbsnpqb-llvm-16.0.6-dev/include, -Qunused-arguments]
[debug]  - targetTriple:            None
[debug]  - GC:                      immix
[debug]  - LTO:                     none
[debug]  - mode:                    debug
[debug]  - buildTarget              Application
[debug]  - check:                   false
[debug]  - checkFatalWarnings:      false
[debug]  - checkFeatures            true
[debug]  - dump:                    false
[debug]  - sanitizer:               none
[debug]  - linkStubs:               false
[debug]  - optimize                 true
[debug]  - incrementalCompilation:  true
[debug]  - multithreading           Some(true)
[debug]  - linktimeProperties:      []
[debug]  - embedResources:          false
[debug]  - resourceIncludePatterns: [**]
[debug]  - resourceExcludePatterns: []
[debug]  - serviceProviders:        []
[debug]  - optimizerConfig:         
[debug]     - maxInlineDepth:    32 functions
[debug]     - smallFunctionSize: 12 instructions
[debug]     - maxCallerSize:     2048 instructions
[debug]     - maxCalleeSize:     256 instructions
[debug] 
[debug]  - semanticsConfig:         SemanticsConfig(
[debug]     - finalFields: Relaxed
[debug]     - strictExternCallSemantics: false
[debug]     )
[debug]  - sourceLevelDebuggingConfig: SourceLevelDebuggingConfig[Disabled]
[debug]     - customSourceRoots:       []
[debug]     - generateFunctionSourcePositions: false
[debug]     - generateLocalVariables:  false
[debug]     )
[debug] )
[debug] )
[info] Total (262 ms)
[error] java.util.concurrent.ExecutionException: Boxed Error
[error]     at scala.concurrent.impl.Promise$.resolver(Promise.scala:87)
[error]     at scala.concurrent.impl.Promise$.scala$concurrent$impl$Promise$$resolveTry(Promise.scala:79)
[error]     at scala.concurrent.impl.Promise$DefaultPromise.tryComplete(Promise.scala:284)
[error]     at scala.concurrent.Promise.complete(Promise.scala:53)
[error]     at scala.concurrent.Promise.complete$(Promise.scala:52)
[error]     at scala.concurrent.impl.Promise$DefaultPromise.complete(Promise.scala:187)
[error]     at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:33)
[error]     at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64)
[error]     at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
[error]     at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
[error]     at java.base/java.lang.Thread.run(Thread.java:1583)
[error] Caused by: java.lang.AssertionError: assertion failed: Can't read binary-incompatible version of NIR from 'MUnitRunner$ForeachUnsafeResult.nir' (expected compat=6, got 5; expected revision=10, got 9).
[error]     at scala.Predef$.assert(Predef.scala:223)
[error]     at scala.scalanative.nir.serialization.Prelude$.readFrom(Prelude.scala:39)
[error]     at scala.scalanative.linker.ClassPath$Impl.$anonfun$classesWithEntryPoints$1(ClassPath.scala:79)
[error]     at scala.scalanative.linker.ClassPath$Impl.$anonfun$classesWithEntryPoints$1$adapted(ClassPath.scala:75)
[error]     at scala.collection.TraversableLike.$anonfun$filterImpl$1(TraversableLike.scala:304)
[error]     at scala.collection.mutable.HashMap.$anonfun$foreach$1(HashMap.scala:149)
[error]     at scala.collection.mutable.HashTable.foreachEntry(HashTable.scala:237)
[error]     at scala.collection.mutable.HashTable.foreachEntry$(HashTable.scala:230)
[error]     at scala.collection.mutable.HashMap.foreachEntry(HashMap.scala:44)
[error]     at scala.collection.mutable.HashMap.foreach(HashMap.scala:149)
[error]     at scala.collection.TraversableLike.filterImpl(TraversableLike.scala:303)
[error]     at scala.collection.TraversableLike.filterImpl$(TraversableLike.scala:297)
[error]     at scala.collection.AbstractTraversable.filterImpl(Traversable.scala:108)
[error]     at scala.collection.TraversableLike.filter(TraversableLike.scala:395)
[error]     at scala.collection.TraversableLike.filter$(TraversableLike.scala:395)
[error]     at scala.collection.AbstractTraversable.filter(Traversable.scala:108)
[error]     at scala.scalanative.linker.ClassPath$Impl.classesWithEntryPoints$lzycompute(ClassPath.scala:75)
[error]     at scala.scalanative.linker.ClassPath$Impl.classesWithEntryPoints(ClassPath.scala:74)
[error]     at scala.scalanative.linker.ClassLoader$FromDisk.$anonfun$classesWithEntryPoints$1(ClassLoader.scala:32)
[error]     at scala.collection.immutable.List.flatMap(List.scala:366)
[error]     at scala.scalanative.linker.ClassLoader$FromDisk.classesWithEntryPoints$lzycompute(ClassLoader.scala:32)
[error]     at scala.scalanative.linker.ClassLoader$FromDisk.classesWithEntryPoints(ClassLoader.scala:31)
[error]     at scala.scalanative.linker.Reach.(Reach.scala:59)
[error]     at scala.scalanative.linker.Reach$.apply(Reach.scala:1166)
[error]     at scala.scalanative.linker.Link$.apply(Link.scala:12)
[error]     at scala.scalanative.build.ScalaNative$.$anonfun$link$3(ScalaNative.scala:45)
[error]     at scala.scalanative.build.Logger.time(Logger.scala:36)
[error]     at scala.scalanative.build.Logger.time$(Logger.scala:33)
[error]     at scala.scalanative.build.Logger$$anon$3.time(Logger.scala:102)
[error]     at scala.scalanative.build.ScalaNative$.$anonfun$link$1(ScalaNative.scala:45)
[error]     at scala.concurrent.Future$.$anonfun$apply$1(Future.scala:659)
[error]     at scala.util.Success.$anonfun$map$1(Try.scala:255)
[error]     at scala.util.Success.map(Try.scala:213)
[error]     at scala.concurrent.Future.$anonfun$map$1(Future.scala:292)
[error]     at scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:33)
[error]     at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:33)
[error]     at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64)
[error]     at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
[error]     at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
[error]     at java.base/java.lang.Thread.run(Thread.java:1583)
[error] (rootNative / Test / nativeLink) java.util.concurrent.ExecutionException: Boxed Error
tgodzik commented 7 months ago

Looks like I broke that release then :/ I was sure if we released with 0.5.0 set it would just work, but it seems somehow it took artifacts compiled with 0.4.x and just put it under 0.5.x

This is becoming more complex since, I can't update munit to 0.5.0 because we depend on scalacheck, which is released with Scala LTS and munit can't update because it is blocked by an issue in LTS

tgodzik commented 7 months ago

I released a new milestone (12 :fearful: ) automatically, so things should work fine.

natsukagami commented 7 months ago

I think it works now, thanks @tgodzik!!

natsukagami commented 6 months ago

And 0.2 is released using scala-native 0.5.1 :tada: