-
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
[SPARK-34762][BUILD] Fix the build failure with Scala 2.13 which is related to commons-* with better solution #31880
Closed
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
0be2ecf
Fix for SPARK-34762 with better solution.
sarutak 7bc154b
Revert the change in pomlxml.
sarutak 4cdc8c5
Merge branch 'master' of https://github.com/apache/spark into fix-com…
sarutak 3c66069
Modify change-scala-version.sh to choose scala.version from <profile>.
sarutak 9660460
Modify comment.
sarutak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
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.
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 think this is fine now(?) we're avoiding maven help that caused side effect. It makes the script more robust anyway ...
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.
You mean we can go with this change?
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 still don't see why this part is necessary. Can we fix this without breaking other parts of the build script that depend on scala.version?
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.
sbt (or courier?) seems to fail to resolve dependency if the pom file for a dependency is in
~/.m2
but jar file is not. I don't know the reason.For
master
branch, before #31862,change-scala-version.sh
runmvn help:evaluate
and it downloadscommons-cli-1.2.pom
but doesn'tcommons-cli-1.2.jar
.You can also confirm with
mvn -X help:evaluate
.So, I resolved by getting
commons-cli-1.2.jar
usingmvn dependency:get
in #31862.For
branch-3.1
,mvn help:evaluate
also downloadscommons-cli-1.2.jar
but it's resolved this part by #31862.But
mvn dependency:get
downloadscommons-io-2.6.pom
though it doesn't downloadcommons-io-2.6.jar
.I understand
branch-3.1
depends oncommons-io-2.5
but, in fact, if we manually deletecommons-io/comons-io-2.6
beforesbt
, build successfully finishes.It's also true for
master
thatcommons-io-2.6.pom
is present butcommons-io-2.6.jar
is absent.But there is one difference between
master
andbranch-3.1
.master
depends oncommons-io-2.8
which is newer version thancommons-io-2.6
whilebranch-3.1
depends oncommons-io-2.5
which is older thancommons-io-2.6
.So I guess this affects build failure for
branch-3.1
while it succeeds formaster
.Anyway, if we don't use maven plugins in
change-scala-version.sh
, this problem can be resolved easily.Or, do you have a better solution?
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.
Can we solve this by updating commons-io in older branches? that would be fine too IMHO.
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 thought what you think too and it can resolve this issue for the time being.
But I'm afraid that this build failure happens again in the future.
In this case, only
commons-cli
andcomons-io
matters but, actually,help
anddependency
downloads not only them.I confirmed that
help
downloads pom files but not jar files for 300+ dependencies.If we use newer maven or upgraded plugins and Spark and those plugins have a comondependency but plugins use newer version, this problem can happen again.
My worry might be unnecessary or you think we just just fix this problem when it happens again, I'll close this PR.
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.
To be clear can we fix this by using newer Maven versions or newer plugins, or newer versions of the dependencies? I think that's fine, even if it means it pulls in a lot of stuff.
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 don't think we can fix this by using newer Maven or newer plugins.
Spark needs to use newer version of dependencies than what plugins use.
This problem can happen if all the following condition is true.
pom
but notjar
for the dependency.sbt
(or may be the casecourier
is used) under the condition that the pom is present but the jar is absent..One example is
dependency-plugin
andcommons-io
. Both Spark anddependency-plugin
depends oncommons-io
(dependency-plugin
seems to depend on it indirectly).And
branch-3.1
depends oncommons-io:2.4
, whiledependency-plugin
depends on newercommons-io:2.6
.When
mvn dependency:get
runs, pom is downloaded but doesn't jar forcommons-io:2.6
.Under this condition, if we build with
sbt
,sbt
orcourier
doesn't download the dependent jar, leading this issue.Newer Maven and newer plugins can depends on newer version of the common dependency than what Spark depends on. So I don't think we can't fix this issue using newer Maven or newer plugins.