typelevel / sbt-typelevel

Let sbt work for you.
https://typelevel.org/sbt-typelevel/
Apache License 2.0
168 stars 47 forks source link

JDK API mappings not working sometimes (?) #347

Open armanbilge opened 2 years ago

armanbilge commented 2 years ago

I put a dogfood test for this inside the site plugin.

[error] .../sbt-typelevel/site/src/main/scala/org/typelevel/sbt/site/TypelevelHeliumExtensions.scala:47:3: Could not find any member to link for "java.net.URL".
[error]   /**
[error]   ^
[error] one error found
$ java -version
openjdk version "11.0.15" 2022-04-19
OpenJDK Runtime Environment Homebrew (build 11.0.15+0)
OpenJDK 64-Bit Server VM Homebrew (build 11.0.15+0, mixed mode)
satorg commented 2 years ago

On temurin11 it fails as well:

$ java -version
openjdk version "11.0.15" 2022-04-19
OpenJDK Runtime Environment Temurin-11.0.15+10 (build 11.0.15+10)
OpenJDK 64-Bit Server VM Temurin-11.0.15+10 (build 11.0.15+10, mixed mode)
armanbilge commented 2 years ago

Aha, thanks for that. I was able to reproduce with temurin 11 on linux. We should add that to CI and fix it :)

satorg commented 2 years ago

And which JDK is it currently working on? Did you have it succeeding on any JVM locally?

armanbilge commented 2 years ago

It works on the JDK 8 and JDK 17 temurins used in CI.

armanbilge commented 2 years ago

Huh. Locally it fails for me even with temurin 17. Ok, this is pretty bizarre.

DavidGregory084 commented 2 years ago

FWIW I have been seeing this intermittently on sbt-tpolecat too when running scripted tests

sbt:sbt-tpolecat> scripted
[info] Wrote /Users/davidgregory/Repos/sbt-tpolecat/plugin/target/scala-2.12/sbt-1.0/sbt-tpolecat-0.4.1+31-2f9e1eda+20220728-1550-SNAPSHOT.pom
[info] Main Scala API documentation to /Users/davidgregory/Repos/sbt-tpolecat/plugin/target/scala-2.12/sbt-1.0/api...
[info] compiling 1 Scala source to /Users/davidgregory/Repos/sbt-tpolecat/plugin/target/scala-2.12/sbt-1.0/classes ...
model contains 17 documentable templates
[error] /Users/davidgregory/Repos/sbt-tpolecat/plugin/src/main/scala/io/github/davidgregory084/ScalacOptions.scala:409:3: Could not find any member to link for "java.lang.Runtime#availableProcessors".
[error]   /** Configures the number of worker threads for the compiler backend.
[error]   ^
[error] one error found
armanbilge commented 2 years ago

@DavidGregory084 sure, but does sbt-tpolecat have something like this in its settings? It's a known issue but supposedly we solved it 😅

https://github.com/typelevel/sbt-typelevel/blob/195bfa5aa5509f3ed0d9434253bb4584a018a74c/settings/src/main/scala/org/typelevel/sbt/TypelevelSettingsPlugin.scala#L294-L314

DavidGregory084 commented 2 years ago

Uhhhhh no 😆 I'm still confused that it's intermittent though in both cases