Skip to content

Commit 3ac2307

Browse files
jsjoeiocode-asher
andauthored
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 <[email protected]> * fixup!: fix: remove deprecated symlink * Update ci/build/build-vscode.sh Co-authored-by: Asher <[email protected]> * Update ci/build/build-vscode.sh Co-authored-by: Asher <[email protected]> * fixup: use NODE_EXEC_PATh * Update ci/build/build-vscode.sh Co-authored-by: Asher <[email protected]> Co-authored-by: Asher <[email protected]>
1 parent 8629d6a commit 3ac2307

File tree

5 files changed

+4
-23
lines changed

5 files changed

+4
-23
lines changed

.github/workflows/build.yaml

-12
Original file line numberDiff line numberDiff line change
@@ -318,12 +318,6 @@ jobs:
318318
./test/node_modules/.bin/playwright install-deps
319319
./test/node_modules/.bin/playwright install
320320
321-
# TODO@jsjoeio - this is temp. We need to do an actual fix
322-
- name: Copy node binary to release
323-
run: |
324-
ln -s $(which node) ./release/lib/node
325-
ln -s $(which node) ./release/node
326-
327321
- name: Run end-to-end tests
328322
run: CODE_SERVER_TEST_ENTRY=./release yarn test:e2e --global-timeout 840000
329323

@@ -400,12 +394,6 @@ jobs:
400394
- name: Start Caddy
401395
run: sudo ~/.cache/caddy/caddy start --config ./ci/Caddyfile
402396

403-
# TODO@jsjoeio - this is temp. We need to do an actual fix
404-
- name: Copy node binary to release
405-
run: |
406-
ln -s $(which node) ./release/lib/node
407-
ln -s $(which node) ./release/node
408-
409397
- name: Run end-to-end tests
410398
run: CODE_SERVER_TEST_ENTRY=./release yarn test:e2e:proxy --global-timeout 840000
411399

ci/build/build-standalone-release.sh

-3
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ main() {
2424
rsync ./ci/build/code-server.sh "$RELEASE_PATH/bin/code-server"
2525
rsync "$node_path" "$RELEASE_PATH/lib/node"
2626

27-
ln -s "./bin/code-server" "$RELEASE_PATH/code-server"
28-
ln -s "./lib/node" "$RELEASE_PATH/node"
29-
3027
pushd "$RELEASE_PATH"
3128
npm install --unsafe-perm --omit=dev
3229
popd

ci/build/build-vscode.sh

+3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ copy-bin-script() {
2323
# shellcheck disable=SC2016
2424
sed -i.bak 's/^ROOT=\(.*\)$/VSROOT=\1\nROOT="$(dirname "$(dirname "$VSROOT")")"/g' "$dest"
2525
sed -i.bak 's/ROOT\/out/VSROOT\/out/g' "$dest"
26+
# We do not want expansion here; this text should make it to the file as-is.
27+
# shellcheck disable=SC2016
28+
sed -i.bak 's/$ROOT\/node/${NODE_EXEC_PATH:-$ROOT\/lib\/node}/g' "$dest"
2629

2730
# Fix Node path on Windows.
2831
sed -i.bak 's/^set ROOT_DIR=\(.*\)$/set ROOT_DIR=%~dp0..\\..\\..\\..\r\nset VSROOT_DIR=\1/g' "$dest"

ci/build/code-server.sh

-8
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,6 @@ _realpath() {
1111
cd "$(dirname "$script")"
1212

1313
while [ -L "$(basename "$script")" ]; do
14-
if [ -L "./node" ] && [ -L "./code-server" ] \
15-
&& [ -f "package.json" ] \
16-
&& cat package.json | grep -q '^ "name": "code-server",$'; then
17-
echo "***** Please use the script in bin/code-server instead!" >&2
18-
echo "***** This script will soon be removed!" >&2
19-
echo "***** See the release notes at https://github.com/coder/code-server/releases/tag/v3.4.0" >&2
20-
fi
21-
2214
script="$(readlink "$(basename "$script")")"
2315
cd "$(dirname "$script")"
2416
done

src/node/wrapper.ts

+1
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ export class ParentProcess extends Process {
321321
env: {
322322
...process.env,
323323
CODE_SERVER_PARENT_PID: process.pid.toString(),
324+
NODE_EXEC_PATH: process.execPath,
324325
},
325326
stdio: ["pipe", "pipe", "pipe", "ipc"],
326327
})

0 commit comments

Comments
 (0)