Skip to content
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

asdf Plugin Capitalization & Silent Failing #816

Closed
ctsstc opened this issue Oct 12, 2020 · 2 comments · Fixed by #1400
Closed

asdf Plugin Capitalization & Silent Failing #816

ctsstc opened this issue Oct 12, 2020 · 2 comments · Fixed by #1400

Comments

@ctsstc
Copy link

ctsstc commented Oct 12, 2020

Describe the bug

If you add a plugin with different capitalization asdf will not function properly.
There are also no warnings for missing/mismatched plugins listed in the .tool-versions.

To Reproduce

Tell us what actions you performed before the issue occurred

Steps to reproduce the behavior:

For example if you added the following it would expect Ruby instead of ruby.

asdf plugin-add Ruby https://github.com/asdf-vm/asdf-ruby.git

If the .tool-verions has ruby instead of Ruby it will not install.
There's no warning for not having plugins added that are listed in a .tool-versions.
Also I think it should be case insensitive.

If you try to add the same plugin with different capitalization it will say it's already been added.

Expected behavior

I think it should be case insensitive when you run asdf install.

A warning would be nice if there's something listed in .tool-versions that you haven't yet added. It would be even nicer if it tried to push you in the right direction or asked you if you wanted to install the associated plugins.

Actual behavior

No error, it doesn't say anything installs if there's a capitalization mismatch.

Environment

OS:
Darwin Coders-MBP 19.6.0 Darwin Kernel Version 19.6.0: Sun Jul  5 00:43:10 PDT 2020; root:xnu-6153.141.1~9/RELEASE_X86_64 x86_64

SHELL:
zsh 5.7.1 (x86_64-apple-darwin19.0)

ASDF VERSION:
v0.8.0

ASDF ENVIRONMENT VARIABLES:
ASDF_DIR=/usr/local/opt/asdf

ASDF INSTALLED PLUGINS:
nodejs                       https://github.com/asdf-vm/asdf-nodejs.git
php                          https://github.com/asdf-community/asdf-php.git
ruby                         https://github.com/asdf-vm/asdf-ruby.git

asdf plugins affected (if relevant):

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

@Stratus3D
Copy link
Member

Stratus3D commented Oct 15, 2020

I don't think asdf should be case insensitive, because of the operating systems asdf runs on are case sensitive (OSX is a strange one, but generally things work better if you treat it as case sensitive).

I warning when adding a plugin with an uppercase name should be all that is needed to avoid this issue. Unless necessary I don't think plugin names should include uppercase characters.

@jthegedus
Copy link
Contributor

jthegedus commented Jul 17, 2022

Currently we're running a regex match over plugin names:

local regex="^[[:alpha:][:digit:]_-]+$"

Requirements to close this Issue:

  • on plugin add, warn if the user names a plugin with an uppercase character. Not all OSs are case sensitive. We recommend naming everything with lowercase to avoid possible issues.
  • assert the warning in a test

Related PRs:

jthegedus pushed a commit that referenced this issue Dec 29, 2022
Co-authored-by: Trevor Brown <Stratus3D@users.noreply.github.com>
Closes #816
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants