Merge master into staging-next

This commit is contained in:
nixpkgs-ci[bot]
2026-04-13 15:26:23 +00:00
committed by GitHub
7 changed files with 193 additions and 7 deletions

View File

@@ -312,6 +312,12 @@ jobs:
script: |
const { readFile } = require('node:fs/promises')
const changed = JSON.parse(await readFile('comparison/changed-paths.json', 'utf-8'))
const removedByKernel = Object.fromEntries(
Object.entries(changed.attrdiffByKernel ?? {}).map(([kernel, diff]) => [
kernel,
diff.removed.length,
]),
)
const description =
'Package: ' + [
`added ${changed.attrdiff.added.length}`,
@@ -321,7 +327,15 @@ jobs:
' — Rebuild: ' + [
`linux ${changed.rebuildCountByKernel.linux}`,
`darwin ${changed.rebuildCountByKernel.darwin}`
].join(', ')
].join(', ') +
(
Object.values(removedByKernel).some((count) => count > 0)
? ' — Removed: ' + [
`linux ${removedByKernel.linux ?? 0}`,
`darwin ${removedByKernel.darwin ?? 0}`
].join(', ')
: ''
)
const { serverUrl, repo, runId, payload } = context
const target_url =

View File

@@ -74,9 +74,38 @@ let
{
attrdiff: {
added: ["package1"],
changed: ["package2", "package3"],
changed: ["package2", "package3", "package4"],
removed: ["package4"],
},
attrdiffByKernel: {
darwin: {
added: [],
changed: ["package2", "package4"],
removed: ["package4"],
},
linux: {
added: ["package1"],
changed: ["package3", "package4"],
removed: [],
},
},
attrdiffByPlatform: {
aarch64-darwin: {
added: [],
changed: ["package2"],
removed: ["package4"],
},
aarch64-linux: {
added: ["package1"],
changed: ["package3"],
removed: [],
},
x86_64-linux: {
added: [],
changed: ["package4"],
removed: [],
},
},
labels: {
"10.rebuild-darwin: 1-10": true,
"10.rebuild-linux: 1-10": true
@@ -113,6 +142,8 @@ let
inherit (import ./utils.nix { inherit lib; })
groupByKernel
convertToPackagePlatformAttrs
groupAttrdiffByKernel
groupAttrdiffByPlatform
groupByPlatform
extractPackageNames
getLabels
@@ -127,6 +158,15 @@ let
changed-paths =
let
attrdiff = lib.mapAttrs (_: extractPackageNames) {
inherit (diffAttrs) added changed removed;
};
attrdiffByPlatform = groupAttrdiffByPlatform {
inherit (diffAttrs) added changed removed;
};
attrdiffByKernel = groupAttrdiffByKernel {
inherit (diffAttrs) added changed removed;
};
rebuildsByPlatform = groupByPlatform rebuildsPackagePlatformAttrs;
rebuildsByKernel = groupByKernel rebuildsPackagePlatformAttrs;
rebuildCountByKernel = lib.mapAttrs (
@@ -135,7 +175,7 @@ let
in
writeText "changed-paths.json" (
builtins.toJSON {
attrdiff = lib.mapAttrs (_: extractPackageNames) { inherit (diffAttrs) added changed removed; };
inherit attrdiff attrdiffByKernel attrdiffByPlatform;
inherit
rebuildsByPlatform
rebuildsByKernel

View File

@@ -7,6 +7,7 @@
}:
let
fun = import ./maintainers.nix { inherit lib; };
utils = import ./utils.nix { inherit lib; };
mockPkgs =
{
@@ -226,6 +227,83 @@ let
];
};
};
testGroupAttrdiffByPlatform = {
expr = utils.groupAttrdiffByPlatform {
added = [
"new-tool.aarch64-linux"
"new-tool.x86_64-darwin"
];
changed = [
"updated-tool.x86_64-darwin"
"shared-tool.x86_64-darwin"
];
removed = [
"removed-tool.aarch64-darwin"
"shared-tool.aarch64-darwin"
];
};
expected = {
aarch64-darwin = {
added = [ ];
changed = [ ];
removed = [
"removed-tool"
"shared-tool"
];
};
aarch64-linux = {
added = [ "new-tool" ];
changed = [ ];
removed = [ ];
};
x86_64-darwin = {
added = [ "new-tool" ];
changed = [
"shared-tool"
"updated-tool"
];
removed = [ ];
};
};
};
testGroupAttrdiffByKernel = {
expr =
let
grouped = utils.groupAttrdiffByKernel {
added = [
"new-tool.aarch64-linux"
"new-tool.x86_64-darwin"
];
changed = [
"updated-tool.x86_64-darwin"
"shared-tool.x86_64-darwin"
];
removed = [
"removed-tool.aarch64-darwin"
"shared-tool.aarch64-darwin"
];
};
in
lib.mapAttrs (_: diff: lib.mapAttrs (_: lib.sort lib.lessThan) diff) grouped;
expected = {
darwin = {
added = [ "new-tool" ];
changed = [
"shared-tool"
"updated-tool"
];
removed = [
"removed-tool"
"shared-tool"
];
};
linux = {
added = [ "new-tool" ];
changed = [ ];
removed = [ ];
};
};
};
};
in
{

View File

@@ -150,6 +150,50 @@ rec {
in
lib.genAttrs [ "linux" "darwin" ] filterKernel;
/*
Group an attrdiff-style mapping by a derived key such as platform or kernel.
Turns
{
added = [ "new-tool.aarch64-linux" "new-tool.x86_64-darwin" ];
changed = [ "updated-tool.x86_64-darwin" "shared-tool.x86_64-darwin" ];
removed = [ "removed-tool.aarch64-darwin" "shared-tool.aarch64-darwin" ];
}
into
{
aarch64-darwin = {
added = [ ];
changed = [ ];
removed = [ "removed-tool" "shared-tool" ];
};
aarch64-linux = {
added = [ "new-tool" ];
changed = [ ];
removed = [ ];
};
x86_64-darwin = {
added = [ "new-tool" ];
changed = [ "shared-tool" "updated-tool" ];
removed = [ ];
};
}
when used with `groupByPlatform`.
*/
groupAttrdiffBy =
grouper: attrdiff:
let
groupedByKind = lib.mapAttrs (
_: packagePlatformPaths:
grouper (convertToPackagePlatformAttrs (uniqueStrings packagePlatformPaths))
) attrdiff;
groups = uniqueStrings (lib.flatten (map builtins.attrNames (lib.attrValues groupedByKind)));
in
lib.genAttrs groups (group: lib.mapAttrs (_: byGroup: byGroup.${group} or [ ]) groupedByKind);
groupAttrdiffByPlatform = groupAttrdiffBy groupByPlatform;
groupAttrdiffByKernel = groupAttrdiffBy groupByKernel;
/*
Maps an attrs of `kernel - rebuild counts` mappings to an attrs of labels

View File

@@ -25,6 +25,16 @@ async function checkTargetBranch({ github, context, core, dry }) {
* changed: string[],
* removed: string[],
* },
* attrdiffByKernel: Record<string, {
* added: string[],
* changed: string[],
* removed: string[],
* }>,
* attrdiffByPlatform: Record<string, {
* added: string[],
* changed: string[],
* removed: string[],
* }>,
* labels: Record<string, boolean>,
* rebuildCountByKernel: Record<string, number>,
* rebuildsByKernel: Record<string, string[]>,

View File

@@ -44,6 +44,6 @@ stdenv.mkDerivation {
platforms
;
broken = !(lib.versionAtLeast kernel.version "6.16" && lib.versionOlder kernel.version "6.20");
broken = !(lib.versionAtLeast kernel.version "6.16" && lib.versionOlder kernel.version "7.1");
};
}

View File

@@ -24,13 +24,13 @@
stdenv.mkDerivation (finalAttrs: {
pname = "cubeb";
version = "0-unstable-2026-03-25";
version = "0-unstable-2026-04-06";
src = fetchFromGitHub {
owner = "mozilla";
repo = "cubeb";
rev = "774182f2c1b6d5e0d8ce975f2ed9f58fab7f1da2";
hash = "sha256-Wh/yKAritCLg0FGbM4i+iorgOZvmFysLlDxpuZH7NjI=";
rev = "626d7d9f906e9f3cfb70be9e58af0f5a5f399a74";
hash = "sha256-qo3gVlYGxKef7RVGngFDKuSODoVbSCaFZwoKY4RDaAk=";
};
outputs = [