github / github/codeql

CodeQL emits error when binlog does not contain compilation

Đang mở
#17,981 6 bình luận 0 reaction 0 người được giao Xem trên GitHub
question
Ngôn ngữ chính
CodeQL
Star
10.1k
Fork
2.1k
Merge trung bình
2 ngày 15 giờ
Pull request đã merge (30 ngày)
141

Mô tả

**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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.