Skip to content

Commit

Permalink
chore: update nodejs to v22.1.0 (#6044)
Browse files Browse the repository at this point in the history
* chore: update nodejs to v22.1.0

* feat: option to enable v8 cache

This has the potential to speed up CLI startup.

When setting `GARDEN_COMPILE_CACHE=1`,
garden enables the `NODE_COMPILE_CACHE`
variable to improve the startup time.

Let's experiment this and consider enabling this in the future.

See also https://nodejs.org/api/cli.html#node_compile_cachedir

* chore: remove UV_USE_IO_URING=0 fix as libuv 1.48 landed

* chore: update nodejs in circleci

* chore(images): update `circleci-runner` to use NodeJS 22.1.0

* ci: use NodeJS 22.1.0 in CI

* fix: add skip-shell parameter to fnm installer

* chore: fix compile-time error

* revert: remove experimental node cache

Can be introduced separately

* chore: update version in install osx dependencies script

---------

Co-authored-by: Vladimir Vagaytsev <vladimir.vagaitsev@gmail.com>
  • Loading branch information
stefreak and vvagaytsev committed May 15, 2024
1 parent 27fbb30 commit 451c484
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 35 deletions.
14 changes: 3 additions & 11 deletions .circleci/continue-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@ parameters:
GARDEN_DISABLE_ANALYTICS: "true"
GARDEN_K8S_BUILD_SYNC_MODE: "mutagen"

# Libuv 1.45.0 is affected by a kernel bug on certain kernels (Ubuntu 22)
# This leads to errors where Garden tool downloading errors with ETXTBSY
# Apparently file descriptor accounting is broken when using USE_IO_URING on older kernels
# See also: https://github.com/libuv/libuv/pull/4141/files
# TODO: Remove this once libuv 1.47 landed in a future NodeJS version, and we upgraded to it.
UV_USE_IO_URING: "0"


ubuntu-vm-runner: &ubuntu-vm-runner
image: "ubuntu-2204:2023.10.1"
docker_layer_caching: true
Expand All @@ -38,7 +30,7 @@ parameters:
docker_layer_caching: true

runner-image: &runner-image
image: gardendev/circleci-runner:21.7.3-1@sha256:7611893b8f10841017ade7730d22708ed2a08b36bcd86da089c8b7771f0b8db9
image: gardendev/circleci-runner:22.1.0-1@sha256:ce3c5de0ce246daaf66b6e2d2a535cd4f32042fdc52a5c693b2220bef11a2d3c

# Configuration for our node jobs
docker-runner: &docker-runner
Expand Down Expand Up @@ -108,7 +100,7 @@ commands:
node_version:
description: The node version to use
type: string
default: v21.7.3
default: v22.1.0
steps:
# See also https://github.com/CircleCI-Public/node-orb/issues/158#issuecomment-1461095390
- run: rm -rf ~/.npm ~/.fnm
Expand All @@ -132,7 +124,7 @@ commands:
if which fnm; then
echo "Using cached fnm installation"
else
curl -fsSL https://raw.githubusercontent.com/Schniz/fnm/9d0dd1b04521ac4a1c25bb91a65323dbb691e40c/.ci/install.sh | bash -s -- --install-dir "$HOME/.fnm" --force-install
curl -fsSL https://raw.githubusercontent.com/Schniz/fnm/9d0dd1b04521ac4a1c25bb91a65323dbb691e40c/.ci/install.sh | bash -s -- --install-dir "$HOME/.fnm" --force-install --skip-shell
fi
eval "`fnm env --fnm-dir "$HOME/.fnm-cache"`"
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
21.7
22.1
14 changes: 7 additions & 7 deletions cli/src/build-pkg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function getRustTarget(spec: TargetSpec): string {
return `${rustArchMap[spec.arch]}-${rustOsMap[spec.os]}`
}

export const nodeVersion = "21.7.3"
export const nodeVersion = "22.1.0"
export const nodeTargets: {
[name: string]: { spec: TargetSpec; handler: (p: TargetHandlerParams) => Promise<void> }
} = {
Expand All @@ -82,7 +82,7 @@ export const nodeTargets: {
node: nodeVersion,
nodeBinaryPlatform: "darwin",
url: `https://nodejs.org/dist/v${nodeVersion}/node-v${nodeVersion}-darwin-x64.tar.gz`,
checksum: "58d0212e169764c3424d2d5bec73e8a098d34b4e82fca6e1dd54083ea3049c5f",
checksum: "3a2c351b3eeeb4d12dee978f93f8f510589384b66a09feb903b609a58cf1bb5b",
},
handler: pkgMacos,
},
Expand All @@ -93,7 +93,7 @@ export const nodeTargets: {
node: nodeVersion,
nodeBinaryPlatform: "darwin",
url: `https://nodejs.org/dist/v${nodeVersion}/node-v${nodeVersion}-darwin-arm64.tar.gz`,
checksum: "165d3ba3500cfc8708f85d3815aaaa21ce418164c933d5419c30825ccad3a99c",
checksum: "93904abf2b6afd0dc2a7c2947a83e10ed65cc39171db17663edb6f763aaa5a57",
},
handler: pkgMacos,
},
Expand All @@ -104,7 +104,7 @@ export const nodeTargets: {
node: nodeVersion,
nodeBinaryPlatform: "linux",
url: `https://nodejs.org/dist/v${nodeVersion}/node-v${nodeVersion}-linux-x64.tar.gz`,
checksum: "a64cbb12282cb60d35743ef4f51561f8d89946a5f0a484f99168f4de602d7c3d",
checksum: "d8ae35a9e2bb0c0c0611ee9bacf564ea51cc8291ace1447f95ee6aeaf4f1d61d",
},
handler: pkgLinux,
},
Expand All @@ -115,7 +115,7 @@ export const nodeTargets: {
node: nodeVersion,
nodeBinaryPlatform: "linux",
url: `https://nodejs.org/dist/v${nodeVersion}/node-v${nodeVersion}-linux-arm64.tar.gz`,
checksum: "15390ba8509b71c0051e61f75a6fdb0a2eb38318c03a01bf60c93d33d414d138",
checksum: "9c111af1f951e8869615bca3601ce7ab6969374933bdba6397469843b808f222",
},
handler: pkgLinux,
},
Expand All @@ -127,7 +127,7 @@ export const nodeTargets: {
nodeBinaryPlatform: "linux",
// Alpine builds live in https://unofficial-builds.nodejs.org/download/release/
url: `https://unofficial-builds.nodejs.org/download/release/v${nodeVersion}/node-v${nodeVersion}-linux-x64-musl.tar.gz`,
checksum: "2d285e4c473b31420d9473e4c38a9757cadaef640faebaaa0d13642bac08be4a",
checksum: "531d2b010fa39803cf03b3aa75a910d98d50ae446a7d3df4774579abae867bb8",
},
handler: pkgAlpine,
},
Expand All @@ -138,7 +138,7 @@ export const nodeTargets: {
node: nodeVersion,
nodeBinaryPlatform: "win32",
url: `https://nodejs.org/dist/v${nodeVersion}/node-v${nodeVersion}-win-x64.zip`,
checksum: "d2314f496782b53ad2fe5fa82fca6ff7f39f07fe59dd007116404ad92179c78e",
checksum: "4b0f90bc3f1f41df16f9022ecded0c4eff55f8c3ece66ba348275c69fea4eb8e",
},
handler: pkgWindows,
},
Expand Down
2 changes: 1 addition & 1 deletion core/src/util/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import { dedent, naturalList, tailString } from "./string.js"
import split2 from "split2"
import type { Options as ExecaOptions } from "execa"
import { execa } from "execa"
import corePackageJson from "../../package.json" assert { type: "json" }
import corePackageJson from "../../package.json" with { type: "json" }
import { makeDocsLinkStyled } from "../docs/common.js"

export { apply as jsonMerge } from "json-merge-patch"
Expand Down
10 changes: 0 additions & 10 deletions garden-sea/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,6 @@ where
#[cfg(all(target_os = "linux"))]
command.env("GARDEN_SEA_TARGET_ENV", TARGET_ENV);

// Libuv 1.45.0 is affected by a kernel bug on certain kernels (Ubuntu 22)
// This leads to errors where Garden tool downloading errors with ETXTBSY
// Apparently file descriptor accounting is broken when using USE_IO_URING on older kernels
// See also: https://github.com/libuv/libuv/pull/4141/files
// TODO: Remove this once libuv 1.47 landed in a future NodeJS version, and we upgraded to it.
command.env(
"UV_USE_IO_URING",
env::var("GARDEN_SEA_UV_USE_IO_URING").unwrap_or("0".into()),
);

// Allow users to override the heap size if needed.
let max_old_space_size = env::var("GARDEN_MAX_OLD_SPACE_SIZE").unwrap_or("4096".into());
let max_semi_space_size = env::var("GARDEN_MAX_SEMI_SPACE_SIZE").unwrap_or("64".into());
Expand Down
4 changes: 2 additions & 2 deletions images/circleci-runner/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ FROM google/cloud-sdk:411.0.0@sha256:b5c292e4cbf1ff57853a5f48bda5bf1f01c4750bc3d
FROM cibuilds/github:0.12.2@sha256:a247975213771f2f4c61b806771ef6c22b225fdc46558738b7c935517c0dcdd4 AS ghr

#### ldid utility ####
FROM cimg/node:21.7.3@sha256:024bc06a21ec87420cba0253d76f1f92250b5d480275b124563c40663cf3d43b as ldid
FROM cimg/node:22.1.0@sha256:700d5aaaa00ba98937817a0b682049490af8e4bf4645411279f8f78193265072 as ldid

RUN sudo apt-get update && sudo apt-get install -qq -y --no-install-recommends \
git \
Expand All @@ -22,7 +22,7 @@ RUN cd /tmp && \
sudo cp -f ./ldid /usr/local/bin/ldid

#### main ####
FROM cimg/node:21.7.3@sha256:024bc06a21ec87420cba0253d76f1f92250b5d480275b124563c40663cf3d43b
FROM cimg/node:22.1.0@sha256:700d5aaaa00ba98937817a0b682049490af8e4bf4645411279f8f78193265072

# install system deps
RUN sudo apt-get update && sudo apt-get -y install rsync parallel python3 curl
Expand Down
2 changes: 1 addition & 1 deletion images/circleci-runner/garden.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ kind: Module
type: container
name: circleci-runner
description: Used for the core pipeline in CircleCI
image: gardendev/circleci-runner:21.7.3-1
image: gardendev/circleci-runner:22.1.0-1
extraFlags: ["--platform", "linux/amd64"]
4 changes: 2 additions & 2 deletions scripts/install-osx-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# install node
nvm install v21
nvm alias default v21
nvm install v22
nvm alias default v22
nvm use default

# install/update global packages
Expand Down

0 comments on commit 451c484

Please sign in to comment.