Skip to content

Visual Studio Code, rebuilt in Rust

Rust

fix(studio): drop upstream build scripts when the link is repointed

rokartur265fc427627b
diff --git a/port/tools/studio b/port/tools/studio
index 40f116a4748..60c1a5edeb7 100755
--- a/port/tools/studio
+++ b/port/tools/studio
@@ -29,9 +29,9 @@ stale=$(mktemp)
trap 'rm -f "$stale" "$sync_lock"' EXIT
# A mirror without alternates still has the full .git of the old rsync copy: replace it with a light one.
# A mixed reset moves only the index, so file mtimes and the cargo build stay as they are.
-# A mirror of a tree without src/ (split, milestone 22) reads upstream from the Studio's 1.148.0 reference: upstream -> ~/Developer/vscode-ref-1.148.0,
# repointed on every run: a mirror seeded from port-src-integrate or synced before the uplift links the 1.147.0 one.
-ssh studio "cd ~/$work/$name && bash -c 'test -f .git/objects/info/alternates || { rm -rf .git && git init -q && echo ~/$work/git.git/objects > .git/objects/info/alternates; }; git reset -q $head && git clean -fdq && { git cat-file -e HEAD:src 2>/dev/null || test -d upstream -a ! -L upstream || ln -sfn ~/Developer/vscode-ref-1.148.0 upstream; } && git ls-files -m -z'" > "$stale"
+# A repointed link also drops the build scripts that read upstream: cargo watches the old target's files, which never change, so it keeps their stale VSCODE_SRC.
+ssh studio "cd ~/$work/$name && bash -c 'test -f .git/objects/info/alternates || { rm -rf .git && git init -q && echo ~/$work/git.git/objects > .git/objects/info/alternates; }; git reset -q $head && git clean -fdq && { git cat-file -e HEAD:src 2>/dev/null || test -d upstream -a ! -L upstream || test \"\$(readlink upstream)\" = ~/Developer/vscode-ref-1.148.0 || { ln -sfn ~/Developer/vscode-ref-1.148.0 upstream && rm -rf native/target/*/build/{app,diff,exthost,files}-*; }; } && git ls-files -m -z'" > "$stale"
# Diff against HEAD, not the index: staged changes (a merge being resolved) must travel too.
# openrsync has no --ignore-missing-args: leave out files deleted here.
cat "$stale" <(git diff --name-only -z --diff-filter=d HEAD) <(git ls-files -o --exclude-standard -z) | sort -zu | { grep -zvxFf <(git -c core.quotepath=off diff --name-only --diff-filter=D HEAD) || true; } | rsync -az --from0 --files-from=- . "studio:$work/$name/"