Skip to content

Visual Studio Code, rebuilt in Rust

Rust

fix(studio): drop cross-target build scripts on an upstream relink

rokartur3e9f9cb0250a
diff --git a/port/tools/studio b/port/tools/studio
index 60c1a5edeb7..afeeb82e09b 100755
--- a/port/tools/studio
+++ b/port/tools/studio
@@ -31,7 +31,7 @@ trap 'rm -f "$stale" "$sync_lock"' EXIT
# A mixed reset moves only the index, so file mtimes and the cargo build stay as they are.
# repointed on every run: a mirror seeded from port-src-integrate or synced before the uplift links the 1.147.0 one.
# 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"
+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}-* 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/"