github / github/codeql-cli-binaries
typescript-parser-wrapper fails for tsconfig.json path check on Windows
- Ngôn ngữ chính
- Không có dữ liệu ngôn ngữ
- Star
- 1k
- Fork
- 184
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
When javascript is scanned during finalize typescript-parser-wrapper can throw with tsconfig.json path mismatch.
This particular situation was found when more than javascript was detected and was on a Windows agent.
```log
D:\a\_work\_temp\codeql3000\github\codeql\codeql.exe database trace-command --index-traceless-dbs --db-cluster D:\a\_work\_temp\codeql3000\d
Running 2 commands for 3 databases:
- D:\a\_work\_temp\codeql3000\d\cpp
- D:\a\_work\_temp\codeql3000\d\javascript
- D:\a\_work\_temp\codeql3000\d\python
Running command in D:\a\_work\1\s: [D:\a\_work\_temp\codeql3000\github\codeql\javascript\tools\autobuild.cmd]
[2023-04-25 22:24:54] [build-stdout] Single-threaded extraction.
[2023-04-25 22:24:54] [build-stdout] packages\domain\interop\package.json: Main file set to packages\domain\interop\src\index.ts
[2023-04-25 22:24:54] [build-stdout] packages\domain\shf_validator\package.json: Main file not found
[2023-04-25 22:24:54] [build-stdout] Found Node.js at: node
[2023-04-25 22:24:54] [build-stdout] Found Node.js version: v16.15.1
[2023-04-25 22:24:54] [build-stdout] Opening project D:\a\_work\1\s\build\tsconfig.json
[2023-04-25 22:24:54] [build-stdout] Memory for TypeScript process: 2000 MB, and 400 MB reserve
[2023-04-25 22:24:54] [build-stderr] D:\a\_work\_temp\codeql3000\github\codeql\javascript\tools\typescript-parser-wrapper\node_modules\typescript\lib\typescript.js:2572
[2023-04-25 22:24:54] [build-stderr] throw e;
[2023-04-25 22:24:54] [build-stderr] ^
[2023-04-25 22:24:54] [build-stderr] Error: Debug Failure. Expected D:/a/_work/1/s/build/tsconfig.json === D:\a\_work\1\s\build\tsconfig.json.
[2023-04-25 22:24:54] [build-stderr] at attachFileToDiagnostic (D:\a\_work\_temp\codeql3000\github\codeql\javascript\tools\typescript-parser-wrapper\node_modules\typescript\lib\typescript.js:20186:18)
[2023-04-25 22:24:54] [build-stderr] at Object.attachFileToDiagnostics (D:\a\_work\_temp\codeql3000\github\codeql\javascript\tools\typescript-parser-wrapper\node_modules\typescript\lib\typescript.js:20218:42)
[2023-04-25 22:24:54] [build-stderr] at Object.parseJsonText (D:\a\_work\_temp\codeql3000\github\codeql\javascript\tools\typescript-parser-wrapper\node_modules\typescript\lib\typescript.js:32364:46)
[2023-04-25 22:24:54] [build-stderr] at Object.parseJsonText (D:\a\_work\_temp\codeql3000\github\codeql\javascript\tools\typescript-parser-wrapper\node_modules\typescript\lib\typescript.js:32092:23)
[2023-04-25 22:24:54] [build-stderr] at parseConfigFileTextToJson (D:\a\_work\_temp\codeql3000\github\codeql\javascript\tools\typescript-parser-wrapper\node_modules\typescript\lib\typescript.js:41734:33)
[2023-04-25 22:24:54] [build-stderr] at Object.readConfigFile (D:\a\_work\_temp\codeql3000\github\codeql\javascript\tools\typescript-parser-wrapper\node_modules\typescript\lib\typescript.js:41725:48)
[2023-04-25 22:24:54] [build-stderr] at loadTsConfig (D:\a\_work\_temp\codeql3000\github\codeql\javascript\tools\typescript-parser-wrapper\main.js:327:23)
[2023-04-25 22:24:54] [build-stderr] at handleOpenProjectCommand (D:\a\_work\_temp\codeql3000\github\codeql\javascript\tools\typescript-parser-wrapper\main.js:393:14)
[2023-04-25 22:24:54] [build-stderr] at Interface. (D:\a\_work\_temp\codeql3000\github\codeql\javascript\tools\typescript-parser-wrapper\main.js:620:17)
[2023-04-25 22:24:54] [build-stderr] at Interface.emit (node:events:527:28)
[2023-04-25 22:24:55] [build-stderr] at Interface._onLine (node:readline:487:10)
[2023-04-25 22:24:55] [build-stderr] at Interface._normalWrite (node:readline:661:12)
[2023-04-25 22:24:55] [build-stderr] at Socket.ondata (node:readline:269:10)
[2023-04-25 22:24:55] [build-stderr] at Socket.emit (node:events:527:28)
[2023-04-25 22:24:55] [build-stderr] at addChunk (node:internal/streams/readable:315:12)
[2023-04-25 22:24:55] [build-stderr] at readableAddChunk (node:internal/streams/readable:289:9)
[2023-04-25 22:24:55] [build-stderr] at Socket.Readable.push (node:internal/streams/readable:228:10)
[2023-04-25 22:24:55] [build-stderr] at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)
[2023-04-25 22:24:55] [build-stderr] com.semmle.util.exception.CatastrophicError: The TypeScript parser wrapper crashed with exit code 1
[2023-04-25 22:24:55] [ERROR] Spawned process exited abnormally (code 1; tried to run: [D:\a\_work\_temp\codeql3000\github\codeql\tools\win64\tracer.exe, D:\a\_work\_temp\codeql3000\github\codeql\tools\win64\runner.exe, cmd.exe, /C, type, NUL, &&, D:\a\_work\_temp\codeql3000\github\codeql\javascript\tools\autobuild.cmd])
A fatal error occurred: Exit status 1 from command: [D:\a\_work\_temp\codeql3000\github\codeql\tools\win64\runner.exe, cmd.exe, /C, type, NUL, &&, D:\a\_work\_temp\codeql3000\github\codeql\javascript\tools\autobuild.cmd]
```
Hướng dẫn đóng góp
Hướng nghiên cứu
Start at javascript/tools/typescript-parser-wrapper/main.js:327, in loadTsConfig, and follow the open-project path from handleOpenProjectCommand. Reproduce the tsconfig.json mismatch on a Windows agent while scanning multiple languages, then verify that autobuild.cmd completes without the parser wrapper crashing and handles the reported paths consistently.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- javascript, node.js, typescript
- Lĩnh vực
- devtools, operating-systems
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 45/100