-
Notifications
You must be signed in to change notification settings - Fork 38
Not finding arduino-installed sketchbook libs that use 1.0 library format #28
Comments
@machadolab I was very skeptical about this being a "bug" when I first read your description, mostly because all the Adafruit examples (that are now also part of the framework's official examples) are compliant with the 1.0 standard, not the 1.5!
|
Ah I didn’t notice that about EnableInterrupt, but I have seen that in the past so ya it should support it. The other library that I had a problem with is Skywriter (https://github.com/pimoroni/skywriter-hat/tree/master/arduino/Skywriter) which I did not install via the library manager so I wasn’t sure if that had something to do with it. This lib appears to conform to 1.0 standard and has both .cpp and .h files, so sounds like a different problem. If you can see why this lib isn’t working, I’d much appreciate it! Thanks for all the hard work - this project is great! For the record my motivation to get this working well is that I use CLion IDE which is way nicer, as a professional software developer, than the arduino IDE and is 100% cmake based. So far it’s been working well with this project! |
Good thing I develop this framework in CLion myself 😆 Absolutely love this IDE! I'm considering developing a plugin to this framework once it'll get to 1.0, but we'll see about that lol Back to business - I had a look at the Skywriter library and it appears as a classical example of a user library which tricks you to think it's an Arduino library. There several ways to solve this issue probably, and I honestly don't know which is best. I'll list them when I'll have time to attend this issue, and we'll decide together 😃 |
I had the same thought about a CLion plugin based on this work! :) As for the library issue - I was re-reading the spec and based on this section https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification#library-metadata it sounds like library.properties file was added as part of the 1.5 spec. So I would expect that not many, if any, 1.0 libs would have this file, so I'd suggest just the existence of the library directory as the signal that the library exists. |
You're right, I did miss that section about the file being added only in the 1.5 standard. One way to tackle our problem is by simply assuming that a library that doesn't list the library.properties file is in fact arch-agnostic, and hope that this is indeed the case. The 2nd option is to simply treat it as a user library that the user should manually provide. @machadolab What option do you like better? Or is there anything else you'd like to suggest? |
I would assume the arch is * if no library.properties is found. If there are problems, the lib maintainer should update it to 1.5 with the correct arch in the metadata. Agree with the idea that if there are new things required to deal with it then - and just try and infer what the official IDE does with the old libraries. The 2nd option might not work well, because libs often require the arduino build CFLAGS, and I am guessing those wouldnt be automatically added to user libs. |
@machadolab You're absolutely right, user libraries don't get any special Arduino flags and that options is definitely worse! |
@machadolab Checkout the new develop branch - It includes a fix to this issue 😃 |
It looks like the new code finds the 1.5 libs just fine. Thanks!!
But I've tried 3 different libs that use the old 1.0 format (no src/ directory) and none of them can be found. Here is an example using the EnableInterrupt library:
(as an aside, there seems be a problem again finding the arduino SDK on OSX. I had to set the system environment variable ARDUINO_SDK_PATH in order for it to work (but there is still funny log output with NOTFOUND in the output). (I'll open another bug for this).
CMakeLists.txt library entry:
Result:
The text was updated successfully, but these errors were encountered: