-
-
Notifications
You must be signed in to change notification settings - Fork 114
Unnecessary rebuild all for any core lib file changed #251
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
Comments
We know it and do on purpose to solve a broader problem: with normal caching infrastructure, it you change anything in |
Yes. Definitely everything has to be recompiled if platform.txt or boards.txt change. If any of the settings that make up the fully qualified board name change, of course everything needs to be recompiled. But for changes only in the source code, whether or not to recompile a particular source file is the whole purpose of those .d files. I believe they are very trustworthy, if you can verify the .d file and .o file are newer than the timestamps on all the files listed within the .d file. Arduino 1.6.5 (the last before switching to arduino-builder) did this quite well, even though it didn't have many of the features arduino-builder has now. |
I'm facing this issue as well. Compiling on macOS with VSCode's Arduino extension takes very long this way. Not sure if that has anything to do with it? |
@pedzed I'm not sure that VSCode extension uses |
I actually do think it does (based on the terminal with Arduino that opens up in the background).
Really? I am getting it again. I am not even touching the code, just reuploading. |
All other source files are "tracked" by .d dependency files Solves arduino#251
@pedzed @PaulStoffregen 9b0a81a should target this issue, since it wipes only if |
I am having the same problem.
EDIT: only the INO file is opened in Metapad. |
I have the same issues running esp8266 board. It is always recompile all, but no boards or platforms file changed. 1.9 beta working fine. Any chance to have the same fix for 1.8.6? |
I switched from Arduino Builder to PlatformIO (in combination with the lovely VSCode editor). Definitely recommended. It solved all issues for me. |
fwiw, I've been using 1.8.5 with the arduino-builder from 1.9, and the tools-builder stuff it needs. I did have to add another rule into platform.txt for the new preprocessor. With platform.txt updated, it works very well. The parallel build is especially nice when regularly switching between boards. With 1.9 so far on the horizon, I too hope a stable 1.8.6 release can be made with the updated arduino-builder. There is a huge community of Arduino users who aren't going to use beta software, and are needlessly suffering slow compile times. I know the dev effort is going into 1.9, but can't a little work go into giving so many ordinary non-beta users these very stable improvements while the rest of the new stuff remains in 1.9? |
@PaulStoffregen care to share what you changed in platform.txt ? I am dealing with full recompile every time on 1.8.5 and have no solution right now. |
@guino - First, try the nightly build, or copy arduino-builder from the nightly into 1.8.5. The latest nightly has these changes (since this commit: arduino/Arduino@ee1967c ), but (probably) doesn't need the platform.txt change. But to answer your question, with the caveat that this is for Teensy, here is what I added to platform.txt:
This is almost certainly not correct for other non-Teensy boards, since we use C++14 and Teensyduino has a significantly different boards.txt and platform.txt. But you asked what I added, so there it is. |
@PaulStoffregen I tried the latest nightly compile and it worked to my surprise! Now the compiles are way faster without that full rebuild every time. I am just crossing fingers it doesn't break something else. Thanks for the suggestion and information! |
Dear arduino core people, you ask me for donations when I download arduino, I donate, and then we have impacting bugs like this one that go unfixed for close to a year. |
Even old computers without SSD storage aren't that slow. Pretty much only 1 thing causes such slow compiles: Windows anti-virus software doing "real time scan". |
@PaulStoffregen you are correct for teensy it's not as bad. For ESP32 and ESP8266, the core libraries are quite large in comparison, hence the minute+ rebuild times. Sure enough 1.8.6 pre release also fixes the spurious rebuild problem. |
I too hope for a 1.8.6 release soon, mostly for Windows users suffering from the OneDrive bug. |
Regarding library sizes, Teensy has substantially more core library code than ESP32. In CPP files, ESP32 has 2576 lines in 13 files. Teensy has 23 CPP files totaling 4238 lines. In C files (which compile much faster), ESP32 has 4024 lines in 17 files. Teensy has 13421 lines in 28 files. Likewise for headers, ESP32 has 3426 lines in 36 files. Teensy has 34560 lines in 59 files. There is simply a lot more code in Teensy's core library. Running on a high-end Linux system, a full rebuild takes about 6 seconds. Admittedly, Linux is faster. But even slow Windows machines manage a full rebuilt in ~30 seconds. If you're seeing 2 minute full rebuild times on Windows, you really should try disabling real-time or heuristic anti-virus scanning. |
@PaulStoffregen thanks for correcting me on teensy vs ESP32. My recollection of how long it felt,can't argue with your real data :) |
Testing so far with 1.8.6 looks like this problem is fixed. Does anyone see a reason to leave this issue open? |
Indeed, closing as fixed by 1.8.6 |
When any file within the core library changes, "Build options changed, rebuilding all" prints and all files are unnecessarily recompiled.
I tested just now with arduino-PR-beta1.9-BUILD-22 on Linux 64 bit (Ubuntu 14.04), with Arduino/Genuino Zero Programming Port selected. I have preferences set to show verbose info while compiling. The problem seems to happen with any code, but this is the program I used just now:
To produce the problem, I first clicked Verify. Then I run this in a terminal window:
When I click Verify again after this command, the result is "Build options changed, rebuilding all", and all files in the core library are recompiled, even though only Print.cpp has changed.
The text was updated successfully, but these errors were encountered: