We use Arduino IDE 2.1.1 in a classroom setting on Windows 10 machines. Both lecturers and students have Active Directory accounts on these PCs.
When I log in with my lecturer account and compile a sketch, the core libraries and all unchanged libraries get compiled once, after that, only the sketch itself is compiled, just like it should be.
If a student uses the Arduino IDE, all libraries get compiled all the time, resulting in terrible turn-over times.
I looked at all the settings I could find, but to no avail. I guess it is a user rights problem. In order to track this down: Where should I look for the cache files? And is it possible to change the path of these files to a local folder, for example?
I'm not a windows user but one thing I would check is if the IDE and tools are installed locally on each machine or if you have a shared volume mounted on each PC. access rights might then be an issue ?
During compile, I can see that the binaries for libraries should go to a path like -o "C:\\Users\\xxxxxx\\AppData\\Local\\Temp\\arduino_build_830282\\libraries\\ArduinoBLE\\BLEAdvertisingData.cpp.o" (This is for the ArduinoBLE library, just an example).
After compile, I can see the libraries there. With IDE 1.x, core, scheduler and wire do not get recompiled, but Arduino_LSM9DS1, ArduinoBLE and NanoBLEFlashPrefs do. Same for IDE 2.1.2-nightly-20230824, just a different path.
Hi @DirkF. As you noticed, the compile cache is stored under the system temporary folder (even when using Arduino IDE 1.x in "portable" mode). That is is a per-user folder, so it is expected that there will not be a cache the first time each user makes a compilation (unless the system administrator prepared one for each user account in advance). However, the behavior you describe is unexpected:
I'm going to ask you to post the full verbose output from a compilation where this unexpected full recompilation occurred.
This procedure is not intended to solve the problem. The purpose is to gather more information.
Please do this:
Select File > Preferences... from the Arduino IDE menus.
The "Preferences" dialog will open.
Check the box next to "Show verbose output during: ☐ compilation" in the "Preferences" dialog.
Click the OK button.
Select Sketch > Verify/Compile from the Arduino IDE menus.
Wait for the compilation to finish.
Select Sketch > Verify/Compile from the Arduino IDE menus. Yes, I'm intentionally asking you to perform two compilations. The reason is to ensure that a compile cache would have been in place if everything was working as expected.
Wait for the compilation to finish.
Right click on the black "Output" panel at the bottom of the Arduino IDE window.
From the context menu, click Copy All.
Open a forum reply here by clicking the Reply button.
Click the <CODE/> icon on the post composer toolbar.
This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
Press Ctrl+V.
This will paste the compilation output into the code block.
Move the cursor outside of the code tags before you add any additional text to your reply.
Click the Reply button to post the output.
In case the output is longer than the forum software will allow to be added to a post, you can instead save it to a .txt file and then attach that file to a reply here:
Alternatively, instead of using the "Upload" icon on the post composer toolbar as described in steps (5) - (7) above, you can simply drag and drop the .txt file onto the post composer field to attach it.
The path is relative to the system temporary folder location returned by the operating system, so you would need to configure the operating system to use a different system temporary folder location to do this.