IDE 2.03 mis-directs folder name because of broken link

Hi! Sorry if the title is a little obscure, but ...
I had a link to a link to a broken link in a sub-folder of a backup sub-folder of my working folder, and the IDE wouldn't open my sketch, with the "sketch name and folder name must match" msg.

Took a while to grok that.

Is it really necessary to stat every file before seeing if they're used??
Thanks, Doug

I do not quite understand. Did you try to open the backup ino file? Or something else?

You seem to have been using Arduino for a while; it has always been the case that the (main) ino file needs to have the same name as the sketch directory.

Hi!
Apologize for garbled msg but it was a garbled error.
The sketch was in the correctly-named folder, but IDE 2 seems to have stat-ed every file in every sub- & sub-sub-folder, and some were broken links. That errored into the incorrect "names must match" msg.
The sketch opens just fine in 1.8
Doug

Unlike Arduino IDE 1.x, Arduino IDE 2.x has support for opening files from the subfolders of the sketch via the "Sketchbook" view. So the IDE must scan the subfolders of the sketch in addition to the root folder in order to generate the tree structure to display in the Sketchbook view. I suspect this is the cause of the behavior you observed.

That's a good improvement! Thanks.
But the error-handling was confusing.

Wow! The compiler's fast! WooHoo
Thanks
Doug

I agree. I think it is reasonable for the IDE to not allow sketches with this type of problem, but it should clearly communicate the problem to the user.

With respect, there wasn't a problem with the sketch, per se.
The broken link was to a backup file in a completely different folder, not any part of the dependencies of the .ino file.
How about stat-ing when there's an actual need to.

Please provide instructions I can follow to produce a minimal demonstration of the bug.

Ard1 folder
--Backup folder
----soft link to Ard2/Backup/soft link_to_deletedFile (Ard1 and Ard2 are siblings of the same parent)
Ard1.ino
...

Try to open Ard1.ino

Opens fine in 1.8.x, fails with 2.x.

Linux Mint, if that's important.

Thanks for looking
Doug

If "Backup folder" is inside "Ard1 folder" then it is indeed a problem with the sketch.

Since many Arduino sketches contain only a single .ino file, it is easy to get the impression that the .ino file is the sketch, but this is not true. A sketch is a folder, which may contain multiple code files that are compiled into the sketch program. So if there is a problem in a subfolder of the sketch folder, that is a problem with the sketch.

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