Skip to content

Commit

Permalink
Check paths for existence to prevent ignorable error messages during …
Browse files Browse the repository at this point in the history
…build (#9786)

Fixes #9782

Signed-off-by: Gera Shegalov <[email protected]>
  • Loading branch information
gerashegalov authored Nov 22, 2023
1 parent cd3f85f commit 1ca5a09
Show file tree
Hide file tree
Showing 8 changed files with 116 additions and 32 deletions.
26 changes: 17 additions & 9 deletions aggregator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,23 @@
<mkdir dir="${newClassesDir}"/>
<delete dir="${newClassesDir}"/>
<unzip src="${realAggJar}" dest="${newClassesDir}"/>
<mkdir dir="${oldClassesDir}"/>

<exec executable="diff"
resultproperty="diff.result">
<arg value="-q"/>
<arg value="-r"/>
<arg value="${oldClassesDir}"/>
<arg value="${newClassesDir}"/>
</exec>
<ac:if xmlns:ac="antlib:net.sf.antcontrib">
<available file="${oldClassesDir}" type="dir"/>
<then>
<exec executable="diff"
resultproperty="diff.result"
discardOutput="${nonfail.errors.quiet}"
discardError="${nonfail.errors.quiet}">
<arg value="-q"/>
<arg value="-r"/>
<arg value="${oldClassesDir}"/>
<arg value="${newClassesDir}"/>
</exec>
</then>
<else>
<echo>Clean build? Skipping diff because ${oldClassesDir} does not exist</echo>
</else>
</ac:if>

<ac:if xmlns:ac="antlib:net.sf.antcontrib">
<equals arg1="0" arg2="${diff.result}"/>
Expand Down
15 changes: 12 additions & 3 deletions dist/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,18 @@
<goals><goal>run</goal></goals>
<configuration>
<target>
<copy todir="${project.build.directory}/parallel-world">
<fileset dir="${project.build.directory}/jni-deps"/>
</copy>
<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
<ac:if xmlns:ac="antlib:net.sf.antcontrib">
<available file="${project.build.directory}/jni-deps" type="dir"/>
<then>
<copy todir="${project.build.directory}/parallel-world">
<fileset dir="${project.build.directory}/jni-deps"/>
</copy>
</then>
<else>
<fail>Re-execute build with the default `-Drapids.jni.unpack.skip=false`</fail>
</else>
</ac:if>
</target>
</configuration>
</execution>
Expand Down
20 changes: 17 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,7 @@
<bloop.installPhase>install</bloop.installPhase>
<bloop.configDirectory>${spark.rapids.source.basedir}/.bloop</bloop.configDirectory>
<build.info.path>${project.build.outputDirectory}/rapids4spark-version-info.properties</build.info.path>
<nonfail.errors.quiet>false</nonfail.errors.quiet>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -984,11 +985,22 @@
<configuration>
<!-- Execute the shell script to generate the plugin build information. -->
<target name="build-info">
<exec executable="git" outputproperty="git.head.revision">
<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
<exec executable="git"
outputproperty="git.head.revision"
discardError="${nonfail.errors.quiet}">
<arg value="rev-parse"/>
<arg value="HEAD"/>
</exec>
<property file="${build.info.path}" prefix="saved.build-info"/>
<ac:if xmlns:ac="antlib:net.sf.antcontrib">
<available file="${build.info.path}" type="file"/>
<then>
<property file="${build.info.path}" prefix="saved.build-info"/>
</then>
<else>
<property name="saved.build-info.revision" value="N/A"/>
</else>
</ac:if>
<echo>
Comparing git revisions:
previous=${saved.build-info.revision}
Expand Down Expand Up @@ -1471,7 +1483,9 @@ This will force full Scala code rebuild in downstream modules.
</pathconvert>
<echo>Cleaning build directories of all modules ${target.dirs.str}</echo>
<!-- workaround ant delete does not work with dirset -->
<exec dir="${project.basedir}" executable="rm">
<exec dir="${project.basedir}"
executable="rm"
discardError="${nonfail.errors.quiet}">
<arg value="-rf"/>
<arg line="${target.dirs.str}"/>
</exec>
Expand Down
26 changes: 17 additions & 9 deletions scala2.13/aggregator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,23 @@
<mkdir dir="${newClassesDir}"/>
<delete dir="${newClassesDir}"/>
<unzip src="${realAggJar}" dest="${newClassesDir}"/>
<mkdir dir="${oldClassesDir}"/>

<exec executable="diff"
resultproperty="diff.result">
<arg value="-q"/>
<arg value="-r"/>
<arg value="${oldClassesDir}"/>
<arg value="${newClassesDir}"/>
</exec>
<ac:if xmlns:ac="antlib:net.sf.antcontrib">
<available file="${oldClassesDir}" type="dir"/>
<then>
<exec executable="diff"
resultproperty="diff.result"
discardOutput="${nonfail.errors.quiet}"
discardError="${nonfail.errors.quiet}">
<arg value="-q"/>
<arg value="-r"/>
<arg value="${oldClassesDir}"/>
<arg value="${newClassesDir}"/>
</exec>
</then>
<else>
<echo>Clean build? Skipping diff because ${oldClassesDir} does not exist</echo>
</else>
</ac:if>

<ac:if xmlns:ac="antlib:net.sf.antcontrib">
<equals arg1="0" arg2="${diff.result}"/>
Expand Down
15 changes: 12 additions & 3 deletions scala2.13/dist/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,18 @@
<goals><goal>run</goal></goals>
<configuration>
<target>
<copy todir="${project.build.directory}/parallel-world">
<fileset dir="${project.build.directory}/jni-deps"/>
</copy>
<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
<ac:if xmlns:ac="antlib:net.sf.antcontrib">
<available file="${project.build.directory}/jni-deps" type="dir"/>
<then>
<copy todir="${project.build.directory}/parallel-world">
<fileset dir="${project.build.directory}/jni-deps"/>
</copy>
</then>
<else>
<fail>Re-execute build with the default `-Drapids.jni.unpack.skip=false`</fail>
</else>
</ac:if>
</target>
</configuration>
</execution>
Expand Down
20 changes: 17 additions & 3 deletions scala2.13/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,7 @@
<bloop.installPhase>install</bloop.installPhase>
<bloop.configDirectory>${spark.rapids.source.basedir}/.bloop</bloop.configDirectory>
<build.info.path>${project.build.outputDirectory}/rapids4spark-version-info.properties</build.info.path>
<nonfail.errors.quiet>false</nonfail.errors.quiet>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -984,11 +985,22 @@
<configuration>
<!-- Execute the shell script to generate the plugin build information. -->
<target name="build-info">
<exec executable="git" outputproperty="git.head.revision">
<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
<exec executable="git"
outputproperty="git.head.revision"
discardError="${nonfail.errors.quiet}">
<arg value="rev-parse"/>
<arg value="HEAD"/>
</exec>
<property file="${build.info.path}" prefix="saved.build-info"/>
<ac:if xmlns:ac="antlib:net.sf.antcontrib">
<available file="${build.info.path}" type="file"/>
<then>
<property file="${build.info.path}" prefix="saved.build-info"/>
</then>
<else>
<property name="saved.build-info.revision" value="N/A"/>
</else>
</ac:if>
<echo>
Comparing git revisions:
previous=${saved.build-info.revision}
Expand Down Expand Up @@ -1471,7 +1483,9 @@ This will force full Scala code rebuild in downstream modules.
</pathconvert>
<echo>Cleaning build directories of all modules ${target.dirs.str}</echo>
<!-- workaround ant delete does not work with dirset -->
<exec dir="${project.basedir}" executable="rm">
<exec dir="${project.basedir}"
executable="rm"
discardError="${nonfail.errors.quiet}">
<arg value="-rf"/>
<arg line="${target.dirs.str}"/>
</exec>
Expand Down
13 changes: 12 additions & 1 deletion scala2.13/sql-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,18 @@
value="${servicesDir}/com.nvidia.spark.rapids.SparkShimServiceProvider"/>
<property name="shimServiceClass"
value="com.nvidia.spark.rapids.shims.${spark.version.classifier}.SparkShimServiceProvider"/>
<loadfile property="currentServiceClass" srcFile="${serviceFile}" failonerror="false"/>
<ac:if xmlns:ac="antlib:net.sf.antcontrib">
<available file="${serviceFile}" type="file"/>
<then>
<loadfile property="currentServiceClass"
srcFile="${serviceFile}"
failonerror="false"
quiet="${nonfail.errors.quiet}"/>
</then>
<else>
<property name="currentServiceClass" value="N/A"/>
</else>
</ac:if>
<ac:if xmlns:ac="antlib:net.sf.antcontrib">
<equals arg1="${currentServiceClass}" arg2="${shimServiceClass}${line.separator}"/>
<then>
Expand Down
13 changes: 12 additions & 1 deletion sql-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,18 @@
value="${servicesDir}/com.nvidia.spark.rapids.SparkShimServiceProvider"/>
<property name="shimServiceClass"
value="com.nvidia.spark.rapids.shims.${spark.version.classifier}.SparkShimServiceProvider"/>
<loadfile property="currentServiceClass" srcFile="${serviceFile}" failonerror="false"/>
<ac:if xmlns:ac="antlib:net.sf.antcontrib">
<available file="${serviceFile}" type="file"/>
<then>
<loadfile property="currentServiceClass"
srcFile="${serviceFile}"
failonerror="false"
quiet="${nonfail.errors.quiet}"/>
</then>
<else>
<property name="currentServiceClass" value="N/A"/>
</else>
</ac:if>
<ac:if xmlns:ac="antlib:net.sf.antcontrib">
<equals arg1="${currentServiceClass}" arg2="${shimServiceClass}${line.separator}"/>
<then>
Expand Down

0 comments on commit 1ca5a09

Please sign in to comment.