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

Prioritize scala and kt providers before JavaInfo #1202

Closed
wants to merge 2 commits into from

Conversation

jin
Copy link
Member

@jin jin commented Sep 25, 2019

While scala_library / other Scala rules have JavaInfo as well, their Scala-specific data lives in the scala provider. Proritizing JavaInfo over scala causes the plugin to assume that there are no outputs, hence causing all Scala workspaces to fail to resolve ("No Scala SDK added") #1183

Instead, prioritize kt and scala providers over JavaInfo.

This wasn't an issue previously because we checked for the legacy "java" provider first, which Scala targets do not have, and the conditional successfully fell through.

This fixes #1183.

@ghost ghost closed this in b343686 Sep 25, 2019
@ittaiz
Copy link
Member

ittaiz commented Sep 26, 2019

Thanks! What I don’t understand is what is missing from the JavaInfo rules_scala generates? The scala attribute is more brittle than the canonical JavaInfo provider

@ittaiz
Copy link
Member

ittaiz commented Sep 26, 2019

Or is it just about having some sort of “signal” to the plugin that this is scala core?

@brendandouglas
Copy link
Contributor

It's an actual difference between target[JavaInfo] and target.scala. We treat them identically otherwise.

The aspect otherwise doesn't distinguish between java and scala targets, and the plugin only uses the rule kind to distinguish between them.

@ittaiz
Copy link
Member

ittaiz commented Sep 27, 2019

Wow. That’s bad. Sounds like on rules_scala side. I’ll run the aspect and try to print debug the differences between the two. Thanks!

aradchykov pushed a commit to aradchykov/intellij that referenced this pull request Oct 6, 2019
…j PR import bazelbuild#1202)

While `scala_library` / other Scala rules have `JavaInfo` as well, their Scala-specific data lives in the `scala` provider. Proritizing `JavaInfo` over `scala` causes the plugin to assume that there are no outputs, hence causing all Scala workspaces to fail to resolve ("No Scala SDK added") bazelbuild#1183

Instead, prioritize `kt` and `scala` providers over `JavaInfo`.

This wasn't an issue previously because we c[hecked for the legacy "java" provider first](bazelbuild@5f03bde), which Scala targets do not have, and the conditional successfully fell through.

This fixes bazelbuild#1183.

Closes bazelbuild#1202

PiperOrigin-RevId: 271236868
@comius comius changed the title Prioritzie scala and kt providers before JavaInfo Prioritize scala and kt providers before JavaInfo Apr 12, 2024
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scala Import fails to add Scala SDK
4 participants