Skip to content

Don't rebuild core.a when not needed #2003

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

matthijskooijman
Copy link
Collaborator

As pointed out in #1991, the core.a file was always rebuilt, even when nothing about it changed. This fixes that by only rebuilding it when needed. Note that the .o files for the core were already reused, this concerns just the .a file.

@tchilton
Copy link

tchilton commented May 3, 2014

Completely agree with this. When doing other things, like sorting programmers or board definitions, it just slows things down - couple of minutes for a build - even for an empty sketch, then 2 seconds for the test.
Would be nice to extend this so that the IDE followed standard builld dependency tree like a MAKE rather than everything every. Takes ages to build big projects by comparison to other tools.

@matthijskooijman
Copy link
Collaborator Author

Not sure what you by the last part - The IDE already lets the compiler generate .d files with dependencies and only compiles a source file if it or its dependencies change?

@tchilton
Copy link

tchilton commented May 4, 2014

Open project, verify, then do upload. It does a rebuild (compiling sketch). Similarly, upload, then without doing anything else, do upload again results in the same. If the IDE knows that no source files have been changed, why even call the compiler at all ?.

@matthijskooijman
Copy link
Collaborator Author

After you open the IDE, a full compile is expected - the compiler keeps the object files in a temporary directory, which gets cleaned up when the IDE quits.

However, within a single IDE session, it shouldn't recompile everything. Just tested this (with verify, not upload, I don't have an Arduino attached right now) and indeed, the first verify compiles everything. The second one compiles just the sketch itself, and re-assembles the core.a file (which is fixed by this pullrequest). If things are different for you, perhaps you can put the (verbose) output of the first and second run up at e.g. http://pastebin.com?

@tchilton
Copy link

tchilton commented May 5, 2014

OK, with a bit more detail then ..

  1. The tidy up on exit does not work reliably. Find the temporary folder in explorer, exit IDE and folder remains.
  2. The recompile, I understand re the initial build and its need given (1) above. but it builds when not necessary - my point about upload then upload, it rebuilds between the two when nothing changed. How about if no source files changed in IDE, then skip build, or give a separate function of "program".. Its a bit painful when trying to develop programming interfaces ... spend more time waiting for un-necessary compiles. Having looked into the debug output, most of it is libraries, rather than my code.. An upload of an empty sketch is a good example of this.

@matthijskooijman
Copy link
Collaborator Author

@tchilton, thanks for the additional detail.

  1. This seems like an unrelated problem. Could you file a separate issue for this?
  2. Like I said before, the IDE already only recompiles files that changed. If this is not working for you somehow, then that's a bug - not a missing feature. As I asked before - could you show the verbose output of the first and second upload or verify runs so we can figure out why it's not working?

@matthijskooijman
Copy link
Collaborator Author

(Something that just occured to me - is you system clock set correctly? Was it perhaps set to a (far) future time in the past?)

@cmaglie cmaglie added this to the Release 1.5.8 milestone Jul 15, 2014
@matthijskooijman matthijskooijman added Version: 1.5.x feature request A request to make an enhancement (not a bug fix) Component: IDE The Arduino IDE Component: Compilation Related to compilation of Arduino sketches labels Sep 10, 2014
@cmaglie cmaglie modified the milestones: Release 1.5.8, Release 1.5.9 Oct 13, 2014
@matthijskooijman matthijskooijman force-pushed the ide-1.5.x-core.a-rebuild branch from d4a4e6e to a470e1d Compare October 31, 2014 14:17
Before, the ar command was just ran for all .o files that should end up
in core.a, which should replace any old code in core.a. However, it
seems that in the unlikely event that functions or entire source files
are deleted, they might linger in the core.a file.
This prevents a half-finished core.a file from lingering around.
Currently, this should not make a difference since core.a is rebuilt
every time, but this prepares for skipping this build step if possible.
@matthijskooijman matthijskooijman force-pushed the ide-1.5.x-core.a-rebuild branch from a470e1d to 48f0fe6 Compare October 31, 2014 14:46
@matthijskooijman
Copy link
Collaborator Author

I just rebased this PR to current ide-1.5.x

@cmaglie
Copy link
Member

cmaglie commented Oct 31, 2014

If I select the Arduino Due board the second build fails with:

     [exec] /home/megabug/Code/arduino/build/linux/work/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-g++ -c -g -Os -w -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf -MMD -mcpu=cortex-m3 -DF_CPU=84000000L -DARDUINO=158 -DARDUINO_SAM_DUE -DARDUINO_ARCH_SAM -D__SAM3X8E__ -mthumb -DUSB_VID=0x2341 -DUSB_PID=0x003e -DUSBCON -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Due" -I/home/megabug/Code/arduino/build/linux/work/hardware/arduino/sam/system/libsam -I/home/megabug/Code/arduino/build/linux/work/hardware/arduino/sam/system/CMSIS/CMSIS/Include/ -I/home/megabug/Code/arduino/build/linux/work/hardware/arduino/sam/system/CMSIS/Device/ATMEL/ -I/home/megabug/Code/arduino/build/linux/work/hardware/arduino/sam/cores/arduino -I/home/megabug/Code/arduino/build/linux/work/hardware/arduino/sam/variants/arduino_due_x /tmp/build3446787470371834433.tmp/sketch_oct31a.cpp -o /tmp/build3446787470371834433.tmp/sketch_oct31a.cpp.o 
     [exec] Using previously compiled file: /tmp/build3446787470371834433.tmp/wiring.c.o
     [exec] Using previously compiled file: /tmp/build3446787470371834433.tmp/syscalls_sam3.c.o
     [exec] Using previously compiled file: /tmp/build3446787470371834433.tmp/WInterrupts.c.o
     [exec] Using previously compiled file: /tmp/build3446787470371834433.tmp/wiring_shift.c.o
     [exec] Using previously compiled file: /tmp/build3446787470371834433.tmp/hooks.c.o
     [exec] Using previously compiled file: /tmp/build3446787470371834433.tmp/wiring_analog.c.o
     [exec] Using previously compiled file: /tmp/build3446787470371834433.tmp/iar_calls_sam3.c.o
     [exec] Using previously compiled file: /tmp/build3446787470371834433.tmp/itoa.c.o
     [exec] Using previously compiled file: /tmp/build3446787470371834433.tmp/wiring_digital.c.o
     [exec] Using previously compiled file: /tmp/build3446787470371834433.tmp/cortex_handlers.c.o
     [exec] Using previously compiled file: /tmp/build3446787470371834433.tmp/dtostrf.c.o
     [exec] Using previously compiled file: /tmp/build3446787470371834433.tmp/new.cpp.o
     [exec] Using previously compiled file: /tmp/build3446787470371834433.tmp/main.cpp.o
     [exec] Using previously compiled file: /tmp/build3446787470371834433.tmp/USARTClass.cpp.o
     [exec] Using previously compiled file: /tmp/build3446787470371834433.tmp/WMath.cpp.o
     [exec] Using previously compiled file: /tmp/build3446787470371834433.tmp/RingBuffer.cpp.o
     [exec] Using previously compiled file: /tmp/build3446787470371834433.tmp/HID.cpp.o
     [exec] Using previously compiled file: /tmp/build3446787470371834433.tmp/CDC.cpp.o
     [exec] Using previously compiled file: /tmp/build3446787470371834433.tmp/USBCore.cpp.o
     [exec] Using previously compiled file: /tmp/build3446787470371834433.tmp/UARTClass.cpp.o
     [exec] Using previously compiled file: /tmp/build3446787470371834433.tmp/abi.cpp.o
     [exec] Using previously compiled file: /tmp/build3446787470371834433.tmp/WString.cpp.o
     [exec] Using previously compiled file: /tmp/build3446787470371834433.tmp/Stream.cpp.o
     [exec] Using previously compiled file: /tmp/build3446787470371834433.tmp/Print.cpp.o
     [exec] Using previously compiled file: /tmp/build3446787470371834433.tmp/Reset.cpp.o
     [exec] Using previously compiled file: /tmp/build3446787470371834433.tmp/wiring_pulse.cpp.o
     [exec] Using previously compiled file: /tmp/build3446787470371834433.tmp/IPAddress.cpp.o
     [exec] Using previously compiled file: /tmp/build3446787470371834433.tmp/core.a
     [exec] /home/megabug/Code/arduino/build/linux/work/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-gcc -Os -Wl,--gc-sections -mcpu=cortex-m3 -T/home/megabug/Code/arduino/build/linux/work/hardware/arduino/sam/variants/arduino_due_x/linker_scripts/gcc/flash.ld -Wl,-Map,/tmp/build3446787470371834433.tmp/sketch_oct31a.cpp.map -o /tmp/build3446787470371834433.tmp/sketch_oct31a.cpp.elf -L/tmp/build3446787470371834433.tmp -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=Reset_Handler -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols -Wl,--start-group /tmp/build3446787470371834433.tmp/syscalls_sam3.c.o /tmp/build3446787470371834433.tmp/sketch_oct31a.cpp.o /home/megabug/Code/arduino/build/linux/work/hardware/arduino/sam/variants/arduino_due_x/libsam_sam3x8e_gcc_rel.a /tmp/build3446787470371834433.tmp/core.a -Wl,--end-group -lm -gcc 
     [exec] /home/megabug/Code/arduino/build/linux/work/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-objcopy -O binary /tmp/build3446787470371834433.tmp/sketch_oct31a.cpp.elf /tmp/build3446787470371834433.tmp/sketch_oct31a.cpp.bin 
     [exec] 
     [exec] Sketch uses 5,700 bytes (1%) of program storage space. Maximum is 524,288 bytes.
     [exec] /tmp/build3446787470371834433.tmp/core.a(main.cpp.o): In function `main':
     [exec] /home/megabug/Code/arduino/build/linux/work/hardware/arduino/sam/cores/arduino/main.cpp:44: warning: undefined reference to `init'

with the latest 1.5.x instead (without the improvement for core.a) the output of the second run is;

     [exec] /home/megabug/Code/arduino/build/linux/work/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-g++ -c -g -Os -w -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf -MMD -mcpu=cortex-m3 -DF_CPU=84000000L -DARDUINO=158 -DARDUINO_SAM_DUE -DARDUINO_ARCH_SAM -D__SAM3X8E__ -mthumb -DUSB_VID=0x2341 -DUSB_PID=0x003e -DUSBCON -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Due" -I/home/megabug/Code/arduino/build/linux/work/hardware/arduino/sam/system/libsam -I/home/megabug/Code/arduino/build/linux/work/hardware/arduino/sam/system/CMSIS/CMSIS/Include/ -I/home/megabug/Code/arduino/build/linux/work/hardware/arduino/sam/system/CMSIS/Device/ATMEL/ -I/home/megabug/Code/arduino/build/linux/work/hardware/arduino/sam/cores/arduino -I/home/megabug/Code/arduino/build/linux/work/hardware/arduino/sam/variants/arduino_due_x /tmp/build5276493252931863530.tmp/sketch_oct31a.cpp -o /tmp/build5276493252931863530.tmp/sketch_oct31a.cpp.o 
     [exec] Using previously compiled file: /tmp/build5276493252931863530.tmp/wiring.c.o
     [exec] Using previously compiled file: /tmp/build5276493252931863530.tmp/syscalls_sam3.c.o
     [exec] Using previously compiled file: /tmp/build5276493252931863530.tmp/WInterrupts.c.o
     [exec] Using previously compiled file: /tmp/build5276493252931863530.tmp/wiring_shift.c.o
     [exec] Using previously compiled file: /tmp/build5276493252931863530.tmp/hooks.c.o
     [exec] Using previously compiled file: /tmp/build5276493252931863530.tmp/wiring_analog.c.o
     [exec] Using previously compiled file: /tmp/build5276493252931863530.tmp/iar_calls_sam3.c.o
     [exec] Using previously compiled file: /tmp/build5276493252931863530.tmp/itoa.c.o
     [exec] Using previously compiled file: /tmp/build5276493252931863530.tmp/wiring_digital.c.o
     [exec] Using previously compiled file: /tmp/build5276493252931863530.tmp/cortex_handlers.c.o
     [exec] Using previously compiled file: /tmp/build5276493252931863530.tmp/dtostrf.c.o
     [exec] Using previously compiled file: /tmp/build5276493252931863530.tmp/new.cpp.o
     [exec] Using previously compiled file: /tmp/build5276493252931863530.tmp/main.cpp.o
     [exec] Using previously compiled file: /tmp/build5276493252931863530.tmp/USARTClass.cpp.o
     [exec] Using previously compiled file: /tmp/build5276493252931863530.tmp/WMath.cpp.o
     [exec] Using previously compiled file: /tmp/build5276493252931863530.tmp/RingBuffer.cpp.o
     [exec] Using previously compiled file: /tmp/build5276493252931863530.tmp/HID.cpp.o
     [exec] Using previously compiled file: /tmp/build5276493252931863530.tmp/CDC.cpp.o
     [exec] Using previously compiled file: /tmp/build5276493252931863530.tmp/USBCore.cpp.o
     [exec] Using previously compiled file: /tmp/build5276493252931863530.tmp/UARTClass.cpp.o
     [exec] Using previously compiled file: /tmp/build5276493252931863530.tmp/abi.cpp.o
     [exec] Using previously compiled file: /tmp/build5276493252931863530.tmp/WString.cpp.o
     [exec] Using previously compiled file: /tmp/build5276493252931863530.tmp/Stream.cpp.o
     [exec] Using previously compiled file: /tmp/build5276493252931863530.tmp/Print.cpp.o
     [exec] Using previously compiled file: /tmp/build5276493252931863530.tmp/Reset.cpp.o
     [exec] Using previously compiled file: /tmp/build5276493252931863530.tmp/wiring_pulse.cpp.o
     [exec] Using previously compiled file: /tmp/build5276493252931863530.tmp/IPAddress.cpp.o
     [exec] /home/megabug/Code/arduino/build/linux/work/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-ar rcs /tmp/build5276493252931863530.tmp/core.a /tmp/build5276493252931863530.tmp/wiring.c.o 
     [exec] /home/megabug/Code/arduino/build/linux/work/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-ar rcs /tmp/build5276493252931863530.tmp/core.a /tmp/build5276493252931863530.tmp/syscalls_sam3.c.o 
     [exec] /home/megabug/Code/arduino/build/linux/work/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-ar rcs /tmp/build5276493252931863530.tmp/core.a /tmp/build5276493252931863530.tmp/WInterrupts.c.o 
     [exec] /home/megabug/Code/arduino/build/linux/work/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-ar rcs /tmp/build5276493252931863530.tmp/core.a /tmp/build5276493252931863530.tmp/wiring_shift.c.o 
     [exec] /home/megabug/Code/arduino/build/linux/work/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-ar rcs /tmp/build5276493252931863530.tmp/core.a /tmp/build5276493252931863530.tmp/hooks.c.o 
     [exec] /home/megabug/Code/arduino/build/linux/work/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-ar rcs /tmp/build5276493252931863530.tmp/core.a /tmp/build5276493252931863530.tmp/wiring_analog.c.o 
     [exec] /home/megabug/Code/arduino/build/linux/work/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-ar rcs /tmp/build5276493252931863530.tmp/core.a /tmp/build5276493252931863530.tmp/iar_calls_sam3.c.o 
     [exec] /home/megabug/Code/arduino/build/linux/work/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-ar rcs /tmp/build5276493252931863530.tmp/core.a /tmp/build5276493252931863530.tmp/itoa.c.o 
     [exec] /home/megabug/Code/arduino/build/linux/work/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-ar rcs /tmp/build5276493252931863530.tmp/core.a /tmp/build5276493252931863530.tmp/wiring_digital.c.o 
     [exec] /home/megabug/Code/arduino/build/linux/work/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-ar rcs /tmp/build5276493252931863530.tmp/core.a /tmp/build5276493252931863530.tmp/cortex_handlers.c.o 
     [exec] /home/megabug/Code/arduino/build/linux/work/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-ar rcs /tmp/build5276493252931863530.tmp/core.a /tmp/build5276493252931863530.tmp/dtostrf.c.o 
     [exec] /home/megabug/Code/arduino/build/linux/work/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-ar rcs /tmp/build5276493252931863530.tmp/core.a /tmp/build5276493252931863530.tmp/new.cpp.o 
     [exec] /home/megabug/Code/arduino/build/linux/work/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-ar rcs /tmp/build5276493252931863530.tmp/core.a /tmp/build5276493252931863530.tmp/main.cpp.o 
     [exec] /home/megabug/Code/arduino/build/linux/work/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-ar rcs /tmp/build5276493252931863530.tmp/core.a /tmp/build5276493252931863530.tmp/USARTClass.cpp.o 
     [exec] /home/megabug/Code/arduino/build/linux/work/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-ar rcs /tmp/build5276493252931863530.tmp/core.a /tmp/build5276493252931863530.tmp/WMath.cpp.o 
     [exec] /home/megabug/Code/arduino/build/linux/work/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-ar rcs /tmp/build5276493252931863530.tmp/core.a /tmp/build5276493252931863530.tmp/RingBuffer.cpp.o 
     [exec] /home/megabug/Code/arduino/build/linux/work/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-ar rcs /tmp/build5276493252931863530.tmp/core.a /tmp/build5276493252931863530.tmp/HID.cpp.o 
     [exec] /home/megabug/Code/arduino/build/linux/work/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-ar rcs /tmp/build5276493252931863530.tmp/core.a /tmp/build5276493252931863530.tmp/CDC.cpp.o 
     [exec] /home/megabug/Code/arduino/build/linux/work/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-ar rcs /tmp/build5276493252931863530.tmp/core.a /tmp/build5276493252931863530.tmp/USBCore.cpp.o 
     [exec] /home/megabug/Code/arduino/build/linux/work/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-ar rcs /tmp/build5276493252931863530.tmp/core.a /tmp/build5276493252931863530.tmp/UARTClass.cpp.o 
     [exec] /home/megabug/Code/arduino/build/linux/work/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-ar rcs /tmp/build5276493252931863530.tmp/core.a /tmp/build5276493252931863530.tmp/abi.cpp.o 
     [exec] /home/megabug/Code/arduino/build/linux/work/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-ar rcs /tmp/build5276493252931863530.tmp/core.a /tmp/build5276493252931863530.tmp/WString.cpp.o 
     [exec] /home/megabug/Code/arduino/build/linux/work/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-ar rcs /tmp/build5276493252931863530.tmp/core.a /tmp/build5276493252931863530.tmp/Stream.cpp.o 
     [exec] /home/megabug/Code/arduino/build/linux/work/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-ar rcs /tmp/build5276493252931863530.tmp/core.a /tmp/build5276493252931863530.tmp/Print.cpp.o 
     [exec] /home/megabug/Code/arduino/build/linux/work/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-ar rcs /tmp/build5276493252931863530.tmp/core.a /tmp/build5276493252931863530.tmp/Reset.cpp.o 
     [exec] /home/megabug/Code/arduino/build/linux/work/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-ar rcs /tmp/build5276493252931863530.tmp/core.a /tmp/build5276493252931863530.tmp/wiring_pulse.cpp.o 
     [exec] /home/megabug/Code/arduino/build/linux/work/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-ar rcs /tmp/build5276493252931863530.tmp/core.a /tmp/build5276493252931863530.tmp/IPAddress.cpp.o 
     [exec] Using previously compiled file: /tmp/build5276493252931863530.tmp/variant.cpp.o
     [exec] /home/megabug/Code/arduino/build/linux/work/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-gcc -Os -Wl,--gc-sections -mcpu=cortex-m3 -T/home/megabug/Code/arduino/build/linux/work/hardware/arduino/sam/variants/arduino_due_x/linker_scripts/gcc/flash.ld -Wl,-Map,/tmp/build5276493252931863530.tmp/sketch_oct31a.cpp.map -o /tmp/build5276493252931863530.tmp/sketch_oct31a.cpp.elf -L/tmp/build5276493252931863530.tmp -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=Reset_Handler -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols -Wl,--start-group /tmp/build5276493252931863530.tmp/syscalls_sam3.c.o /tmp/build5276493252931863530.tmp/sketch_oct31a.cpp.o /tmp/build5276493252931863530.tmp/variant.cpp.o /home/megabug/Code/arduino/build/linux/work/hardware/arduino/sam/variants/arduino_due_x/libsam_sam3x8e_gcc_rel.a /tmp/build5276493252931863530.tmp/core.a -Wl,--end-group -lm -gcc 
     [exec] /home/megabug/Code/arduino/build/linux/work/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-objcopy -O binary /tmp/build5276493252931863530.tmp/sketch_oct31a.cpp.elf /tmp/build5276493252931863530.tmp/sketch_oct31a.cpp.bin 
     [exec] 
     [exec] Sketch uses 10,648 bytes (2%) of program storage space. Maximum is 524,288 bytes.

Not sure what's happening here... still investigating...

@matthijskooijman
Copy link
Collaborator Author

Ah, I think the variant file is compiled only after it decided not to build core.a, and the variant file was moved out of core.a recently (I had some conflicts with that change). Hold on - I'll fix right away.

Before, core.a would be rebuilt on every build, even when none of the
core .o files changed. Now, the timestamps are checked against the
timestamp on core.a first, skipping the build if nothing changed.

Because this uses the current list of .o files, there is a corner case
when a source file is deleted, but no other source file is modified. In
that case, core.a is not rebuilt, even though it should be. However,
this is such a narrow and unrealistic case, that it should pose a real
problem.

This fixes part of arduino#1991
@matthijskooijman matthijskooijman force-pushed the ide-1.5.x-core.a-rebuild branch from 48f0fe6 to b783392 Compare October 31, 2014 16:52
@matthijskooijman
Copy link
Collaborator Author

Fixed by moving the variant compilation up a bit .

@cmaglie cmaglie merged commit b783392 into arduino:ide-1.5.x Nov 2, 2014
@ArduinoBot
Copy link
Contributor

Great, thanks!

@cmaglie
Copy link
Member

cmaglie commented Nov 2, 2014

hey, it seems that ArduinoBot is really happy :-)

@matthijskooijman matthijskooijman deleted the ide-1.5.x-core.a-rebuild branch June 12, 2015 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Compilation Related to compilation of Arduino sketches Component: IDE The Arduino IDE feature request A request to make an enhancement (not a bug fix)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants