From 4b35cafd5755b0f213afb12b590ed29aaffb129e Mon Sep 17 00:00:00 2001 From: Mathieu Hofman Date: Mon, 1 Jul 2024 01:50:29 +0000 Subject: [PATCH 1/2] revert fix: typescript-estree does not support Node.js LTS (#9619) --- ...typescript-eslint+typescript-estree+7.13.0.patch | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 patches/@typescript-eslint+typescript-estree+7.13.0.patch diff --git a/patches/@typescript-eslint+typescript-estree+7.13.0.patch b/patches/@typescript-eslint+typescript-estree+7.13.0.patch deleted file mode 100644 index 089e48848b6..00000000000 --- a/patches/@typescript-eslint+typescript-estree+7.13.0.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/node_modules/@typescript-eslint/typescript-estree/package.json b/node_modules/@typescript-eslint/typescript-estree/package.json -index 3a1b7a2..8c8c9f2 100644 ---- a/node_modules/@typescript-eslint/typescript-estree/package.json -+++ b/node_modules/@typescript-eslint/typescript-estree/package.json -@@ -22,7 +22,7 @@ - }, - "types": "./dist/index.d.ts", - "engines": { -- "node": "^18.18.0 || >=20.0.0" -+ "node": "^18.12 || >=20.0.0" - }, - "repository": { - "type": "git", From 5f01bef764025ed1b6d2093f278ca2be9982f941 Mon Sep 17 00:00:00 2001 From: Mathieu Hofman Date: Mon, 1 Jul 2024 01:51:05 +0000 Subject: [PATCH 2/2] fix(agd): force own node.js version check --- repoconfig.sh | 12 +++++++++++- scripts/agd-builder.sh | 10 +++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/repoconfig.sh b/repoconfig.sh index 231093a2c66..81c33672d95 100644 --- a/repoconfig.sh +++ b/repoconfig.sh @@ -1,6 +1,6 @@ #! /bin/sh # shellcheck disable=SC2034 -NODEJS_VERSION=v16 +NODEJS_VERSION=v20 GOLANG_VERSION=1.20.3 GOLANG_DIR=golang/cosmos GOLANG_DAEMON=$GOLANG_DIR/build/agd @@ -15,3 +15,13 @@ golang_version_check() { echo 1>&2 "need go version 1.20.2+, 1.21+, or 2+" return 1 } + +# Args are major, minor and patch version numbers +nodejs_version_check() { + { + [ "$1" -eq 18 ] && [ "$2" -ge 12 ] && return 0 + [ "$1" -ge 20 ] && [ "$2" -ge 9 ] && return 0 + } 2> /dev/null + echo 1>&2 "need Node.js LTS version ^18.12 or ^20.9, found $1.$2.$3" + return 1 +} diff --git a/scripts/agd-builder.sh b/scripts/agd-builder.sh index 39a1648dc44..9b09c4bfca2 100755 --- a/scripts/agd-builder.sh +++ b/scripts/agd-builder.sh @@ -106,6 +106,12 @@ if $need_nodejs; then } 1>&2 ;; esac + + if nodeversion=$(node --version 2> /dev/null); then + noderegexp='v([0-9]+)\.([0-9]+)\.([0-9]+)' + [[ "$nodeversion" =~ $noderegexp ]] || fatal "illegible node version '$nodeversion'" + nodejs_version_check "${BASH_REMATCH[1]}" "${BASH_REMATCH[2]}" "${BASH_REMATCH[3]}" || exit 1 + fi fi $do_not_build || ( @@ -194,7 +200,9 @@ $do_not_build || ( test -z "$src" || { echo "At least $src is newer than node_modules" rm -f "$STAMPS/yarn-built" - lazy_yarn install + # Ignore engines since we already checked officially supported versions above + # UNTIL https://github.com/Agoric/agoric-sdk/issues/9622 + lazy_yarn install --ignore-engines } stamp=$STAMPS/yarn-built