Skip to content

Bug: vermatch order make >= unmatchable#16

Open
jessequinn wants to merge 1 commit intochainguard-dev:mainfrom
jessequinn:vermatch-order
Open

Bug: vermatch order make >= unmatchable#16
jessequinn wants to merge 1 commit intochainguard-dev:mainfrom
jessequinn:vermatch-order

Conversation

@jessequinn
Copy link
Copy Markdown

@jessequinn jessequinn commented Mar 27, 2026

The order in verMatch makes >= unmatchable. goparsify.Any tries alternatives in order and returns the first match. The order is:

verMatch = goparsify.Any(verLessThanEqual, verLessThan, verEqual, verGreaterThan, verGreaterThanEqual)

When the input is >=, the parser tries verGreaterThan first (which matches >) and returns immediately consuming only the > and leaving = unmatched. verGreaterThanEqual (>=) never gets tried.

I hit an issue with Melange chainguard-dev/melange#2137 due to this.

So freetype2 >= 9.8.3 in gd-dev's .pc file gets parsed as freetype2 > 9.8.3 with a leftover = causing a parse error or wrong comparison, which then makes the solver reject freetype2 at version 26.2.20 even though it clearly satisfies the constraint.

Copy link
Copy Markdown
Member

@stevebeattie stevebeattie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly to #15, is there a chance you could add testcases around this? Thanks!

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.

2 participants