Bug 1430073 - Snap: Move executable outside of $WORKSPACE/source/opt/firefox r=sfraser
authorJohan Lorenzo <jlorenzo@mozilla.com>
Fri, 12 Jan 2018 13:51:40 +0100
changeset 453750 f9fe9a19adc4b7ee199afe5f755ed3dcf6a46a88
parent 453749 16dc5da96ab6265e8071adfbdd7a8f54ec7b9002
child 453751 bdd0bea249e3ded6e7e9a263ee002205ec30abf9
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfraser
bugs1430073
milestone59.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 1430073 - Snap: Move executable outside of $WORKSPACE/source/opt/firefox r=sfraser MozReview-Commit-ID: 1Fqeg04yncD
taskcluster/docker/firefox-snap/runme.sh
taskcluster/docker/firefox-snap/snapcraft.yaml.in
--- a/taskcluster/docker/firefox-snap/runme.sh
+++ b/taskcluster/docker/firefox-snap/runme.sh
@@ -10,48 +10,46 @@ test $CANDIDATES_DIR
 # Optional env variables
 : WORKSPACE                     ${WORKSPACE:=/home/worker/workspace}
 : ARTIFACTS_DIR                 ${ARTIFACTS_DIR:=/home/worker/artifacts}
 
 SCRIPT_DIRECTORY="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 
 TARGET="firefox-${VERSION}.snap"
 TARGET_FULL_PATH="$ARTIFACTS_DIR/$TARGET"
+SOURCE_DEST="${WORKSPACE}/source"
 
 mkdir -p "$ARTIFACTS_DIR"
-rm -rf "${WORKSPACE}/source" && mkdir -p "${WORKSPACE}/source/opt" "${WORKSPACE}/source/usr/bin"
+rm -rf "$SOURCE_DEST" && mkdir -p "$SOURCE_DEST"
 
 CURL="curl --location --retry 10 --retry-delay 10"
 
 # Download and extract en-US linux64 binary
 $CURL -o "${WORKSPACE}/firefox.tar.bz2" \
     "${CANDIDATES_DIR}/${VERSION}-candidates/build${BUILD_NUMBER}/linux-x86_64/en-US/firefox-${VERSION}.tar.bz2"
-tar -C "${WORKSPACE}/source/opt" -xf "${WORKSPACE}/firefox.tar.bz2"
+tar -C "$SOURCE_DEST" -xf "${WORKSPACE}/firefox.tar.bz2" --strip-components=1
 
 # Get Ubuntu configuration
 PARTNER_CONFIG_DIR="$WORKSPACE/partner_config"
 git clone https://github.com/mozilla-partners/canonical.git "$PARTNER_CONFIG_DIR"
 
-DISTRIBUTION_DIR="$WORKSPACE/source/opt/firefox/distribution"
+DISTRIBUTION_DIR="$SOURCE_DEST/distribution"
 mv "$PARTNER_CONFIG_DIR/desktop/ubuntu/distribution" "$DISTRIBUTION_DIR"
 cp -v "$SCRIPT_DIRECTORY/firefox.desktop" "$DISTRIBUTION_DIR"
 
 # Use release-specific list of locales to fetch L10N XPIs
 $CURL -o "${WORKSPACE}/l10n_changesets.txt" "${CANDIDATES_DIR}/${VERSION}-candidates/build${BUILD_NUMBER}/l10n_changesets.txt"
 cat "${WORKSPACE}/l10n_changesets.txt"
 
 mkdir -p "$DISTRIBUTION_DIR/extensions"
 for locale in $(grep -v ja-JP-mac "${WORKSPACE}/l10n_changesets.txt" | awk '{print $1}'); do
-    $CURL -o "${WORKSPACE}/source/opt/firefox/distribution/extensions/langpack-${locale}@firefox.mozilla.org.xpi" \
+    $CURL -o "$SOURCE_DEST/distribution/extensions/langpack-${locale}@firefox.mozilla.org.xpi" \
         "$CANDIDATES_DIR/${VERSION}-candidates/build${BUILD_NUMBER}/linux-x86_64/xpi/${locale}.xpi"
 done
 
-# Symlink firefox binary to /usr/bin to make it available in PATH
-ln -s ../../opt/firefox/firefox "${WORKSPACE}/source/usr/bin"
-
 # Generate snapcraft manifest
 sed -e "s/@VERSION@/${VERSION}/g" -e "s/@BUILD_NUMBER@/${BUILD_NUMBER}/g" snapcraft.yaml.in > ${WORKSPACE}/snapcraft.yaml
 cd ${WORKSPACE}
 snapcraft
 
 mv *.snap "$TARGET_FULL_PATH"
 
 cd $ARTIFACTS_DIR
--- a/taskcluster/docker/firefox-snap/snapcraft.yaml.in
+++ b/taskcluster/docker/firefox-snap/snapcraft.yaml.in
@@ -2,18 +2,18 @@ name: firefox
 version: @VERSION@-@BUILD_NUMBER@
 summary: Mozilla Firefox web browser
 description:  Firefox is a powerful, extensible web browser with support for modern web application technologies.
 confinement: strict
 grade: stable
 
 apps:
   firefox:
-    command: desktop-launch firefox
-    desktop: opt/firefox/distribution/firefox.desktop
+    command: desktop-launch $SNAP/firefox
+    desktop: distribution/firefox.desktop
     environment:
       DISABLE_WAYLAND: 1
     plugs:
       - avahi-observe
       - browser-sandbox
       - camera
       - cups-control
       - desktop