-
-
Notifications
You must be signed in to change notification settings - Fork 422
Fix "lib uninstall" when library name contains spaces #443
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
Conversation
Thanks for the PR!
Before we start reviewing, can you fix these two tests that are failing?
https://github.com/arduino/arduino-cli/blob/master/legacy/builder/test/libraries_loader_test.go#L92
https://github.com/arduino/arduino-cli/blob/master/legacy/builder/test/libraries_loader_test.go#L200
cdcd726
to
07c646b
Compare
@howjmay we're almost there, now integration tests are failing here: https://github.com/arduino/arduino-cli/blob/master/test/test_lib.py#L61
You can find the nstructions to run integration tests locally here: https://github.com/arduino/arduino-cli/tree/master/test let me know if you need any guidance, those tests require a Python3 interpreter to run.
Thanks @masci
It seems I may meet a problem, but I am still digging it.
I will ask for help if I can't solve alone!
Hi @masci Sorry for answering late. My PC was broken in the last few weeks.
I met a problem that in
arduino-cli/arduino/utils/filenames.go
Line 22 in 292277f
Name with space " " would be replace with underline "_", but this would cause a problem if I simply transform an underline back to space. Because the underline may be transformed from other symbol.
I am kind confused that how can I solve this problem. Maybe we need a naming rule for libraries ?
Hi @howjmay, unfortunately, we currently don't have a specification for the library names.
The original library name is changed here
using the SanitizeName()
function to be more filesystem friendly and is also used internally as an identifier for the library within the LibrariesManager
data structures.
Why don't we limit the use of the sanitized version of the library name inside the librariesmanager
package only?
We could change this:
into something like this:
saneName := utils.SanitizeName(libRef.Name)
alternatives, have := sc.Libraries[saneName]
All the sanitize/normalization stuff would remain inside the librariesmanager
package making it easier to change it into something else later on.
@zmoog Thank you !!
I didn't be aware there is a way like this!!
6d07a91
to
e09e367
Compare
Hi @masci I failed in CI for some unknown issue. Do you know what happen?
@howjmay my apologies, the CI system is currently disabled due to administrative problems but it'll be back online soon. For the time being I'm afraid you have to rely on running the tests locally, thanks for your patience!
Hi @masci How is the situation of CI?
Last time I ran the test of this PR, I passed it, even though I met some problems to run tests again.
@howjmay CI is back, you can add a commit and push (or just force-push last commit) to retrigger
Fix the inconsistent name of libraries when installing and uninstalling.
e09e367
to
c99fc5b
Compare
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I wrote an integration test for this feature, I'll push it in a separate PR.
Thanks for your code!
Thank you @masci
Now, the "_" is replaced with a blanket " ", to reslove the
inconsistency problem. However, use the name of the installing
library may be a better solution.
fixes #362
BTW, when we uninstall libraries, there are no messages to notify the user libraries are successfully uninstalled.
However, when we install libraries message like
Installed LiquidCrystal I2C@1.1.2
is printed to notify libraries are successfully installed.