Skip to content

Commit

Permalink
Fix: Fix broken builds on node 18.20 and 20.12
Browse files Browse the repository at this point in the history
Closes #157
  • Loading branch information
leojonathanoh committed Apr 21, 2024
1 parent 3120eff commit e76d3f8
Show file tree
Hide file tree
Showing 61 changed files with 183 additions and 183 deletions.
6 changes: 3 additions & 3 deletions generate/templates/Dockerfile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ $( if ([version]$VARIANT['_metadata']['package_version'] -ge [version]'4.17') {
"@
} )
npm config set python python3; \
( set +x; export GITHUB_TOKEN=`$( cat /run/secrets/GITHUB_TOKEN ); set -x; npm install --global code-server@$( $VARIANT['_metadata']['package_version'] ) --unsafe-perm ); \
# Use 'NODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT' to fix node 18.20 and 20.12 making experimental API the default, which breaks builds
( set +x; export GITHUB_TOKEN=`$( cat /run/secrets/GITHUB_TOKEN ); set -x; CXXFLAGS='-DNODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT' npm install --global code-server@$( $VARIANT['_metadata']['package_version'] ) --unsafe-perm ); \
# Fix missing dependencies. See: https://github.com/coder/code-server/issues/5530
cd /usr/local/lib/node_modules/code-server/lib/vscode; \
( set +x; export GITHUB_TOKEN=`$( cat /run/secrets/GITHUB_TOKEN ); set -x; npm install --legacy-peer-deps ); \
( cd /usr/local/lib/node_modules/code-server/lib/vscode; set +x; export GITHUB_TOKEN=`$( cat /run/secrets/GITHUB_TOKEN ); set -x; CXXFLAGS='-DNODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT' npm install --legacy-peer-deps ); \
code-server --version; \
apk del `$DEPS
Expand Down
6 changes: 3 additions & 3 deletions variants/4.11.0-docker-go-1.20.14/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ RUN --mount=type=secret,id=GITHUB_TOKEN \
# Constraint to npm 8, or else npm will fail with 'npm ERR! python is not a valid npm option'. See: https://stackoverflow.com/questions/74522956/python-is-not-a-valid-npm-option and https://jubianchi.github.io/semver-check/#/~8/8
apk add --no-cache npm~8 nodejs~16; \
npm config set python python3; \
( set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; npm install --global code-server@4.11.0 --unsafe-perm ); \
# Use 'NODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT' to fix node 18.20 and 20.12 making experimental API the default, which breaks builds
( set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; CXXFLAGS='-DNODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT' npm install --global code-server@4.11.0 --unsafe-perm ); \
# Fix missing dependencies. See: https://github.com/coder/code-server/issues/5530
cd /usr/local/lib/node_modules/code-server/lib/vscode; \
( set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; npm install --legacy-peer-deps ); \
( cd /usr/local/lib/node_modules/code-server/lib/vscode; set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; CXXFLAGS='-DNODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT' npm install --legacy-peer-deps ); \
code-server --version; \
apk del $DEPS

Expand Down
6 changes: 3 additions & 3 deletions variants/4.11.0-docker-rootless-go-1.20.14/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ RUN --mount=type=secret,id=GITHUB_TOKEN \
# Constraint to npm 8, or else npm will fail with 'npm ERR! python is not a valid npm option'. See: https://stackoverflow.com/questions/74522956/python-is-not-a-valid-npm-option and https://jubianchi.github.io/semver-check/#/~8/8
apk add --no-cache npm~8 nodejs~16; \
npm config set python python3; \
( set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; npm install --global code-server@4.11.0 --unsafe-perm ); \
# Use 'NODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT' to fix node 18.20 and 20.12 making experimental API the default, which breaks builds
( set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; CXXFLAGS='-DNODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT' npm install --global code-server@4.11.0 --unsafe-perm ); \
# Fix missing dependencies. See: https://github.com/coder/code-server/issues/5530
cd /usr/local/lib/node_modules/code-server/lib/vscode; \
( set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; npm install --legacy-peer-deps ); \
( cd /usr/local/lib/node_modules/code-server/lib/vscode; set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; CXXFLAGS='-DNODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT' npm install --legacy-peer-deps ); \
code-server --version; \
apk del $DEPS

Expand Down
6 changes: 3 additions & 3 deletions variants/4.11.0-docker-rootless/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ RUN --mount=type=secret,id=GITHUB_TOKEN \
# Constraint to npm 8, or else npm will fail with 'npm ERR! python is not a valid npm option'. See: https://stackoverflow.com/questions/74522956/python-is-not-a-valid-npm-option and https://jubianchi.github.io/semver-check/#/~8/8
apk add --no-cache npm~8 nodejs~16; \
npm config set python python3; \
( set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; npm install --global code-server@4.11.0 --unsafe-perm ); \
# Use 'NODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT' to fix node 18.20 and 20.12 making experimental API the default, which breaks builds
( set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; CXXFLAGS='-DNODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT' npm install --global code-server@4.11.0 --unsafe-perm ); \
# Fix missing dependencies. See: https://github.com/coder/code-server/issues/5530
cd /usr/local/lib/node_modules/code-server/lib/vscode; \
( set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; npm install --legacy-peer-deps ); \
( cd /usr/local/lib/node_modules/code-server/lib/vscode; set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; CXXFLAGS='-DNODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT' npm install --legacy-peer-deps ); \
code-server --version; \
apk del $DEPS

Expand Down
6 changes: 3 additions & 3 deletions variants/4.11.0-docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ RUN --mount=type=secret,id=GITHUB_TOKEN \
# Constraint to npm 8, or else npm will fail with 'npm ERR! python is not a valid npm option'. See: https://stackoverflow.com/questions/74522956/python-is-not-a-valid-npm-option and https://jubianchi.github.io/semver-check/#/~8/8
apk add --no-cache npm~8 nodejs~16; \
npm config set python python3; \
( set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; npm install --global code-server@4.11.0 --unsafe-perm ); \
# Use 'NODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT' to fix node 18.20 and 20.12 making experimental API the default, which breaks builds
( set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; CXXFLAGS='-DNODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT' npm install --global code-server@4.11.0 --unsafe-perm ); \
# Fix missing dependencies. See: https://github.com/coder/code-server/issues/5530
cd /usr/local/lib/node_modules/code-server/lib/vscode; \
( set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; npm install --legacy-peer-deps ); \
( cd /usr/local/lib/node_modules/code-server/lib/vscode; set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; CXXFLAGS='-DNODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT' npm install --legacy-peer-deps ); \
code-server --version; \
apk del $DEPS

Expand Down
6 changes: 3 additions & 3 deletions variants/4.11.0/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ RUN --mount=type=secret,id=GITHUB_TOKEN \
# Constraint to npm 8, or else npm will fail with 'npm ERR! python is not a valid npm option'. See: https://stackoverflow.com/questions/74522956/python-is-not-a-valid-npm-option and https://jubianchi.github.io/semver-check/#/~8/8
apk add --no-cache npm~8 nodejs~16; \
npm config set python python3; \
( set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; npm install --global code-server@4.11.0 --unsafe-perm ); \
# Use 'NODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT' to fix node 18.20 and 20.12 making experimental API the default, which breaks builds
( set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; CXXFLAGS='-DNODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT' npm install --global code-server@4.11.0 --unsafe-perm ); \
# Fix missing dependencies. See: https://github.com/coder/code-server/issues/5530
cd /usr/local/lib/node_modules/code-server/lib/vscode; \
( set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; npm install --legacy-peer-deps ); \
( cd /usr/local/lib/node_modules/code-server/lib/vscode; set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; CXXFLAGS='-DNODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT' npm install --legacy-peer-deps ); \
code-server --version; \
apk del $DEPS

Expand Down
6 changes: 3 additions & 3 deletions variants/4.12.0-docker-go-1.20.14/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ RUN --mount=type=secret,id=GITHUB_TOKEN \
# Constraint to npm 8, or else npm will fail with 'npm ERR! python is not a valid npm option'. See: https://stackoverflow.com/questions/74522956/python-is-not-a-valid-npm-option and https://jubianchi.github.io/semver-check/#/~8/8
apk add --no-cache npm~8 nodejs~16; \
npm config set python python3; \
( set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; npm install --global code-server@4.12.0 --unsafe-perm ); \
# Use 'NODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT' to fix node 18.20 and 20.12 making experimental API the default, which breaks builds
( set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; CXXFLAGS='-DNODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT' npm install --global code-server@4.12.0 --unsafe-perm ); \
# Fix missing dependencies. See: https://github.com/coder/code-server/issues/5530
cd /usr/local/lib/node_modules/code-server/lib/vscode; \
( set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; npm install --legacy-peer-deps ); \
( cd /usr/local/lib/node_modules/code-server/lib/vscode; set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; CXXFLAGS='-DNODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT' npm install --legacy-peer-deps ); \
code-server --version; \
apk del $DEPS

Expand Down
6 changes: 3 additions & 3 deletions variants/4.12.0-docker-rootless-go-1.20.14/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ RUN --mount=type=secret,id=GITHUB_TOKEN \
# Constraint to npm 8, or else npm will fail with 'npm ERR! python is not a valid npm option'. See: https://stackoverflow.com/questions/74522956/python-is-not-a-valid-npm-option and https://jubianchi.github.io/semver-check/#/~8/8
apk add --no-cache npm~8 nodejs~16; \
npm config set python python3; \
( set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; npm install --global code-server@4.12.0 --unsafe-perm ); \
# Use 'NODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT' to fix node 18.20 and 20.12 making experimental API the default, which breaks builds
( set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; CXXFLAGS='-DNODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT' npm install --global code-server@4.12.0 --unsafe-perm ); \
# Fix missing dependencies. See: https://github.com/coder/code-server/issues/5530
cd /usr/local/lib/node_modules/code-server/lib/vscode; \
( set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; npm install --legacy-peer-deps ); \
( cd /usr/local/lib/node_modules/code-server/lib/vscode; set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; CXXFLAGS='-DNODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT' npm install --legacy-peer-deps ); \
code-server --version; \
apk del $DEPS

Expand Down
6 changes: 3 additions & 3 deletions variants/4.12.0-docker-rootless/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ RUN --mount=type=secret,id=GITHUB_TOKEN \
# Constraint to npm 8, or else npm will fail with 'npm ERR! python is not a valid npm option'. See: https://stackoverflow.com/questions/74522956/python-is-not-a-valid-npm-option and https://jubianchi.github.io/semver-check/#/~8/8
apk add --no-cache npm~8 nodejs~16; \
npm config set python python3; \
( set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; npm install --global code-server@4.12.0 --unsafe-perm ); \
# Use 'NODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT' to fix node 18.20 and 20.12 making experimental API the default, which breaks builds
( set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; CXXFLAGS='-DNODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT' npm install --global code-server@4.12.0 --unsafe-perm ); \
# Fix missing dependencies. See: https://github.com/coder/code-server/issues/5530
cd /usr/local/lib/node_modules/code-server/lib/vscode; \
( set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; npm install --legacy-peer-deps ); \
( cd /usr/local/lib/node_modules/code-server/lib/vscode; set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; CXXFLAGS='-DNODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT' npm install --legacy-peer-deps ); \
code-server --version; \
apk del $DEPS

Expand Down
6 changes: 3 additions & 3 deletions variants/4.12.0-docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ RUN --mount=type=secret,id=GITHUB_TOKEN \
# Constraint to npm 8, or else npm will fail with 'npm ERR! python is not a valid npm option'. See: https://stackoverflow.com/questions/74522956/python-is-not-a-valid-npm-option and https://jubianchi.github.io/semver-check/#/~8/8
apk add --no-cache npm~8 nodejs~16; \
npm config set python python3; \
( set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; npm install --global code-server@4.12.0 --unsafe-perm ); \
# Use 'NODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT' to fix node 18.20 and 20.12 making experimental API the default, which breaks builds
( set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; CXXFLAGS='-DNODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT' npm install --global code-server@4.12.0 --unsafe-perm ); \
# Fix missing dependencies. See: https://github.com/coder/code-server/issues/5530
cd /usr/local/lib/node_modules/code-server/lib/vscode; \
( set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; npm install --legacy-peer-deps ); \
( cd /usr/local/lib/node_modules/code-server/lib/vscode; set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; CXXFLAGS='-DNODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT' npm install --legacy-peer-deps ); \
code-server --version; \
apk del $DEPS

Expand Down
6 changes: 3 additions & 3 deletions variants/4.12.0/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ RUN --mount=type=secret,id=GITHUB_TOKEN \
# Constraint to npm 8, or else npm will fail with 'npm ERR! python is not a valid npm option'. See: https://stackoverflow.com/questions/74522956/python-is-not-a-valid-npm-option and https://jubianchi.github.io/semver-check/#/~8/8
apk add --no-cache npm~8 nodejs~16; \
npm config set python python3; \
( set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; npm install --global code-server@4.12.0 --unsafe-perm ); \
# Use 'NODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT' to fix node 18.20 and 20.12 making experimental API the default, which breaks builds
( set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; CXXFLAGS='-DNODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT' npm install --global code-server@4.12.0 --unsafe-perm ); \
# Fix missing dependencies. See: https://github.com/coder/code-server/issues/5530
cd /usr/local/lib/node_modules/code-server/lib/vscode; \
( set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; npm install --legacy-peer-deps ); \
( cd /usr/local/lib/node_modules/code-server/lib/vscode; set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; CXXFLAGS='-DNODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT' npm install --legacy-peer-deps ); \
code-server --version; \
apk del $DEPS

Expand Down
6 changes: 3 additions & 3 deletions variants/4.13.0-docker-go-1.20.14/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ RUN --mount=type=secret,id=GITHUB_TOKEN \
# Constraint to npm 8, or else npm will fail with 'npm ERR! python is not a valid npm option'. See: https://stackoverflow.com/questions/74522956/python-is-not-a-valid-npm-option and https://jubianchi.github.io/semver-check/#/~8/8
apk add --no-cache npm~8 nodejs~16; \
npm config set python python3; \
( set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; npm install --global code-server@4.13.0 --unsafe-perm ); \
# Use 'NODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT' to fix node 18.20 and 20.12 making experimental API the default, which breaks builds
( set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; CXXFLAGS='-DNODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT' npm install --global code-server@4.13.0 --unsafe-perm ); \
# Fix missing dependencies. See: https://github.com/coder/code-server/issues/5530
cd /usr/local/lib/node_modules/code-server/lib/vscode; \
( set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; npm install --legacy-peer-deps ); \
( cd /usr/local/lib/node_modules/code-server/lib/vscode; set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; CXXFLAGS='-DNODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT' npm install --legacy-peer-deps ); \
code-server --version; \
apk del $DEPS

Expand Down
6 changes: 3 additions & 3 deletions variants/4.13.0-docker-rootless-go-1.20.14/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ RUN --mount=type=secret,id=GITHUB_TOKEN \
# Constraint to npm 8, or else npm will fail with 'npm ERR! python is not a valid npm option'. See: https://stackoverflow.com/questions/74522956/python-is-not-a-valid-npm-option and https://jubianchi.github.io/semver-check/#/~8/8
apk add --no-cache npm~8 nodejs~16; \
npm config set python python3; \
( set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; npm install --global code-server@4.13.0 --unsafe-perm ); \
# Use 'NODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT' to fix node 18.20 and 20.12 making experimental API the default, which breaks builds
( set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; CXXFLAGS='-DNODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT' npm install --global code-server@4.13.0 --unsafe-perm ); \
# Fix missing dependencies. See: https://github.com/coder/code-server/issues/5530
cd /usr/local/lib/node_modules/code-server/lib/vscode; \
( set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; npm install --legacy-peer-deps ); \
( cd /usr/local/lib/node_modules/code-server/lib/vscode; set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; CXXFLAGS='-DNODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT' npm install --legacy-peer-deps ); \
code-server --version; \
apk del $DEPS

Expand Down
6 changes: 3 additions & 3 deletions variants/4.13.0-docker-rootless/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ RUN --mount=type=secret,id=GITHUB_TOKEN \
# Constraint to npm 8, or else npm will fail with 'npm ERR! python is not a valid npm option'. See: https://stackoverflow.com/questions/74522956/python-is-not-a-valid-npm-option and https://jubianchi.github.io/semver-check/#/~8/8
apk add --no-cache npm~8 nodejs~16; \
npm config set python python3; \
( set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; npm install --global code-server@4.13.0 --unsafe-perm ); \
# Use 'NODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT' to fix node 18.20 and 20.12 making experimental API the default, which breaks builds
( set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; CXXFLAGS='-DNODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT' npm install --global code-server@4.13.0 --unsafe-perm ); \
# Fix missing dependencies. See: https://github.com/coder/code-server/issues/5530
cd /usr/local/lib/node_modules/code-server/lib/vscode; \
( set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; npm install --legacy-peer-deps ); \
( cd /usr/local/lib/node_modules/code-server/lib/vscode; set +x; export GITHUB_TOKEN=$( cat /run/secrets/GITHUB_TOKEN ); set -x; CXXFLAGS='-DNODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT' npm install --legacy-peer-deps ); \
code-server --version; \
apk del $DEPS

Expand Down
Loading

0 comments on commit e76d3f8

Please sign in to comment.