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

Cannot download Hydra on sbt imported project with scalaHome set #37

Open
dotta opened this issue Dec 22, 2017 · 0 comments
Open

Cannot download Hydra on sbt imported project with scalaHome set #37

dotta opened this issue Dec 22, 2017 · 0 comments

Comments

@dotta
Copy link
Member

dotta commented Dec 22, 2017

Here is the build.sbt file to use to reproduce the issue:

name := "bug"

scalaVersion := "2.11.8"

scalaHome := Some(file("/opt/scala-2.11.8/")) // <-- modify this to point to your scala home

Import the project into idea using the sbt build. Then, enable Hydra on the project and hit the Download button to fetch the Hydra artifacts. The following error is prompted:

Could not determine Scala version in this project

Checking the idea.log provide the trail to understand the issue:

2017-12-22 15:44:21,812 [4923936]   INFO - s.plugins.hydra.HydraVersions$ - Could not retrieve Scala version in module 'bug' with compiler classpath: List(/opt/scala-2.11.8/lib/jline-2.12.1.jar, /opt/scala-2.11.8/lib/scala-compiler.jar, /opt/scala-2.11.8/lib/scala-continuations-library_2.11-1.0.2.jar, /opt/scala-2.11.8/lib/scala-continuations-plugin_2.11.8-1.0.2.jar, /opt/scala-2.11.8/lib/scala-library.jar, /opt/scala-2.11.8/lib/scala-parser-combinators_2.11-1.0.4.jar, /opt/scala-2.11.8/lib/scala-reflect.jar, /opt/scala-2.11.8/lib/scala-swing_2.11-1.0.2.jar, /opt/scala-2.11.8/lib/scala-xml_2.11-1.0.4.jar, /opt/scala-2.11.8/lib/scalap-2.11.8.jar)

The issue is the regex we use to determine the scala version (see HydraVersions).

One possible fix is to look inside the scala-compiler.jar and read the version from the compiler.properties file if there is no version appended to the scala-compiler jar.

dotta added a commit to dotta/intellij-scala that referenced this issue Dec 23, 2017
…on. Fix triplequote#37

Our heuristic for extracting the scala version from the scala-compiler jar name
may not work if the scala-compiler jar in the classpath has no version happended
(this for instance can happen when importing an sbt project with the `scalaHome`
setting set to point to a locally installed Scala distribution).

The implemented solution consists in falling back to the module SDK Scala
version if the version cannot be extracted from the scala-compiler jar name.
dotta added a commit to dotta/intellij-scala that referenced this issue Dec 23, 2017
…on. Fix triplequote#37

Our heuristic for extracting the scala version from the scala-compiler jar name
may not work if the scala-compiler jar in the classpath has no version happended
(this for instance can happen when importing an sbt project with the `scalaHome`
setting set to point to a locally installed Scala distribution).

The implemented solution consists in falling back to the module SDK Scala
version if the version cannot be extracted from the scala-compiler jar name.
dotta added a commit to dotta/intellij-scala that referenced this issue Dec 23, 2017
…on. Fix triplequote#37

Our heuristic for extracting the scala version from the scala-compiler jar name
may not work if the scala-compiler jar in the classpath has no version happended
(this for instance can happen when importing an sbt project with the `scalaHome`
setting set to point to a locally installed Scala distribution).

The implemented solution consists in falling back to the module SDK Scala
version if the version cannot be extracted from the scala-compiler jar name.
dotta added a commit that referenced this issue Dec 23, 2017
…tion

Hydra Scala version detection heuristic fallbacks to module SDK version. Fix #37
dotta added a commit to dotta/intellij-scala that referenced this issue Jan 6, 2018
…on. Fix triplequote#37

Our heuristic for extracting the scala version from the scala-compiler jar name
may not work if the scala-compiler jar in the classpath has no version happended
(this for instance can happen when importing an sbt project with the `scalaHome`
setting set to point to a locally installed Scala distribution).

The implemented solution consists in falling back to the module SDK Scala
version if the version cannot be extracted from the scala-compiler jar name.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant