diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3244f2b810f..eea7fe81387 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -353,13 +353,10 @@ interested in. For example, to generate the Bloop projects for the Spark 3.2.0 d just for the production code run: ```shell script -mvn install ch.epfl.scala:bloop-maven-plugin:bloopInstall -pl aggregator -am \ - -DdownloadSources=true \ - -Dbuildver=320 \ - -DskipTests \ - -Dskip \ - -Dmaven.scalastyle.skip=true \ - -Dmaven.updateconfig.skip=true +mvn -B clean install \ + -DbloopInstall \ + -DdownloadSources=true \ + -Dbuildver=320 ``` With `--generate-bloop` we integrated Bloop project generation into `buildall`. It makes it easier @@ -384,6 +381,11 @@ You can now open the spark-rapids as a Read on for VS Code Scala Metals instructions. +##### JDK 11 Requirement + +It is known that Bloop's SemanticDB generation with JDK 8 is broken for spark-rapids. Please use JDK +11 or later for Bloop builds. + #### Bloop, Scala Metals, and Visual Studio Code _Last tested with 1.63.0-insider (Universal) Commit: bedf867b5b02c1c800fbaf4d6ce09cefba_ @@ -431,18 +433,11 @@ jps -l ###### java.lang.RuntimeException: boom Metals background compilation process status appears to be resetting to 0% after reaching 99% -and you see a peculiar error message [`java.lang.RuntimeException: boom`][1]. You can work around -it by making sure Metals Server (Bloop client) and Bloop Server are both running on Java 11+. - -1. To this end make sure that Bloop projects are generated using Java 11+ - - ```bash - JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64 \ - mvn install ch.epfl.scala:bloop-maven-plugin:bloopInstall \ - -DdownloadSources=true \ - -Dbuildver=331 \ - -Dskip -DskipTests - ``` +and you see a peculiar error message [`java.lang.RuntimeException: boom`][1]. This is a known issue +when running Metals/Bloop on Java 8. To work around it, ensure Metals and Bloop are both running on +Java 11+. + +1. The `-DbloopInstall` profile will enforce Java 11+ compliance. 1. Add [`metals.javaHome`][2] to VSCode preferences to point to Java 11+. diff --git a/build/buildall b/build/buildall index 7521b3f1719..a700acad539 100755 --- a/build/buildall +++ b/build/buildall @@ -65,15 +65,10 @@ function bloopInstall() { bloopTmpConfigDir="$bloopTmpDir/.bloop$bv" mkdir -p $bloopTmpConfigDir $MVN -B clean install \ - ch.epfl.scala:bloop-maven-plugin:bloopInstall \ - -pl aggregator -am \ + -DbloopInstall \ -Dbloop.configDirectory="$bloopTmpConfigDir" \ -DdownloadSources=true \ - -Dbuildver="$bv" \ - -DskipTests \ - -Dskip \ - -Dmaven.scalastyle.skip=true \ - -Dmaven.updateconfig.skip=true + -Dbuildver="$bv" specifier="spark$bv" bloopDir=$PWD/.bloop-$specifier diff --git a/pom.xml b/pom.xml index bf0a18385f1..afb519ffc03 100644 --- a/pom.xml +++ b/pom.xml @@ -569,6 +569,57 @@ ${cuda.version}-arm64 + + bloopInstall + + + bloopInstall + true + + + + true + true + true + + + + + org.apache.maven.plugins + maven-enforcer-plugin + + + enforce-bloop-rules + enforce + + + + Metals semantic database requires JAVA_HOME pointing to JDK 11+, actual Java version: ${java.version} + [11,) + + + + + + + + ch.epfl.scala + bloop-maven-plugin + + + generate-bloop-projects + bloopInstall + ${bloop.installPhase} + + + ${bloop.configDirectory} + + + + + + + @@ -655,6 +706,7 @@ org/scala-lang/scala-library/${scala.version}/scala-library-${scala.version}.jar ${spark.version.classifier} 3.1.0 + false false true 0.14.1 @@ -765,6 +817,8 @@ -Djdk.reflect.useDirectMethodHandle=false false + install + ${spark.rapids.source.basedir}/.bloop @@ -1043,6 +1097,7 @@ -doc-external-doc:${settings.localRepository}/${scala.local-lib.path}#https://scala-lang.org/api/${scala.version}/ -doc-external-doc:${settings.localRepository}/org/apache/spark/spark-sql_${scala.binary.version}/${spark.version}/spark-sql_${scala.binary.version}-${spark.version}.jar#https://spark.apache.org/docs/${spark.version}/api/scala/index.html + ${maven.scaladoc.skip} @@ -1212,6 +1267,21 @@ + + ch.epfl.scala + bloop-maven-plugin + 2.0.0 + + + default-cli + + true + + /dev/null/ERROR: Do not specify the bloop-maven-plugin on the command line. Instead invoke `mvn install -DbloopInstall ...` + + + + org.apache.maven.plugins maven-enforcer-plugin diff --git a/scala2.13/pom.xml b/scala2.13/pom.xml index 34531329ef2..629692d6e65 100644 --- a/scala2.13/pom.xml +++ b/scala2.13/pom.xml @@ -569,6 +569,57 @@ ${cuda.version}-arm64 + + bloopInstall + + + bloopInstall + true + + + + true + true + true + + + + + org.apache.maven.plugins + maven-enforcer-plugin + + + enforce-bloop-rules + enforce + + + + Metals semantic database requires JAVA_HOME pointing to JDK 11+, actual Java version: ${java.version} + [11,) + + + + + + + + ch.epfl.scala + bloop-maven-plugin + + + generate-bloop-projects + bloopInstall + ${bloop.installPhase} + + + ${bloop.configDirectory} + + + + + + + @@ -655,6 +706,7 @@ org/scala-lang/scala-library/${scala.version}/scala-library-${scala.version}.jar ${spark.version.classifier} 3.1.0 + false false true 0.14.1 @@ -765,6 +817,8 @@ -Djdk.reflect.useDirectMethodHandle=false false + install + ${spark.rapids.source.basedir}/.bloop @@ -1043,6 +1097,7 @@ -doc-external-doc:${settings.localRepository}/${scala.local-lib.path}#https://scala-lang.org/api/${scala.version}/ -doc-external-doc:${settings.localRepository}/org/apache/spark/spark-sql_${scala.binary.version}/${spark.version}/spark-sql_${scala.binary.version}-${spark.version}.jar#https://spark.apache.org/docs/${spark.version}/api/scala/index.html + ${maven.scaladoc.skip} @@ -1212,6 +1267,21 @@ + + ch.epfl.scala + bloop-maven-plugin + 2.0.0 + + + default-cli + + true + + /dev/null/ERROR: Do not specify the bloop-maven-plugin on the command line. Instead invoke `mvn install -DbloopInstall ...` + + + + org.apache.maven.plugins maven-enforcer-plugin