Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 17 of 17

Thread: Force Rebuild button - or : Buggy cache system

  1. #1
    Moderator Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,346

    Force Rebuild button - or : Buggy cache system

    Hi Paul,

    can you add a "Force Rebuild" button to Arduino ? I know, the official Arduino team would be a better addressee, but we all know, that they ignore user-requests.
    I know Mr Banzi calls Arduino a "full IDE" but it's more a joke than IDE... instead improving it, it becomes worse.

    The caching is buggy. It does not recognize changed #defines for libraries that are built before. It's very annoying and there's no way to tell the system that it needs to rebuild all.
    It leads to baffling situations.

    Please add a "make clean". Or something similar.
    Last edited by Frank B; 09-12-2017 at 07:44 PM.

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    15,711
    Yes, I believe they broke something starting with 1.8.2. It worked much better in Arduino 1.8.1. For now, if you're working on libraries I recommend using Arduino 1.8.1 to avoid long build times.

    You can force a rebuild all by changing any of the Tools menu settings, like CPU Speed or Optimization.

  3. #3
    Senior Member
    Join Date
    Jul 2014
    Posts
    1,454
    Quote Originally Posted by PaulStoffregen View Post
    Yes, I believe they broke something starting with 1.8.2. It worked much better in Arduino 1.8.1. For now, if you're working on libraries I recommend using Arduino 1.8.1 to avoid long build times.

    You can force a rebuild all by changing any of the Tools menu settings, like CPU Speed or Optimization.
    I second Frank.
    Paul, following your suggestions means twice full build, (twice going for a coffee) one moving away from desired configuration (say lower speed) and one to return to desired configuration (or do I misunderstand something?)

    ALL IDE's I have worked with have a rebuild all, or clear option.

  4. #4
    It would be nice to have 'Rebuild All' that just assures results you have come from current code - swapping Tools values back and forth is not always quick, or assured you either did enough or set everything back before clicking build. Does swapping CPU versus other items make any effort to rescan device specific libraries on a change? { a full scan is only done on startup AFAIK }

    My system hasn't caught me recently in the few lib changes I've made they seemed to have been picked up - but maybe I do the Tools hacking at the right time. But the IDE change to stop always rebuilding all to 'perfect needed rebuild' has been fluid.

  5. #5
    Moderator Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,346
    During the last days, the defective caching hit me several times. I think I really have to install an old version..
    A Rebuild-button would be the better option.. no developer can say "just use an old version".. his boss will kill him ;-)
    I hope there are plans to make it better...

  6. #6
    Moderator KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    3,072
    Been hit with this also. Also still hit from time to time when it can not rename a file as it already exists... With both cases the other solution I do is to exit Arduino and start it up again... Yes sort of a pain, but usually works.

    While on Wish list. - I wish I could toggle Use External editor - as something like in the view menu for specific window... And/Or they would simply listen for file changes and if it happens, either ask (especially if you have outstanding changes) or automatically reload... But sorry off topic

  7. #7
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    15,711
    Quote Originally Posted by Frank B View Post
    I hope there are plans to make it better...
    I'm pretty sure this a relatively new bug in Arduino. It's almost certainly in the arduino-builder part, which is the one area I haven't ever touched. I've never used Google Go language either, so I'm *really* not prepared to dig into this myself.

    So far, this bug hasn't ever hit me. I've done quite a lot with the latest versions, but almost all on Linux. Maybe this bug only strikes on Windows or Macintosh?

    If we could find a test case, I'm sure the Arduino devs will fix it. But how? Maybe a script that repetitively runs Arduino from the command line?

  8. #8
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    15,711
    Another option I've considered from time to time is jumping off the arduino-builder ship for Teensy. That would involve a *lot* of work to put the old 1.6.5 Java-based build system back into Arduino's code. But Teensyduino already patches the Java code, so maybe this could be an option. I believe quite a bit better & faster caching could also be done, compared to what arduino-builder needs to do as a separate process.

    But if I go down that path, it means Teensy is likely to slowly diverge from Arduino's build process. It could be a long-term maintenance nightmare. Or maybe not?

  9. #9
    Moderator Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,346
    Sometimes it's no fun...
    Last night I was glad to have solved a big problem because everything seemed to work. Something fooled me.
    Turned on the computer today, recompiled it - and it's NOT working. I haven't changed a single line of code. : - (
    !"§$%&/()

    Edit: No, i don't know how this could happen. Perhaps a #define that moved to an other file and changed it's value and a file that used it was not re-compiled. Or something like that. I've edited so much...
    Last edited by Frank B; 10-26-2017 at 08:06 PM.

  10. #10
    Moderator Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    930
    ... or switching over to Sloeber which is a customized Eclipse package with an Arduino plugin. Besides of things like “Build all”, true project management, ability to edit your sketch, libraries and even the core files (I open these most times only to look up) simultaneously in different tabs, having a defines, class and function browser is a real advantage. Since I installed it more than one year ago, I do not longer use the Arduino IDE, but I keep it just installed and updated as a Teensyduino install container. Sloeber needs only once to have the hardware and lib path for Teensyduino configured, and then, you are autonomous!

  11. #11
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    15,711
    You can always get a rebuild all in Arduino by changing the CPU speed or other settings in the Tools menu.

    I too would very much like to know what really happened. It's never going to get fixed unless we can find a test case to report to the Arduino devs.

  12. #12
    Senior Member
    Join Date
    Jul 2014
    Posts
    1,454
    Quote Originally Posted by PaulStoffregen View Post
    You can always get a rebuild all in Arduino by changing the CPU speed or other settings in the Tools menu.
    I admire your black humor.

  13. #13
    Moderator Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,346
    :-)

    I have no idea how to reproduce that.
    Sometimes it does just happen. I *believe* it is more often when Arduino is not restarted for a long time (hours) - but I'm not even sure about that.
    Changing the settings means TWO rebuilds. I'm sure you don't know how long this takes with my current project..
    Edit: Would be more convenient with a button which stops the current compilation ;-)

    Why is it so complicated to add two buttons ? One to Arduino for rebuild, the other to the loader for "Reset".
    Can't take longer than 1 hour...
    Last edited by Frank B; 10-28-2017 at 11:20 PM.

  14. #14
    Moderator Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,346
    Theremingenieur : Assuming, I've never used Eclipse: How complicated is it to switch to Sloeber ? Is there a "howto" ? Is it better than Visual Studio ? And are there any compability-issues in the compile-process ?
    I'm afraid as long as Mr. Banzi claims Arduino is an IDE, nothing will ever change for the better.

  15. #15
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    15,711
    Quote Originally Posted by Frank B View Post
    I *believe* it is more often when Arduino is not restarted for a long time (hours) - but I'm not even sure about that.
    The really strange part is the Arduino IDE moved its entire build system to a command line "arduino-builder" program, starting at version 1.6.6.

    However, it does store quite a bit of info and copies of the .o and .d files from previous compiles in a cache folder. Even though the command line program exits after every build, maybe something is going wrong with all the cached info?

  16. #16
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    15,711
    Quote Originally Posted by Frank B View Post
    Why is it so complicated to add two buttons ?
    This isn't as simple as it might seem, because the software is structured in many separately developed pieces.

    The code to send the reboot request is in a command line utility, not the Teensy Loader GUI application. Currently the GUI application doesn't even know the location where that command line program resides. The GUI code is all structured very differently too, as a single threaded event loop and built on top of the wxWidgets cross platform GUI library. That design works well for making a GUI that's consistent on Mac, Windows & Linux, but it comes with a lot of baggage. Doing things the way the command line utility does inside such a GUI causes the user interface to stall, and the length of time the GUI controls remain frozen can't easily be kept under a low threshold in all cases. Certainly there are solutions, like multi-threading, but those bring with them tremendous complexity. Also on Windows, at least last time I checked (admittedly years ago) going to threading with C++ runtime was the tipping point where a single stand-alone EXE has to turn into a package at least one DLL. The reboot request code could be rewritten from the ground up to work within the GUI's event-based model, but that's more involved than a 1 hour project of just repurposing prior code.

    Likewise on the Arduino side, starting with 1.6.6 the Arduino devs moved all the build system to a command line program. I'm personally not a big fan of that design decision, but I can see why they wanted to do so. The new builder is written in Google Go language. I've been avoiding touching it, and for that matter I've been mostly trying to focus on device-side things like USB Host, rather than more hacks inside the Arduino IDE. There probably is some way to add a button which would delete all temporary files. I would challenge anyone who thinks they could do it in under an hour to dive into the Java code of the Arduino IDE and prove themselves!

    However, putting the reset request button in the Arduino IDE might be doable on a reasonable time scale. The IDE is set up to run those types of commands. The IDE already has threading due to the Java JRE. All that heavyweight Java environment does make a lot of things much simpler than a C++ build with wxWidgets which targets a single-file executable (no libs, no DLLs).

  17. #17
    Moderator Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,346
    Rebuild: I'd just add a random parameter to the builder-commandline.
    Reset: Isn't this just changing the baudrate ? (From my memory..I might confuse it with something else..)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •