Skip to content

Strip complete version constraints without joining package names - #51

Open
OskarEichler wants to merge 2 commits into
ruby-gnome:mainfrom
OskarEichler:codex/parse-requirement-versions
Open

OskarEichler wants to merge 2 commits into
ruby-gnome:mainfrom
OskarEichler:codex/parse-requirement-versions

Conversation

@OskarEichler

Copy link
Copy Markdown

Summary

Consume the complete version token and != operator while preserving the separator between dependency names.

Reproduction and verification

Requires: foo >= 1.2.3+build, bar currently invents a +build dependency. foo != 1.0, bar invents !; compact foo>=1.0 bar becomes foobar. The candidate extracts ["foo", "bar"]. Versions containing ~ or : have the same token-boundary problem.

Ninety combinations of operators, version tokens and spacing pass on the candidate. Existing six version-parser tests pass. Native pkgconf 3.0.6 inspection also accepts version tokens with +, ~ and :; the compact syntax corpus additionally preserves the Ruby parser’s existing permissiveness and is not claimed to match every native grammar rule.

Existing suite on Ruby 4.0.6 through rbenv: 27 tests, 31 assertions, zero failures/errors, two upstream macOS omissions, baseline and this isolated patch. Combined installed-release consumer also passes the suite, 1,098 focused/model checks, four process cases, five linker-option cases and four path cases. rbenv exec ruby test/run.rb runs the existing suite.

Compatibility and limitations

No version solver is introduced: requirements continue to return names, not enforce constraints. Previously misparsed valid requirements now resolve the intended names. Invalid/quoted dependency syntax remains outside this change.

No tests were added or modified under the consuming repository's no-new-tests policy. Verification uses existing tests and external scratch reproductions. No production changes; older Ruby/Linux/Windows matrices await upstream CI. No unrelated version/dependency changes.

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

Successfully merging this pull request may close these issues.

1 participant