-
Notifications
You must be signed in to change notification settings - Fork 1
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
[Draft] Package URL specifications for CPAN Packages #8
Comments
Hei! I've been mulling about this ticket a while now; and here are a couple thoughts for your consideration. Please note that some of this is produced from memory, so it's possible that I may be mistaken on some points – please correct me if you find something wrong! (thank you 😁) PURL usage scenarios
Terminology
SBOM Use
Sources(Updated 2024-01-19) |
Related, NIST has published a Software Identification Ecosystem Option Analysis where they talk a little about the contexts where PackageURLs may be used. Very useful reflections, and recommended reading. They specifically look for something they call "Grouping", which they for some reason claim is a "missing feature" in purls. (I may have misunderstood something here). Not sure of it's relevancy for this module either, but the idea is out there, so possibly necessary to consider. |
Having thought a little more about this, I'm currently considering the following proposals....
I guess I'm pretty much echoing what you've already have proposed, with the difference of explicitly adding "module" (in lowercase) to the PURL, to make it easily distinguishable from distribution names, which have to be in uppercase; And making a point out of having separate API methods that produce each of these explicitly. So, with this I've been trying to think about about it from an "independent" starting point, and basically ended up where you and @mrdvt92 in #2 have arrived. So for whatever it's worth, I'm happy to stand behind what's here, plus the perspectives in #2. 😺 |
@giterlizzi, I just learned that the PackageURL spec author is working on getting it registered as an ECMA standard. Maybe it's time to get the CPAN bits included? source: https://youtu.be/B2bVaaeqpAk?si=c7cdfDZCEJkucOic&t=623 |
By the way! When in comes to specifying (pre-resolution) dependencies, there's a version-range spec for purl. Should we adopt this at the same time, while we're at it? https://github.com/package-url/purl-spec/tree/version-range-spec |
Yes, I think we can start validating the specification described in the first comment (Components and Qualifiers) and open a PR to include it in https://github.com/package-url/purl-spec/blob/master/PURL-TYPES.rst |
Apparently, there's a pull request open already at package-url/purl-spec#155 - maybe worth updating? Also, I expect to meet the purl author, Philippe Ombredanne, in Brussels tomorrow. If you want, I can ask him what's needed to get this PR merged? |
If you agree I would modify it like this: cpan
It would be great. Thank you! |
The more I think about it, I believe only CPAN distributions should be supported and not modules or packages.
I propose to only use
If we really must use modules, does each module in a distribution need to be specified? |
Aaah, no, let's NOT word it like this. Instead, I propose this -
Correct examples:
Incorrect syntax examples:
|
Modules do have versions (see https://www.cpan.org/modules/02packges.details.txt for documentation) Note also that a distribution name MUST contain the author's CPAN id to be valid! That's why I'm insisting that a PackageURL referring to a dist also must live up to this. (The reason why this is so, is that it's possible for several authors to make releases for the same distribution, and allow users later to refer to which of them they want) |
I agree ! |
@sjn Have added a initial check for "cpan" purl type
|
If we can get a purl-spec PR for this made, we can have it merged lunchtime today! 🤩 |
😃 Changed the specification. cpan
|
Great! Do you have a PR link I can refer to? |
This is the new PR package-url/purl-spec#288 |
One question; Is it really necessary to mention MetaCPAN at all? |
You mean this ?
|
Congratulations with getting this merged into the spec! :-D Now the work starts with getting purls supported in other parts of the Perl/CPAN toolchain! (btw, I've tried to reach out to you on twitter/x; are there better channels for reaching you?) |
Package URL
A Package URL (aka "purl") is a URL string used to identify and locate a software
package in a mostly universal and uniform way across programing languages,
package managers, packaging conventions, tools, APIs and databases.
https://github.com/package-url/purl-spec
A purl is a URL composed of seven components:
Components are separated by a specific character for unambiguous parsing.
The defintion for each components is:
scheme
: this is the URL scheme with the constant value of "pkg".One of the primary reason for this single scheme is to facilitate the future
official registration of the "pkg" scheme for package URLs. Required.
type
: the package "type" or package "protocol" such as maven, npm,nuget, gem, pypi, etc. Required.
namespace
: some name prefix such as a Maven groupid, a Docker imageowner, a GitHub user or organization. Optional and type-specific.
name
: the name of the package. Required.version
: the version of the package. Optional.qualifiers
: extra qualifying data for a package such as an OS,architecture, a distro, etc. Optional and type-specific.
subpath
: extra subpath within a package, relative to the package root.Optional.
Package URL for CPAN Packages
Components
Minimal components:
type
for CPAN Perl packages and ditribution iscpan
name
is the module or distribution name and is case sensitiveOptional (but advised) components:
namespace
is the author name. It is must be uppercasedversion
is the package or distribution versionQualifiers
Optional qualifiers may include:
repository_url
, CPAN/MetaCPAN/BackPAN/DarkPAN repository base URL (default ishttps://www.cpan.org
)download_url
, URL of package or distibutionvcs_url
, extra URL for a package version control systemext
, file extension (default istar.gz
)Extras
https://www.cpan.org
https://metacpan.org
Examples
Minimal "purl" string:
"purl" string with
namespace
(author) component:"purl" string with
repository_url
qualifier:"purl" string with
vcs_url
qualifier:The text was updated successfully, but these errors were encountered: