Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork436
Open
Description
Describe the request
If a sketch is recompiled twice in a row, the Arduino-preprocessed sketchSketch.ino.cpp is recompiled and re-linked even if not necessary.
Describe the current behavior
If you do the same compile twice in a row:
~/Arduino/Blink$ LANG=en arduino-cli compile -b arduino:avr:uno --cleanSketch uses 1636 bytes (5%) of program storage space. Maximum is 32256 bytes.Global variables use 122 bytes (5%) of dynamic memory, leaving 1926 bytes for local variables. Maximum is 2048 bytes.Used library Version Path Wire 1.0 /home/megabug/.arduino15/packages/arduino/hardware/avr/1.8.6/libraries/WireUsed platform Version Path arduino:avr 1.8.6 /home/megabug/.arduino15/packages/arduino/hardware/avr/1.8.6~/Arduino/Blink$ LANG=en arduino-cli compile -b arduino:avr:uno -vFQBN: arduino:avr:unoUsing board 'uno' from platform in folder: /home/megabug/.arduino15/packages/arduino/hardware/avr/1.8.6Using core 'arduino' from platform in folder: /home/megabug/.arduino15/packages/arduino/hardware/avr/1.8.6Detecting libraries used...[...]Generating function prototypes...[...]Compiling sketch.../home/megabug/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/home/megabug/.arduino15/packages/arduino/hardware/avr/1.8.6/cores/arduino -I/home/megabug/.arduino15/packages/arduino/hardware/avr/1.8.6/variants/standard -I/home/megabug/.arduino15/packages/arduino/hardware/avr/1.8.6/libraries/Wire/src /tmp/arduino/sketches/002050EAA7EFB9A4FC451CDFBC0FA2D3/sketch/Blink.ino.cpp -o /tmp/arduino/sketches/002050EAA7EFB9A4FC451CDFBC0FA2D3/sketch/Blink.ino.cpp.oCompiling libraries...Compiling library "Wire"Using previously compiled file: /tmp/arduino/sketches/002050EAA7EFB9A4FC451CDFBC0FA2D3/libraries/Wire/utility/twi.c.oUsing previously compiled file: /tmp/arduino/sketches/002050EAA7EFB9A4FC451CDFBC0FA2D3/libraries/Wire/Wire.cpp.oCompiling core...Using precompiled core: /tmp/arduino/cores/arduino_avr_uno_12e4cfbdc0590d50ab9cd20e50a4c3c5/core.aLinking everything together.../home/megabug/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-gcc -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p -o /tmp/arduino/sketches/002050EAA7EFB9A4FC451CDFBC0FA2D3/Blink.ino.elf /tmp/arduino/sketches/002050EAA7EFB9A4FC451CDFBC0FA2D3/sketch/Blink.ino.cpp.o /tmp/arduino/sketches/002050EAA7EFB9A4FC451CDFBC0FA2D3/libraries/Wire/Wire.cpp.o /tmp/arduino/sketches/002050EAA7EFB9A4FC451CDFBC0FA2D3/libraries/Wire/utility/twi.c.o /tmp/arduino/sketches/002050EAA7EFB9A4FC451CDFBC0FA2D3/../../cores/arduino_avr_uno_12e4cfbdc0590d50ab9cd20e50a4c3c5/core.a -L/tmp/arduino/sketches/002050EAA7EFB9A4FC451CDFBC0FA2D3 -lm/home/megabug/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-objcopy -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 /tmp/arduino/sketches/002050EAA7EFB9A4FC451CDFBC0FA2D3/Blink.ino.elf /tmp/arduino/sketches/002050EAA7EFB9A4FC451CDFBC0FA2D3/Blink.ino.eep/home/megabug/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-objcopy -O ihex -R .eeprom /tmp/arduino/sketches/002050EAA7EFB9A4FC451CDFBC0FA2D3/Blink.ino.elf /tmp/arduino/sketches/002050EAA7EFB9A4FC451CDFBC0FA2D3/Blink.ino.hexMultiple libraries were found for "Wire.h" Used: /home/megabug/.arduino15/packages/arduino/hardware/avr/1.8.6/libraries/Wire Not used: /home/megabug/Workspace/Arduino_ThreadsUsing library Wire at version 1.0 in folder: /home/megabug/.arduino15/packages/arduino/hardware/avr/1.8.6/libraries/Wire /home/megabug/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-size -A /tmp/arduino/sketches/002050EAA7EFB9A4FC451CDFBC0FA2D3/Blink.ino.elfSketch uses 1636 bytes (5%) of program storage space. Maximum is 32256 bytes.Global variables use 122 bytes (5%) of dynamic memory, leaving 1926 bytes for local variables. Maximum is 2048 bytes.Used library Version Path Wire 1.0 /home/megabug/.arduino15/packages/arduino/hardware/avr/1.8.6/libraries/WireUsed platform Version Path arduino:avr 1.8.6 /home/megabug/.arduino15/packages/arduino/hardware/avr/1.8.6🐛 The sketch fileBlink.ino.cpp is recompiled even if there are no changes.
The sketch and linking phase could be completely skipped in this particular case.
Arduino CLI version
nightly
Operating system
N/A
Operating system version
N/A
Additional context
Additional requests
- Sketch re-compiled when unnecessary #1996
- Sketch re-compiled when unnecessary #1996 (comment)
- Sketch re-compiled when unnecessary #1996 (comment)
- Avoid unnecessary compiling when clicking "Upload" button #2015
- Retry upload arduino-ide#270
- Avoid recompiling when uploading multiple times without making changes arduino-ide#1789
- "Upload" also does a build/verify arduino-ide#2103
- Avoid recompiling if the code has not changed arduino-ide#2140
- Can we please have the compiled code SHA stamped so that is doesn't have to recompile after EVERY upload attempt? arduino-ide#2732
- Sketch gets recompiled for every verification and upload Arduino#2335
- Switch in IDE to skip compiling Arduino#6625
- feature request: upload without compile Arduino#8149
- https://forum.arduino.cc/t/recompiling-on-upload-without-code-change/897394
- https://forum.arduino.cc/t/arduino-ide-compiles-every-time-and-is-slow/1044606
- https://forum.arduino.cc/t/ide-2-0-2-why-recompile-every-time/1064264
- https://forum.arduino.cc/t/upload-without-compile/1175639
- https://forum.arduino.cc/t/still-no-upload-without-recompile/1300242
Issue checklist
- I searched for previous requests inthe issue tracker
- I verified the feature was still missing when using thenightly build
- My request contains all necessary details