-
-
Notifications
You must be signed in to change notification settings - Fork 398
delete auto downloaded SD library in users <sb>/libraries directory, does not then use board specific one #1755
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
Comments
Thanks so much for your report @KurtE! I was able to determine that this is actually a bug in Arduino CLI, so I have transferred the issue to the appropriate repository. This is not in any way specific to the Teensy Arduino boards platform, but that platform does provide a dramatic demonstration of the bug due to the Library Manager installation of "SD" being given priority over the platform bundled installation. In most cases (e.g., "USBHost" lib and I bisected the bug to f0245bc In case it might assist the developers in the investigation, I'll provide a demo of the issue using Arduino CLI directly:
Run these
🐛 The second compilation failed. It was necessary to reinitialize Arduino CLI in order to get it to recognize the removal of the library. |
Sorry maybe it is just me, but I think there is something missing in the transition from Arduino 1.x to Arduino 2.x as it relates to library search order. That is with for example Arduino 1.8.19, The Arduino installer, did install a version of the SD library. When I install Teensyduino: there is a version of it installed at: C:\arduino-1.8.19\hardware\teensy\avr\libraries Now if I am working on the SD library, I may put a version up at: C:\Users\kurte\Documents\Arduino\libraries And if I am not mistaken, the library search order is: Which makes sense. But now with the Current RC for Arduino V2 you got rid of lowest priority and now install the default IDE libraries in the sketch folder (highest priority), which breaks all of the setups that use board specific libraries. Also as per my other issue (arduino/arduino-ide#798) |
This is a subject I absolutely love to discuss, but that discussion would be completely off topic for this issue. I will point you to the complete documentation here in case you would like to learn about how it really works: https://arduino.github.io/arduino-cli/dev/sketch-build-process/#dependency-resolution If you have any questions or would like to discuss that more, please post over on the Arduino forum. I'll be happy to give you the full "-v" over there.
That is off topic for discussion in this issue and for discussion in this repository. If there are bug report or feature request you would like to make that is distinct from the existing one at arduino/arduino-ide#798, please do submit them. But let's keep the discussion in this issue focused exclusively on Arduino CLI not recognizing library removals during a session. |
@per1234 - At least from this 1 quick test, Arduino CLI is properly recognizing library removals. I'm pretty sure this is an IDE 2.0 issue, not a problem with Arduino CLI. I'd recommend moving this back to the IDE repository. Perhaps the title should be edited too, to more clearly emphasize the real problem that the wrong library ends up getting used. I'm not quite sure what "during a session" means regarding Arduino CLI, but I here's the test I tried just now to check whether Arduino CLI is not recognizing library removals. But here's the test I ran just now. First, I'm using the latest nightly, Linux x86-64 build.
My machine's current packages are a result of having recently run IDE 2.0.0-rc7. When I run it to compile a sketch which uses the SD library, I get this:
The real problem is use of /home/paul/Arduino/libraries/SD. I don't understand why this happens well enough to create a narrowly focused issue. But I do know I can test whether Arduino CLI recognizes its removal.
Then when I run the same Arduino CLI command again, it does indeed use the SD library from Teensy's package.
Again, I don't fully understand this problem. But from this test, I'm pretty confident it's not within Arduino CLI. Or if some bug within Arduino CLI was the cause of a conflicting copy of SD appearing at /home/paul/Arduino/libraries/SD, it definitely did respond properly when I deleted that errant copy, and in using only CLI that errant SD library has not magically reappeared. So I can't 100% rule out CLI, but all signs point to CLI is working as expected and the cause of this conflict is most likely something going wrong with library management in the IDE. Recommend moving this issue back to IDE. |
That is because you are using the command line interface. The library removal is recognized on initialization, which happens every time you run an |
Ah, ok. I'm not familiar with the gRPC interface. Will put it on my bucket list... Where would be the appropriate place to discuss the problem that something is causing installation of the generic SD library at /home/paul/Arduino/libraries/SD, which overrides the platform specific SD library? Is an issue already open for that problem? |
This is the intended behavior for the first run of the Arduino IDE: arduino/arduino-ide#663
This can be fixed by simply adjusting the metadata of the Teensy platform's bundled SD library. @KurtE has already explained it over on the forum thread: https://forum.pjrc.com/threads/53548-Arduino-CLI-Alpha-Release-Teensy-Support/page9 If you have any questions about that, I will be happy to answer them over there.
There isn't anything other than the only peripherally related arduino/arduino-ide#798 about the built-in libraries installation. If you have a proposal about refining its behavior separate from the overwrite issue tracked by arduino/arduino-ide#798 (which clearly needs to be fixed), feel free to submit an issue over on the As for the override issue, this was discussed extensively back when Library Manager was first implemented. I'm sure there are multiple issues about it, but I found this one: |
Describe the problem
I installed RC7 on new machine (RPI4 running Ubuntu 22.04). But pretty sure other setups would work the same.
I then installed the Teensy boards, which installs it's own SD library (~/.arduino15/packages/teensy/hardware...)
I then opened a sketch and tried to compile it, I received several strange errors and then remembered it was using the old SD library. So opened up Arduino/libraries folder and deleted SD.
I then tried to build again.
The compiler then failed with error saying that it used: SD.h from the Arduino/libraries/SD folder and not the one from the teensy install. And then gave error that the file did not exist.
To reproduce
Described above.
Expected behavior
Would expect it to see that the folder did not exist and then do the find of it again.
Note: I also tried closing the window and reopen it and it still gave same error.
Arduino IDE version
RC7
Operating system
Linux
Operating system version
Ubuntu 22.04 (RPI 64 bit)
Additional context
Sort of related to my arduino/arduino-ide#798, where I would hope if I had a custom version already installed it would not overwrite.
Also tried to search for duplicate but hard to find search terms.
Issue checklist
The text was updated successfully, but these errors were encountered: