Skip to content

Document library name restrictions in Library Manager FAQ #6611

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

Closed
per1234 opened this issue Aug 14, 2017 · 11 comments
Closed

Document library name restrictions in Library Manager FAQ #6611

per1234 opened this issue Aug 14, 2017 · 11 comments
Labels
Component: Board/Lib Manager Boards Manager or Library Manager Component: Documentation Related to Arduino's documentation content

Comments

@per1234
Copy link
Collaborator

per1234 commented Aug 14, 2017

I know there are some restrictions on the allowed library.properties name values in order for a library to be allowed inclusion in the Library Manager index. It seems like it would be a good idea to document this in the Library Manager FAQ. I'm happy to do the edit but I don't know exactly what the exact restrictions are so I just need a little information to get started.

@cmaglie I guess you're the expert on this?

@per1234 per1234 added Component: Board/Lib Manager Boards Manager or Library Manager Component: Documentation Related to Arduino's documentation content labels Aug 14, 2017
@cmaglie
Copy link
Member

cmaglie commented Aug 17, 2017

I'm happy to do the edit but I don't know exactly what the exact restrictions are so I just need a little information to get started

thank you @per1234!

The allowed chars for the library name are:

  • numbers 0123456789
  • letters (any case) A-Z or a-z
  • space, underscore, dot and dash _ . -

the name cannot start or end with a space.

@cmaglie
Copy link
Member

cmaglie commented Aug 17, 2017

And it cannot start with a number too... see #6630... (sigh)

Even if this limitation is going to be removed (#6592) it's better to keep it in the library manager to allow compatibility with older IDE installations.

@KLszTsu
Copy link

KLszTsu commented Aug 17, 2017

@cmaglie If the library name allows spaces, please also update the notification here.
screenshot from 2017-08-17 20-54-52

Thanks.

@cmaglie
Copy link
Member

cmaglie commented Aug 17, 2017

please also update the notification here.

good point...

@KLszTsu
Copy link

KLszTsu commented Aug 17, 2017

@cmaglie @per1234 I've update the Arduino IDE 1.5: Library specification with following line.

name - the name of the library. Library names must contain only basic letters (A-Z or a-z) and numbers (0-9), spaces ( ), underscores (_), dots (.) and dashes (-). It cannot start or end with a space, and also it cannot start with a number.

BTW, I hope the library server can distinguish library name automatically by the name in library.properties. When I changed the name in library.properties of my library two hours ago, the problem wasn't solved. If it does, I don't need to call you again an hour ago :).

Thanks.

@cmaglie
Copy link
Member

cmaglie commented Aug 17, 2017

BTW, I think now the folder name of a library is not decided by the name in library.properties

actually the problem is in the check for the folder name performed by the IDE that is made independently from the library manager.
I think that you still have a library folder named 4Digit7Seg12Pin that is causing the popup to appear. BTW now that the name is fixed in the library manager this should not happen anymore.

@KLszTsu
Copy link

KLszTsu commented Aug 17, 2017

Thanks a lot, my library works well now.
Two hours ago, the name in library.properties had been changed to fDigitsSegtPin (4Digit7Seg12Pin Release v1.0.2). But when I remove the 4Digit7Seg12Pin folder in my library folder and re-download it though library manager, it create a 4Digit7Seg12Pin folder again. So the IDE maybe create the folder with the name of the library's name on the library server but not with name in library.properties.

@cmaglie
Copy link
Member

cmaglie commented Aug 17, 2017

But when I remove the 4Digit7Seg12Pin folder in my library folder and re-download it though library manager, it create a 4Digit7Seg12Pin folder again

That was because the name cannot be change once the library is registered in the index (neither changing it from library.properties). Probably you tried before I changed the name in #6630

@KLszTsu
Copy link

KLszTsu commented Aug 17, 2017

Yes, I've tried to change the name before #6630 , so I hope that the server can automatically check and change the name in the index with name in library.properties when updating to a new version (maybe sentence and paragraph too; I didn't have a try). Thanks.

@per1234
Copy link
Collaborator Author

per1234 commented Aug 18, 2017

Thanks for the edit @kuanglei!

My first thought was to add the name value restrictions to the Library Manager FAQ page since these restrictions don't seem to apply when the library is not installed via Library Manager but after looking at it more closely, the library specification page seems the most logical place for this information and its best if all libraries follow these name value guidelines since they may later decide to request Library Manager inclusion.

@per1234 per1234 closed this as completed Aug 18, 2017
@feikname
Copy link
Contributor

@cmaglie It might a good idea to not allow major OS reserved names too.

  • Windows: CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9.
  • *NIX: . and .. and files starting with either - or --.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Board/Lib Manager Boards Manager or Library Manager Component: Documentation Related to Arduino's documentation content
Projects
None yet
Development

No branches or pull requests

4 participants