Option to prevent arduino-cli following junctions

I keep my sketches on my main system in a folder F:\Dev\Arduino. However, to maintain a consistent setup with other systems (e.g. my laptop), I access it via a junction at C:\Etc\Dev\ which points to F:\Dev. This allows me to access the sketches at C:\Etc\Dev\Arduino. This is because the laptop only has one drive, so sketches have to live in C:\Etc\Dev\Arduino.

The problem is that when I build a sketch with arduino-cli, even though I specify the sketch folder as C:\Etc\Dev\Arduino\Sketchname, errors are all reported as F:\Dev\Arduino\Sketchname\filename.cpp ... What's happened is that Arduino-cli has resolved the junction and has printed the true name of the file, rather than the apparent name as seen from C:\Etc\Dev...

This causes all sorts of problems since the editing tools have the files open with their names based from C:\Etc\Dev, but when I double click on the error message, it opens a second copy of the same file using the name based at F:\Dev... As I'm sure you can understand, having the same file open in two different tabs in the editing tool causes all sorts of trouble since changes written via one tab can overwrite changes made in the other.

Generally a very bad situation.

Is there some way to turn off the "auto-resolution" of junction paths, and just leave them as the apparent path on C: when printing errors?

For what it's worth, apparently the IDE itself doesn't seem to like this behaviour. While chasing another problem, I noticed the following line in the IDE output:

2023-06-25T07:20:28.983Z sketches-service WARN Warning! The request sketch path was different than the response sketch path from the CLI. This could be a potential bug. Request: <c:\Etc\Dev\Arduino\blink>, response: <f:\Dev\Arduino\blink>.

So yeah, I'd say the IDE is correct, this is probably a bug.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.