github / github/codeql

CodeQL emits error when binlog does not contain compilation

Offen
#17,981 6 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
question
Vorherrschende Sprache
CodeQL
Sterne
10.1k
Forks
2.1k
Ø Merge
2 T. 15 Std.
Gemergte PRs (30 T.)
141

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.