diff --git a/taskcluster/docker/snap-coreXX-build/Dockerfile b/taskcluster/docker/snap-coreXX-build/Dockerfile index 0e1e5fe6a7a5..847f3822eb6e 100644 --- a/taskcluster/docker/snap-coreXX-build/Dockerfile +++ b/taskcluster/docker/snap-coreXX-build/Dockerfile @@ -36,6 +36,7 @@ COPY install-snap.sh /usr/local/bin/ RUN install-snap.sh core +# 8.11.1 is https://api.snapcraft.io/api/v1/snaps/download/vMTKRaLjnOJQetI78HjntT37VuoyssFE_15600.snap RUN install-snap.sh snapcraft RUN install-snap.sh $SNAP_BASE @@ -66,6 +67,14 @@ ENV SNAP_INSTANCE_KEY= ENV SNAP_INSTANCE_NAME=snapcraft ENV SNAPCRAFT_PLATFORM= +# Bug 1985494 +# +# The change at https://github.com/canonical/craft-application/commit/f3436a9eab1eeed3ad6d44d9d430b5f4b008f7d8 +# moved configuration query and breaks us in docker +# This is a temporary workaround and proper fix should be done: +# - either there's a way to feed the configuration to avoid hitting snapctl +# - or we need to introduce a way to bypass that properly with upstream +RUN sed -ri 's/debug_mode = .*/debug_mode = False/g' /snap/snapcraft/current/lib/python*/site-packages/craft_application/application.py RUN snapcraft --version # Snapcraft pull will need to sudo apt-get update ... diff --git a/taskcluster/docker/snap-coreXX-build/install-snap.sh b/taskcluster/docker/snap-coreXX-build/install-snap.sh index 7b7a5719b27e..fe965f28e496 100755 --- a/taskcluster/docker/snap-coreXX-build/install-snap.sh +++ b/taskcluster/docker/snap-coreXX-build/install-snap.sh @@ -3,6 +3,7 @@ set -ex SNAP_TO_INSTALL=$1 +SNAP_URL=$2 if [ -z "${SNAP_TO_INSTALL}" ]; then echo "Please give a snap name" @@ -13,11 +14,12 @@ fi # place (the 'Snap-CDN: none' header allows building in restricted network # environments such as Launchpad builders) +if [ -z "${SNAP_URL}" ]; then + SNAP_URL=$(curl -H 'X-Ubuntu-Series: 16' "https://api.snapcraft.io/api/v1/snaps/details/${SNAP_TO_INSTALL}?channel=stable" | jq '.download_url' -r) +fi + # shellcheck disable=SC2046 -curl -L \ - -H 'Snap-CDN: none' \ - $(curl -H 'X-Ubuntu-Series: 16' "https://api.snapcraft.io/api/v1/snaps/details/${SNAP_TO_INSTALL}?channel=stable" | jq '.download_url' -r) \ - --output "${SNAP_TO_INSTALL}.snap" +curl -L -H 'Snap-CDN: none' "$SNAP_URL" --output "${SNAP_TO_INSTALL}.snap" mkdir -p "/snap/${SNAP_TO_INSTALL}" diff --git a/taskcluster/docker/snap-coreXX-build/run.sh b/taskcluster/docker/snap-coreXX-build/run.sh index 4fd4a90bc6d8..03c2f9a05f85 100755 --- a/taskcluster/docker/snap-coreXX-build/run.sh +++ b/taskcluster/docker/snap-coreXX-build/run.sh @@ -27,6 +27,8 @@ MOZCONFIG=mozconfig.in USE_SNAP_FROM_STORE_OR_MC=${USE_SNAP_FROM_STORE_OR_MC:-0} +sudo mkdir -p /run/user/1000 && sudo chown 1000:1000 /run/user/1000 + TRY=0 if [ "${BRANCH}" = "try" ]; then if [ "${SOURCE_BRANCH}" = "try" ]; then