2022-01-02 Nixpkgs Architecture Team Meeting #23

Nixpkgs Architecture Team Meeting #23

Notes

Action items

Unit CI Audits

This should get moved to a repo or something.
Just a draft for some CI checks for unit dirs.

#! /usr/bin/bash

set -eu;
set -o pipefail;

# All Shard Dirs must be 1-4 chars.
if [[ 0 -lt "$(
  find ./unit -mindepth 1 -maxdepth 1 -type d -print  \
    |grep -qv '^[a-z][a-zA-Z0-9_-]\{1,4\}$'           \
    |wc -l;
  )"
]]; then
  echo "You blew it" >&2;
  exit 1;
fi

# All members of shard dir must have prefix.
for d in $( find ./unit -maxdepth 1 -type d -print; ); do
  if [[ 0 -lt "$(
    find "$d" -mindepth 1 -maxdepth 1 -type d -print  \
      |grep -qv "${d//./\\.}.*"                       \
      |wc -l;
    )"
  ]]; then
    echo "You blew it in shard dir: $d" >&2;
    exit 2;
  fi
done

# Eval must succeed without referring to `../` paths.
for p in $( find ./unit -type f -name pkg-fun.nix -print; ); do
  # Something like:
  nix eval --show-trace -f <( cat "$p"; ) --apply 'pf: let
    nixpkgs = builtins.getFlake "nixpkgs";
    system  = builtins.currentSystem;
    pkgsFor = nixpkgs.legacyPackages.${system}
  in builtins.seq ( pkgsFor.callPackage pf {} ).drvAttrs true
  ';
done
2 Likes

re stat storm fixing interest: we’re available for discussions should there be any such interest (modulo timezone nonsense, as usual). would be very nice if this could be fixed :slight_smile: