Generating the sets

oxblade-icon-sets Alpha Rust

This page explains how the set crates are generated from pinned PHP releases and how to check that the committed files match.

Inputs

sets.toml pins each set: the PHP package and release tag, its full Git commit, the SHA-256 of the release archive, the folders the SVGs come from, the expected icon count, the artwork repository and commit, the SHA-256 of both licence files, and the licences that apply.

Generate and check

scripts/generate.py downloads each pinned archive and artwork licence, verifies them, and writes the crates under crates/. To check that the committed crates match the pins without writing anything:

python3 scripts/generate.py --check

It prints the number of verified SVGs per crate and fails if a file is missing, changed or obsolete. To regenerate after changing sets.toml:

python3 scripts/generate.py            # every set
python3 scripts/generate.py lucide     # one set

Both commands need network access to GitHub. --archive-cache <dir> reads the archives and licence files from a folder instead.

What the generator checks

Before it writes any file, the generator:

  • refuses an archive or licence file whose SHA-256 differs from sets.toml;
  • refuses a licence outside the reviewed list;
  • refuses archive entries that are links, absolute paths or contain .., and never extracts the archive to disk;
  • accepts icon names made of lowercase letters, digits, - and _;
  • accepts only SVG files whose elements are svg, circle, ellipse, g, line, path, polygon, polyline and rect, with a fixed list of presentation attributes (including unitless opacity from 0 to 1), no text content, no comments except the five pinned Font Awesome attribution comments, and no declarations;
  • refuses a set whose icon count differs from sets.toml.

The accepted SVGs are copied byte for byte. Nothing is optimised or rewritten.

Updating a set

Change the pins for one set in sets.toml, review the new archive and licence, run the generator for that set, and check the diff of its NOTICE and LICENSES/. A change to the licence terms is reviewed before the new pin is merged.