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

Run arbitrary main in scala feature has been broken #1172

Closed
ittaiz opened this issue Sep 17, 2019 · 6 comments
Closed

Run arbitrary main in scala feature has been broken #1172

ittaiz opened this issue Sep 17, 2019 · 6 comments
Labels
lang: scala Scala rules integration product: IntelliJ IntelliJ plugin type: bug

Comments

@ittaiz
Copy link
Member

ittaiz commented Sep 17, 2019

Hi,
The ability to right click any main in a scala_library and run it has been broken recently. Unfortunately it wasn't recently enough so it was before the fine grain commits and we don't know which commit did it.
The current situation is that the run configuration is created with a correct before task (I see from the console the right _deploy jar is built) but then the run configuration is somehow configured incorrectly.
I'd love to contribute an e2e for this to cover future regression but not sure where to start.
@jin @brendandouglas would you accept an e2e for this feature? If so can you share a few pointers?

Thanks!

@liucijus
Copy link
Collaborator

This seems to fail finding artifact after this change:
98d0504#diff-c924e38cec968aa15f096048cb42b57fR185

@ittaiz
Copy link
Member Author

ittaiz commented Sep 18, 2019

@brendandouglas @jin @liucijus found that if we revert that one line the feature goes back to working. Would you be open to a PR reverting this?
We'd still love adding a test to protect from such a regression if you can point us towards where

@jin
Copy link
Member

jin commented Sep 18, 2019

@ittaiz @liucijus can you provide a Scala repro example for this? For future issue reports, it will really help us if you can provide Scala repro projects as we don't really have expertise on the language.

@jin jin added product: IntelliJ IntelliJ plugin lang: scala Scala rules integration type: bug labels Sep 18, 2019
@liucijus
Copy link
Collaborator

liucijus commented Sep 20, 2019

https://github.com/liucijus/bazel-scala-example can be used to reproduce the problem:
Import Bazel project, add scala view in project view then click on the green run arrow next to Main class in com.example.Main.
Expected: runs and prints "Hello!"
Actual: Red notification "Failed to find deployable jar when building //:mainlib"

@liucijus
Copy link
Collaborator

@jin, FYI, I had problems importing example project on custom build from master source: #1183

@liucijus
Copy link
Collaborator

Thanks, @jin!

aradchykov pushed a commit to aradchykov/intellij that referenced this issue Oct 6, 2019
…ij PR import bazelbuild#1205)

Fixes bazelbuild#1172

Before bazelbuild@98d0504#diff-c924e38cec968aa15f096048cb42b57fR185, the deployable jar was not filtered against any label. If the scala library is `//:foo`, the deployable is `//:foo_deploy.jar` according to the parsed bep output.

Fix this by searching for `<label>_deploy.jar` instead.

Closes bazelbuild#1205

PiperOrigin-RevId: 271252067
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang: scala Scala rules integration product: IntelliJ IntelliJ plugin type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants