github / github/codeql

CodeQL emits error when binlog does not contain compilation

オープン
#17,981 コメント 6 件 リアクション 0 件 担当者 0 名 GitHub で見る
question
主要言語
CodeQL
スター
10.1k
フォーク
2.1k
平均マージ
2日 18時間
マージ済み PR(30日)
152

説明

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

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

global.json、NoTargetsProject.csproj、msbuild.binlog、および提供された codeql-binlog-min-repro.zip を使ってシナリオを再現し、その後 -Obinlog と --build-mode=none を指定してデータベース作成コマンドを実行します。binlog にコンパイルがない場合の C# autobuild.cmd パスを追跡することから始めます。このケースで、エラー終了する代わりにコンパイルが見つからなかったことが報告されれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
csharp
領域
build-system
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。