github / github/codeql

CodeQL emits error when binlog does not contain compilation

未關閉
#17,981 6 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
question
主要語言
CodeQL
星號
10.1k
分支
2.1k
平均合併
2 天 15 小時
30 天內合併 PR
141

描述

**Description of the issue**
An error is emitted when creating a database with the `-Obinlog` option using a `binlog` file that _does not_ contain any compilation.

Repro steps:
1. Download and extract [codeql-binlog-min-repro.zip](https://github.com/user-attachments/files/17736274/codeql-binlog-min-repro.zip) (contains two files: `global.json` and `NoTargetsProject.csproj`) to some directory.
2. In said directory, run `msbuild.exe /t:restore;build /bl`.
3. Run `codeql.exe database create --language=csharp --build-mode=none -Obinlog=msbuild.binlog`
4. Observe the following error (note that I've generalized some personal file paths):
```
Initializing database at C:\Users\DSHEPE~1\AppData\Local\Temp\CodeQL_CB_DB2.
Running build command: []
Running command in D:\repos\test: [\codeql\csharp\tools\autobuild.cmd]
[2024-11-13 12:00:24] [build-stdout] CodeQL C# autobuilder
[2024-11-13 12:00:24] [build-stdout] Working directory: D:\repos\test
[2024-11-13 12:00:25] [ERROR] Spawned process exited abnormally (code 2; tried to run: [codeql\tools\win64\runner.exe, cmd.exe, /C, type, NUL, &&, \codeql\csharp\tools\autobuild.cmd])
A fatal error occurred: Exit status 2 from command: [\codeql\tools\win64\runner.exe, cmd.exe, /C, type, NUL, &&, \codeql\csharp\tools\autobuild.cmd]
```

Can this scenario be treated as a no-op, with just a message emitted that no compilations were found in the binlog?

cc: @tamasvajk

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。