This is an automated email from the ASF dual-hosted git repository.

srowen pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new e0aa67c  [SPARK-34507][BUILD] Update scala.version in parent POM when 
changing Scala version for cross-build
e0aa67c is described below

commit e0aa67c98424336bc6665142efbc892d02d65edb
Author: Sean Owen <sro...@gmail.com>
AuthorDate: Thu Mar 11 10:02:24 2021 +0900

    [SPARK-34507][BUILD] Update scala.version in parent POM when changing Scala 
version for cross-build
    
    ### What changes were proposed in this pull request?
    
    The `change-scala-version.sh` script updates Scala versions across the 
build for cross-build purposes. It manually changes `scala.binary.version` but 
not `scala.version`.
    
    ### Why are the changes needed?
    
    It seems that this has always been an oversight, and the cross-built builds 
of Spark have an incorrect scala.version. See 2.4.5's 2.12 POM for example, 
which shows a Scala 2.11 version.
    https://search.maven.org/artifact/org.apache.spark/spark-core_2.12/2.4.5/pom
    
    More comments in the JIRA.
    
    ### Does this PR introduce _any_ user-facing change?
    
    Should be a build-only bug fix.
    
    ### How was this patch tested?
    
    Existing tests, but really N/A
    
    Closes #31801 from srowen/SPARK-34507.
    
    Authored-by: Sean Owen <sro...@gmail.com>
    Signed-off-by: HyukjinKwon <gurwls...@apache.org>
---
 dev/change-scala-version.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/dev/change-scala-version.sh b/dev/change-scala-version.sh
index 06411b9..9cdc7d9 100755
--- a/dev/change-scala-version.sh
+++ b/dev/change-scala-version.sh
@@ -60,6 +60,12 @@ BASEDIR=$(dirname $0)/..
 find "$BASEDIR" -name 'pom.xml' -not -path '*target*' -print \
   -exec bash -c "sed_i 's/\(artifactId.*\)_'$FROM_VERSION'/\1_'$TO_VERSION'/g' 
{}" \;
 
+# Update <scala.version> in parent POM
+# First find the right full version from the profile's build
+SCALA_VERSION=`build/mvn help:evaluate -Pscala-${TO_VERSION} 
-Dexpression=scala.version -q -DforceStdout`
+sed_i 
'1,/<scala\.version>[0-9]*\.[0-9]*\.[0-9]*</s/<scala\.version>[0-9]*\.[0-9]*\.[0-9]*</<scala.version>'$SCALA_VERSION'</'
 \
+  "$BASEDIR/pom.xml"
+
 # Also update <scala.binary.version> in parent POM
 # Match any scala binary version to ensure idempotency
 sed_i 
'1,/<scala\.binary\.version>[0-9]*\.[0-9]*</s/<scala\.binary\.version>[0-9]*\.[0-9]*</<scala.binary.version>'$TO_VERSION'</'
 \


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to