[gradle] exclude scala-reflect#13894
Merged
danking merged 1 commit intohail-is:mainfrom Oct 25, 2023
Merged
Conversation
CHANGELOG: Fixes hail-is#13837 in which Hail could break a Spark installation if the Hail JAR appears on the classpath before the Scala JARs. Several dependencies of ours *and us* are exposing an old version of scala-reflect (rude of us and them). If our JAR appears on the classpath before the scala JARs and the sub-versions of Scala differ, Spark is likely to have incompatible bytecode. See hail-is#13837 . In this PR, this command, ``` make shadowJar && \ jar tf build/libs/hail-all-spark.jar | grep scala/reflect | wc -l && \ jar tf build/libs/hail-all-spark.jar | grep 'MutableSettings' ``` prints: ``` 0 ``` On main (`5d7dc2cab7`) it prints: ``` 1417 scala/reflect/internal/settings/MutableSettings$.class scala/reflect/internal/settings/MutableSettings$SettingValue.class scala/reflect/internal/settings/MutableSettings.class ``` --- A bit more details follow for the curious. `./gradlew dependencies` shows these packages as depending on `scala-reflect`: ``` +--- org.scalanlp:breeze-natives_2.12:1.1 | +--- org.scala-lang:scala-library:2.12.10 -> 2.12.17 | +--- org.scalanlp:breeze_2.12:1.1 -> 1.2 | | +--- org.scala-lang:scala-library:2.12.10 -> 2.12.17 | | +--- org.scalanlp:breeze-macros_2.12:1.2 | | | +--- org.scala-lang:scala-library:2.12.10 -> 2.12.17 | | | \--- org.scala-lang:scala-reflect:2.12.10 -> 2.12.15 ... +--- org.elasticsearch:elasticsearch-spark-30_2.12:8.4.3 | +--- org.scala-lang:scala-library:2.12.8 -> 2.12.17 | +--- org.scala-lang:scala-reflect:2.12.8 -> 2.12.15 (*) | \--- org.apache.spark:spark-core_2.12:3.2.1 -> 3.3.0 ... | +--- org.scala-lang:scala-reflect:2.12.15 (*) ... +--- org.scala-lang:scala-reflect:2.12.15 (*) ... +--- org.apache.spark:spark-sql_2.12:3.3.0 ... | +--- org.apache.spark:spark-catalyst_2.12:3.3.0 | | +--- org.scala-lang:scala-reflect:2.12.15 (*) ``` This root (the fourth to last package above): ``` +--- org.scala-lang:scala-reflect:2.12.15 (*) ``` is coming from this line in build.gradle: ```gradle shadow 'org.scala-lang:scala-reflect:' + scalaVersion ``` I think `shadow` means "needed to compile but do not include in shadow JAR", so I do not know if we can trust `./gradlew dependencies` to tell us why any particular class file is in our shadow JAR.
This was referenced Oct 24, 2023
Closed
Contributor
Author
|
bump; I'd like to include this in 0.2.125 |
daniel-goldstein
approved these changes
Oct 25, 2023
patrick-schultz
approved these changes
Oct 25, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CHANGELOG: Fixes #13837 in which Hail could break a Spark installation if the Hail JAR appears on the classpath before the Scala JARs.
We and several dependencies of ours are exposing an old version of scala-reflect (rude of us and them). If our JAR appears on the classpath before the scala JARs and the sub-versions of Scala differ, Spark is likely to have incompatible bytecode.
See #13837 .
In this PR, this command,
prints:
On main (
5d7dc2cab7) it prints:A bit more details follow for the curious.
./gradlew dependenciesshows these packages as depending onscala-reflect:This root (the fourth to last package above):
is coming from this line in build.gradle:
I think
shadowmeans "needed to compile but do not include in shadow JAR", so I do not know if we can trust./gradlew dependenciesto tell us why any particular class file is in our shadow JAR.