Skip to content

Arduino compiler fails if file "includes.cache" exists in the build directory #1246

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

Open
3 tasks done
wcieslik opened this issue Jun 12, 2020 · 13 comments
Open
3 tasks done
Labels
topic: build-process Related to the sketch build process topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@wcieslik
Copy link

wcieslik commented Jun 12, 2020

Describe the problem

A project can only be compiled once per Arduino IDE session.

At the first compile, includes.cache is created in the build directory as expected and the compilation is successful.

All subsequent compilations fail:

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\e156994\Documents\Arduino\libraries -fqbn=arduino:avr:nano:cpu=atmega328old -vid-pid=1A86_7523 -ide-version=10812 -build-path C:\Users\e156994\AppData\Local\Temp\arduino_build_990350 -warnings=none -build-cache C:\Users\e156994\AppData\Local\Temp\arduino_cache_802750 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino5.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Users\e156994\Documents\Arduino\Projects\MyBlink\Blink\Blink.ino
C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\e156994\Documents\Arduino\libraries -fqbn=arduino:avr:nano:cpu=atmega328old -vid-pid=1A86_7523 -ide-version=10812 -build-path C:\Users\e156994\AppData\Local\Temp\arduino_build_990350 -warnings=none -build-cache C:\Users\e156994\AppData\Local\Temp\arduino_cache_802750 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino5.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Users\e156994\Documents\Arduino\Projects\MyBlink\Blink\Blink.ino
Using board 'nano' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
Using core 'arduino' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
Detecting libraries used...
Error compiling for board Arduino Nano.

If the includes.cache file is manually deleted then the compile works again and a new includes.cache file is created.

Closing Arduino IDE 1.x deletes the entire build directory, which is why closing and re-opening the IDE allows a one time compile.

Using the command line and arduino_debug.exe, produces the same result.

I note that the includes.cache file is not write protected or hidden, etc.

Arduino CLI version

Arduino IDE 1.8.13 hourly build 2020/06/03 04:33

Operating system

Windows

Operating system version

Windows 10

Additional context

The fault occurs with any sketch, including "BareMinimum" and "Blink".


I can reproduce the fault using Arduino IDE 1.8.11, 1.8.12, and 1.8.13.

I can not reproduce the fault using Arduino IDE 1.8.10.


Fairly sure this is some sort of permissions/domain or local security policy or even a firewall thing, but can't find anything to indicate what the actual issue is with the IDE and this file.

Which really means "error compiling because I can't overwrite includes.cache"

Additional reports

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the nightly build
  • My report contains all necessary details
@wcieslik

This comment was marked as duplicate.

@matthijskooijman

This comment was marked as outdated.

@wcieslik

This comment was marked as duplicate.

@matthijskooijman

This comment was marked as outdated.

@wcieslik

This comment was marked as duplicate.

@wcieslik wcieslik closed this as completed Jul 5, 2020
@wcieslik wcieslik reopened this Jul 5, 2020
@wcieslik

This comment was marked as resolved.

@matthijskooijman
Copy link
Collaborator

matthijskooijman commented Jul 5, 2020

The output you provided is very weird, since it seems arduino-builder just stops with an error code, without printing any error message.

Looking at the changes to arduino-builder between IDE 1.8.10 (arduino-builder 1.4.7) and IDE 1.8.11 (arduino-builder 1.5.1), I find it includes the following changes to arduino-cli: b3db7a6...d3c1d50 Of those, cc73753 seems to be the only one related to include caching, so that would be a likely suspect to cause this problem.

I don't directly see how that commit would cause this, but I would like to confirm that this commit is indeed problematic. @wcieslik could you:

  • Install 1.8.11 and confirm the problem does occur.
  • Replace C:\Program Files (x86)\Arduino\arduino-builder.exe with this version of arduino-builder.exe (you'll have to unzip it, Github does not allow attaching .exe files directly) and see if the problem still occurs.

The arduino-builder version I've attached is 1.5.1 (like contained in IDE 1.8.11), but with commit cc73753 reverted.

@wcieslik
Copy link
Author

Apologies for leaving this so long...
I re-confirmed the version 1.8.10 works for me w.r.t. the compliler/builder, and ver 1.8.11 does not.
Same issue with the latest 1.8.13 as well.

Following you suggestion I renamed arduino-builder.exe and copied in the zipped one you sent me.
This seems to work fine !

Many thanks for your help with this...

@matthijskooijman
Copy link
Collaborator

Thanks for the followup and additional details. So the commit I mentioned above is somehow responsible, but I'm quite unsure how exactly... No time to look deeper right now, but I'll probably need you to do some more testing in the future. I'll get back to you.

@cmaglie, any ideas?

@wcieslik
Copy link
Author

wcieslik commented Sep 22, 2020 via email

@miweber67
Copy link

I am also having this issue... FWIW, it wasn't always the case, but it appears to have started when I started changing code in libraries in my documents\Arduino\libraries... folder. Before that, I never had an issue. Don't know if that's a red herring or not, but... just another data point.

I ran arduino_debug, but got no additional information between "Detecting libraries used" and the error message.

@sztimi

This comment was marked as duplicate.

@per1234 per1234 transferred this issue from arduino/Arduino Mar 29, 2021
@fstasi fstasi removed the type: bug label Sep 16, 2021
@rsora rsora added type: imperfection Perceived defect in any part of project topic: core labels Sep 22, 2021
@mavhc
Copy link

mavhc commented Mar 1, 2022

I managed to fix this by disabling "Control Flow Guard" in Windows Exploit Protection

@per1234 per1234 added the topic: code Related to content of the project itself label Mar 1, 2022
@umbynos umbynos added the topic: build-process Related to the sketch build process label Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: build-process Related to the sketch build process topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

10 participants