Skip to content

Conversation

@darakian
Copy link
Contributor

Broken out from #514 as its fairly minor, but worth being explicit about.

Nokogiri is another gem which makes heavy use of qualifiers https://rubygems.org/gems/nokogiri/versions

@darakian darakian mentioned this pull request Jul 28, 2025
Copy link
Member

@pombredanne pombredanne left a comment

Choose a reason for hiding this comment

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

Thanks!
If there is a enumeration somewhere that would be awesome,

@darakian
Copy link
Contributor Author

Your ask for an enumerated list sent me down a rabbit hole. The short answer is I don't believe there is a complete list of platforms.

The longer train of thought is that I first looked for a spec which lead to
https://guides.rubygems.org/specification-reference/#platform=
and
https://bundler.io/man/gemfile.5.html
Neither is definitive, but the second lists a few possible platforms. Alas it also discusses some which are not in the list. Poking around a little more I came across the --normalize-platforms option for lock files
https://bundler.io/man/bundle-lock.1.html
Which does indicate that drift is a problem

Some more googling and I came across these discussions
https://github.com/orgs/rubygems/discussions/8645
https://github.com/orgs/rubygems/discussions/7487
Which seem to indicate that "invalid" platforms were once allowed and that there's an open conversation on how to move forward.
and eventually I started trying to read the code
https://github.com/rubygems/rubygems/blob/master/lib/rubygems/platform.rb
Which is filled with regexes and made me think that the code is essentially read something from the current platform and try to fit it in some known boxes.

All in all I came to a reasonably strong belief that the platform identifier is a free string for the ruby world. One could run the experiment of trying to publish a gem with a manually configured platform of foobarbizbaz or something to see if the rubygems registry accepts it or not, but at least from a few hours of digging it seems like its just strings. If someone with more ruby knowledge would like to chime in I would love to be wrong here.

Copy link
Member

@johnmhoran johnmhoran left a comment

Choose a reason for hiding this comment

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

LGTM -- thanks @darakian !

@pombredanne pombredanne merged commit d242805 into package-url:main Sep 9, 2025
@pombredanne
Copy link
Member

@darakian 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.

3 participants