Arduino importer problems

Using 1.11.0 running on Ubuntu 24.04 (but same thing happened a year or two ago):
The importer picks up many files that are in the sketchbook directory tree but ignored by Arduino’s build.
That is not so big a deal, but filetree,mk is read-only and I thought that it was to be editable so that things like this could be fixed.
Before I go into more detail on that there are a few problems that could be solved by embeetle not trying so hard to be helpful. One is the removal of what embeetle decided was a gratuitous extra wrapping of parens, for an expression that the author (not me) added to ensure that a macro worked correctly. The other was crlf->lf transformation on some files, a gratuitous operation and one that kicked off a bunch of trivial git diff’s.
Back to importing files that should not be referenced:
I have a shared library for my Arduino projects that includes some files that are particular to certain processors and as such cannot all be compiled into any Arduino project ever. I manage this by having them in a separate folder and then create links to just those files I am using. Embeetle’s importer created concrete copies of the linked files and also copied in the directory they came from since I had a convenience link to it within the Arduino project folder, while the git repo of them is beside it.
What I would have preferred: copy links as links, with perhaps a notice that the target of the link is not getting copied. This reconstruction of the filetree just as it was for Arduino seems like the always safer approach to the import, including leaving out the targets of links, those are expert tools and experts can deal with embeetle being cautious about them.

The reason for my file layout instead of Arduino’s library layout is that I often am ‘improving’ the library along with each project that uses it. Having separate branches for different processor specific bits would make it hard to manage the files common to all processors.
All the files relevant to this post are in public github repos, github user 980f.

2 Likes

Hi Andy,
Thank you for reaching out to us, and welcome to Embeetle!

The importer picks up many files that are in the sketchbook directory tree but ignored by Arduino’s build.

The Arduino importer basically runs the Arduino compiler on the original project with the --verbose flag to list all the required .c and .cpp files. Those are then copied into the Embeetle project. However, this doesn’t always cover all needed files. We’ve built in a few extra mechanisms to ensure everything is covered, and thereby play on the safe side. So you might indeed have a few more files in the project than absolutely necessary.
Over the years, our Embeetle Source Analyzer has improved, and we now do have the technology to be more selective in Arduino imports. In other words: we would now be able to refine the importer such that it ONLY selects the bare minimum of files you need for the project to compile. That would be a valid design choice - but comes with its own drawbacks. In the world of Arduino, people are used to some things just working out-of-the-box. You write a print-statement, so you want that to just work. For that, certain files have to be part of the project regardless of them being used or not in the Arduino sketch you start importing from.

That being said, I don’t want to shrug off your concerns just like that. Maybe our current importer has been too greedy, including files that are totally unnecessary? If that is the case, then it would be great if you could share the project and we look into it together.

filetree.mk is read-only and I thought that it was to be editable so that things like this could be fixed.

The way to change things in filetree.mk is by right-clicking the red and green checkmarks in the Filetree. All the source files get either a red or green checkmark in our Filetree, which indicates if the file is part of the project or not. If our Source Analyzer (our engine that parses the files in the background) makes a mistake there, you can overrule its decisions by clicking on the checkmarks in the Filetree and clicking “Force Include” or “Force Exclude”:

image

You will see that filetree.mk changes accordingly.

I apologize that this wasn’t clear. Our goal is to make Embeetle so intuitive that things like this are clear for anyone, without reading the manual. Good software is intuitive - no need for a manual. Maybe we should show a popup when a user tries to modify filetree.mk to clarify this? Popups are sometimes annoying though. What would have been the ideal way for you to intuitively feel this link between filetree.mk and the Filetree tab? I look forward to your suggestion on this matter.

There are a few problems that could be solved by embeetle not trying so hard to be helpful. One is the removal of what embeetle decided was a gratuitous extra wrapping of parens, for an expression that the author (not me) added to ensure that a macro worked correctly.

The removal of extra parenthesis wrappings is something we did for both our Arduino and CubeMX importers, because we got so many warnings from these projects. I wasn’t aware that this would break some macros. Thank you for bringing that to our attention!
Can you share the code snippet that has been affected by this? We can then fix it in our next release.

The other was crlf->lf transformation on some files, a gratuitous operation and one that kicked off a bunch of trivial git diff’s.

We’ve had problems in the past with the crlf and figured that giving all projects a linux-style line ending solved so many headaches.
I understand it’s annoying for you with the git diffs. I’ll check with my colleagues if we can figure something out here.
Aside from the git diffs - is there any other nuisance that the conversion from crlf->lf causes on your system?

Embeetle’s importer created concrete copies of the linked files and also copied in the directory they came from since I had a convenience link to it within the Arduino project folder, while the git repo of them is beside it.
What I would have preferred: copy links as links, with perhaps a notice that the target of the link is not getting copied.

In the early days of Embeetle, we set up a few “laws” or “principles” that we adhere to at all costs. One of these is the self-contained project principle: every Embeetle project has all of its files (source files, makefiles, linker scripts, openocd files, …) collected in a single folder. Of course that single folder can have subfolders to organize everything nicely. But you get the point:
if you share your project with a colleague or friend - just zip the folder and send it to him. It just works.

Your request to “copy links as links” would break that principle.

I do acknowledge that this practice comes with its downsides. You now have a library that’s duplicated in each of your Embeetle projects. Could Git help you out with this (making your own forks of the public repos)? Git submodules maybe? We should have a chat about this. It would be great to hear your thoughts on the matter.

Thank you Andy for sharing your concerns with us. I look forward to fix them together.

Can you give me a few moments you are available for a video call?

1 Like

As soon as the holidays are a bit more over I would be happy to converse with you on any embeetle issues you care to discuss. I am retired and getting very bored on rainy days :slight_smile: I live in central Texas, CST timezone.

Some background on me: I have worked with multiple Eclipse systems and been frustrated with every one of them. I presently have been giving Clion one last chance to do microcontroller work, I have never gotten it to debug due to its sloppy connection via openOCD. I have used QtCreator extensively for raspberry pi based products, actual paid for work as well as free stuff. Rowley’s crossstudio is the only tool whose debugger worked well, I have hopes that embeetle can match that.Rowley quit talking to me after I submitted a list of 60 bugs with their UI :slight_smile:
I’ll build an Arduino project from scratch and see if I still have issues.
My github repos of interest are 980f/arduino for my shared libraries and 980f/sketchbook . My Arduino IDE fork gives it optional horizontal screen splitting, abetter search facility, and fixes many inconveniences with the serial port monitor, mostly an optional unbuffered mode for single character commands to my device.

2 Likes

Hi @AndyH ,
That’s great. Thank you for sharing your experiences with IDEs!

When the holidays are over, please send me a few moments that you’d be available for a video call, so we can fix one that matches both our agendas.

I wish you happy holidays!

Cheers,