-
Notifications
You must be signed in to change notification settings - Fork 201
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
bugfix: Never set empty Scala JS version from sbt #2161
Conversation
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.
Maybe findVersion
should be renamed findPluginVersion
.
@@ -777,8 +777,12 @@ object BloopDefaults { | |||
} | |||
} else if (pluginLabels.contains(ScalaJsPluginLabel)) { | |||
Def.task { | |||
val emptyScalaJs = Config.JsConfig.empty | |||
val scalaJsVersion = findVersion(libraryDeps, "org.scala-js").getOrElse(emptyScalaJs.version) | |||
val emptyScalaJs = Config.JsConfig.empty |
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.
Do we still need this?
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.
I just set all the default values and removed this, it should be more obvious now.
This is "less bad" than looking at the version of the compiler plugin, for sure. However it's still not what sbt-scalajs itself will do. What matters is the version of the linker. You can look at the version of the |
Hmm... I tried different ways, but I can get that setting in the Bloop plugin itself. How would you normally access it from a different plugin? I tried looking in globalSettings of the Scala JS plugin, but the setting is not initialized. I also tried faking the setting key and doing:
but that throws an exception:
I am thinking of leaving the current mechanism as I don't have any idea how to do it properly :/ |
In another plugin, or in your sbt build itself, you would read the constant value |
PReviously, we were always expecting scala JS plugin to find the correct version of Scala JS, however I think for Scala 3 it's not a plugin, which is causing the version field to be empty. Now, we look for the scala-js library instead and default to the latest known scala js version.
008ebfb
to
31f1eee
Compare
Renamed to |
But I would need to depend explicitely on the ScalaJS plugin, no? |
That seems to work, but then I need find the version from the file path, which is another complication. I think the current approach should do for the time being and it at least fixes the issue at hand |
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.
LGTM
Can someone please make a release? I'm seeing
on 1.5.11 and it seems like this should've solved it :) |
I want to include some sbt fixes still, so will release after that. Sorry for the delay! |
This remains an issue for me in
|
Did you use bloop-sbt 1.5.12 to export the json definition also? Do you have a reproduction? |
Apparently not, thanks for pointing that out! |
There is a small regression, so we haven't updated it in Metals yet. |
Previously, we were always expecting scala JS plugin to find the correct version of Scala JS, however I think for Scala 3 it's not a plugin, which is causing the version field to be empty. Now, we look for the scala-js library instead and default to the latest known scala js version.
@sjrd would this be a correct assumption?