Bug 1570054: Specify `UPLOAD_DIR` explicitly in taskgraph for docker-worker built toolchains; r=glandium
authorTom Prince <mozilla@hocat.ca>
Mon, 29 Jul 2019 10:32:50 -0600
changeset 485935 78ec10f9e93c6c14fb1de9e34bec4dda9a3835df
parent 485934 d7b5f558fe69ab98e61f8fdb5b12c59fbc966413
child 485936 b51ee02350943b85c837cedfa0ce4f12f2b409ad
push id36378
push usercsabou@mozilla.com
push dateFri, 02 Aug 2019 16:02:34 +0000
treeherdermozilla-central@c0b4e4289875 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1570054
milestone70.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 1570054: Specify `UPLOAD_DIR` explicitly in taskgraph for docker-worker built toolchains; r=glandium Differential Revision: https://phabricator.services.mozilla.com/D39903
taskcluster/ci/toolchain/rust.yml
taskcluster/scripts/misc/build-binutils-linux.sh
taskcluster/scripts/misc/build-cbindgen.sh
taskcluster/scripts/misc/build-cctools-port.sh
taskcluster/scripts/misc/build-clang-4.0-linux.sh
taskcluster/scripts/misc/build-clang-7-linux.sh
taskcluster/scripts/misc/build-clang-8-android.sh
taskcluster/scripts/misc/build-clang-8-linux-aarch64-cross.sh
taskcluster/scripts/misc/build-clang-8-linux-macosx-cross.sh
taskcluster/scripts/misc/build-clang-8-linux.sh
taskcluster/scripts/misc/build-clang-8-mingw.sh
taskcluster/scripts/misc/build-clang-macosx.sh
taskcluster/scripts/misc/build-clang-tidy-linux.sh
taskcluster/scripts/misc/build-clang-tidy-macosx.sh
taskcluster/scripts/misc/build-custom-v8.sh
taskcluster/scripts/misc/build-dist-toolchains.sh
taskcluster/scripts/misc/build-gcc-6-linux.sh
taskcluster/scripts/misc/build-gcc-7-linux.sh
taskcluster/scripts/misc/build-gcc-8-linux.sh
taskcluster/scripts/misc/build-gcc-9-linux.sh
taskcluster/scripts/misc/build-gcc-mingw32.sh
taskcluster/scripts/misc/build-gcc-sixgill-plugin-linux.sh
taskcluster/scripts/misc/build-gn-linux.sh
taskcluster/scripts/misc/build-gn-macosx.sh
taskcluster/scripts/misc/build-grcov.sh
taskcluster/scripts/misc/build-hfsplus-linux.sh
taskcluster/scripts/misc/build-infer-linux.sh
taskcluster/scripts/misc/build-libdmg-hfsplus.sh
taskcluster/scripts/misc/build-llvm-dsymutil.sh
taskcluster/scripts/misc/build-mar-tools.sh
taskcluster/scripts/misc/build-mingw-fxc2-x86.sh
taskcluster/scripts/misc/build-mingw32-nsis.sh
taskcluster/scripts/misc/build-minidump-stackwalk.sh
taskcluster/scripts/misc/build-nasm.sh
taskcluster/scripts/misc/build-rust-size.sh
taskcluster/scripts/misc/build-sccache.sh
taskcluster/scripts/misc/build-tup-linux.sh
taskcluster/scripts/misc/build-upx.sh
taskcluster/scripts/misc/build-wine.sh
taskcluster/scripts/misc/repack-node.sh
taskcluster/scripts/run-task
taskcluster/taskgraph/transforms/job/common.py
--- a/taskcluster/ci/toolchain/rust.yml
+++ b/taskcluster/ci/toolchain/rust.yml
@@ -2,18 +2,16 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 ---
 job-defaults:
     description: "rust repack"
     worker-type: b-linux
     worker:
         max-run-time: 7200
-        env:
-            UPLOAD_DIR: artifacts
     run:
         script: repack_rust.py
         toolchain-artifact: public/build/rustc.tar.xz
 
 linux64-rust-1.28:
     treeherder:
         symbol: TL(rust-1.28)
     run:
--- a/taskcluster/scripts/misc/build-binutils-linux.sh
+++ b/taskcluster/scripts/misc/build-binutils-linux.sh
@@ -1,16 +1,15 @@
 #!/bin/bash
 set -x -e -v
 
 # This script is for building binutils for Linux.
 
 WORKSPACE=$HOME/workspace
 HOME_DIR=$WORKSPACE/build
-UPLOAD_DIR=$HOME/artifacts
 
 cd $HOME_DIR/src
 
 build/unix/build-binutils/build-binutils.sh $HOME_DIR
 
 # Put a tarball in the artifacts dir
 mkdir -p $UPLOAD_DIR
 cp $HOME_DIR/binutils.tar.* $UPLOAD_DIR
--- a/taskcluster/scripts/misc/build-cbindgen.sh
+++ b/taskcluster/scripts/misc/build-cbindgen.sh
@@ -4,17 +4,16 @@ set -x -e -v
 # If you update this, make sure to update the minimum version in
 # build/moz.configure/bindgen.configure as well.
 CBINDGEN_REVISION=e19526e00b3fe6921b881682147a1fe5d6b64124 # v0.9.0
 TARGET="$1"
 
 case "$(uname -s)" in
 Linux)
     WORKSPACE=$HOME/workspace
-    UPLOAD_DIR=$HOME/artifacts
     COMPRESS_EXT=xz
     ;;
 MINGW*)
     WORKSPACE=$PWD
     UPLOAD_DIR=$WORKSPACE/public/build
     WIN_WORKSPACE="$(pwd -W)"
     COMPRESS_EXT=bz2
 
--- a/taskcluster/scripts/misc/build-cctools-port.sh
+++ b/taskcluster/scripts/misc/build-cctools-port.sh
@@ -4,17 +4,16 @@
 # Until bug 1471905 is addressed, increase the following number
 # when a forced rebuild of cctools is necessary: 1
 
 set -x -e -v
 
 # This script is for building cctools (Apple's binutils) for Linux using
 # cctools-port (https://github.com/tpoechtrager/cctools-port).
 WORKSPACE=$HOME/workspace
-UPLOAD_DIR=$HOME/artifacts
 
 # Set some crosstools-port and libtapi directories
 CROSSTOOLS_SOURCE_DIR=$MOZ_FETCHES_DIR/cctools-port
 CROSSTOOLS_CCTOOLS_DIR=$CROSSTOOLS_SOURCE_DIR/cctools
 CROSSTOOLS_BUILD_DIR=$WORKSPACE/cctools
 LIBTAPI_SOURCE_DIR=$MOZ_FETCHES_DIR/apple-libtapi
 LIBTAPI_BUILD_DIR=$WORKSPACE/libtapi-build
 CLANG_DIR=$WORKSPACE/build/src/clang
--- a/taskcluster/scripts/misc/build-clang-4.0-linux.sh
+++ b/taskcluster/scripts/misc/build-clang-4.0-linux.sh
@@ -1,16 +1,15 @@
 #!/bin/bash
 set -x -e -v
 
 # This script is for building clang for Linux.
 
 WORKSPACE=$HOME/workspace
 HOME_DIR=$WORKSPACE/build
-UPLOAD_DIR=$HOME/artifacts
 
 cd $HOME_DIR/src
 
 . taskcluster/scripts/misc/tooltool-download.sh
 
 # gets a bit too verbose here
 set +x
 
--- a/taskcluster/scripts/misc/build-clang-7-linux.sh
+++ b/taskcluster/scripts/misc/build-clang-7-linux.sh
@@ -1,16 +1,15 @@
 #!/bin/bash
 set -x -e -v
 
 # This script is for building clang for Linux.
 
 WORKSPACE=$HOME/workspace
 HOME_DIR=$WORKSPACE/build
-UPLOAD_DIR=$HOME/artifacts
 
 cd $HOME_DIR/src
 
 . taskcluster/scripts/misc/tooltool-download.sh
 
 # gets a bit too verbose here
 set +x
 
--- a/taskcluster/scripts/misc/build-clang-8-android.sh
+++ b/taskcluster/scripts/misc/build-clang-8-android.sh
@@ -1,17 +1,16 @@
 #!/bin/bash
 set -x -e -v
 
 # This script is for building clang on a Linux host with android compiler rt
 # libs.
 
 WORKSPACE=$HOME/workspace
 HOME_DIR=$WORKSPACE/build
-UPLOAD_DIR=$HOME/artifacts
 
 cd $HOME_DIR/src
 
 . taskcluster/scripts/misc/tooltool-download.sh
 
 # gets a bit too verbose here
 set +x
 
--- a/taskcluster/scripts/misc/build-clang-8-linux-aarch64-cross.sh
+++ b/taskcluster/scripts/misc/build-clang-8-linux-aarch64-cross.sh
@@ -1,16 +1,15 @@
 #!/bin/bash
 set -x -e -v
 
 # This script is for building clang for Linux.
 
 WORKSPACE=$HOME/workspace
 HOME_DIR=$WORKSPACE/build
-UPLOAD_DIR=$HOME/artifacts
 
 cd $HOME_DIR/src
 
 . taskcluster/scripts/misc/tooltool-download.sh
 
 export PATH="$WORKSPACE/build/src/binutils/bin:$PATH"
 
 # gets a bit too verbose here
--- a/taskcluster/scripts/misc/build-clang-8-linux-macosx-cross.sh
+++ b/taskcluster/scripts/misc/build-clang-8-linux-macosx-cross.sh
@@ -1,16 +1,15 @@
 #!/bin/bash
 set -x -e -v
 
 # This script is for building clang for Mac OS X targets on a Linux host,
 # including native Mac OS X Compiler-RT libraries and llvm-symbolizer.
 WORKSPACE=$HOME/workspace
 HOME_DIR=$WORKSPACE/build
-UPLOAD_DIR=$HOME/artifacts
 
 cd $HOME_DIR/src
 
 . taskcluster/scripts/misc/tooltool-download.sh
 
 # these variables are used in build-clang.py
 export CROSS_CCTOOLS_PATH=$HOME_DIR/src/cctools
 export CROSS_SYSROOT=$HOME_DIR/src/MacOSX10.11.sdk
--- a/taskcluster/scripts/misc/build-clang-8-linux.sh
+++ b/taskcluster/scripts/misc/build-clang-8-linux.sh
@@ -1,16 +1,15 @@
 #!/bin/bash
 set -x -e -v
 
 # This script is for building clang for Linux.
 
 WORKSPACE=$HOME/workspace
 HOME_DIR=$WORKSPACE/build
-UPLOAD_DIR=$HOME/artifacts
 
 cd $HOME_DIR/src
 
 . taskcluster/scripts/misc/tooltool-download.sh
 
 # gets a bit too verbose here
 set +x
 
--- a/taskcluster/scripts/misc/build-clang-8-mingw.sh
+++ b/taskcluster/scripts/misc/build-clang-8-mingw.sh
@@ -18,17 +18,16 @@ elif [ "$1" == "x64" ]; then
   WRAPPER_FLAGS=""
 else
   echo "Provide either x86 or x64 to specify a toolchain."
   exit 1;
 fi
 
 WORKSPACE=$HOME/workspace
 HOME_DIR=$WORKSPACE/build
-UPLOAD_DIR=$HOME/artifacts
 
 TOOLCHAIN_DIR=$WORKSPACE/moz-toolchain
 INSTALL_DIR=$TOOLCHAIN_DIR/build/stage3/clang
 CROSS_PREFIX_DIR=$INSTALL_DIR/$machine-w64-mingw32
 SRC_DIR=$TOOLCHAIN_DIR/src
 
 make_flags="-j$(nproc)"
 
--- a/taskcluster/scripts/misc/build-clang-macosx.sh
+++ b/taskcluster/scripts/misc/build-clang-macosx.sh
@@ -1,15 +1,14 @@
 #!/bin/bash
 set -x -e -v
 
 # This script is for building clang for Mac OS X on Linux.
 WORKSPACE=$HOME/workspace
 HOME_DIR=$WORKSPACE/build
-UPLOAD_DIR=$HOME/artifacts
 
 cd $HOME_DIR/src
 
 . taskcluster/scripts/misc/tooltool-download.sh
 
 # these variables are used in build-clang.py
 export CROSS_CCTOOLS_PATH=$HOME_DIR/src/cctools
 export CROSS_SYSROOT=$HOME_DIR/src/MacOSX10.11.sdk
--- a/taskcluster/scripts/misc/build-clang-tidy-linux.sh
+++ b/taskcluster/scripts/misc/build-clang-tidy-linux.sh
@@ -1,16 +1,15 @@
 #!/bin/bash
 set -x -e -v
 
 # This script is for building clang for Linux.
 
 WORKSPACE=$HOME/workspace
 HOME_DIR=$WORKSPACE/build
-UPLOAD_DIR=$HOME/artifacts
 
 cd $HOME_DIR/src
 
 . taskcluster/scripts/misc/tooltool-download.sh
 
 # gets a bit too verbose here
 set +x
 
--- a/taskcluster/scripts/misc/build-clang-tidy-macosx.sh
+++ b/taskcluster/scripts/misc/build-clang-tidy-macosx.sh
@@ -1,15 +1,14 @@
 #!/bin/bash
 set -x -e -v
 
 # This script is for building clang for Mac OS X on Linux.
 WORKSPACE=$HOME/workspace
 HOME_DIR=$WORKSPACE/build
-UPLOAD_DIR=$HOME/artifacts
 
 cd $HOME_DIR/src
 
 . taskcluster/scripts/misc/tooltool-download.sh
 
 # these variables are used in build-clang.py
 export CROSS_CCTOOLS_PATH=$HOME_DIR/src/cctools
 export CROSS_SYSROOT=$HOME_DIR/src/MacOSX10.11.sdk
--- a/taskcluster/scripts/misc/build-custom-v8.sh
+++ b/taskcluster/scripts/misc/build-custom-v8.sh
@@ -16,17 +16,16 @@ else
 	CONFIG=$(echo $* | tr -d "'")
 fi
 
 echo "Config: $CONFIG"
 echo "Artifact name: $ARTIFACT_NAME"
 
 WORKSPACE=$HOME/workspace
 HOME_DIR=$WORKSPACE/build
-UPLOAD_DIR=$HOME/artifacts
 
 cd $HOME_DIR/src
 
 # Setup depot_tools
 git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
 export PATH=$PATH:$HOME_DIR/src/depot_tools
 
 # Get v8 source code and dependencies
--- a/taskcluster/scripts/misc/build-dist-toolchains.sh
+++ b/taskcluster/scripts/misc/build-dist-toolchains.sh
@@ -1,13 +1,12 @@
 #!/bin/bash
 set -x -e -v
 
 # This script is for packaging toolchains suitable for use by distributed sccache.
 WORKSPACE=$HOME/workspace
-UPLOAD_DIR=$HOME/artifacts
 TL_NAME="$1"
 
 cd $WORKSPACE/build/src
 
 . taskcluster/scripts/misc/tooltool-download.sh
 
 sccache/sccache --package-toolchain $PWD/$TL_NAME/bin/$TL_NAME $HOME/artifacts/$TL_NAME-dist-toolchain.tar.xz
--- a/taskcluster/scripts/misc/build-gcc-6-linux.sh
+++ b/taskcluster/scripts/misc/build-gcc-6-linux.sh
@@ -1,16 +1,15 @@
 #!/bin/bash
 set -e
 
 # This script is for building GCC 6 for Linux.
 
 WORKSPACE=$HOME/workspace
 HOME_DIR=$WORKSPACE/build
-UPLOAD_DIR=$HOME/artifacts
 
 root_dir=$HOME_DIR
 data_dir=$HOME_DIR/src/build/unix/build-gcc
 
 . $data_dir/build-gcc.sh
 
 gcc_version=6.4.0
 gcc_ext=xz
--- a/taskcluster/scripts/misc/build-gcc-7-linux.sh
+++ b/taskcluster/scripts/misc/build-gcc-7-linux.sh
@@ -1,16 +1,15 @@
 #!/bin/bash
 set -e
 
 # This script is for building GCC 7 for Linux.
 
 WORKSPACE=$HOME/workspace
 HOME_DIR=$WORKSPACE/build
-UPLOAD_DIR=$HOME/artifacts
 
 root_dir=$HOME_DIR
 data_dir=$HOME_DIR/src/build/unix/build-gcc
 
 . $data_dir/build-gcc.sh
 
 gcc_version=7.4.0
 gcc_ext=xz
--- a/taskcluster/scripts/misc/build-gcc-8-linux.sh
+++ b/taskcluster/scripts/misc/build-gcc-8-linux.sh
@@ -1,16 +1,15 @@
 #!/bin/bash
 set -e
 
 # This script is for building GCC 7 for Linux.
 
 WORKSPACE=$HOME/workspace
 HOME_DIR=$WORKSPACE/build
-UPLOAD_DIR=$HOME/artifacts
 
 root_dir=$HOME_DIR
 data_dir=$HOME_DIR/src/build/unix/build-gcc
 
 . $data_dir/build-gcc.sh
 
 gcc_version=8.3.0
 gcc_ext=xz
--- a/taskcluster/scripts/misc/build-gcc-9-linux.sh
+++ b/taskcluster/scripts/misc/build-gcc-9-linux.sh
@@ -1,16 +1,15 @@
 #!/bin/bash
 set -e
 
 # This script is for building GCC 7 for Linux.
 
 WORKSPACE=$HOME/workspace
 HOME_DIR=$WORKSPACE/build
-UPLOAD_DIR=$HOME/artifacts
 
 root_dir=$HOME_DIR
 data_dir=$HOME_DIR/src/build/unix/build-gcc
 
 . $data_dir/build-gcc.sh
 
 gcc_version=9.1.0
 gcc_ext=xz
--- a/taskcluster/scripts/misc/build-gcc-mingw32.sh
+++ b/taskcluster/scripts/misc/build-gcc-mingw32.sh
@@ -1,16 +1,15 @@
 #!/bin/bash
 set -e
 
 # This script is for building a MinGW GCC (and headers) to be used on Linux to compile for Windows.
 
 WORKSPACE=$HOME/workspace
 HOME_DIR=$WORKSPACE/build
-UPLOAD_DIR=$HOME/artifacts
 
 root_dir=$HOME_DIR
 data_dir=$HOME_DIR/src/build/unix/build-gcc
 
 . $data_dir/build-gcc.sh
 
 gcc_version=6.4.0
 gcc_ext=xz
--- a/taskcluster/scripts/misc/build-gcc-sixgill-plugin-linux.sh
+++ b/taskcluster/scripts/misc/build-gcc-sixgill-plugin-linux.sh
@@ -4,17 +4,16 @@ set -e
 set -x
 
 # This script is for building the sixgill GCC plugin for Linux. It relies on
 # the gcc checkout because it needs to recompile gmp and the gcc build script
 # determines the version of gmp to download.
 
 WORKSPACE=$HOME/workspace
 HOME_DIR=$WORKSPACE/build
-UPLOAD_DIR=$HOME/artifacts
 
 root_dir=$HOME_DIR
 build_dir=$HOME_DIR/src/build
 data_dir=$HOME_DIR/src/build/unix/build-gcc
 
 # Download and unpack upstream toolchain artifacts (ie, the gcc binary).
 . $(dirname $0)/tooltool-download.sh
 
--- a/taskcluster/scripts/misc/build-gn-linux.sh
+++ b/taskcluster/scripts/misc/build-gn-linux.sh
@@ -1,15 +1,14 @@
 #!/bin/bash
 set -e -v
 
 # This script is for building GN on Linux.
 
 WORKSPACE=$HOME/workspace
-UPLOAD_DIR=$HOME/artifacts
 COMPRESS_EXT=xz
 export CC=$WORKSPACE/build/src/gcc/bin/gcc
 export CXX=$WORKSPACE/build/src/gcc/bin/g++
 export LDFLAGS=-lrt
 
 # Gn build scripts use #!/usr/bin/env python, which will be python 2.6 on
 # the worker and cause failures. Work around this by putting python2.7
 # ahead of it in PATH.
--- a/taskcluster/scripts/misc/build-gn-macosx.sh
+++ b/taskcluster/scripts/misc/build-gn-macosx.sh
@@ -1,15 +1,14 @@
 #!/bin/bash
 set -e -v
 
 # This script is for building GN.
 
 WORKSPACE=$HOME/workspace
-UPLOAD_DIR=$HOME/artifacts
 COMPRESS_EXT=xz
 
 CROSS_CCTOOLS_PATH=$WORKSPACE/build/src/cctools
 CROSS_SYSROOT=$WORKSPACE/build/src/MacOSX10.11.sdk
 
 export CC=$WORKSPACE/build/src/clang/bin/clang
 export CXX=$WORKSPACE/build/src/clang/bin/clang++
 export AR=$WORKSPACE/build/src/clang/bin/llvm-ar
--- a/taskcluster/scripts/misc/build-grcov.sh
+++ b/taskcluster/scripts/misc/build-grcov.sh
@@ -6,17 +6,16 @@ set -x -e -v
 OWNER=marco-c
 PROJECT=grcov
 PROJECT_REVISION=9214a916805838265764f9c69eaed657ea3db021
 
 # This script is for building rust-size
 case "$(uname -s)" in
 Linux)
     WORKSPACE=$HOME/workspace
-    UPLOAD_DIR=$HOME/artifacts
     COMPRESS_EXT=xz
     ;;
 MINGW*)
     WORKSPACE=$PWD
     UPLOAD_DIR=$WORKSPACE/public/build
     WIN_WORKSPACE="$(pwd -W)"
     COMPRESS_EXT=bz2
 
--- a/taskcluster/scripts/misc/build-hfsplus-linux.sh
+++ b/taskcluster/scripts/misc/build-hfsplus-linux.sh
@@ -1,15 +1,14 @@
 #!/bin/bash
 set -x -e -v
 
 # This script is for building hfsplus for Linux.
 WORKSPACE=$HOME/workspace
 HOME_DIR=$WORKSPACE/build
-UPLOAD_DIR=$HOME/artifacts
 
 cd $HOME_DIR/src
 
 . taskcluster/scripts/misc/tooltool-download.sh
 
 export PATH=$PATH:$HOME_DIR/src/clang/bin
 
 build/unix/build-hfsplus/build-hfsplus.sh $HOME_DIR
--- a/taskcluster/scripts/misc/build-infer-linux.sh
+++ b/taskcluster/scripts/misc/build-infer-linux.sh
@@ -1,16 +1,15 @@
 #!/bin/bash
 set -x -e -v
 
 # This script is for building infer for Linux.
 
 WORKSPACE=$HOME/workspace
 HOME_DIR=$WORKSPACE/build
-UPLOAD_DIR=$HOME/artifacts
 
 cd $HOME_DIR/src
 
 # gets a bit too verbose here
 set +x
 
 cd build/build-infer
 ./build-infer.py -c infer-linux64.json
--- a/taskcluster/scripts/misc/build-libdmg-hfsplus.sh
+++ b/taskcluster/scripts/misc/build-libdmg-hfsplus.sh
@@ -1,17 +1,16 @@
 #!/bin/bash
 set -x -e -v
 
 # This script is for building libdmg-hfsplus to get the `dmg` and `hfsplus`
 # tools for producing DMG archives on Linux.
 
 WORKSPACE=$HOME/workspace
 STAGE=$WORKSPACE/dmg
-UPLOAD_DIR=$HOME/artifacts
 
 mkdir -p $UPLOAD_DIR $STAGE
 
 cd $MOZ_FETCHES_DIR/libdmg-hfsplus
 
 cmake -DOPENSSL_USE_STATIC_LIBS=1 .
 make -j$(nproc)
 
--- a/taskcluster/scripts/misc/build-llvm-dsymutil.sh
+++ b/taskcluster/scripts/misc/build-llvm-dsymutil.sh
@@ -1,16 +1,15 @@
 #!/bin/bash
 set -x -e -v
 
 # This script is for building clang for Linux.
 
 WORKSPACE=$HOME/workspace
 HOME_DIR=$WORKSPACE/build
-UPLOAD_DIR=$HOME/artifacts
 
 cd $HOME_DIR/src
 
 . taskcluster/scripts/misc/tooltool-download.sh
 
 cd $MOZ_FETCHES_DIR/llvm-project/llvm
 
 mkdir build
--- a/taskcluster/scripts/misc/build-mar-tools.sh
+++ b/taskcluster/scripts/misc/build-mar-tools.sh
@@ -1,15 +1,14 @@
 #!/bin/bash
 set -x -e -v
 
 # This script is for building mar and mbsdiff
 
 WORKSPACE=$HOME/workspace
-UPLOAD_DIR=$HOME/artifacts
 COMPRESS_EXT=xz
 
 cd $WORKSPACE/build/src
 
 . taskcluster/scripts/misc/tooltool-download.sh
 
 export MOZ_OBJDIR=obj-mar
 
--- a/taskcluster/scripts/misc/build-mingw-fxc2-x86.sh
+++ b/taskcluster/scripts/misc/build-mingw-fxc2-x86.sh
@@ -1,16 +1,15 @@
 #!/bin/bash
 set -x -e -v
 
 WORKSPACE=$HOME/workspace
 HOME_DIR=$WORKSPACE/build
 INSTALL_DIR=$WORKSPACE/fxc2
 TOOLTOOL_DIR=$WORKSPACE/build/src
-UPLOAD_DIR=$HOME/artifacts
 
 mkdir -p $INSTALL_DIR/bin
 
 cd $TOOLTOOL_DIR
 . taskcluster/scripts/misc/tooltool-download.sh
 export PATH="$TOOLTOOL_DIR/clang/bin:$PATH"
 
 cd $WORKSPACE
--- a/taskcluster/scripts/misc/build-mingw32-nsis.sh
+++ b/taskcluster/scripts/misc/build-mingw32-nsis.sh
@@ -10,17 +10,16 @@ set -x -e -v
 #   DEBUG: | Error: opening stub "/home/worker/workspace/mingw32/
 #   DEBUG: | Error initalizing CEXEBuild: error setting
 #   ERROR: Failed to get nsis version.
 
 WORKSPACE=$HOME/workspace
 HOME_DIR=$WORKSPACE/build
 INSTALL_DIR=$WORKSPACE/build/src/mingw32
 TOOLTOOL_DIR=$WORKSPACE/build/src
-UPLOAD_DIR=$HOME/artifacts
 
 mkdir -p $INSTALL_DIR
 
 cd $TOOLTOOL_DIR
 . taskcluster/scripts/misc/tooltool-download.sh
 # After tooltool runs, we move the stuff we just downloaded.
 # As explained above, we have to build nsis to the directory it
 # will eventually be run from, which is the same place we just
--- a/taskcluster/scripts/misc/build-minidump-stackwalk.sh
+++ b/taskcluster/scripts/misc/build-minidump-stackwalk.sh
@@ -1,15 +1,14 @@
 #!/bin/bash
 set -x -e -v
 
 # This script is for building minidump_stackwalk
 
 WORKSPACE=$HOME/workspace
-UPLOAD_DIR=$HOME/artifacts
 COMPRESS_EXT=xz
 
 cd $WORKSPACE/build/src
 
 . taskcluster/scripts/misc/tooltool-download.sh
 
 export MOZ_OBJDIR=obj-minidump
 
--- a/taskcluster/scripts/misc/build-nasm.sh
+++ b/taskcluster/scripts/misc/build-nasm.sh
@@ -1,14 +1,12 @@
-
 #!/bin/bash
 set -x -e -v
 
 WORKSPACE=$HOME/workspace
-UPLOAD_DIR=$HOME/artifacts
 COMPRESS_EXT=bz2
 
 cd $WORKSPACE/build/src
 
 . taskcluster/scripts/misc/tooltool-download.sh
 
 cd $WORKSPACE/build/nasm-*
 case "$1" in
--- a/taskcluster/scripts/misc/build-rust-size.sh
+++ b/taskcluster/scripts/misc/build-rust-size.sh
@@ -4,17 +4,16 @@ set -x -e -v
 OWNER=luser
 PROJECT=rust-size
 PROJECT_REVISION=ab659d93b1faba95307df952aefe3fbed3583669
 
 # This script is for building rust-size
 case "$(uname -s)" in
 Linux)
     WORKSPACE=$HOME/workspace
-    UPLOAD_DIR=$HOME/artifacts
     COMPRESS_EXT=xz
     ;;
 MINGW*)
     WORKSPACE=$PWD
     UPLOAD_DIR=$WORKSPACE/public/build
     WIN_WORKSPACE="$(pwd -W)"
     COMPRESS_EXT=bz2
 
--- a/taskcluster/scripts/misc/build-sccache.sh
+++ b/taskcluster/scripts/misc/build-sccache.sh
@@ -5,17 +5,16 @@ set -x -e -v
 SCCACHE_REVISION=93475f3458f7776c37b08201ae0d83ecac4b8fa2
 TARGET="$1"
 
 # This script is for building sccache
 
 case "$(uname -s)" in
 Linux)
     WORKSPACE=$HOME/workspace
-    UPLOAD_DIR=$HOME/artifacts
     COMPRESS_EXT=xz
     PATH="$WORKSPACE/build/src/binutils/bin:$PATH"
     ;;
 MINGW*)
     WORKSPACE=$PWD
     UPLOAD_DIR=$WORKSPACE/public/build
     WIN_WORKSPACE="$(pwd -W)"
     COMPRESS_EXT=bz2
--- a/taskcluster/scripts/misc/build-tup-linux.sh
+++ b/taskcluster/scripts/misc/build-tup-linux.sh
@@ -1,15 +1,14 @@
 #!/bin/bash
 set -e -v
 
 # This script is for building tup on Linux.
 
 WORKSPACE=$HOME/workspace
-UPLOAD_DIR=$HOME/artifacts
 COMPRESS_EXT=xz
 export PATH=$WORKSPACE/build/src/gcc/bin:$PATH
 
 cd $WORKSPACE/build/src
 
 . taskcluster/scripts/misc/tooltool-download.sh
 
 cd $MOZ_FETCHES_DIR/tup
--- a/taskcluster/scripts/misc/build-upx.sh
+++ b/taskcluster/scripts/misc/build-upx.sh
@@ -1,15 +1,14 @@
 #!/bin/bash
 set -x -e -v
 
 WORKSPACE=$HOME/workspace
 HOME_DIR=$WORKSPACE/build
 INSTALL_DIR=$WORKSPACE/upx
-UPLOAD_DIR=$HOME/artifacts
 
 mkdir -p $INSTALL_DIR/bin
 
 cd $WORKSPACE
 
 git clone -n https://github.com/upx/upx.git upx-clone
 cd upx-clone
 # https://github.com/upx/upx/releases/tag/v3.95
--- a/taskcluster/scripts/misc/build-wine.sh
+++ b/taskcluster/scripts/misc/build-wine.sh
@@ -1,15 +1,14 @@
 #!/bin/bash
 set -x -e -v
 
 WORKSPACE=$HOME/workspace
 HOME_DIR=$WORKSPACE/build
 INSTALL_DIR=$WORKSPACE/wine
-UPLOAD_DIR=$HOME/artifacts
 
 mkdir -p $INSTALL_DIR
 
 cd $HOME_DIR
 
 # --------------
 cd wine-3.0.3
 ./configure --prefix=$INSTALL_DIR/
--- a/taskcluster/scripts/misc/repack-node.sh
+++ b/taskcluster/scripts/misc/repack-node.sh
@@ -1,15 +1,14 @@
 #!/bin/bash
 set -x -e -v
 
 # This script is for repacking Node (and NPM) from nodejs.org.
 
 WORKSPACE=$HOME/workspace
-UPLOAD_DIR=$HOME/artifacts
 SUFFIX=tar.xz
 UNARCHIVE="tar xaf"
 REPACK_TAR_COMPRESSION_SWITCH=J
 REPACK_SUFFIX=tar.xz
 
 case "$1" in
 linux64)
     ARCH=linux-x64
--- a/taskcluster/scripts/run-task
+++ b/taskcluster/scripts/run-task
@@ -829,17 +829,17 @@ def main(args):
         os.umask(0o22)
         os.setresgid(gid, gid, gid)
         os.setresuid(uid, uid, uid)
 
     vcs_checkout_from_args(args, 'gecko')
     vcs_checkout_from_args(args, 'comm')
 
     try:
-        for k in ('GECKO_PATH', 'MOZ_FETCHES_DIR'):
+        for k in ('GECKO_PATH', 'MOZ_FETCHES_DIR', 'UPLOAD_DIR'):
             if k in os.environ:
                 os.environ[k] = os.path.abspath(os.environ[k])
                 print_line(b'setup', b'%s is %s\n' % (
                     k.encode('utf-8'),
                     os.environ[k].encode('utf-8')))
 
         if 'MOZ_FETCHES' in os.environ:
             fetch_artifacts()
--- a/taskcluster/taskgraph/transforms/job/common.py
+++ b/taskcluster/taskgraph/transforms/job/common.py
@@ -79,17 +79,19 @@ def add_artifacts(config, job, taskdesc,
         'name': get_artifact_prefix(taskdesc),
         'path': path,
         'type': 'directory',
     })
 
 
 def docker_worker_add_artifacts(config, job, taskdesc):
     """ Adds an artifact directory to the task """
-    add_artifacts(config, job, taskdesc, path='{workdir}/artifacts/'.format(**job['run']))
+    path = '{workdir}/artifacts/'.format(**job['run'])
+    taskdesc['worker']['env']['UPLOAD_DIR'] = path
+    add_artifacts(config, job, taskdesc, path)
 
 
 def generic_worker_add_artifacts(config, job, taskdesc):
     """ Adds an artifact directory to the task """
     # The path is the location on disk; it doesn't necessarily
     # mean the artifacts will be public or private; that is set via the name
     # attribute in add_artifacts.
     add_artifacts(config, job, taskdesc, path=get_artifact_prefix(taskdesc))