Skip to content

Revert "feat: restore asar for node_modules" - #324875

Merged
Robo (deepak1556) merged 3 commits into
mainfrom
robo/revert_asar
Jul 8, 2026
Merged

Robo (deepak1556) merged 3 commits into
mainfrom
robo/revert_asar

Conversation

@deepak1556

@deepak1556 Robo (deepak1556) commented Jul 8, 2026 •

Copy link
Copy Markdown
Collaborator

@deepak1556 Robo (deepak1556) added this to the 1.129.0 milestone Jul 8, 2026
@deepak1556 Robo (deepak1556) self-assigned this Jul 8, 2026
Copilot AI review requested due to automatic review settings July 8, 2026 07:01
@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

Anthony Kim (@anthonykim1)

Matched files:

  • src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.ts

TylerLeonhardt

Matched files:

  • src/vs/workbench/services/languageDetection/browser/languageDetectionWorkerServiceImpl.ts

@deepak1556
Robo (deepak1556) enabled auto-merge (squash) July 8, 2026 07:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reverts the recently merged "feat: restore asar for node_modules" (#324084), returning VS Code to the pre-asar state where node_modules ships unpacked as a plain directory rather than bundled into a node_modules.asar archive. ASAR remains gated off behind the long-standing canASAR = false (TODO@esm) flag. The change re-simplifies module/native-binary path resolution across the workbench, agent host, Copilot extension, and the build/packaging pipeline so everything resolves from plain node_modules again.

Changes:

  • Restores canASAR = false gating in amdX.ts and removes the ESM/CJS ASAR resolution hooks in bootstrap-esm.ts/bootstrap-node.ts (keeping only the fs→original-fs mapping).
  • Reverts native-binary and CLI path resolution (ripgrep, node-pty, MXC sandbox, tree-sitter wasm, Copilot CLI) back to plain node_modules, dropping the nativeModulesDir/appNodeModules indirection and their tests.
  • Reverts build packaging: removes the MXC exclude filter, restores the original createAsar unpack/duplicate lists, drops the universal-app MXC cross-copy/singleArchFiles, and removes the _manifest module-ignore rule.

Reviewed changes

Copilot reviewed 31 out of 31 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/vs/amdX.ts Restores canASAR flag, simplifies _nodeJSLoadScript to import('fs'/'vm'/'module'), and gates useASAR on canASAR && isBuilt && !isWeb.
src/vs/base/common/platform.ts Removes the now-unused hasElectronUserAgent export.
src/bootstrap-esm.ts Removes the ESM ASAR resolution hook, keeping only fs→original-fs; reorders globals after the register block.
src/bootstrap-node.ts Removes the CommonJS enableASARSupport splice of node_modules.asar into lookup paths.
src/vs/code/electron-browser/workbench/workbench.ts Drops the _VSCODE_PRODUCT_JSON global (product comes from sandbox config).
src/vs/sessions/electron-browser/sessions.ts Drops the _VSCODE_PRODUCT_JSON global (sessions window).
src/vs/platform/webWorker/browser/webWorkerServiceImpl.ts Removes _VSCODE_PRODUCT_JSON from the worker bootstrap.
src/vs/platform/sandbox/common/terminalSandboxEngine.ts Removes the nativeModulesDir field and its use for rg/mxc paths.
src/vs/platform/sandbox/common/terminalSandboxMxcRuntime.ts Drops nativeModulesDir param; resolves MXC exec from node_modules.
src/vs/platform/agentHost/node/copilot/copilotAgent.ts Resolves node_modules relative to out/ instead of the ASAR-unpacked path.
src/vs/platform/agentHost/node/copilot/agentHostSandboxEngine.ts Removes nativeModulesDir from runtime info.
src/vs/platform/agentHost/node/commandAutoApprover.ts Resolves tree-sitter wasm from plain node_modules.
src/vs/workbench/services/treeSitter/browser/treeSitterLibraryService.ts Gates module location on canASAR; drops isWeb import.
src/vs/workbench/services/textMate/browser/textMateTokenizationFeatureImpl.ts Gates the onig.wasm ASAR path on canASAR.
src/vs/workbench/services/textMate/browser/backgroundTokenization/threadedBackgroundTokenizerFactory.ts Gates oniguruma ASAR selection on canASAR.
src/vs/workbench/services/languageDetection/browser/languageDetectionWorkerServiceImpl.ts Gates the worker ASAR selection on canASAR.
src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.ts Drops nativeModulesDir from both remote and local runtime info.
extensions/copilot/.../node/appNodeModules.ts Deletes the dual-root (node_modules/.asar.unpacked) resolver helper.
extensions/copilot/.../node/test/appNodeModules.spec.ts Deletes the helper's tests.
extensions/copilot/.../node/ripgrepShim.ts Resolves ripgrep from plain node_modules.
extensions/copilot/.../node/nodePtyShim.ts Resolves node-pty from plain node_modules; drops multi-root probing.
extensions/copilot/.../node/test/nodePtyShim.spec.ts Removes .asar.unpacked resolution tests.
extensions/copilot/.../node/copilotCli.ts Sets MXC_BIN_DIR from plain node_modules.
extensions/copilot/.../claude/node/claudeCodeAgent.ts Builds the ripgrep PATH from plain node_modules.
build/gulpfile.vscode.ts Restores original createAsar unpack/duplicate lists; drops MXC exclude filter and unpacked shim dir.
build/gulpfile.reh.ts Drops the MXC exclude filter from the REH package task.
build/lib/copilot.ts Removes getMxcExcludeFilter and mxcArchitectures.
build/lib/test/copilot.test.ts Removes the MXC exclude-filter tests.
build/darwin/create-universal-app.ts Drops the MXC cross-copy loop and singleArchFiles allowlist.
build/linux/dependencies-generator.ts Uses a local canAsar = false gate to scan plain node_modules.
build/.moduleignore Removes the _manifest signing-artifacts ignore rule.

@deepak1556
Robo (deepak1556) merged commit 9269826 into main Jul 8, 2026
30 checks passed
@deepak1556
Robo (deepak1556) deleted the robo/revert_asar branch July 8, 2026 07:16
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Aug 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants