Closed
Description
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 commentedon Nov 14, 2021
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:
esp32:esp32
boards platform--only-compilation-database
flagThis 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 same type of issue occurs when compiling for boards of the
STMicroelectronics:stm32
boards platform (except the missing file is namedbuild.opt
):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 requiredbuild_opt.h
/build.opt
file is missing from the build folder.Now 'compile --only-compilation-database' will run all pre-* hooks
compile --only-compilation-database
will run all pre-* hooks #1549Now `compile --only-compilation-database` will run all pre-* hooks (#…