-
Notifications
You must be signed in to change notification settings - Fork 311
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
Scala Import fails to add Scala SDK #1183
Comments
cc @iirina this change caused all Scala workspaces to stop resolving code. Do you know what may be the root cause here? |
cc @brendandouglas this is pretty serious as it causes all Scala workspaces to complete stop resolving. In the mean time while we find a mitigation (either the plugin or rules_scala), shall we revert the 5f03bde and cherry pick the revert into the next release? |
Thanks @jin for finding a fix! |
…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
My hunch is that the issue was caused by bazelbuild/bazel#8916 which is now fixed but not released yet. |
@liucijus I tried reproducing the issue by manually editing the |
I can't run this fix without upgrading rules_scala version. But if I upgrade problem does not reproduce with older versions of bazel as well. For example, with
|
That's strange because I think this reproduced internally when we were on a relatively advanced version of rules_scala. What do you think we should do here? |
With the bazel plugin |
@jakemcc usually valuable to also note which rules_scala version you're using and which bazel version you're using because unfortunately all 4 components need to be in sync. @brendandouglas I just merged a change to rules_scala which drops the |
This happens every time to me with |
I'm running into the Scala SDK being dropped on sync with the following versions: IntelliJ IDEA 2021.3.2 (Ultimate Edition) Build #IU-213.6777.52 I have a prototype project where these versions work fine and don't drop the SDK setting on a sync, but in a much larger project where it is being dropped. Any suggestions on what else I could look into? |
IntelliJ IDEA 2019.2.2 (Community Edition)
Bazel Plugin: source build
Sync fails attaching Scala SDK to module. Can be reproduced since 5f03bde
Repo to reproduce: https://github.com/liucijus/bazel-scala-example
The text was updated successfully, but these errors were encountered: