Skip to content

Unable to generate only the compilation database #1547

Closed
@jacquesg

Description

@jacquesg

Bug Report

Current behavior

/home/linuxbrew/.linuxbrew/bin/arduino-cli --config-file /home/jacquesg/.arduino15/arduino-cli.yaml compile --fqbn esp32:esp32:featheresp32 --only-compilation-database --clean --build-path $PWD/build --format json /home/jacquesg/dev/AdvancedWebServer
{                                                                                                                                                                                                         
  "compiler_out": "",                                                                                                                                                                                     
  "compiler_err": "xtensa-esp32-elf-g++: error: /home/jacquesg/dev/AdvancedWebServer/build/build_opt.h: No such file or directory\n",                                                                     
  "builder_result": {                                                                                                                                                                                     
    "build_path": "/home/jacquesg/dev/AdvancedWebServer/build"                                                                                                                                            
  },                                                                                                                                                                                                      
  "success": false                                                                                                                                                                                        
} 
/home/linuxbrew/.linuxbrew/bin/arduino-cli --config-file /home/jacquesg/.arduino15/arduino-cli.yaml compile --fqbn esp32:esp32:featheresp32 --clean --build-path $PWD/build --format json /home/jacquesg/dev/AdvancedWebServer                                                                                                                                                     
{                                                                                                                                                                                                         
  "compiler_out": "Sketch uses 701109 bytes (53%) of program storage space. Maximum is 1310720 bytes.\nGlobal variables use 39840 bytes (12%) of dynamic memory, leaving 287840 bytes for local variables.
 Maximum is 327680 bytes.\n",                                                                                                                                                                             
  "compiler_err": "",
... SNIP ...
  },
  "success": true
}

From the above, by only requesting the compilation database the compilation fails.

Expected behavior

No error should be generated.

Environment

  • CLI version (output of arduino-cli version): arduino-cli alpha Version: 0.19.3 Commit: 12f1afc Date: 2021-10-11T15:14:04Z
  • OS and platform: Linux with an ESP32 board

Activity

per1234

per1234 commented on Nov 14, 2021

@per1234
Contributor

I'll add some additional information:
The command that was shared is far more than is needed for a minimal demonstration. The only two requirements are:

arduino-cli compile --fqbn esp32:esp32:featheresp32 --only-compilation-database

This is specific to the configuration of the ESP32 platform (i.e., it won't occur when compiling for another platform such as arduino:avr). It is the result of this feature:
espressif/arduino-esp32#5237

Note the comment there:

The script has been taken from stm32duino's Arduino_Core_STM32 package

The same type of issue occurs when compiling for boards of the STMicroelectronics:stm32 boards platform (except the missing file is named build.opt):

$ arduino-cli compile --fqbn STMicroelectronics:stm32:GenF0 --only-compilation-database Foo
arm-none-eabi-g++: error: C:\Users\per\AppData\Local\Temp\arduino-sketch-E8AF847218556EB3A395D00D1B675AD8/sketch/build.opt: No such file or directory

Error during build: exit status 1

The problem seems to be that the recipe.hooks.prebuild.NUMBER.pattern hook doesn't run when using the --only-compilation-database flag, so the required build_opt.h/build.opt file is missing from the build folder.

added
topic: codeRelated to content of the project itself
type: imperfectionPerceived defect in any part of project
on Nov 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Unable to generate only the compilation database · Issue #1547 · arduino/arduino-cli