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 摘要。