Bug 1611513 - Migrate Node toolchain tasks to fetch toolchain tasks. r=firefox-build-system-reviewers,andi,mhentges

Differential Revision: https://phabricator.services.mozilla.com/D112896
This commit is contained in:
Mike Hommey 2021-04-21 23:53:15 +00:00
parent 02a7cd7a9e
commit d4935c3ff9
3 changed files with 59 additions and 69 deletions

View File

@ -539,3 +539,47 @@ makecab:
type: git
repo: https://github.com/luser/rust-makecab/
revision: d2bc6797648b7a834782714a55d339d2fd4e58c8
nodejs-10-linux64:
description: nodejs 10 for x64 linux
fetch:
type: static-url
url: https://nodejs.org/dist/v10.23.1/node-v10.23.1-linux-x64.tar.xz
sha256: 207e5ec77ca655ba6fcde922d6b329acbb09898b0bd793ccfcce6c27a36fdff0
size: 13139076
artifact-name: nodejs.tar.zst
strip-components: 1
add-prefix: node/
nodejs-10-macosx64:
description: nodejs 10 for x64 macOS
fetch:
type: static-url
url: https://nodejs.org/dist/v10.23.1/node-v10.23.1-darwin-x64.tar.xz
sha256: febfdabd98ab5b8f8fdff32ab8c111d834083805bf042ab65c923cc22609c99d
size: 12233276
artifact-name: nodejs.tar.zst
strip-components: 1
add-prefix: node/
nodejs-10-win32:
description: nodejs 10 for x86 Windows
fetch:
type: static-url
url: https://nodejs.org/dist/v10.23.1/node-v10.23.1-win-x86.zip
sha256: c3be0fd50c218cc52e85377c9e22d7d2110d72de95bdbc9447145b246330f818
size: 16806899
artifact-name: nodejs.tar.zst
strip-components: 1
add-prefix: node/
nodejs-10-win64:
description: nodejs 10 for x64 Windows
fetch:
type: static-url
url: https://nodejs.org/dist/v10.23.1/node-v10.23.1-win-x64.zip
sha256: 497996aa1037b6f7f492c1d275bb90140269223939525286b4e95babad16f0de
size: 18307638
artifact-name: nodejs.tar.zst
strip-components: 1
add-prefix: node/

View File

@ -12,37 +12,43 @@ job-defaults:
run-on-projects: [trunk]
run:
script: repack-node.sh
toolchain-artifact: public/build/node.tar.xz
toolchain-artifact: public/build/node.tar.zst
linux64-node-10:
treeherder:
symbol: TL(node-10)
run:
arguments: ['linux64', '10']
toolchain-alias: linux64-node
fetches:
fetch:
- nodejs-10-linux64
macosx64-node-10:
treeherder:
symbol: TM(node-10)
run:
arguments: ['macosx64', '10']
toolchain-alias:
- macosx64-node
# There isn't an arm64-native node yet, so use the x86_64 one.
- macosx64-aarch64-node
fetches:
fetch:
- nodejs-10-macosx64
win64-node-10:
treeherder:
symbol: TW64(node-10)
run:
arguments: ['win64', '10']
toolchain-artifact: public/build/node.tar.bz2
toolchain-alias: win64-node
fetches:
fetch:
- nodejs-10-win64
win32-node-10:
treeherder:
symbol: TW32(node-10)
run:
arguments: ['win32', '10']
toolchain-artifact: public/build/node.tar.bz2
toolchain-alias: win32-node
fetches:
fetch:
- nodejs-10-win32

View File

@ -3,72 +3,12 @@ set -x -e -v
# This script is for repacking Node (and NPM) from nodejs.org.
WORKSPACE=$HOME/workspace
case "$1" in
linux64) ARCH=linux-x64 ;;
macosx64) ARCH=darwin-x64 ;;
win64) ARCH=win-x64 ;;
win32) ARCH=win-x86 ;;
*)
echo "Unknown architecture $1 not recognized in repack-node.sh" >&2
exit 1
;;
esac
case "$ARCH" in
linux-x64|darwin-x64)
SUFFIX=tar.xz
UNARCHIVE="tar xaf"
REPACK_TAR_COMPRESSION_SWITCH=J
REPACK_SUFFIX=tar.xz
;;
win-x64|win-x86)
SUFFIX=zip
UNARCHIVE=unzip
REPACK_TAR_COMPRESSION_SWITCH=j
REPACK_SUFFIX=tar.bz2
;;
esac
# Although we're only using one version at the moment, this infrastructure is
# useful for when we need to do upgrades and have multiple versions of node
# live in taskcluster at once.
case "$2" in
10) VERSION="10.23.1" ;;
*)
echo "Unknown version $2 not recognized in repack-node.sh" >&2
exit 1
;;
esac
case "$ARCH--$VERSION" in
# From https://nodejs.org/dist/v10.23.1/SHASUMS256.txt.asc
linux-x64--10.23.1) SHA256SUM=207e5ec77ca655ba6fcde922d6b329acbb09898b0bd793ccfcce6c27a36fdff0 ;;
darwin-x64--10.23.1) SHA256SUM=febfdabd98ab5b8f8fdff32ab8c111d834083805bf042ab65c923cc22609c99d ;;
win-x64--10.23.1) SHA256SUM=497996aa1037b6f7f492c1d275bb90140269223939525286b4e95babad16f0de ;;
win-x86--10.23.1) SHA256SUM=c3be0fd50c218cc52e85377c9e22d7d2110d72de95bdbc9447145b246330f818 ;;
esac
# From https://nodejs.org/en/download/
URL=https://nodejs.org/dist/v$VERSION/node-v$VERSION-$ARCH.$SUFFIX
ARCHIVE=node-v$VERSION-$ARCH.$SUFFIX
mkdir -p "$UPLOAD_DIR"
cd "$WORKSPACE"
wget --progress=dot:mega $URL
cd "$MOZ_FETCHES_DIR"
# shasum is available on both Linux and Windows builders, but on
# Windows, reading from stdin doesn't work as expected.
echo "$SHA256SUM $ARCHIVE" > node.txt
shasum --algorithm 256 --check node.txt
$UNARCHIVE $ARCHIVE
mv node-v$VERSION-$ARCH node
# npx doesn't have great security characteristics (it downloads and executes
# stuff directly out of npm at runtime), so let's not risk it getting into
# anyone's PATH who doesn't already have it there:
rm -f node/bin/npx node/bin/npx.exe
tar c${REPACK_TAR_COMPRESSION_SWITCH}f "$UPLOAD_DIR"/node.$REPACK_SUFFIX node
tar caf "$UPLOAD_DIR"/node.tar.zst node