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

Build metadata in version numbers fail validation #6224

Closed
karalabe opened this issue Nov 22, 2016 · 1 comment · Fixed by CocoaPods/Core#361
Closed

Build metadata in version numbers fail validation #6224

karalabe opened this issue Nov 22, 2016 · 1 comment · Fixed by CocoaPods/Core#361
Labels
d2:moderate A moderately-difficult ticket that may require a bit of knowledge about the codebase t2:defect These are known bugs. The issue should also contain steps to reproduce. PRs welcome!

Comments

@karalabe
Copy link

According to https://guides.cocoapods.org/syntax/podspec.html#version, CocoaPods use semantic versioning as specified in http://semver.org/ .

That spec among others describes that version strings may include arbitrary build metadata suffixes delimited by a plus sign (http://semver.org/#spec-item-10):

Build metadata MAY be denoted by appending a plus sign and a series of dot separated identifiers immediately following the patch or pre-release version. Identifiers MUST comprise only ASCII alphanumerics and hyphen [0-9A-Za-z-]. Identifiers MUST NOT be empty. Build metadata SHOULD be ignored when determining version precedence. Thus two versions that differ only in the build metadata, have the same precedence. Examples: 1.0.0-alpha+001, 1.0.0+20130313144700, 1.0.0-beta+exp.sha.5114f85.

However adding such a build metadata entry to a pod version will blow up during podspec validation:

ArgumentError - Malformed version number string 1.5.3+a0e42aa4
/Users/travis/.rvm/gems/ruby-2.0.0-p648/gems/cocoapods-core-1.2.0.beta.1/lib/cocoapods-core/version.rb:52:in `initialize'
/Users/travis/.rvm/gems/ruby-2.0.0-p648/gems/cocoapods-core-1.2.0.beta.1/lib/cocoapods-core/vendor/version.rb:199:in `new'
/Users/travis/.rvm/gems/ruby-2.0.0-p648/gems/cocoapods-core-1.2.0.beta.1/lib/cocoapods-core/vendor/version.rb:199:in `new'
/Users/travis/.rvm/gems/ruby-2.0.0-p648/gems/cocoapods-core-1.2.0.beta.1/lib/cocoapods-core/specification/root_attribute_accessors.rb:31:in `version'
/Users/travis/.rvm/gems/ruby-2.0.0-p648/gems/cocoapods-core-1.2.0.beta.1/lib/cocoapods-core/specification/linter.rb:109:in `block in check_required_attributes'
/Users/travis/.rvm/gems/ruby-2.0.0-p648/gems/cocoapods-core-1.2.0.beta.1/lib/cocoapods-core/specification/linter.rb:108:in `each'
/Users/travis/.rvm/gems/ruby-2.0.0-p648/gems/cocoapods-core-1.2.0.beta.1/lib/cocoapods-core/specification/linter.rb:108:in `check_required_attributes'
/Users/travis/.rvm/gems/ruby-2.0.0-p648/gems/cocoapods-core-1.2.0.beta.1/lib/cocoapods-core/specification/linter.rb:50:in `lint'
/Users/travis/.rvm/gems/ruby-2.0.0-p648/gems/cocoapods-1.2.0.beta.1/lib/cocoapods/validator.rb:283:in `perform_linting'
/Users/travis/.rvm/gems/ruby-2.0.0-p648/gems/cocoapods-1.2.0.beta.1/lib/cocoapods/validator.rb:78:in `validate'
/Users/travis/.rvm/gems/ruby-2.0.0-p648/gems/cocoapods-trunk-1.1.1/lib/pod/command/trunk/push.rb:119:in `validate_podspec'
/Users/travis/.rvm/gems/ruby-2.0.0-p648/gems/cocoapods-trunk-1.1.1/lib/pod/command/trunk/push.rb:64:in `run'
/Users/travis/.rvm/gems/ruby-2.0.0-p648/gems/claide-1.0.1/lib/claide/command.rb:334:in `run'
/Users/travis/.rvm/gems/ruby-2.0.0-p648/gems/cocoapods-1.2.0.beta.1/lib/cocoapods/command.rb:50:in `run'
/Users/travis/.rvm/gems/ruby-2.0.0-p648/gems/cocoapods-1.2.0.beta.1/bin/pod:55:in `<top (required)>'
/Users/travis/.rvm/gems/ruby-2.0.0-p648/bin/pod:23:in `load'
/Users/travis/.rvm/gems/ruby-2.0.0-p648/bin/pod:23:in `<main>'
/Users/travis/.rvm/gems/ruby-2.0.0-p648/bin/ruby_executable_hooks:15:in `eval'
/Users/travis/.rvm/gems/ruby-2.0.0-p648/bin/ruby_executable_hooks:15:in `<main>'

Are there plans for supporting metadata tags in version numbers? If not, it would be useful to emphasize this on the podspec version description page.

@benasher44
Copy link
Member

benasher44 commented Nov 22, 2016

This sounds reasonable to support to me! This should be fixed in the CocoaPods/Core repo. Checkout this PR for some examples on how to get started fixing this kind of issue. A PR would be appreciated! Thanks for filing! :)

@benasher44 benasher44 added t2:defect These are known bugs. The issue should also contain steps to reproduce. PRs welcome! d2:moderate A moderately-difficult ticket that may require a bit of knowledge about the codebase labels Nov 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
d2:moderate A moderately-difficult ticket that may require a bit of knowledge about the codebase t2:defect These are known bugs. The issue should also contain steps to reproduce. PRs welcome!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants