typelevel / sbt-typelevel

Let sbt work for you.
https://typelevel.org/sbt-typelevel/
Apache License 2.0
164 stars 44 forks source link

scalacOptions don't work properly when combined with sbt-projectmatrix #464

Open etspaceman opened 1 year ago

etspaceman commented 1 year ago

Per a discussion with @armanbilge - we noticed that the crossScalaVersions will only display 1 scalaVersion when combined with the sbt-projectMatrix plugin. This means that this conditional is met, which is incorrect for projects that also contain Scala 2 cross builds:

https://github.com/typelevel/sbt-typelevel/blob/series/0.4/settings/src/main/scala/org/typelevel/sbt/TypelevelSettingsPlugin.scala#L153

satorg commented 1 year ago

Could you elaborate a bit more please on how to reproduce this?

armanbilge commented 1 year ago

@satorg here's a reproducer: https://github.com/armanbilge/scala-native-config-brew/blob/656793d295782ca893e6afd500c347161d1e61b1/build.sbt

If you open that project in sbt and do show core3/scalacOptions, you will see it is setting compiler flags that don't make sense for code that is cross-compiling with Scala 2 (e.g. the underscore mode for kind-projector).