-
Notifications
You must be signed in to change notification settings - Fork 28.4k
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-20123][build]$SPARK_HOME variable might have spaces in it(e.g. $SPARK… #17452
Changes from all 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 |
---|---|---|
|
@@ -140,7 +140,7 @@ echo "Spark version is $VERSION" | |
if [ "$MAKE_TGZ" == "true" ]; then | ||
echo "Making spark-$VERSION-bin-$NAME.tgz" | ||
else | ||
echo "Making distribution for Spark $VERSION in $DISTDIR..." | ||
echo "Making distribution for Spark $VERSION in '$DISTDIR'..." | ||
fi | ||
|
||
# Build uber fat JAR | ||
|
@@ -170,7 +170,7 @@ cp "$SPARK_HOME"/assembly/target/scala*/jars/* "$DISTDIR/jars/" | |
|
||
# Only create the yarn directory if the yarn artifacts were build. | ||
if [ -f "$SPARK_HOME"/common/network-yarn/target/scala*/spark-*-yarn-shuffle.jar ]; then | ||
mkdir "$DISTDIR"/yarn | ||
mkdir "$DISTDIR/yarn" | ||
cp "$SPARK_HOME"/common/network-yarn/target/scala*/spark-*-yarn-shuffle.jar "$DISTDIR/yarn" | ||
fi | ||
|
||
|
@@ -179,7 +179,7 @@ mkdir -p "$DISTDIR/examples/jars" | |
cp "$SPARK_HOME"/examples/target/scala*/jars/* "$DISTDIR/examples/jars" | ||
|
||
# Deduplicate jars that have already been packaged as part of the main Spark dependencies. | ||
for f in "$DISTDIR/examples/jars/"*; do | ||
for f in "$DISTDIR"/examples/jars/*; do | ||
name=$(basename "$f") | ||
if [ -f "$DISTDIR/jars/$name" ]; then | ||
rm "$DISTDIR/examples/jars/$name" | ||
|
@@ -188,14 +188,14 @@ done | |
|
||
# Copy example sources (needed for python and SQL) | ||
mkdir -p "$DISTDIR/examples/src/main" | ||
cp -r "$SPARK_HOME"/examples/src/main "$DISTDIR/examples/src/" | ||
cp -r "$SPARK_HOME/examples/src/main" "$DISTDIR/examples/src/" | ||
|
||
# Copy license and ASF files | ||
cp "$SPARK_HOME/LICENSE" "$DISTDIR" | ||
cp -r "$SPARK_HOME/licenses" "$DISTDIR" | ||
cp "$SPARK_HOME/NOTICE" "$DISTDIR" | ||
|
||
if [ -e "$SPARK_HOME"/CHANGES.txt ]; then | ||
if [ -e "$SPARK_HOME/CHANGES.txt" ]; then | ||
cp "$SPARK_HOME/CHANGES.txt" "$DISTDIR" | ||
fi | ||
|
||
|
@@ -217,43 +217,43 @@ fi | |
# Make R package - this is used for both CRAN release and packing R layout into distribution | ||
if [ "$MAKE_R" == "true" ]; then | ||
echo "Building R source package" | ||
R_PACKAGE_VERSION=`grep Version $SPARK_HOME/R/pkg/DESCRIPTION | awk '{print $NF}'` | ||
R_PACKAGE_VERSION=`grep Version "$SPARK_HOME/R/pkg/DESCRIPTION" | awk '{print $NF}'` | ||
pushd "$SPARK_HOME/R" > /dev/null | ||
# Build source package and run full checks | ||
# Do not source the check-cran.sh - it should be run from where it is for it to set SPARK_HOME | ||
NO_TESTS=1 "$SPARK_HOME/"R/check-cran.sh | ||
NO_TESTS=1 "$SPARK_HOME/R/check-cran.sh" | ||
|
||
# Move R source package to match the Spark release version if the versions are not the same. | ||
# NOTE(shivaram): `mv` throws an error on Linux if source and destination are same file | ||
if [ "$R_PACKAGE_VERSION" != "$VERSION" ]; then | ||
mv $SPARK_HOME/R/SparkR_"$R_PACKAGE_VERSION".tar.gz $SPARK_HOME/R/SparkR_"$VERSION".tar.gz | ||
mv "$SPARK_HOME/R/SparkR_$R_PACKAGE_VERSION.tar.gz" "$SPARK_HOME/R/SparkR_$VERSION.tar.gz" | ||
fi | ||
|
||
# Install source package to get it to generate vignettes rds files, etc. | ||
VERSION=$VERSION "$SPARK_HOME/"R/install-source-package.sh | ||
VERSION=$VERSION "$SPARK_HOME/R/install-source-package.sh" | ||
popd > /dev/null | ||
else | ||
echo "Skipping building R source package" | ||
fi | ||
|
||
# Copy other things | ||
mkdir "$DISTDIR"/conf | ||
cp "$SPARK_HOME"/conf/*.template "$DISTDIR"/conf | ||
mkdir "$DISTDIR/conf" | ||
cp "$SPARK_HOME"/conf/*.template "$DISTDIR/conf" | ||
cp "$SPARK_HOME/README.md" "$DISTDIR" | ||
cp -r "$SPARK_HOME/bin" "$DISTDIR" | ||
cp -r "$SPARK_HOME/python" "$DISTDIR" | ||
|
||
# Remove the python distribution from dist/ if we built it | ||
if [ "$MAKE_PIP" == "true" ]; then | ||
rm -f $DISTDIR/python/dist/pyspark-*.tar.gz | ||
rm -f "$DISTDIR"/python/dist/pyspark-*.tar.gz | ||
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.
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. Doesn't that fail to work because 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. it is wrong if we quote the arg 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. ok I see that other thread... |
||
fi | ||
|
||
cp -r "$SPARK_HOME/sbin" "$DISTDIR" | ||
# Copy SparkR if it exists | ||
if [ -d "$SPARK_HOME"/R/lib/SparkR ]; then | ||
mkdir -p "$DISTDIR"/R/lib | ||
cp -r "$SPARK_HOME/R/lib/SparkR" "$DISTDIR"/R/lib | ||
cp "$SPARK_HOME/R/lib/sparkr.zip" "$DISTDIR"/R/lib | ||
if [ -d "$SPARK_HOME/R/lib/SparkR" ]; then | ||
mkdir -p "$DISTDIR/R/lib" | ||
cp -r "$SPARK_HOME/R/lib/SparkR" "$DISTDIR/R/lib" | ||
cp "$SPARK_HOME/R/lib/sparkr.zip" "$DISTDIR/R/lib" | ||
fi | ||
|
||
if [ "$MAKE_TGZ" == "true" ]; then | ||
|
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 the two args need quoting separately?
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.
oh NO, it might be wrong if we quote the arg $SPARK_HOME/conf/*.template as a whole.
It works well already and the debug info as follows :
+ mkdir '/home/spark build/spark/dist/conf'
+ cp '/home/spark build/spark/conf/docker.properties.template' '/home/spark build/spark/conf/fairscheduler.xml.template' '/home/spark build/spark/conf/log4j.properties.template' '/home/spark build/spark/conf/metrics.properties.template' '/home/spark build/spark/conf/slaves.template' '/home/spark build/spark/conf/spark-defaults.conf.template' '/home/spark build/spark/conf/spark-env.sh.template' '/home/spark build/spark/dist/conf'
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.
Sorry, yes that's also correct. But right now this is just one big argument to cp, not 2 or more. Doesn't it need to be more like
cp "$SPARK_HOME"/conf/*.template "$DISTDIR/conf"
?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.
Of course i use
cp "$SPARK_HOME"/conf/*.template "$DISTDIR/conf"
to get the debug info. You can write a test.sh and $ sh -x test.sh for debug.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.
Hm, I don't see that this works.
What am I missing?
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.
If you quote
f* bar
,f* bar
will be treated as one argument. The error is missing the destination file.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.
OK the line above is correct. I must be crazy, I thought I read it earlier as being one big quoted argument. If it wasn't that way before then I must have misread it and you can ignore this comment.