Closed dilin-MS closed 4 years ago
Although you can't set it via arduino-cli.yaml, you can accomplish this via arduino-cli compile
's --build-path
and --build-cache-path
options.
Hi, @per1234 , I try the arduino-cli compile
's --build-path
and --build-cache-path
options. The result confuses me. Could you help explain?
I mount the folder /root
to a docker volume., which means everytime I run the image, only /root
will be preserved. Other folders will be flushed out(for example, /tmp
). To preserve last time compilation result, I will set the compiled files to be stored in /root
folder.
project_path=/root/Arduino/device
tmp_path=/root/tmp
arduino-cli compile --fqbn AZ3166:stm32f4:MXCHIP_AZ3166 ${project_path} --debug
arduino-cli compile --fqbn AZ3166:stm32f4:MXCHIP_AZ3166 ${project_path} --build-cache-path ${tmp_path} --build-path ${tmp_path} --debug
arduino-cli compile --fqbn AZ3166:stm32f4:MXCHIP_AZ3166 ${project_path} --build-path ${tmp_path} --debug
arduino-cli compile --fqbn AZ3166:stm32f4:MXCHIP_AZ3166 ${project_path} --build-cache-path ${tmp_path} --debug
I ran the above four commands separately. Only the fourth command achieves incremental build, which means re-compilation takes little time. Other commands' second-time compilation time consumption is as same as the first time. They didn't achieve incremental build. Why?
Why the --build-cache-path
didn't save the time and even worse the time?
By running the fourth command arduino-cli compile --fqbn AZ3166:stm32f4:MXCHIP_AZ3166 ${project_path} --build-cache-path ${tmp_path} --debug
, the recompile action only suggest "devkit.ino.cpp.o" as "Not Found".
Not found: /tmp/arduino-sketch-3E00829D3080742371472E93F1888B0F/sketch/device.ino.cpp.o
Any other best practice?
@per1234 ,Hi, how can I specify the build output file XX.elf
and XX.bin
to a customized folder, such as a folder named .build/
? We do not want to place the file directly in the skech folder.
Currently if I set --build-path=.build/
, the arduino-cli compile
command will first store them in .build
folder, and later copy them into my skech folder.
root@93b792d24baa:/workspaces/workflow# arduino-cli compile --fqbn AZ3166:stm32f4:MXCHIP_AZ3166 /workspaces/workflow/ --build-path /workspaces/workflow/.build --debug
...
Sketch uses 215372 bytes (20%) of program storage space. Maximum is 1048576 bytes.
Global variables use 43896 bytes (16%) of dynamic memory, leaving 218248 bytes for local variables. Maximum is 262144 bytes.
INFO[0002] copying sketch build output from=/workspaces/workflow/.build/workflow.ino.bin to=/workspaces/workflow/workflow.AZ3166.stm32f4.MXCHIP_AZ3166.bin
INFO[0002] copying sketch build output from=/workspaces/workflow/.build/workflow.ino.elf to=/workspaces/workflow/workflow.AZ3166.stm32f4.MXCHIP_AZ3166.elf
Looking for the solution. Thanks!
You can use arduino-cli compile
's --output option for this purpose:
arduino-cli compile --fqbn AZ3166:stm32f4:MXCHIP_AZ3166 /workspaces/workflow/ --build-path /workspaces/workflow/.build --output /workspaces/workflow/.build/output --debug
will save the output files as /workspaces/workflow/.build/output/output.elf
and /workspaces/workflow/.build/output/output.bin
.
It seems like this should really be configurable via arduino-cli.yaml
.
Hi everyone! I wonder if the latest IDE version is already supporting the configuration of the output path via arduino-cli.yaml.
I'm using the hex files in a simulator and this would facilitate a lot.
Thanks!
Hi, I was wondering whether arduino-cli support customization of build path?
Currently I can only set
sketchbook_path
andarduino_data
througharduino-cli.yaml
file. I am using arduino-cli within docker container.In order to realize incremental build, I need to preserve intermediate files in a specific folder, so next time these files can be found by the arduino-cli comiler and thus reduce the compilation time. However, the
sketchbook_path
only store theXX.ino
,XX.elf
andXX.bin
file. Other files needed to reduce the next compilation time is stored automatically in/tmp/
directory. Is there any way that I can change the default intermediate files output path/tmp
to some customized path, like/root/Arduino/MyFirstSketch/.build
? Where should I configure this value? When I talk about intermediate files, I mean something like:Reproduce the scenario
/root/.arduino15/arduino-cli.yaml
fileWhen I ran
arduino-cli compile --fqbn AZ3166:stm32f4:MXCHIP_AZ3166 /root/Arduino/devkit/devkit.ino --debug
command, I got:ls -al /work/devkit/
ls -al /root/Arduino/devkit/
Wait for the reply. Thanks a lot!