Integration tests on Apple Silicon attempt to run under Rosetta and fail
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- electron, node.js, typescript
- Lĩnh vực
- desktop, testing-qa, tooling
Hướng nghiên cứu
Trong extensions/ql-vscode, hãy bắt đầu với run-integration-tests.ts và entry point npm run integration; sau đó kiểm tra hành vi của download.ts trong vscode-test được tham chiếu. Tái hiện trên một máy Mac M1 và so sánh binary Electron đã tải xuống với đường dẫn ARM-native được cấu hình khởi chạy Run and Debug sử dụng. Hoàn tất khi lệnh khởi chạy VS Code ARM-native mà không dùng Rosetta và các bài kiểm thử tích hợp đều vượt qua.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.tstest 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 acceptsdarwinas 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 DebugUI. This is because the UI test launcher uses the tasks defined inlaunch.json, which start VS Code directly without going throughrun-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 Testsfrom theRun and Debugview 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.
- Ngôn ngữ chính
- TypeScript
- Star
- 539
- Fork
- 240
- Merge trung bình
- 2 ngày 18 giờ
- Pull request đã merge (30 ngày)
- 37
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của github/vscode-codeql
-
bug VSCode
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
github/vscode-codeql#4471 · 1 bình luận ·
-
bug enhancement VSCode
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
github/vscode-codeql#592 · 2 bình luận ·
-
enhancement VSCode
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
github/vscode-codeql#4432 · 1 bình luận ·
-
bug VSCode
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
github/vscode-codeql#4356 ·
-
bug VSCode
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 64/100
github/vscode-codeql#4339 · 1 bình luận ·
Tất cả issue của github/vscode-codeql
Issue tương tự
-
blocklist removal
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
MetaMask/eth-phishing-detect#296544 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
pastelsky/bundlephobia#1122 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
category/development priority/P2 scope/file-operations scope/testing type/enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Enatega Customer and Rider app: Add-ons price is not visible to customer after order is placed. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100