Skip to content

compile_commands.json is not generated if cli run with --only-compilation-database ends in error #1245

Open
@ag88

Description

@ag88

Bug Report

Current behavior

this issue is discovered in Arduino IDE 2.0 beta 4 found here
arduino/arduino-ide#220 (comment)

if arduino-cli compile is run with --only-compilation-database ends in error, compile_commands.json is not generated

however if arduino-cli compile is run without --only-compilation-database the build completes, though with a success : false status and a detailed compile_commands.json file is successfully generated

the complete details is in the Arduino IDE issue comment link above.

Expected behavior

the missing compile_commands.json file causes definition and symbol lookup to fail in Arduino IDE 2.0.
it would seem --only-compilation-database needs to run to completion even if encountering some errors as otherwise compile_commands.json is not generated

Environment

  • CLI version (output of arduino-cli version):
  • arduino-cli version
    arduino-cli alpha Version: 0.17.0 Commit: ab58758 Date: 2021-03-17T15:10:16Z
  • OS and platform: linux opensuse

Additional context

the problem is discovered in Arduino IDE 2.0 beta4

Metadata

Metadata

Assignees

Labels

topic: build-processRelated to the sketch build processtopic: codeRelated to content of the project itselftype: imperfectionPerceived defect in any part of project

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions