Skip to content

stdenv: pURL perl implementation#448343

Draft
h0nIg wants to merge 7 commits intoNixOS:masterfrom
h0nIg:h0nIg-patch-1-perl
Draft

stdenv: pURL perl implementation#448343
h0nIg wants to merge 7 commits intoNixOS:masterfrom
h0nIg:h0nIg-patch-1-perl

Conversation

@h0nIg
Copy link
Contributor

@h0nIg h0nIg commented Oct 3, 2025

continue perl aspect of #421125

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

h0nIg added 7 commits October 3, 2025 21:19
perl -0777 -i.original -pe 's|(fetchurl {\n      url = "mirror://cpan/authors/id/./.{2}/([^/]*)/(.*?))\n    };\n  };\n|\1\n      identifiers.purlParts = {\n        type = "cpan";\n        spec = "\2/\${pname}@\${version}";\n      };\n    };\n  };\n|igs' pkgs/top-level/perl-packages.nix
sed -i 's/buildPerlPackage {/buildPerlPackage rec {/g' pkgs/top-level/perl-packages.nix
@h0nIg h0nIg mentioned this pull request Oct 3, 2025
13 tasks
@h0nIg
Copy link
Contributor Author

h0nIg commented Oct 3, 2025

@stigtsp:

An issue with the CPAN pURLs is the inclusion of the (required) author id. Since authors can vary across versions for authorized distributions, this could cause problems with version ranges and mapping to the single affected.packageURL field coming to CVE.

According to cpan-definition.md, the implementation in this PR is correct however.

On CPAN multiple maintainers can have permissions to publish authorized releases for a distribution, for example:

Since the pURL support in the new CVE format seems to only support a single packageURL in the affected section, a correct pURL like pkg:cpan/HMBRAND/DBI would give a false negative for a hypothetical vulnerability that effects versions 1.643 through 1.644.

I think we should wait adding pURLs to perl-packages.nix until this concern has been addressed or resolved in the pURL specification. @pombredanne @sjn

@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 6.topic: python Python is a high-level, general-purpose programming language. 8.has: changelog This PR adds or changes release notes 6.topic: golang Go is a high-level general purpose programming language that is statically typed and compiled. 6.topic: ruby A dynamic, open source programming language with a focus on simplicity and productivity. 6.topic: fetch Fetchers (e.g. fetchgit, fetchsvn, ...) 6.topic: stdenv Standard environment 8.has: documentation This PR adds or changes documentation labels Oct 3, 2025
@h0nIg
Copy link
Contributor Author

h0nIg commented Oct 3, 2025

@stigtsp:

An issue with the CPAN pURLs is the inclusion of the (required) author id. Since authors can vary across versions for authorized distributions, this could cause problems with version ranges and mapping to the single affected.packageURL field coming to CVE.
According to cpan-definition.md, the implementation in this PR is correct however.
On CPAN multiple maintainers can have permissions to publish authorized releases for a distribution, for example:

Since the pURL support in the new CVE format seems to only support a single packageURL in the affected section, a correct pURL like pkg:cpan/HMBRAND/DBI would give a false negative for a hypothetical vulnerability that effects versions 1.643 through 1.644.
I think we should wait adding pURLs to perl-packages.nix until this concern has been addressed or resolved in the pURL specification. @pombredanne @sjn

your fear is that the lines below the fetchurl may get missed for such a scenario?

what about the following? drv.src.meta may get referenced in the same way as python and others on the main PR? The lines which will get changed are near to each other, but the chance of backport cherry-pick conflicts is higher as well

  ActionCircuitBreaker = buildPerlPackage rec {
    pname = "Action-CircuitBreaker";
    version = "0.1";
    src = fetchurl {
      url = "mirror://cpan/authors/id/H/HA/HANGY/Action-CircuitBreaker-0.1.tar.gz";
      hash = "sha256-P49dcm+uU3qzNuAKaBmuSoWW5MXyQ+dypTbvLrbmBrE=";
      meta = {
        identifiers.purlParts = {
          type = "cpan";
          spec = "HANGY/${pname}@${version}";
        };
      };
    };

What about backporting the stdenv.identifiers check, so we could theoretically backport the identifiers on fetchurl without having them actively accessed? Would you support something?

@nixpkgs-ci nixpkgs-ci bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Oct 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.status: merge conflict This PR has merge conflicts with the target branch 6.topic: fetch Fetchers (e.g. fetchgit, fetchsvn, ...) 6.topic: golang Go is a high-level general purpose programming language that is statically typed and compiled. 6.topic: python Python is a high-level, general-purpose programming language. 6.topic: ruby A dynamic, open source programming language with a focus on simplicity and productivity. 6.topic: stdenv Standard environment 8.has: changelog This PR adds or changes release notes 8.has: documentation This PR adds or changes documentation 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant