From 3ac2307b5c980f372d44a8cea9e89fee58688b9b Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Thu, 29 Sep 2022 16:02:53 -0700 Subject: [PATCH] fix: add node to path (#5598) * fix: remove deprecated symlink * refactor: remove deprecation notice * fixup! refactor: remove deprecation notice * fix: add node to path * fixup: shellcheck * Update src/node/wrapper.ts Co-authored-by: Asher * fixup!: fix: remove deprecated symlink * Update ci/build/build-vscode.sh Co-authored-by: Asher * Update ci/build/build-vscode.sh Co-authored-by: Asher * fixup: use NODE_EXEC_PATh * Update ci/build/build-vscode.sh Co-authored-by: Asher Co-authored-by: Asher --- .github/workflows/build.yaml | 12 ------------ ci/build/build-standalone-release.sh | 3 --- ci/build/build-vscode.sh | 3 +++ ci/build/code-server.sh | 8 -------- src/node/wrapper.ts | 1 + 5 files changed, 4 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 1d72596e1..72a04242b 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -318,12 +318,6 @@ jobs: ./test/node_modules/.bin/playwright install-deps ./test/node_modules/.bin/playwright install - # TODO@jsjoeio - this is temp. We need to do an actual fix - - name: Copy node binary to release - run: | - ln -s $(which node) ./release/lib/node - ln -s $(which node) ./release/node - - name: Run end-to-end tests run: CODE_SERVER_TEST_ENTRY=./release yarn test:e2e --global-timeout 840000 @@ -400,12 +394,6 @@ jobs: - name: Start Caddy run: sudo ~/.cache/caddy/caddy start --config ./ci/Caddyfile - # TODO@jsjoeio - this is temp. We need to do an actual fix - - name: Copy node binary to release - run: | - ln -s $(which node) ./release/lib/node - ln -s $(which node) ./release/node - - name: Run end-to-end tests run: CODE_SERVER_TEST_ENTRY=./release yarn test:e2e:proxy --global-timeout 840000 diff --git a/ci/build/build-standalone-release.sh b/ci/build/build-standalone-release.sh index be9f0df7f..a297b9044 100755 --- a/ci/build/build-standalone-release.sh +++ b/ci/build/build-standalone-release.sh @@ -24,9 +24,6 @@ main() { rsync ./ci/build/code-server.sh "$RELEASE_PATH/bin/code-server" rsync "$node_path" "$RELEASE_PATH/lib/node" - ln -s "./bin/code-server" "$RELEASE_PATH/code-server" - ln -s "./lib/node" "$RELEASE_PATH/node" - pushd "$RELEASE_PATH" npm install --unsafe-perm --omit=dev popd diff --git a/ci/build/build-vscode.sh b/ci/build/build-vscode.sh index b0cf0529b..631964d5e 100755 --- a/ci/build/build-vscode.sh +++ b/ci/build/build-vscode.sh @@ -23,6 +23,9 @@ copy-bin-script() { # shellcheck disable=SC2016 sed -i.bak 's/^ROOT=\(.*\)$/VSROOT=\1\nROOT="$(dirname "$(dirname "$VSROOT")")"/g' "$dest" sed -i.bak 's/ROOT\/out/VSROOT\/out/g' "$dest" + # We do not want expansion here; this text should make it to the file as-is. + # shellcheck disable=SC2016 + sed -i.bak 's/$ROOT\/node/${NODE_EXEC_PATH:-$ROOT\/lib\/node}/g' "$dest" # Fix Node path on Windows. sed -i.bak 's/^set ROOT_DIR=\(.*\)$/set ROOT_DIR=%~dp0..\\..\\..\\..\r\nset VSROOT_DIR=\1/g' "$dest" diff --git a/ci/build/code-server.sh b/ci/build/code-server.sh index c2bdfc892..801835ea8 100755 --- a/ci/build/code-server.sh +++ b/ci/build/code-server.sh @@ -11,14 +11,6 @@ _realpath() { cd "$(dirname "$script")" while [ -L "$(basename "$script")" ]; do - if [ -L "./node" ] && [ -L "./code-server" ] \ - && [ -f "package.json" ] \ - && cat package.json | grep -q '^ "name": "code-server",$'; then - echo "***** Please use the script in bin/code-server instead!" >&2 - echo "***** This script will soon be removed!" >&2 - echo "***** See the release notes at https://github.com/coder/code-server/releases/tag/v3.4.0" >&2 - fi - script="$(readlink "$(basename "$script")")" cd "$(dirname "$script")" done diff --git a/src/node/wrapper.ts b/src/node/wrapper.ts index dde603462..755914bb9 100644 --- a/src/node/wrapper.ts +++ b/src/node/wrapper.ts @@ -321,6 +321,7 @@ export class ParentProcess extends Process { env: { ...process.env, CODE_SERVER_PARENT_PID: process.pid.toString(), + NODE_EXEC_PATH: process.execPath, }, stdio: ["pipe", "pipe", "pipe", "ipc"], })