-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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
[hotfix] [build] Make sure JAVA_HOME is set for tests. #5441
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -119,7 +119,7 @@ object SparkBuild extends PomBuild { | |
lazy val publishLocalBoth = TaskKey[Unit]("publish-local", "publish local for m2 and ivy") | ||
|
||
lazy val sharedSettings = graphSettings ++ genjavadocSettings ++ Seq ( | ||
javaHome := Properties.envOrNone("JAVA_HOME").map(file), | ||
javaHome := sys.props.get("java.home").map(file), | ||
incOptions := incOptions.value.withNameHashing(true), | ||
retrieveManaged := true, | ||
retrievePattern := "[type]s/[artifact](-[revision])(-[classifier]).[ext]", | ||
|
@@ -426,8 +426,10 @@ object TestSettings { | |
fork := true, | ||
// Setting SPARK_DIST_CLASSPATH is a simple way to make sure any child processes | ||
// launched by the tests have access to the correct test-time classpath. | ||
envVars in Test += ("SPARK_DIST_CLASSPATH" -> | ||
(fullClasspath in Test).value.files.map(_.getAbsolutePath).mkString(":").stripSuffix(":")), | ||
envVars in Test ++= Map( | ||
"SPARK_DIST_CLASSPATH" -> | ||
(fullClasspath in Test).value.files.map(_.getAbsolutePath).mkString(":").stripSuffix(":"), | ||
"JAVA_HOME" -> sys.props("java.home")), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let me fix that. In maven, though, that's probably harder... |
||
javaOptions in Test += "-Dspark.test.home=" + sparkHome, | ||
javaOptions in Test += "-Dspark.testing=1", | ||
javaOptions in Test += "-Dspark.port.maxRetries=100", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm testing out this patch on one of the Jenkins boxes and it looks like this ended up breaking compilation because
java.home
points to a JRE, which will cause us to fail with an error when SBT tries to shell out tojavac
: