-
-
Notifications
You must be signed in to change notification settings - Fork 403
arduino-cli lib install PacketSerial: nil pointer dereference #1176
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
Let the library index return the latest known version, if a library without a version is updated. Signed-off-by: Ruben Jenster <[email protected]>
I can't reproduce this,
Could you try and run that command again with the |
I tried to replay by bash history but unfortunately I can't reproduce it as well. I did not look further than the patched method. I think the nil check doesn't hurt but it may hide the real error. |
I do notice that the UIPEthernet library r10r has installed has an invalid version format:
(the leading zero on the Note that this is different from the UIPEthernet library available from Library Manager, which does have valid metadata. I can tell from the metadata that you don't have the Library Manager version installed. I messed around with this a little bit and wasn't able to reproduce the panic though. |
Ups I mistakenly used the patched version to reproduce this. Now with the unpatched version I can reproduce it.
|
@per1234 @silvanocerza Do you need more information ? |
Does If there is actually a library that has no version would be great if you can find out which one it is. Sorry for the late response, lots of things to do around here. :) |
Let the library index return the latest known version, if a library without a version is found. Signed-off-by: Ruben Jenster <[email protected]>
Yes it does. I've now added a logging statement back to It's the library that I've pointed to initially and where @per1234 pointed to the malformed version
I noticed that the library must have been installed previously by the arduino IDE.
Here is the zipped library folder Output of |
Nope, the CLI install libraries in Anyway. This is a peculiar issue because the error is caused by a library that's not respecting the documentation since it doesn't have a required property. I think we should not even reach that point and avoid loading libraries that are not respecting the requirements, problem is that libraries under development, installed manually, using I think your fix is the best way to go for now. Again, sorry for the late response. |
That allowed me to reproduce the issue! I was not able to reproduce previously because I was installing the library into a folder named after the repository "arduino_uip". It turns out the error only occurs when the folder name matches the library.properties I don't think we should go out of our way to provide support for non-compliant projects, but that we should also accept their occurrence as an inevitability. In this particular case, UIPEthernet is a very popular library and the version issue was even fixed in a branch 7 years ago, but the library author never made that branch default and seems to have abandoned the library. In Arduino Lint, we now have a dedicated tool for encouraging specification compliance, so it's reasonable to make Arduino CLI resilient to a hostile environment when doing so doesn't have a significantly harmful effect on the maintainability or functionality. When the transistion was made to arduino-builder back in 2015, a lot of specification enforcement measures were added with the philosophy "the users will complain to the developers and the developers will fix the issues". But this really punished the users for problems that weren't in their code and that they didn't really have control over. The target user of the Arduino IDE just wants to get that LED blinking, not hunt down the cause of a cryptic error, submit a bug report, then wait years for a fix. Of course, the target user of Arduino CLI is different, but Arduino IDE is increasingly using more of Arduino CLI under the hood, so those users also will become unknowing Arduino CLI users. And certainly it's important to effectively communicate what the problem is to the user when recovering from it is not possible. It would be very difficult for even the target Arduino CLI user to troubleshoot the issue based on the error output r10r shared here. |
Yeah, I think the same. |
Let the library index return the latest known version, if a library without a version is found. Signed-off-by: Ruben Jenster <[email protected]>
…ion (#1189) * librariesindex: Fix nil pointer. Refs #1176 Let the library index return the latest known version, if a library without a version is found. Signed-off-by: Ruben Jenster <[email protected]> * Remove logging statement from FindLibraryUpdate. Signed-off-by: Ruben Jenster <[email protected]> * Add a small comment to the lib.Version nil check. Signed-off-by: Ruben Jenster <[email protected]> * Fix some commands failing when an installed library has invalid version * [skip changelog] Add integration tests Co-authored-by: Ruben Jenster <[email protected]>
…ion (#1189) * librariesindex: Fix nil pointer. Refs #1176 Let the library index return the latest known version, if a library without a version is found. Signed-off-by: Ruben Jenster <[email protected]> * Remove logging statement from FindLibraryUpdate. Signed-off-by: Ruben Jenster <[email protected]> * Add a small comment to the lib.Version nil check. Signed-off-by: Ruben Jenster <[email protected]> * Fix some commands failing when an installed library has invalid version * [skip changelog] Add integration tests Co-authored-by: Ruben Jenster <[email protected]>
Environment
Description
Hi devs, I tried to install the
PacketSerial
library which failedAnalysis
This happens due to a missing nil check in
FindLibraryUpdate
for the following library:The text was updated successfully, but these errors were encountered: