Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Integration tests on Apple Silicon attempt to run under Rosetta and fail

未关闭
#1,072 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
electron, node.js, typescript

调研方向

在 extensions/ql-vscode 中,先从 run-integration-tests.ts 和 npm run integration 入口开始;然后检查所引用的 vscode-test download.ts 行为。在 M1 Mac 上复现,并将下载的 Electron 二进制文件与 Run and Debug 启动配置使用的 ARM-native 路径进行比较。完成标准是该命令能够在不使用 Rosetta 的情况下启动 ARM-native VS Code,并且集成测试通过。

由索引模型根据 Issue 内容生成。

描述

bug VSCode

Describe the bug
Running npm run integration from the command line on an M1 Mac leads to the following error:

> vscode-codeql@1.5.9 integration
> node ./out/vscode-tests/run-integration-tests.js no-workspace,minimal-workspace

Found .vscode-test/vscode-1.63.2. Skipping download.
Running integration tests in these directories: no-workspace,minimal-workspace
Next integration test dir: no-workspace
Launch args: --disable-extensions,--disable-gpu
rosetta error: /var/db/oah/279281325309952_279281325309952/79a831ad051c57eb341ad61bf19eea2efece2baf38aaf9eb68316bb0af278da6/Electron.aot: attachment of code signature supplement failed: 1

Exit code:   null
Done

Unexpected exception while running tests: SIGTRAP

Explanation:

  • The run-integration-tests.ts test harness downloads a stable copy of VS Code to execute the tests in.
  • On Apple Silicon, this downloads an x86 VS Code / Electron binary, even if there is an ARM-native or universal VS Code binary installed.
% file .vscode-test/vscode-1.63.2/Visual Studio Code.app/Contents/MacOS/Electron
.vscode-test/vscode-1.63.2/Visual Studio Code.app/Contents/MacOS/Electron:: Mach-O 64-bit executable x86_64
  • I suspect this behaviour originates from vscode-test, specifically https://github.com/microsoft/vscode-test/blob/fd0e599cd8e096f58f226509c6b76c68f502e926/lib/download.ts#L50, because it only accepts darwin as the download platform, without allowing a choice between x86 or ARM.
  • This means that the integration tests attempt to run under Rosetta.
  • Rosetta fails to launch VS Code due to a code signature mismatch.
  • This error doesn't happen when running the integration tests from the Run and Debug UI. This is because the UI test launcher uses the tasks defined in launch.json, which start VS Code directly without going through run-integration-tests.ts, and use the same VS Code binary as the parent instance (which will be ARM native if you installed it on M1).

Version
VS Code 1.63.2
CodeQL for VS Code 1.5.9

To reproduce

  • Clone repo on an M1 Mac.
  • cd extensions/ql-vscode && npm install && npm run integration
  • Observe error.
  • Choose Launch Integration Tests from the Run and Debug view in the UI.
  • Observe no error.

Expected behavior
npm run integration should download and launch an ARM-native VS Code binary, without using Rosetta, and the tests should pass.

Additional context
Observed by @angelapwen and diagnosed in internal discussion.

主要语言
TypeScript
星标
539
派生
240
平均合并
2 天 18 小时
30 天内合并 PR
37

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

github/vscode-codeql 的其他 Issue

查看 github/vscode-codeql 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。