Skip to content

[Windows] Sketch compilation and core cache cannot live in different partitions #464

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

Closed
KermitRN opened this issue Oct 27, 2019 · 3 comments · Fixed by #479
Closed

[Windows] Sketch compilation and core cache cannot live in different partitions #464

KermitRN opened this issue Oct 27, 2019 · 3 comments · Fixed by #479
Assignees

Comments

@KermitRN
Copy link

If a certain buildpath is configured by adding "build.path=X:\directory_of_choice" to preferences.txt it may lead to a problem for the compiler:
In SDK versions before 1.8.10 it was possible to select "Aggressively cache compiled core" via a checkbox on File/Preferences. When enabled then core was stored in local temp directory which normally is placed on C:. In this case the configurable setting for build.path has to be on C: too. In any other case we get a compiler error like:
"can't make C:\Users\username\AppData\Local\Temp\arduino_cache_37519\core\core_bf266dfb68e28495ab12fdd4a1409781.a relative to X:\ArduinoBuild"
If caching core is disabled or build.path is on the same drive as default temp then everything works fine.
Since v1.8.10 the checkbox is not longer available. The feature can be enabled/disabled via compiler.cache_core=true/false in preferences,txt.

=> It seems that core is always build in default path while scetch is build in configurable path. Would it be possible to use configured build.path for core compilation too? Or is there any reason for using the present method?

@facchinm facchinm transferred this issue from arduino/Arduino Oct 28, 2019
@facchinm
Copy link
Member

Hi @KermitRN ,
we removed the checkbox since the feature seemed to be ok for everyone.
The bug arises from some code we added to try reducing the commandline length on Windows (which was a recurring problem) by making the path relative, but the "different drives" situation is borderline.

If using only the CLI it can be overridden using -build-cache X:/yourpath but the IDE itself doesn't allow specifying it. The patch could be applied in the builder (to overcome the cross device relative issue) or at java ide (adding the chance to modify it here ).

@cmaglie which approach do you prefer? The first one would make the cli more robust but adding the config to the ide preference should be faster and easier.

@facchinm facchinm changed the title kernel compiler doesn't use configured build.path [Windows] Sketch compilation and core cache cannot live in different partitions Oct 28, 2019
@KermitRN
Copy link
Author

Thanks for your quick response.
I need a defined build path to be able to use my own scripts to upload firmware to my devices (avr hardware similar to arduino and some ESP8266 boards).
In earlier SDK versions I used a ramdisk for this purpose which seems to be a good solution.
So my present solution looks like using a build.path on drive C where used temp for core is located but stressing the SSD isn't optimal I think but it works. Setting "compiler.cache_core=false" in preferences.txt is a valid replacement for the checkbox at the moment so there will be time enough to fix the builder which seems to be the more robust solution. So I also think this will be the better solution.
Nevertheless I will have a look at your CLI. As I only do some coding from time to time I did not know that it exist at all but it seems to be a good solution for me too. Thanks for this great work. As I already use an external editor (NPP) which allows to add some own functionality via plugins like NppExec, LuaScript and Customize Toolbar the CLI seems to be the best solution for me using the parameter you told in your proposal. I will have look on how to do it...
best regards and thanks for your help,
Ralf

@cmaglie cmaglie transferred this issue from arduino/arduino-builder Oct 30, 2019
@cmaglie
Copy link
Member

cmaglie commented Oct 30, 2019

This should be fixed in the CLI, I've moved the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants