Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#1,072 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
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時間
マージ済み PR(30日)
37

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

github/vscode-codeql のほかの issue

github/vscode-codeql の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。