-
Notifications
You must be signed in to change notification settings - Fork 170
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
How to use vers:
with pkg:
?
#386
Comments
It sounds nice but there are some potential issues: I've seen, because of software bugs or user error, PURLs that look like I would be surprised if for any package type it were really ambiguous whether a string is referring to a specific version or to a range of versions that can contain a version which isn't exactly the same as the range itself, but because there are so many different formats I would be surprised if there weren't cases where what's a range in one format is a version in a different format (eg using "-" for a range instead of a semver separator), so the rules for determining whether a version is actually a range would need to be package-type dependent, which could complicate the spec and implementation. Having PURLs with version ranges can pose problems for use cases where ranges are not allowed. I work on software which deals with PURLs for specific package types that have specific versions, and we check for versions which are invalid because we know the rules for those package types and we get stuff like ranges where we're expecting specific versions. However, I think general SBOM tools etc will just expect that the PURL is correct and at most canonicalize it. This may lead to problems where dependencies are under-specified or they are specified multiple times because in one place it is a range and in another it is a version, or in one place it is a range with one syntax and in another it is a range with equivalent but different syntax. If it's explicit that you write Although, is it true that |
The most important comment on this topic seems to be slightly higher up: https://github.com/package-url/purl-spec/pull/139/files#discussion_r809185075 contains an expanded version of the three options with pros and cons:
@jaimergp is asking about A, which is not what was chosen. The problems here are (1) that it's not very clear if B or C was chosen, and (2) if A wasn't possible due to backwards compatibility (which makes sense), why did |
Some version syntaxes do allow things like for That's why I was trying to gather more information, but mostly to confirm that if we want a single URL scheme for "PURLs with versions or version ranges" then we need another scheme? |
I mean |
Ok, I see it now, thanks for the explanation. So in terms of next steps, what would be more desirable?
|
One question. A PURL should identify exactly one package, right? That package which the package manager selected during the build/test/deployment, right? If I build/test/deploy again, a new SBOM should be generated, right? Why would I like to use |
The Even if we only consider What's a "package" after all? The source tarball, the installable artifact... For context, the use case I have for |
Okay fair enough. You are right. But the PURL specifier represents exactly one component in a SPDX or CycloneDX file, right? Shouldn't PURL address then one exact component? The software is not using multiple
Okay, the arch should be specified if necessary. The rest should be
The
Can you explain this a little bit more in detail, please. Do you use PURLs in your own package manager? |
We are proposing PURLs as a way to identify external dependencies in the PyPI ecosystem. See the PEP draft and, if you need some "light" reading, this forum thread. The relevant section of the PEP is "Specifying external dependencies". PURLs have also come up in the conda ecosystem (see draft CEP) to allow unequivocal mappings between PyPI and conda-forge. The package managers wouldn't handle PURLs directly as input specifiers, but they might rely on mappings created with the underlying PURL identifier metadata as a "foreign key" between in principle unrelated packaging sources. I'm happy to provide more specific details if you want, but that's the basic overview. |
@jloehel I think your questions stem from this assumption, however if you look at the Problem-Solution content of the README of this repo, it seems quite clear that PURL is for a much wider range of tools and use cases than only SBOMs. For example: "A purl is a URL string used to identify and locate a software package in a mostly universal and uniform way across programming languages, package managers, packaging conventions, tools, APIs and databases." |
@jaimergp Thank you very much, I will read it.
The Definition says |
Originally posted by @tobiasdiez in #66
Echoing this comment ^ by @tobiasdiez, what's the current recommendation? The prior conversation hinted that putting the
vers
string in the URL would mean characters like>
have to be %-encoded, which hinders readability.So is the current recommendation to just
AND
the two URIs together? For example, to refer to the PyPIrequests
library with versions>=3,<4
do I need to spell it like["pkg:pypi/requests", "vers:pypi/>=3,<4"]
?It would be nice if we could repurpose the
@version
field inpkg
instead. With no operators, it's a version (implied exact equality). If there's one or more operators, then it's a range. The namespace would be the same as thepkg
if unspecified, or a generic one if necessary.Or if backwards compatibility is a concern, is this a case for a new protocol
dep:
(orreq:
?) wherepkg
andvers
are merged to exhibit the proposed behavior?The text was updated successfully, but these errors were encountered: