Bug 1591538 - Use rsync to generate the SM tarball; r=sfink
authorAnthony Ramine <nox@nox.paris>
Mon, 18 Nov 2019 08:51:15 +0000
changeset 502382 752245d75539a0a94f5d619782beb340ffe1f2d9
parent 502381 08a1847989107cb554a0721cf3697768ac21f736
child 502383 a475978e4f2f35b5148205a69d6f54919b1d1462
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs1591538
milestone72.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1591538 - Use rsync to generate the SM tarball; r=sfink This lets us exclude things more surgically. Differential Revision: https://phabricator.services.mozilla.com/D50737
js/src/make-source-package.sh
--- a/js/src/make-source-package.sh
+++ b/js/src/make-source-package.sh
@@ -2,16 +2,17 @@
 
 # Find out ASAP if some command breaks here, because we're copying a lot of
 # files we don't actually maintain ourselves, and requirements could easily be
 # broken.
 set -e
 
 : ${MKDIR:=mkdir}
 : ${TAR:=tar}
+: ${RSYNC:=rsync}
 : ${AUTOCONF:=$(which autoconf-2.13 autoconf2.13 autoconf213 | head -1)}
 : ${SRCDIR:=$(cd $(dirname $0); pwd 2>/dev/null)}
 : ${MOZJS_NAME:=mozjs}
 # The place to gather files to be added to the tarball.
 : ${STAGING:=/tmp/mozjs-src-pkg}
 # The place to put the resulting tarball.
 : ${DIST:=/tmp}
 
@@ -30,16 +31,17 @@ pkg="${version}.tar.bz2"
 pkgpath="${DIST}/${pkg}"
 taropts="-jcf"
 
 # need these environment vars:
 echo "Environment:"
 echo "    MAKE = $MAKE"
 echo "    MKDIR = $MKDIR"
 echo "    TAR = $TAR"
+echo "    RSYNC = $RSYNC"
 echo "    AUTOCONF = $AUTOCONF"
 echo "    STAGING = $STAGING"
 echo "    DIST = $DIST"
 echo "    SRCDIR = $SRCDIR"
 echo "    MOZJS_NAME = $MOZJS_NAME"
 echo "    MOZJS_MAJOR_VERSION = $MOZJS_MAJOR_VERSION"
 echo "    MOZJS_MINOR_VERSION = $MOZJS_MINOR_VERSION"
 echo "    MOZJS_PATCH_VERSION = $MOZJS_PATCH_VERSION"
@@ -64,142 +66,94 @@ case $cmd in
 
     echo "Staging source tarball in ${tgtpath}..."
     if [ -d ${tgtpath} ]; then
         echo "WARNING - dist tree ${tgtpath} already exists!"
     fi
 
     ${MKDIR} -p ${tgtpath}
 
-    # Top-level config and build files
-    cp -pPR \
-        ${TOPSRCDIR}/LICENSE \
-        ${TOPSRCDIR}/Makefile.in \
-        ${TOPSRCDIR}/configure.py \
-        ${TOPSRCDIR}/moz.build \
-        ${TOPSRCDIR}/moz.configure \
-        ${TOPSRCDIR}/test.mozbuild \
-        ${tgtpath}/
+    rsync \
+        --delete-excluded \
+        --prune-empty-dirs \
+        --quiet \
+        --recursive \
+        "${TOPSRCDIR}"/ ${tgtpath}/ \
+        --filter=". -" <<FILTER_EOF
+# Top-level config and build files
 
-    # Additional libraries (optionally) used by SpiderMonkey
-    cp -pPR \
-        ${TOPSRCDIR}/mfbt \
-        ${TOPSRCDIR}/nsprpub \
-        ${tgtpath}/
++ /configure.py
++ /LICENSE
++ /Makefile.in
++ /moz.build
++ /moz.configure
++ /test.mozbuild
 
-    ${MKDIR} -p ${tgtpath}/intl
-    cp -pPR \
-        ${TOPSRCDIR}/intl/icu \
-        ${tgtpath}/intl/
-
-    ${MKDIR} -p ${tgtpath}/memory
-    cp -pPR \
-        ${TOPSRCDIR}/memory/moz.build \
-        ${TOPSRCDIR}/memory/build \
-        ${TOPSRCDIR}/memory/mozalloc \
-        ${tgtpath}/memory/
+# Additional libraries (optionally) used by SpiderMonkey
 
-    ${MKDIR} -p ${tgtpath}/modules
-    cp -pPR \
-        ${TOPSRCDIR}/modules/fdlibm \
-        ${TOPSRCDIR}/modules/zlib \
-        ${tgtpath}/modules/
++ /mfbt/**
++ /nsprpub/**
 
-    ${MKDIR} -p ${tgtpath}/mozglue
-    cp -pPR \
-        ${TOPSRCDIR}/mozglue/baseprofiler \
-        ${TOPSRCDIR}/mozglue/build \
-        ${TOPSRCDIR}/mozglue/misc \
-        ${TOPSRCDIR}/mozglue/moz.build \
-        ${TOPSRCDIR}/mozglue/static \
-        ${tgtpath}/mozglue/
++ /intl/icu/**
+
++ /memory/build/**
++ /memory/moz.build
++ /memory/mozalloc/**
 
-    ${MKDIR} -p ${tgtpath}/tools/fuzzing
-    cp -pPR \
-        ${TOPSRCDIR}/tools/fuzzing/moz.build \
-        ${TOPSRCDIR}/tools/fuzzing/interface \
-        ${TOPSRCDIR}/tools/fuzzing/registry \
-        ${TOPSRCDIR}/tools/fuzzing/libfuzzer \
-        ${tgtpath}/tools/fuzzing/
++ /modules/fdlibm/**
++ /modules/zlib/**
 
-
-    # Build system and dependencies
-    cp -pPR \
-        ${TOPSRCDIR}/build \
-        ${TOPSRCDIR}/config \
-        ${TOPSRCDIR}/python \
-        ${tgtpath}/
++ /mozglue/baseprofiler/**
++ /mozglue/build/**
++ /mozglue/misc/**
++ /mozglue/moz.build
++ /mozglue/static/**
 
-    ${MKDIR} -p ${tgtpath}/.cargo
-    cp -pPR \
-        ${TOPSRCDIR}/.cargo/config.in \
-        ${tgtpath}/.cargo/
++ /tools/fuzzing/moz.build
++ /tools/fuzzing/interface/**
++ /tools/fuzzing/registry/**
++ /tools/fuzzing/libfuzzer/**
 
-    ${MKDIR} -p ${tgtpath}/third_party
-    cp -pPR \
-        ${TOPSRCDIR}/third_party/python \
-        ${TOPSRCDIR}/third_party/rust \
-        ${tgtpath}/third_party/
+# Build system and dependencies
 
-    ${MKDIR} -p ${tgtpath}/dom/bindings
-    cp -pPR \
-        ${TOPSRCDIR}/dom/bindings/mozwebidlcodegen \
-        ${tgtpath}/dom/bindings/
++ /build/**
++ /config/**
++ /python/**
 
-    ${MKDIR} -p ${tgtpath}/layout/tools/reftest
-    cp -pPR \
-        ${TOPSRCDIR}/layout/tools/reftest/reftest \
-        ${tgtpath}/layout/tools/reftest/
++ /.cargo/config.in
 
-    ${MKDIR} -p ${tgtpath}/testing
-    cp -pPR \
-        ${TOPSRCDIR}/testing/mozbase \
-        ${tgtpath}/testing/
++ /third_party/python/**
++ /third_party/rust/**
 
-    ${MKDIR} -p ${tgtpath}/testing/web-platform/tests
-    cp -pPR \
-        ${TOPSRCDIR}/testing/web-platform/tests/streams \
-        ${tgtpath}/testing/web-platform/tests/
++ /dom/bindings/mozwebidlcodegen/**
+
++ /layout/tools/reftest/reftest/**
 
-    ${MKDIR} -p ${tgtpath}/taskcluster/taskgraph
-    cp -pPR \
-        ${TOPSRCDIR}/taskcluster/moz.build \
-        ${tgtpath}/taskcluster/
-    cp -pPR \
-        ${TOPSRCDIR}/taskcluster/taskgraph/test \
-        ${tgtpath}/taskcluster/taskgraph/
++ /testing/mozbase/**
++ /testing/web-platform/tests/streams/**
 
-    ${MKDIR} -p ${tgtpath}/toolkit/crashreporter/tools
-    cp -pPR \
-        ${TOPSRCDIR}/toolkit/crashreporter/tools/symbolstore.py \
-        ${tgtpath}/toolkit/crashreporter/tools/
++ /taskcluster/moz.build
++ /taskcluster/taskgraph/test/**
+
++ /toolkit/crashreporter/tools/symbolstore.py
++ /toolkit/mozapps/installer/package-name.mk
++ /toolkit/mozapps/installer/upload-files.mk
 
-    ${MKDIR} -p ${tgtpath}/toolkit/mozapps/installer
-    cp -pPR \
-        ${TOPSRCDIR}/toolkit/mozapps/installer/package-name.mk \
-        ${TOPSRCDIR}/toolkit/mozapps/installer/upload-files.mk \
-        ${tgtpath}/toolkit/mozapps/installer/
-
-
-    # SpiderMonkey itself
+# SpiderMonkey itself
 
-    ${MKDIR} -p ${tgtpath}/js/src
-    cp -pPR \
-        ${TOPSRCDIR}/js/app.mozbuild \
-        ${TOPSRCDIR}/js/*.configure \
-        ${tgtpath}/js/
-    cp -pPR \
-        ${TOPSRCDIR}/js/examples \
-        ${TOPSRCDIR}/js/public \
-        ${TOPSRCDIR}/js/rust \
-        ${tgtpath}/js/
++ /js/src/**
++ /js/app.mozbuild
++ /js/*.configure
++ /js/examples/**
++ /js/public/**
++ /js/rust/**
 
-    find ${TOPSRCDIR}/js/src -mindepth 1 -maxdepth 1 -not -path ${STAGING} -a -not -name ${pkg} \
-        -exec cp -pPR {} ${tgtpath}/js/src/ \;
-
++ */
+- /**
+FILTER_EOF
 
     # Generate configure files to avoid build dependency on autoconf-2.13
     cp -pPR ${TOPSRCDIR}/js/src/configure.in ${tgtpath}/js/src/configure
     chmod a+x ${tgtpath}/js/src/configure
     ${AUTOCONF} --localdir=${TOPSRCDIR}/js/src \
         ${TOPSRCDIR}/js/src/old-configure.in >${tgtpath}/js/src/old-configure
 
     # Copy or create INSTALL