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

CPAN::Meta::Spec says bare '1.2.3' versions are illegal, but these are not caught by CPAN::Meta::Validator #122

Open
karenetheridge opened this issue Oct 23, 2016 · 2 comments

Comments

@karenetheridge
Copy link
Member

as discussed on #toolchain today.

It also turns out that version.pm's qv() is not adding the leading 'v' where it should, which is where a lot of these cases are coming from in the wild, e.g.:

https://v1.metacpan.org/source/PJFL/Unexpected-0.45.1/lib/Unexpected.pm#L8
https://v1.metacpan.org/source/PJFL/Unexpected-0.45.1/META.json#L116

@karenetheridge
Copy link
Member Author

13:42 < leont_> Thing is, changing Validator breaks current dists, causing things that used to work to no longer work
13:42 < leont_> Probably better to solve this in Converter where possible

@Leont
Copy link
Member

Leont commented Oct 30, 2016

It also turns out that version.pm's qv() is not adding the leading 'v' where it should, which is where a lot of these cases are coming from in the wild, e.g.:

version.om is stringifying its input as verbatim as possible (except with a true v-string)

13:42 < leont_> Thing is, changing Validator breaks current dists, causing things that used to work to no longer work
13:42 < leont_> Probably better to solve this in Converter where possible

Actually it turns out to be more complicated than that:

CPAN::Meta's new method has a lazy_validation option that is enabled by default on load_* but not on create. When enabled, it causes the input to be put through Converter before being put through Validator.

One possible approach to this may be to reject this in the Validator, but fix it up in the Converter. That way things would only break on the authoring side not on the consumer side.

That said this may still be more breakage than truly necessary. Given it's not causing that much trouble, a warning in the authoring tool may also be fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants