Conversation
|
we need to squash all commits later, just for transparency let's keep the commits separated in order to understand what has been changed. |
18f4eea to
016c6e6
Compare
016c6e6 to
c8afdf6
Compare
Thank you, it's very helpful to have a concrete example to talk about. As you know (but repeating for new readers), the main current use case for purls is SBOMs, and there are two general techniques for extracting the dependency relationships from nix trees: evaluating the the nix sources 'in nix', and parsing the AFAICT "the jury is still out" on which approach we will land on. Until that time, I think we should not yet merge this PR as-is, as its complex/controversial bits (the propagation between meta and src.meta) only seem useful/necessary for the 'in nix' approach. If we'd land on the drv parsing approach, this propagation is not necessary: I made a small PoC showing that at https://codeberg.org/raboof/nix-build-sbom/src/branch/purl-experiment . Of course that PoC is horrible for several reasons, I'm definitely not suggesting anyone should use that directly, but it does show there are approaches where it's possible to derive purls without having the meta propagation - so it might be premature to introduce it. The introduction of (I have not digested the design decisions of that part of this PR, but it seems to me it might help to discuss those changes in isolation in their own PR, which we might be able to merge more quickly?) |
5528902 to
097b483
Compare
ca4dc6c to
fed1a8d
Compare
as agreed in our call together with @raboof, i removed the inheritance and its feature flag |
@wolfgangwalther that link is now dead. This PR was significantly simplified since - would it be possible to do another performance check? How would one do that? |
The performance data is available in every CI run. Just click your way to the details page of the CI jobs listed at the bottom of the PR and scroll your way through. |
Gotcha, for the 'Eval Summary' job, so https://github.com/NixOS/nixpkgs/actions/runs/22830597798?pr=454333 - so no noticeable change in speed, and a size increase of 0.05%-0.3%. |
raboof
left a comment
There was a problem hiding this comment.
Starting to look attractive! Some comments here and there.
|
|
||
| ### Package URL {#sec-meta-identifiers-purl} | ||
|
|
||
| [Package-URL](https://github.com/package-url/purl-spec) (PURL) is a specification to reliably identify and locate software packages. Through identification of software packages, additional (non-major) use cases are e.g. software license cross-verification via third party databases or initial vulnerability response management. Package URL's shall default to the mkDerivation.src, as the original consumed software package is the single point of truth. |
There was a problem hiding this comment.
"Package URL's shall default to the mkDerivation.src" is no longer true 'in nixpkgs', but consuming tools are expected to make this association (at least for now). That seems like a good start to me.
There was a problem hiding this comment.
src or srcs is implementation specific, the tool outside should not try to guess which one is the right approach. The interface is drv.meta.identifiers.purl and the implementation (the drv) should define the "where to search". I would like to keep this
There was a problem hiding this comment.
I am in agreement that we shouldn't push tools to trying to guess. Especially with tools that try to be efficient and can parallelize things, it makes the concurrency more difficult. Imo, it would be great if drv.meta.identifiers.purl defaults to drv.src.meta.identifiers.purl. I know people would be concerned with eval performance.
| This attribute contains an attribute set of all parts of the PURL for this package. | ||
|
|
||
| * `type` mandatory [type](https://github.com/package-url/purl-spec/blob/18fd3e395dda53c00bc8b11fe481666dc7b3807a/docs/standard/summary.md) which needs to be provided | ||
| * `spec` specify the PURL in accordance with the [purl-spec](https://github.com/package-url/purl-spec/blob/18fd3e395dda53c00bc8b11fe481666dc7b3807a/purl-specification.md) |
There was a problem hiding this comment.
why is this field named 'spec'? what's the motivation for splitting the 'type' and the rest of the purl like this, over 'just' having a purl string? Are you expecting more fields in the future?
There was a problem hiding this comment.
what if all the PURL components are defined as attrs here? except the schema being a constant "pkg".
There was a problem hiding this comment.
i splitted them to give it a thin structure overall
spec is the implementation of the definition schema: https://github.com/package-url/purl-spec/tree/18fd3e395dda53c00bc8b11fe481666dc7b3807a/types
#421125 was merged and reverted later, because of regressions.
the background is described here: #421125 (comment)
@wolfgangwalther outlined the conditions and would like to enhance CI - over time. This is a continuous approach, which is in line with packages which have been found to be defunct and which need a fix. There may be more packages which have problems and we would like to prevent further fallout by a feature flag (prevents accessing + inheritance of drv.src / drv.srcs).
packages list: #453322 (comment)
list of real broken packages: #453322 (comment)
broken packages fix (deferrable PR: #457769)
With the old PR + the broken&platform check fix from #453291 + the feature flag, we enable maintainers to gather experience with PURL and set appropriate information (e.g. jq example, where fetchurl is used instead of fetchFromGithub)
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.Add a 👍 reaction to pull requests you find important.