diff --git a/Makefile b/Makefile index 1911b29f700..4b54fcec247 100644 --- a/Makefile +++ b/Makefile @@ -53,7 +53,7 @@ pylint-hailtop: .PHONY: check-hail check-hail: check-hail-fast pylint-hailtop - cd hail && sh millw __.checkFormat + __.fix --check + cd hail && sh mill __.checkFormat + __.fix --check .PHONY: check-services check-services: $(CHECK_SERVICES_MODULES) diff --git a/build.yaml b/build.yaml index e2841fa1af2..cf1938b499d 100644 --- a/build.yaml +++ b/build.yaml @@ -724,7 +724,7 @@ steps: cd /io/repo/hail export MILLOPTS='--no-server' HAIL_RELEASE_MODE=1 - time retry sh millw --no-server --version + time retry sh mill --no-server --version # We've encountered the following sporadic error in CI between `mill` # finishing assembling the jar and `Make` copying the jar: @@ -770,7 +770,7 @@ steps: cd /io/repo/hail export MILLOPTS='--no-server' - time retry sh millw --no-server --version + time retry sh mill --no-server --version # See `build_hail_jar_and_wheel` time retry make shadowJar @@ -803,7 +803,7 @@ steps: cd /io/repo/hail export MILLOPTS='--no-server' - time retry sh millw --no-server --version + time retry sh mill --no-server --version # See `build_hail_jar_and_wheel` time retry make shadowTestJar @@ -863,7 +863,7 @@ steps: cd /io/repo/hail export SPARK_VERSION="3.0.2" SCALA_VERSION="2.12.13" HAIL_RELEASE_MODE=1 MILLOPTS='--no-server' - time retry sh millw --no-server --version + time retry sh mill --no-server --version # See `build_hail_jar_and_wheel` time retry make shadowJar diff --git a/hail/.mill-version b/hail/.mill-version index b80f98e66f1..e01e0ddd8e8 100644 --- a/hail/.mill-version +++ b/hail/.mill-version @@ -1 +1 @@ -0.11.7 +0.12.4 diff --git a/hail/Makefile b/hail/Makefile index c4d4846efc8..fa06d1eec31 100644 --- a/hail/Makefile +++ b/hail/Makefile @@ -49,7 +49,7 @@ CLOUD_HAIL_DOCTEST_DATA_DIR = $(CLOUD_HAIL_TEST_RESOURCES_PREFIX)/doctest/data/ # mill integration -MILL := bash millw +MILL := bash mill MILLOPTS ?= .PHONY: mill-clean diff --git a/hail/build.sc b/hail/build.mill similarity index 79% rename from hail/build.sc rename to hail/build.mill index 96a3baf26c2..35f3e2be318 100644 --- a/hail/build.sc +++ b/hail/build.mill @@ -1,5 +1,7 @@ -import $ivy.`com.goyeau::mill-scalafix::0.3.2` -import $ivy.`de.tototec::de.tobiasroeser.mill.vcs.version::0.4.0` +package build + +import $ivy.`com.goyeau::mill-scalafix::0.4.2` +import $ivy.`de.tototec::de.tobiasroeser.mill.vcs.version::0.4.1` import com.goyeau.mill.scalafix.ScalafixModule import de.tobiasroeser.mill.vcs.version.VcsVersion import mill._ @@ -15,56 +17,6 @@ object Settings { val hailPatchVersion = "133" } -/** Update the millw script. */ -def millw(): Command[PathRef] = T.command { - val target = - mill.util.Util.download("https://raw.githubusercontent.com/lefou/millw/main/millw") - val millw = T.workspace / "millw" - os.copy.over(target.path, millw) - os.perms.set(millw, os.perms(millw) + java.nio.file.attribute.PosixFilePermission.OWNER_EXECUTE) - target -} - -def scalaVersion: T[String] = T.input { - val v = T.ctx().env.getOrElse("SCALA_VERSION", "2.12.15") - if (!v.startsWith("2.12")) - Result.Failure("Hail currently supports only Scala 2.12") - else - v -} - -def javaVersion: T[String] = T.input { - System.getProperty("java.version") -} - -def sparkVersion: T[String] = T.input { - Result.Success(T.ctx().env.getOrElse("SPARK_VERSION", "3.5.0")) -} - -def debugMode: T[Boolean] = T.input { - val isDebug = !T.ctx().env.contains("HAIL_RELEASE_MODE") - T.log.info(s"Building in ${if (isDebug) "debug" else "release"} mode") - isDebug -} - -def debugOrRelease: Task[String] = T.task { - if (debugMode()) "debug" else "release" -} - -def buildInfo: T[PathRef] = T { - val revision = VcsVersion.vcsState().currentRevision - os.write( - T.dest / "build-info.properties", - s"""[Build Metadata] - |revision=$revision - |sparkVersion=${sparkVersion()} - |hailPipVersion=${Settings.hailMajorMinorVersion}.${Settings.hailPatchVersion} - |hailBuildConfiguration=${debugOrRelease()} - |""".stripMargin, - ) - PathRef(T.dest) -} - object Deps { object HTTPComponents { val core = ivy"org.apache.httpcomponents:httpcore:4.4.14" @@ -94,8 +46,8 @@ object Deps { } object Spark { - def core: Task[Dep] = T.task(ivy"org.apache.spark::spark-core:${sparkVersion()}") - def mllib: Task[Dep] = T.task(ivy"org.apache.spark::spark-mllib:${sparkVersion()}") + def core: Task[Dep] = Task.Anon(ivy"org.apache.spark::spark-core:${build.env.sparkVersion()}") + def mllib: Task[Dep] = Task.Anon(ivy"org.apache.spark::spark-mllib:${build.env.sparkVersion()}") } val samtools = ivy"com.github.samtools:htsjdk:3.0.5" @@ -121,13 +73,13 @@ object Deps { } trait HailScalaModule extends SbtModule with ScalafmtModule with ScalafixModule { outer => - override def scalaVersion: T[String] = build.scalaVersion() + override def scalaVersion: T[String] = build.env.scalaVersion() override def javacOptions: T[Seq[String]] = Seq( "-Xlint:all", "-Werror", - if (debugMode()) "-g" else "-O", - ) ++ (if (!javaVersion().startsWith("1.8")) Seq("-Xlint:-processing") else Seq()) + if (build.env.debugMode()) "-g" else "-O", + ) ++ (if (!build.env.javaVersion().startsWith("1.8")) Seq("-Xlint:-processing") else Seq()) override def scalacOptions: T[Seq[String]] = T { Seq( @@ -139,8 +91,9 @@ trait HailScalaModule extends SbtModule with ScalafmtModule with ScalafixModule "-Yno-adapted-args", // will be removed in 2.13 "-Xlint", "-Ywarn-unused:_,-explicits,-implicits", + "-Wconf:msg=legacy-binding:s", ) ++ ( - if (debugMode()) Seq() + if (build.env.debugMode()) Seq() else Seq( "-Xfatal-warnings", "-opt:l:method", @@ -153,7 +106,7 @@ trait HailScalaModule extends SbtModule with ScalafmtModule with ScalafixModule override def bspCompileClasspath: T[Agg[UnresolvedPath]] = super.bspCompileClasspath() ++ resources().map(p => UnresolvedPath.ResolvedPath(p.path)) - trait HailTests extends SbtModuleTests with TestNg with ScalafmtModule with ScalafixModule { + trait HailTests extends SbtTests with TestNg with ScalafmtModule with ScalafixModule { override def forkArgs: T[Seq[String]] = Seq("-Xss4m", "-Xmx4096M") override def ivyDeps: T[Agg[Dep]] = @@ -171,7 +124,50 @@ trait HailScalaModule extends SbtModule with ScalafmtModule with ScalafixModule } } -object main extends RootModule with HailScalaModule { outer => +object `package` extends RootModule with HailScalaModule { outer => + + object env extends Module { + def scalaVersion: T[String] = Task.Input { + val v = T.ctx().env.getOrElse("SCALA_VERSION", "2.12.20") + if (!v.startsWith("2.12")) + Result.Failure("Hail currently supports only Scala 2.12") + else + v + } + + def javaVersion: T[String] = Task.Input { + System.getProperty("java.version") + } + + def sparkVersion: T[String] = Task.Input { + Result.Success(T.ctx().env.getOrElse("SPARK_VERSION", "3.5.0")) + } + + def debugMode: T[Boolean] = Task.Input { + val isDebug = !T.ctx().env.contains("HAIL_RELEASE_MODE") + T.log.info(s"Building in ${if (isDebug) "debug" else "release"} mode") + isDebug + } + + def debugOrRelease: Task[String] = Task.Anon { + if (debugMode()) "debug" else "release" + } + } + + def buildInfo: T[PathRef] = T { + val revision = VcsVersion.vcsState().currentRevision + os.write( + T.dest / "build-info.properties", + s"""[Build Metadata] + |revision=$revision + |sparkVersion=${env.sparkVersion()} + |hailPipVersion=${Settings.hailMajorMinorVersion}.${Settings.hailPatchVersion} + |hailBuildConfiguration=${env.debugOrRelease()} + |""".stripMargin, + ) + PathRef(T.dest) + } + override def moduleDeps: Seq[JavaModule] = Seq(memory) override def resources: T[Seq[PathRef]] = Seq( @@ -256,15 +252,15 @@ object main extends RootModule with HailScalaModule { outer => override def javacOptions: T[Seq[String]] = outer.javacOptions() ++ ( - if (javaVersion().startsWith("1.8")) Seq( + if (env.javaVersion().startsWith("1.8")) Seq( "-XDenableSunApiLintControl", "-Xlint:-sunapi", ) else Seq() ) - override def sources: T[Seq[PathRef]] = T.sources { - Seq(PathRef(this.millSourcePath / os.up / "src" / debugOrRelease() / "java")) + override def sources: T[Seq[PathRef]] = Task.Sources { + Seq(PathRef(this.millSourcePath / os.up / "src" / env.debugOrRelease() / "java")) } } diff --git a/hail/mill b/hail/mill new file mode 100755 index 00000000000..f4d81f4419f --- /dev/null +++ b/hail/mill @@ -0,0 +1,67 @@ +#!/usr/bin/env sh + +# This is a wrapper script, that automatically download mill from GitHub release pages +# You can give the required mill version with MILL_VERSION env variable +# If no version is given, it falls back to the value of DEFAULT_MILL_VERSION + +set -e + +if [ -z "${DEFAULT_MILL_VERSION}" ] ; then + DEFAULT_MILL_VERSION=0.12.3 +fi + +if [ -z "$MILL_VERSION" ] ; then + if [ -f ".mill-version" ] ; then + MILL_VERSION="$(tr '\r' '\n' < .mill-version | head -n 1 2> /dev/null)" + elif [ -f ".config/mill-version" ] ; then + MILL_VERSION="$(tr '\r' '\n' < .config/mill-version | head -n 1 2> /dev/null)" + elif [ -f "mill" ] && [ "$0" != "mill" ] ; then + MILL_VERSION=$(grep -F "DEFAULT_MILL_VERSION=" "mill" | head -n 1 | cut -d= -f2) + else + MILL_VERSION=$DEFAULT_MILL_VERSION + fi +fi + +if [ "x${XDG_CACHE_HOME}" != "x" ] ; then + MILL_DOWNLOAD_PATH="${XDG_CACHE_HOME}/mill/download" +else + MILL_DOWNLOAD_PATH="${HOME}/.cache/mill/download" +fi +MILL_EXEC_PATH="${MILL_DOWNLOAD_PATH}/${MILL_VERSION}" + +version_remainder="$MILL_VERSION" +MILL_MAJOR_VERSION="${version_remainder%%.*}"; version_remainder="${version_remainder#*.}" +MILL_MINOR_VERSION="${version_remainder%%.*}"; version_remainder="${version_remainder#*.}" + +if [ ! -s "$MILL_EXEC_PATH" ] ; then + mkdir -p "$MILL_DOWNLOAD_PATH" + if [ "$MILL_MAJOR_VERSION" -gt 0 ] || [ "$MILL_MINOR_VERSION" -ge 5 ] ; then + ASSEMBLY="-assembly" + fi + DOWNLOAD_FILE=$MILL_EXEC_PATH-tmp-download + MILL_VERSION_TAG=$(echo $MILL_VERSION | sed -E 's/([^-]+)(-M[0-9]+)?(-.*)?/\1\2/') + MILL_DOWNLOAD_URL="https://repo1.maven.org/maven2/com/lihaoyi/mill-dist/$MILL_VERSION/mill-dist-$MILL_VERSION.jar" + curl --fail -L -o "$DOWNLOAD_FILE" "$MILL_DOWNLOAD_URL" + chmod +x "$DOWNLOAD_FILE" + mv "$DOWNLOAD_FILE" "$MILL_EXEC_PATH" + unset DOWNLOAD_FILE + unset MILL_DOWNLOAD_URL +fi + +if [ -z "$MILL_MAIN_CLI" ] ; then + MILL_MAIN_CLI="${0}" +fi + +MILL_FIRST_ARG="" + + # first arg is a long flag for "--interactive" or starts with "-i" +if [ "$1" = "--bsp" ] || [ "${1#"-i"}" != "$1" ] || [ "$1" = "--interactive" ] || [ "$1" = "--no-server" ] || [ "$1" = "--repl" ] || [ "$1" = "--help" ] ; then + # Need to preserve the first position of those listed options + MILL_FIRST_ARG=$1 + shift +fi + +unset MILL_DOWNLOAD_PATH +unset MILL_VERSION + +exec $MILL_EXEC_PATH $MILL_FIRST_ARG -D "mill.main.cli=${MILL_MAIN_CLI}" "$@" diff --git a/hail/millw b/hail/millw deleted file mode 100755 index 54154284d10..00000000000 --- a/hail/millw +++ /dev/null @@ -1,241 +0,0 @@ -#!/usr/bin/env sh - -# This is a wrapper script, that automatically download mill from GitHub release pages -# You can give the required mill version with --mill-version parameter -# If no version is given, it falls back to the value of DEFAULT_MILL_VERSION -# -# Project page: https://github.com/lefou/millw -# Script Version: 0.4.11 -# -# If you want to improve this script, please also contribute your changes back! -# -# Licensed under the Apache License, Version 2.0 - -set -e - -if [ -z "${DEFAULT_MILL_VERSION}" ] ; then - DEFAULT_MILL_VERSION="0.11.6" -fi - - -if [ -z "${GITHUB_RELEASE_CDN}" ] ; then - GITHUB_RELEASE_CDN="" -fi - - -MILL_REPO_URL="https://github.com/com-lihaoyi/mill" - -if [ -z "${CURL_CMD}" ] ; then - CURL_CMD=curl -fi - -# Explicit commandline argument takes precedence over all other methods -if [ "$1" = "--mill-version" ] ; then - shift - if [ "x$1" != "x" ] ; then - MILL_VERSION="$1" - shift - else - echo "You specified --mill-version without a version." 1>&2 - echo "Please provide a version that matches one provided on" 1>&2 - echo "${MILL_REPO_URL}/releases" 1>&2 - false - fi -fi - -# Please note, that if a MILL_VERSION is already set in the environment, -# We reuse it's value and skip searching for a value. - -# If not already set, read .mill-version file -if [ -z "${MILL_VERSION}" ] ; then - if [ -f ".mill-version" ] ; then - MILL_VERSION="$(head -n 1 .mill-version 2> /dev/null)" - elif [ -f ".config/mill-version" ] ; then - MILL_VERSION="$(head -n 1 .config/mill-version 2> /dev/null)" - fi -fi - -MILL_USER_CACHE_DIR="${XDG_CACHE_HOME:-${HOME}/.cache}/mill" - -if [ -z "${MILL_DOWNLOAD_PATH}" ] ; then - MILL_DOWNLOAD_PATH="${MILL_USER_CACHE_DIR}/download" -fi - -# If not already set, try to fetch newest from Github -if [ -z "${MILL_VERSION}" ] ; then - # TODO: try to load latest version from release page - echo "No mill version specified." 1>&2 - echo "You should provide a version via '.mill-version' file or --mill-version option." 1>&2 - - mkdir -p "${MILL_DOWNLOAD_PATH}" - LANG=C touch -d '1 hour ago' "${MILL_DOWNLOAD_PATH}/.expire_latest" 2>/dev/null || ( - # we might be on OSX or BSD which don't have -d option for touch - # but probably a -A [-][[hh]mm]SS - touch "${MILL_DOWNLOAD_PATH}/.expire_latest"; touch -A -010000 "${MILL_DOWNLOAD_PATH}/.expire_latest" - ) || ( - # in case we still failed, we retry the first touch command with the intention - # to show the (previously suppressed) error message - LANG=C touch -d '1 hour ago' "${MILL_DOWNLOAD_PATH}/.expire_latest" - ) - - # POSIX shell variant of bash's -nt operator, see https://unix.stackexchange.com/a/449744/6993 - # if [ "${MILL_DOWNLOAD_PATH}/.latest" -nt "${MILL_DOWNLOAD_PATH}/.expire_latest" ] ; then - if [ -n "$(find -L "${MILL_DOWNLOAD_PATH}/.latest" -prune -newer "${MILL_DOWNLOAD_PATH}/.expire_latest")" ]; then - # we know a current latest version - MILL_VERSION=$(head -n 1 "${MILL_DOWNLOAD_PATH}"/.latest 2> /dev/null) - fi - - if [ -z "${MILL_VERSION}" ] ; then - # we don't know a current latest version - echo "Retrieving latest mill version ..." 1>&2 - LANG=C ${CURL_CMD} -s -i -f -I ${MILL_REPO_URL}/releases/latest 2> /dev/null | grep --ignore-case Location: | sed s'/^.*tag\///' | tr -d '\r\n' > "${MILL_DOWNLOAD_PATH}/.latest" - MILL_VERSION=$(head -n 1 "${MILL_DOWNLOAD_PATH}"/.latest 2> /dev/null) - fi - - if [ -z "${MILL_VERSION}" ] ; then - # Last resort - MILL_VERSION="${DEFAULT_MILL_VERSION}" - echo "Falling back to hardcoded mill version ${MILL_VERSION}" 1>&2 - else - echo "Using mill version ${MILL_VERSION}" 1>&2 - fi -fi - -MILL="${MILL_DOWNLOAD_PATH}/${MILL_VERSION}" - -try_to_use_system_mill() { - if [ "$(uname)" != "Linux" ]; then - return 0 - fi - - MILL_IN_PATH="$(command -v mill || true)" - - if [ -z "${MILL_IN_PATH}" ]; then - return 0 - fi - - SYSTEM_MILL_FIRST_TWO_BYTES=$(head --bytes=2 "${MILL_IN_PATH}") - if [ "${SYSTEM_MILL_FIRST_TWO_BYTES}" = "#!" ]; then - # MILL_IN_PATH is (very likely) a shell script and not the mill - # executable, ignore it. - return 0 - fi - - SYSTEM_MILL_PATH=$(readlink -e "${MILL_IN_PATH}") - SYSTEM_MILL_SIZE=$(stat --format=%s "${SYSTEM_MILL_PATH}") - SYSTEM_MILL_MTIME=$(stat --format=%y "${SYSTEM_MILL_PATH}") - - if [ ! -d "${MILL_USER_CACHE_DIR}" ]; then - mkdir -p "${MILL_USER_CACHE_DIR}" - fi - - SYSTEM_MILL_INFO_FILE="${MILL_USER_CACHE_DIR}/system-mill-info" - if [ -f "${SYSTEM_MILL_INFO_FILE}" ]; then - parseSystemMillInfo() { - LINE_NUMBER="${1}" - # Select the line number of the SYSTEM_MILL_INFO_FILE, cut the - # variable definition in that line in two halves and return - # the value, and finally remove the quotes. - sed -n "${LINE_NUMBER}p" "${SYSTEM_MILL_INFO_FILE}" |\ - cut -d= -f2 |\ - sed 's/"\(.*\)"/\1/' - } - - CACHED_SYSTEM_MILL_PATH=$(parseSystemMillInfo 1) - CACHED_SYSTEM_MILL_VERSION=$(parseSystemMillInfo 2) - CACHED_SYSTEM_MILL_SIZE=$(parseSystemMillInfo 3) - CACHED_SYSTEM_MILL_MTIME=$(parseSystemMillInfo 4) - - if [ "${SYSTEM_MILL_PATH}" = "${CACHED_SYSTEM_MILL_PATH}" ] \ - && [ "${SYSTEM_MILL_SIZE}" = "${CACHED_SYSTEM_MILL_SIZE}" ] \ - && [ "${SYSTEM_MILL_MTIME}" = "${CACHED_SYSTEM_MILL_MTIME}" ]; then - if [ "${CACHED_SYSTEM_MILL_VERSION}" = "${MILL_VERSION}" ]; then - MILL="${SYSTEM_MILL_PATH}" - return 0 - else - return 0 - fi - fi - fi - - SYSTEM_MILL_VERSION=$(${SYSTEM_MILL_PATH} --version | head -n1 | sed -n 's/^Mill.*version \(.*\)/\1/p') - - cat < "${SYSTEM_MILL_INFO_FILE}" -CACHED_SYSTEM_MILL_PATH="${SYSTEM_MILL_PATH}" -CACHED_SYSTEM_MILL_VERSION="${SYSTEM_MILL_VERSION}" -CACHED_SYSTEM_MILL_SIZE="${SYSTEM_MILL_SIZE}" -CACHED_SYSTEM_MILL_MTIME="${SYSTEM_MILL_MTIME}" -EOF - - if [ "${SYSTEM_MILL_VERSION}" = "${MILL_VERSION}" ]; then - MILL="${SYSTEM_MILL_PATH}" - fi -} -try_to_use_system_mill - -# If not already downloaded, download it -if [ ! -s "${MILL}" ] ; then - - # support old non-XDG download dir - MILL_OLD_DOWNLOAD_PATH="${HOME}/.mill/download" - OLD_MILL="${MILL_OLD_DOWNLOAD_PATH}/${MILL_VERSION}" - if [ -x "${OLD_MILL}" ] ; then - MILL="${OLD_MILL}" - else - case $MILL_VERSION in - 0.0.* | 0.1.* | 0.2.* | 0.3.* | 0.4.* ) - DOWNLOAD_SUFFIX="" - DOWNLOAD_FROM_MAVEN=0 - ;; - 0.5.* | 0.6.* | 0.7.* | 0.8.* | 0.9.* | 0.10.* | 0.11.0-M* ) - DOWNLOAD_SUFFIX="-assembly" - DOWNLOAD_FROM_MAVEN=0 - ;; - *) - DOWNLOAD_SUFFIX="-assembly" - DOWNLOAD_FROM_MAVEN=1 - ;; - esac - - DOWNLOAD_FILE=$(mktemp mill.XXXXXX) - - if [ "$DOWNLOAD_FROM_MAVEN" = "1" ] ; then - DOWNLOAD_URL="https://repo1.maven.org/maven2/com/lihaoyi/mill-dist/${MILL_VERSION}/mill-dist-${MILL_VERSION}.jar" - else - MILL_VERSION_TAG=$(echo "$MILL_VERSION" | sed -E 's/([^-]+)(-M[0-9]+)?(-.*)?/\1\2/') - DOWNLOAD_URL="${GITHUB_RELEASE_CDN}${MILL_REPO_URL}/releases/download/${MILL_VERSION_TAG}/${MILL_VERSION}${DOWNLOAD_SUFFIX}" - unset MILL_VERSION_TAG - fi - - # TODO: handle command not found - echo "Downloading mill ${MILL_VERSION} from ${DOWNLOAD_URL} ..." 1>&2 - ${CURL_CMD} -f -L -o "${DOWNLOAD_FILE}" "${DOWNLOAD_URL}" - chmod +x "${DOWNLOAD_FILE}" - mkdir -p "${MILL_DOWNLOAD_PATH}" - mv "${DOWNLOAD_FILE}" "${MILL}" - - unset DOWNLOAD_FILE - unset DOWNLOAD_SUFFIX - fi -fi - -if [ -z "$MILL_MAIN_CLI" ] ; then - MILL_MAIN_CLI="${0}" -fi - -MILL_FIRST_ARG="" -if [ "$1" = "--bsp" ] || [ "$1" = "-i" ] || [ "$1" = "--interactive" ] || [ "$1" = "--no-server" ] || [ "$1" = "--repl" ] || [ "$1" = "--help" ] ; then - # Need to preserve the first position of those listed options - MILL_FIRST_ARG=$1 - shift -fi - -unset MILL_DOWNLOAD_PATH -unset MILL_OLD_DOWNLOAD_PATH -unset OLD_MILL -unset MILL_VERSION -unset MILL_REPO_URL - -# We don't quote MILL_FIRST_ARG on purpose, so we can expand the empty value without quotes -# shellcheck disable=SC2086 -exec "${MILL}" $MILL_FIRST_ARG -D "mill.main.cli=${MILL_MAIN_CLI}" "$@" diff --git a/hail/src/main/scala/is/hail/expr/ir/Env.scala b/hail/src/main/scala/is/hail/expr/ir/Env.scala index 8280bac16d5..adf9845376c 100644 --- a/hail/src/main/scala/is/hail/expr/ir/Env.scala +++ b/hail/src/main/scala/is/hail/expr/ir/Env.scala @@ -244,7 +244,7 @@ final class Env[V] private (val m: Map[Env.K, V]) { this(Map()) override def equals(other: Any): Boolean = other match { - case env: Env[V] => this.m == env.m + case env: Env[_] => this.m == env.m case _ => false } diff --git a/hail/src/main/scala/is/hail/expr/ir/RefEquality.scala b/hail/src/main/scala/is/hail/expr/ir/RefEquality.scala index 0551e0b2191..bc6077ec480 100644 --- a/hail/src/main/scala/is/hail/expr/ir/RefEquality.scala +++ b/hail/src/main/scala/is/hail/expr/ir/RefEquality.scala @@ -10,7 +10,7 @@ object RefEquality { class RefEquality[+T <: AnyRef](val t: T) { override def equals(obj: scala.Any): Boolean = obj match { - case r: RefEquality[T] => t.eq(r.t) + case r: RefEquality[_] => t.eq(r.t) case _ => false } diff --git a/hail/src/main/scala/is/hail/linalg/BlockMatrix.scala b/hail/src/main/scala/is/hail/linalg/BlockMatrix.scala index 25328be4c11..7cda148db27 100644 --- a/hail/src/main/scala/is/hail/linalg/BlockMatrix.scala +++ b/hail/src/main/scala/is/hail/linalg/BlockMatrix.scala @@ -27,7 +27,7 @@ import breeze.stats.distributions.RandBasis import org.apache.commons.lang3.StringUtils import org.apache.spark._ import org.apache.spark.executor.InputMetrics -import org.apache.spark.mllib.linalg.distributed._ +import org.apache.spark.mllib.linalg.distributed.{GridPartitioner => _, _} import org.apache.spark.rdd.RDD import org.apache.spark.storage.StorageLevel import org.json4s._ diff --git a/hail/src/main/scala/is/hail/lir/SplitMethod.scala b/hail/src/main/scala/is/hail/lir/SplitMethod.scala index 533f094bf7c..d19ad900f1a 100644 --- a/hail/src/main/scala/is/hail/lir/SplitMethod.scala +++ b/hail/src/main/scala/is/hail/lir/SplitMethod.scala @@ -1,6 +1,6 @@ package is.hail.lir -import is.hail.asm4s._ +import is.hail.asm4s.{classInfo, BooleanInfo, IntInfo, UnitInfo} import is.hail.utils._ import scala.collection.mutable diff --git a/hail/src/main/scala/is/hail/lir/X.scala b/hail/src/main/scala/is/hail/lir/X.scala index 8b1f8739860..12406b367f2 100644 --- a/hail/src/main/scala/is/hail/lir/X.scala +++ b/hail/src/main/scala/is/hail/lir/X.scala @@ -1,6 +1,8 @@ package is.hail.lir -import is.hail.asm4s._ +import is.hail.asm4s.{ + arrayInfo, ByteInfo, ClassInfo, DoubleInfo, FloatInfo, IntInfo, LongInfo, TypeInfo, +} import is.hail.utils._ import scala.collection.mutable diff --git a/hail/src/test/scala/is/hail/asm4s/ASM4SSuite.scala b/hail/src/test/scala/is/hail/asm4s/ASM4SSuite.scala index ceb3bee5bf4..3e4602f05e8 100644 --- a/hail/src/test/scala/is/hail/asm4s/ASM4SSuite.scala +++ b/hail/src/test/scala/is/hail/asm4s/ASM4SSuite.scala @@ -14,7 +14,7 @@ import org.testng.annotations.Test trait Z2Z { def apply(z: Boolean): Boolean } class ASM4SSuite extends HailSuite { - private[this] val theHailClassLoader = new HailClassLoader(getClass().getClassLoader()) + override val theHailClassLoader = new HailClassLoader(getClass().getClassLoader()) @Test def not(): Unit = { val notb = FunctionBuilder[Z2Z](