From 5ccb75b7699b207f90da51d240b6ac3a5de38731 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Wed, 28 Sep 2022 14:12:35 -0700 Subject: [PATCH 01/11] fix: remove deprecated symlink --- ci/build/build-standalone-release.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/ci/build/build-standalone-release.sh b/ci/build/build-standalone-release.sh index be9f0df7fa5d..edaf577a079b 100755 --- a/ci/build/build-standalone-release.sh +++ b/ci/build/build-standalone-release.sh @@ -25,7 +25,6 @@ main() { 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 From 980a74364421b67cd0146836afe966f2ae9bdcbb Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Wed, 28 Sep 2022 14:13:36 -0700 Subject: [PATCH 02/11] refactor: remove deprecation notice --- ci/build/code-server.sh | 8 -------- 1 file changed, 8 deletions(-) diff --git a/ci/build/code-server.sh b/ci/build/code-server.sh index c2bdfc89236b..801835ea843b 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 From f59ccd8877adb70f20eb6aec23275b8f7c2af246 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Wed, 28 Sep 2022 14:14:16 -0700 Subject: [PATCH 03/11] fixup! refactor: remove deprecation notice --- .github/workflows/build.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 1d72596e1d4f..f1a231627368 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -322,7 +322,6 @@ jobs: - 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 @@ -404,7 +403,6 @@ jobs: - 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 From 29c02ff599364e347ad7bdd9804015cb4a1f0929 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Wed, 28 Sep 2022 14:35:36 -0700 Subject: [PATCH 04/11] fix: add node to path --- .github/workflows/build.yaml | 10 ---------- ci/build/build-vscode.sh | 1 + src/node/wrapper.ts | 1 + 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f1a231627368..72a04242bc6f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -318,11 +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 - - name: Run end-to-end tests run: CODE_SERVER_TEST_ENTRY=./release yarn test:e2e --global-timeout 840000 @@ -399,11 +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 - - 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-vscode.sh b/ci/build/build-vscode.sh index b0cf0529b61f..f019def088de 100755 --- a/ci/build/build-vscode.sh +++ b/ci/build/build-vscode.sh @@ -23,6 +23,7 @@ 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" + sed -i.bak 's/ROOT\/node/${CS_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/src/node/wrapper.ts b/src/node/wrapper.ts index dde6034628d5..97d09393f011 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(), + CS_NODE_EXEC_PATH: path.dirname(process.execPath) + ":" + process.env.PATH, }, stdio: ["pipe", "pipe", "pipe", "ipc"], }) From e3cf3d36d2e7944202c9dac72ac87299fe582e29 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Wed, 28 Sep 2022 14:40:11 -0700 Subject: [PATCH 05/11] fixup: shellcheck --- ci/build/build-vscode.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ci/build/build-vscode.sh b/ci/build/build-vscode.sh index f019def088de..9635cbc4c6bf 100755 --- a/ci/build/build-vscode.sh +++ b/ci/build/build-vscode.sh @@ -23,6 +23,8 @@ 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/${CS_NODE_EXEC_PATH:-ROOT\/lib/node}/g' "$dest" # Fix Node path on Windows. From fd36ee213dff5c94a2d268b18f301e1935a0a365 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Wed, 28 Sep 2022 15:00:03 -0700 Subject: [PATCH 06/11] Update src/node/wrapper.ts Co-authored-by: Asher --- src/node/wrapper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node/wrapper.ts b/src/node/wrapper.ts index 97d09393f011..858552e65bde 100644 --- a/src/node/wrapper.ts +++ b/src/node/wrapper.ts @@ -321,7 +321,7 @@ export class ParentProcess extends Process { env: { ...process.env, CODE_SERVER_PARENT_PID: process.pid.toString(), - CS_NODE_EXEC_PATH: path.dirname(process.execPath) + ":" + process.env.PATH, + CS_NODE_EXEC_PATH: process.execPath, }, stdio: ["pipe", "pipe", "pipe", "ipc"], }) From 78e17fab11d8cc0694963bf9028588a599936fc4 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Wed, 28 Sep 2022 15:00:45 -0700 Subject: [PATCH 07/11] fixup!: fix: remove deprecated symlink --- ci/build/build-standalone-release.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/ci/build/build-standalone-release.sh b/ci/build/build-standalone-release.sh index edaf577a079b..a297b90449b0 100755 --- a/ci/build/build-standalone-release.sh +++ b/ci/build/build-standalone-release.sh @@ -24,8 +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" - pushd "$RELEASE_PATH" npm install --unsafe-perm --omit=dev popd From 15242a6c1be2d7972a4f41049555b7fea027c51f Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Wed, 28 Sep 2022 15:46:33 -0700 Subject: [PATCH 08/11] Update ci/build/build-vscode.sh Co-authored-by: Asher --- ci/build/build-vscode.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/build/build-vscode.sh b/ci/build/build-vscode.sh index 9635cbc4c6bf..06ab68ad7e42 100755 --- a/ci/build/build-vscode.sh +++ b/ci/build/build-vscode.sh @@ -25,7 +25,7 @@ copy-bin-script() { 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/${CS_NODE_EXEC_PATH:-ROOT\/lib/node}/g' "$dest" + sed -i.bak 's/$ROOT\/node/${CS_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" From 6ca7bf861caa432703556a8eb4b7a93e5fe67750 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Thu, 29 Sep 2022 08:15:16 -0700 Subject: [PATCH 09/11] Update ci/build/build-vscode.sh Co-authored-by: Asher --- ci/build/build-vscode.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/build/build-vscode.sh b/ci/build/build-vscode.sh index 06ab68ad7e42..a7c9774954ca 100755 --- a/ci/build/build-vscode.sh +++ b/ci/build/build-vscode.sh @@ -25,7 +25,7 @@ copy-bin-script() { 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/${CS_NODE_EXEC_PATH:-ROOT\/lib\/node}/g' "$dest" + sed -i.bak 's/$ROOT\/node/${CS_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" From 2c043852df2eb4c927cc2a9d3fe2aef7678d0fd9 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Thu, 29 Sep 2022 09:08:48 -0700 Subject: [PATCH 10/11] fixup: use NODE_EXEC_PATh --- ci/build/build-vscode.sh | 2 +- src/node/wrapper.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/build/build-vscode.sh b/ci/build/build-vscode.sh index a7c9774954ca..716848601178 100755 --- a/ci/build/build-vscode.sh +++ b/ci/build/build-vscode.sh @@ -25,7 +25,7 @@ copy-bin-script() { 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/${CS_NODE_EXEC_PATH:-$ROOT\/lib\/node}/g' "$dest" + 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/src/node/wrapper.ts b/src/node/wrapper.ts index 858552e65bde..755914bb9982 100644 --- a/src/node/wrapper.ts +++ b/src/node/wrapper.ts @@ -321,7 +321,7 @@ export class ParentProcess extends Process { env: { ...process.env, CODE_SERVER_PARENT_PID: process.pid.toString(), - CS_NODE_EXEC_PATH: process.execPath, + NODE_EXEC_PATH: process.execPath, }, stdio: ["pipe", "pipe", "pipe", "ipc"], }) From fc0e48e1943a9df51dbe1bc26e2ab0b3e474d9a9 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Thu, 29 Sep 2022 11:07:42 -0700 Subject: [PATCH 11/11] Update ci/build/build-vscode.sh Co-authored-by: Asher --- ci/build/build-vscode.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/build/build-vscode.sh b/ci/build/build-vscode.sh index 716848601178..631964d5e7e4 100755 --- a/ci/build/build-vscode.sh +++ b/ci/build/build-vscode.sh @@ -25,7 +25,7 @@ copy-bin-script() { 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" + 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"