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

Publish scala2-library-tasty-experimental #19588

Merged
merged 1 commit into from
Mar 11, 2024

Conversation

nicolasstucki
Copy link
Contributor

@nicolasstucki nicolasstucki commented Feb 1, 2024

We will start publishing org.scala-lang::scala2-library-tasty-experimental. This is not considered fully stable.

We publish it to allow users to depend on it for stabilization purposes. Once this version of the library is considered fully stable it will become a default dependency of any Scala build.

Example usage in SBT

libraryDependencies += "org.scala-lang" %% "scala2-library-tasty-experimental" % scalaVersion.value

Behaviour changes

In general, nothing should when compiling against this version of the standard library. If something changes it should be flagged. But this version of the library has more information about the code, which can lead to new warnings (and maybe errors).

  • Better pure expression detection, for example: pure trait initialization
  • More information for the initialization checker. It might catch more errors that involve the initialization of library classes.

@nicolasstucki nicolasstucki added needs-minor-release This PR cannot be merged until the next minor release stat:do not merge discussion labels Feb 1, 2024
@nicolasstucki
Copy link
Contributor Author

We need to test this on the open community build before we can merge. @WojciechMazur will tweet the community build scripts to allow testing this.

@WojciechMazur
Copy link
Contributor

WojciechMazur commented Feb 3, 2024

We've tested 1553 projects, 1483 of them were hinted to use a scala2-library-tasty dependency - best effort, applied to sbt and scala-cli projects only. 94 projects were already failing in latest nightly version.

In the remaining 1389 projects, we've found 4 compilation issues existing only when scala2-library-tasty is present on classpath - these projects compile successfully if this dependency is missing or when using nightly version of compiler

Project Build logs Notes
paoloboni/binance-scala-client https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21186518648 No given instance of type ... But given instance derived in object QueryParamsConverter does not match type See paoloboni/binance-scala-client#466
outr/spice https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21185548243 value += is not a member of Map[String, String]. See #19616 and outr/spice#142
purplekingdomgames/ultraviolet https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21185103003 Exception occurred while executing macro expansion: ... A UBO field was misread See PurpleKingdomGames/ultraviolet#108
zio/zio-protoquill https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21184526108 macro ==== Tree cannot be parsed to 'Ast' ==== See zio/zio-protoquill#424

Full list of failing projects, some of these might be affected as well, but we cannot confirm that in reasonable ammount of time due to other existing regressions.

Projects failing in 3.4.1-RC1-bin-bed2b3fa7252a4bc30473d2e2b8e9847f2697a8b-SNAPSHOT
By build tool:

  • mill: 4 (3.88%)
  • scala-cli: 3 (2.91%)
  • unknown: 1 (0.97%)
  • sbt: 95 (92.23%)
Tool Tasks Project name Build logs
mill Compilation joan38/kubernetes-client https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21186517754
mill Compilation molarmanful/sclin https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21186121305
mill Compilation otavia-projects/otavia https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21184676915
mill Tests jodersky/redicl https://github.com/VirtusLab/community-build3/actions/runs/7767562786/job/21184539636
sbt Compilation akka/akka https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21184519303
sbt Compilation analogweb/analogweb-scala https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21186108306
sbt Compilation andyglow/typesafe-config-scala https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21184522780
sbt Compilation apache/incubator-pekko https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21184519694
sbt Compilation apache/incubator-pekko-connectors https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21184519737
sbt Compilation armanbilge/gcp4s https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21186410506
sbt Compilation atedeg/mdm https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21186515386
sbt Compilation babylonhealth/lit-fhir https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21184522137
sbt Compilation beangle/otk https://github.com/VirtusLab/community-build3/actions/runs/7767562786/job/21184990409
sbt Compilation carlos-verdes/zio-arangodb https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21186583547
sbt Compilation cequence-io/openai-scala-client https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21184674886
sbt Compilation cequence-io/pinecone-scala https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21184523994
sbt Compilation ciaraobrien/dottytags https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21185097806
sbt Compilation circe/circe https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21186248885
sbt Compilation devsisters/shardcake https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21186115871
sbt Compilation dfianthdl/dfiant https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21185301761
sbt Compilation dobrynya/zio-jms https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21185098300
sbt Compilation flink-extended/flink-scala-api https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21185654574
sbt Compilation foldables-io/skunk-tables https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21186117383
sbt Compilation giiita/refuel https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21184527922
sbt Compilation gzoller/scalajack https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21185224765
sbt Compilation haifengl/smile https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21184522687
sbt Compilation iheartradio/ficus https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21184528322
sbt Compilation itv/quartz4s https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21185655698
sbt Compilation j5ik2o/akka-persistence-s3 https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21184528568
sbt Compilation jchapuis/fs2-kafka-mock https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21186249096
sbt Compilation jcouyang/meow https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21185100080
sbt Compilation jd557/minart https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21185100418
sbt Compilation johnhungerford/generic-schema https://github.com/VirtusLab/community-build3/actions/runs/7767562786/job/21184533645
sbt Compilation julianpeeters/dc10-cats https://github.com/VirtusLab/community-build3/actions/runs/7767562786/job/21185129787
sbt Compilation julianpeeters/dc10-sbt https://github.com/VirtusLab/community-build3/actions/runs/7767562786/job/21185129894
sbt Compilation julianpeeters/dc10-scalaq https://github.com/VirtusLab/community-build3/actions/runs/7767562786/job/21185129943
sbt Compilation kalin-rudnicki/harness https://github.com/VirtusLab/community-build3/actions/runs/7767562786/job/21184534467
sbt Compilation kamon-io/kamon-http4s https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21186517904
sbt Compilation kory33/s2mc-test https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21186120522
sbt Compilation kostaskougios/terminal21-restapi https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21186343677
sbt Compilation mjakubowski84/parquet4s https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21185872686
sbt Compilation narma/zio-docker https://github.com/VirtusLab/community-build3/actions/runs/7767562786/job/21184539384
sbt Compilation nrinaudo/kantan.parsers https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21185102391
sbt Compilation outr/spice https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21185548243
sbt Compilation paoloboni/binance-scala-client https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21186518648
sbt Compilation playframework/anorm https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21185873501
sbt Compilation plokhotnyuk/jsoniter-scala https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21186122813
sbt Compilation purplekingdomgames/ultraviolet https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21185103003
sbt Compilation reactivemongo/reactivemongo-play-json https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21185658118
sbt Compilation rmgk/slips https://github.com/VirtusLab/community-build3/actions/runs/7767562786/job/21184542015
sbt Compilation rssh/dotty-cps-async https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21184531158
sbt Compilation sageserpent-open/americium https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21186124194
sbt Compilation scala-ts/scala-ts https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21184531720
sbt Compilation scalacenter/tasty-query https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21185103469
sbt Compilation staeff777/scalaveusz https://github.com/VirtusLab/community-build3/actions/runs/7767562786/job/21184544127
sbt Compilation tarao/record4s https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21186344749
sbt Compilation tomasmikula/libretto https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21185104542
sbt Compilation tomasmikula/nutcracker https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21185303084
sbt Compilation typelevel/kittens https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21185376699
sbt Compilation typelevel/spotted-leopards https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21185226385
sbt Compilation valdemargr/gql https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21186416344
sbt Compilation virtuslab/avocado https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21185661332
sbt Compilation xuwei-k/scala3profile https://github.com/VirtusLab/community-build3/actions/runs/7767562786/job/21184545309
sbt Compilation y-yu/excel-reads https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21186128368
sbt Compilation zio/caliban-deriving https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21185105577
sbt Compilation zio/interop-cats https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21185875546
sbt Compilation zio/zio https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21184679584
sbt Compilation zio/zio-config https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21185548998
sbt Compilation zio/zio-prelude https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21185662204
sbt Compilation zio/zio-protoquill https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21184526108
sbt Compilation zio/zio-redis https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21186128723
sbt Compilation,Publish monix/monix-connect https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21186518521
sbt Tests aaronp/args4c https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21184520338
sbt Tests beangle/db https://github.com/VirtusLab/community-build3/actions/runs/7767562786/job/21184528390
sbt Tests codacy/scalaj-http https://github.com/VirtusLab/community-build3/actions/runs/7767562786/job/21184528964
sbt Tests endpoints4s/play https://github.com/VirtusLab/community-build3/actions/runs/7767562786/job/21184530387
sbt Tests fabiopinheiro/scala-did https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21186584174
sbt Tests flxj/platdb https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21185098893
sbt Tests guardian/etag-caching https://github.com/VirtusLab/community-build3/actions/runs/7767562786/job/21184534376
sbt Tests j5ik2o/event-store-adapter-scala https://github.com/VirtusLab/community-build3/actions/runs/7767562786/job/21184538525
sbt Tests j5ik2o/pekko-persistence-dynamodb https://github.com/VirtusLab/community-build3/actions/runs/7767562786/job/21184538718
sbt Tests joernio/joern https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21184523069
sbt Tests kevin-lee/extras https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21185547903
sbt Tests kevin-lee/refined4s https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21186517995
sbt Tests kostaskougios/functions-remote https://github.com/VirtusLab/community-build3/actions/runs/7767562786/job/21184541246
sbt Tests reactivemongo/reactivemongo-bson https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21185548467
sbt Tests softwaremill/tapir https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21184525904
sbt Tests takapi327/ldbc https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21186415892
sbt Tests tminglei/slick-pg https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21186345086
sbt Tests zaneli/scalikejdbc-athena https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21185769981
sbt Tests zio/zio-ftp https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21185661788
sbt Tests,Scaladoc,Publish akka/akka-http https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21184519393
sbt Publish antognini/type-safe-equality https://github.com/VirtusLab/community-build3/actions/runs/7767562786/job/21184526966
sbt Publish davenverse/mules-http4s https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21186115576
sbt Publish devlaam/leucine https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21184526737
sbt Publish kamon-io/kamon https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21186120210
sbt Scaladoc scalatest/scalatestplus-junit5 https://github.com/VirtusLab/community-build3/actions/runs/7767562786/job/21184546469
sbt Scaladoc,Publish hnaderi/yaml4s https://github.com/VirtusLab/community-build3/actions/runs/7767562786/job/21184536794
sbt Scaladoc,Publish http4s/http4s-finagle https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21185099513
scala-cli Compilation bishabosha/enum-extensions https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21184523134
scala-cli Compilation,Tests kuceramartin/tyqu https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21184529431
scala-cli Compilation,Tests martinhh/scalacheck-derived https://github.com/VirtusLab/community-build3/actions/runs/7767562786/job/21184543065
unknown Other scalacenter/scala-debug-adapter https://github.com/VirtusLab/community-build3/actions/runs/7767560782/job/21185225491

@nicolasstucki
Copy link
Contributor Author

nicolasstucki commented Feb 6, 2024

I would say that the results in #19588 (comment) look pretty good. There is one failure with the Map.+= that is clearly a bug (#19616). The other seems to be macro related, which might be from a macro implementation that may have gotten confused from extra information or changes in some flags (such as the Scala2x flag). Further investigation is needed, we might need some help from the authors of those libraries.

I would argue that this library is stable enough to be published in 3.5 but not used by default. This would allow other libraries/applications that could not be tested with the community build to test it (such as private projects).

@nicolasstucki
Copy link
Contributor Author

The project was renamed to scala2-library-tasty-experimental in #19788.

@nicolasstucki nicolasstucki changed the title Publish scala2-library-tasty Publish scala2-library-tasty-experimental Feb 27, 2024
@nicolasstucki
Copy link
Contributor Author

Now that the project is explicitly identified as experimental we do not need to wait for a minor release.

@nicolasstucki nicolasstucki removed stat:do not merge needs-minor-release This PR cannot be merged until the next minor release labels Feb 27, 2024
@sjrd sjrd merged commit 0c9dcff into scala:main Mar 11, 2024
19 checks passed
@sjrd sjrd deleted the publish-scala2-library-tasty branch March 11, 2024 15:30
@nicolasstucki
Copy link
Contributor Author

This was correctly published for 3.4.2-RC1-bin-20240311-02c2a6e-NIGHTLY.

I tested it with

$ sbt new scala/scala3.g8 
name [Scala 3 Project Template]: 
Template applied in ./scala-3-project-template
$ cd scala-3-project-template

Then modified build.sbt with

- val scala3Version = "3.4.0"
+ val scala3Version = "3.4.2-RC1-bin-20240311-02c2a6e-NIGHTLY"

  lazy val root = project
    .in(file("."))
    .settings(
      name := "Scala 3 Project Template",
      version := "0.1.0-SNAPSHOT",

      scalaVersion := scala3Version,

+     libraryDependencies += "org.scala-lang" %% "scala2-library-tasty-experimental" % scalaVersion.value,
      libraryDependencies += "org.scalameta" %% "munit" % "0.7.29" % Test
    )

To check that the TASTy library is loaded I modified src/main/scala/Main.scala

@main def hello(): Unit =
+ s"test"
  println("Hello world!")
  println(msg)

def msg = "I was compiled by Scala 3. :)"

Compiling this file with the TASTy library will show a new warning

[warn] -- [E129] Potential Issue Warning: ./src/main/scala/Main.scala:2:2 
[warn] 2 |  s"test"
[warn]   |  ^^^^^^^
[warn]   |  A pure expression does nothing in statement position
[warn]   |
[warn]   | longer explanation available when compiling with `-explain`

@Kordyjan Kordyjan added this to the 3.4.2 milestone Mar 28, 2024
Linyxus added a commit that referenced this pull request May 6, 2024
Similar to #19588.

We will start publishing
`org.scala-lang::scala2-library-cc-tasty-experimental`. This is __not
considered fully stable__.

Example usage in SBT
```scala
libraryDependencies += "org.scala-lang" %% "scala2-library-cc-tasty-experimental" % scalaVersion.value
```
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