mod rebuild_set

module rebuild_set

What an in-place easyconfig patch forces EESSI to rebuild.

The patch keeps the filename and the version. The deployed stack is the closure of its easystacks, resolved the same way as crate::pr_overlap: the release easyconfigs, a from-commit tree ahead of them, filtered dependencies dropped, installed modules read with crate::pr_overlap::parse_installed. The reverse index is crate::build_order::reverse_index.

Classification uses only that graph.

  • no-rebuild. Some path from the patched module to this one is made of runtime dependencies. The dependent links the patched package as a shared library. Replacing that library does not require a rebuild.

  • review. Every path uses a builddependency, so the dependent may have linked the package statically or embedded it. The graph cannot say which.

  • must-rebuild. The row is the patched easyconfig itself, or a bundle whose exts_list names the patched package and version. The extension is installed as part of the bundle.

A toolchain edge is not one of these uses. Patching a compiler is outside these three classes.

When RebuildQuery::prefix is set, a builddependency-only row is checked against the patched module’s install directory. No lib*/*.a file means the dependent cannot have linked that module statically, and the row is no-rebuild. Archives that are there keep the row in review and are named in the reason.

RebuildQuery::check_static then reads defined dynamic symbols of each remaining review dependent. A symbol that the patched library also exports is must-rebuild. No such symbol is no-rebuild. The scan sees dynamic symbols only.

Variables

const CLASS_MUST_REBUILD: &str

Class for the patched easyconfig and for a bundle that ships it.

const CLASS_NO_REBUILD: &str

Class for a runtime dependency, direct or through other runtime dependencies.

const CLASS_REVIEW: &str

Class for a dependent reached only through builddependencies.

const REBUILD_SET_SCHEMA_VERSION: u32

Schema of RebuildDocument. Bumped when a field changes meaning.

Version 5 adds reach, the class of each patched easyconfig.

Functions

fn rebuild_easystacks(document: &RebuildDocument) -> Vec<RebuildEasystack>

One easystack per EasyBuild version, containing class must-rebuild only.

The shape matches the files under easystacks/software.eessi.io/2026.06/rebuilds/: a short comment, then easyconfigs entries with rebuild: true. Versions with no such row produce no file. Entries are sorted by filename.

fn rebuild_set(query: &RebuildQuery) -> Result<RebuildDocument, RebuildError>

Close the deployed easystacks and classify query.changed.

fn render_markdown(document: &RebuildDocument) -> String

Markdown table of the rebuild set.

Enums

enum RebuildError

Why a deployed easystack could not be read.

Easystack

The file is not an easystack document.

path: String

Path that was passed in.

message: String

Parser error.

Prefix

--prefix is not an installed EESSI prefix.

path: String

Path that was passed in.

CheckStaticNeedsPrefix

--check-static was set without --prefix.

Structs and Unions

struct RebuildCounts

How many rows fell in each class.

no_rebuild: usize

Runtime dependencies.

review: usize

Builddependency-only paths.

must_rebuild: usize

Patched easyconfigs and bundles that ship them.

struct RebuildDocument

The rebuild set for one installed stack.

schema_version: u32

REBUILD_SET_SCHEMA_VERSION.

generated_at: String

When it was computed.

installed_source: String

Where the installed list came from.

prefix: Option<String>

Installed prefix the archive check read. Omitted when --prefix was not passed.

symbols_checked: bool

Whether defined dynamic symbols were compared. False when --check-static was not passed.

easystacks: Vec<String>

Easystack paths that were read.

changed: Vec<String>

Patched easyconfig filenames, sorted.

reach: BTreeMap<String, String>

Reach class of each filename in Self::changed, including missing ones. cross-user and network-facing justify a backport. local-only and not-reachable do not. unclassified means neither the built-in names nor a site file names the package.

missing: Vec<String>

Changed filenames that are not in the deployed graph.

unresolved: Vec<String>

Requirements no easyconfig satisfies, and easystack entries the robot path does not have.

notes: Vec<String>

Missing easyblock classes, and from-commit pins whose tree was not given. Empty when there is nothing to say.

counts: RebuildCounts

Row counts.

rows: Vec<RebuildRow>

Installed reverse dependents. A review dependent is one row, and changed lists every patched easyconfig that put it there. The other classes stay one row per edge.

struct RebuildEasystack

A class must-rebuild easystack, one EasyBuild version per file.

eb_version: String

EasyBuild version taken from the deployed easystack filenames.

filename: String

YYYYMMDD-eb-<version>-cve-patches.yml.

body: String

File body.

struct RebuildQuery

Inputs for one rebuild-set run.

base: Vec<Candidate>

Easyconfigs of the release the stack uses.

commits: BTreeMap<String, Vec<Candidate>>

Easyconfigs at a from-commit, keyed by commit. Each tree is put ahead of base for entries pinned to that commit.

easystacks: Vec<StackEasystack>

Deployed easystacks. Every entry is a root of the graph.

changed: Vec<String>

Easyconfig filenames to treat as patched in place.

installed: BTreeSet<String>

Installed Name/version modules.

filter_deps: FilterDeps

Dependencies dropped before the walk, EasyBuild --filter-deps.

easyblocks: Option<EasyblockCatalog>

When set, a missing easyblock class is recorded. It does not remove an installed module from the set.

installed_source: String

Label for the installed list, for example x86_64/amd/zen4.

generated_at: String

RFC 3339 timestamp recorded in the report.

prefix: Option<std::path::PathBuf>

Installed EESSI prefix ($EESSI_SOFTWARE_PATH). Static archives are read from <prefix>/software/<name>/<version>/lib*/*.a.

check_static: bool

Read defined dynamic symbols of the remaining review dependents.

Requires Self::prefix. A dependent that defines an export of a patched library is must-rebuild. A dependent that defines none of them is no-rebuild.

struct RebuildRow

One row of the rebuild table.

changed: String

Patched easyconfig filename.

dependent: String

Dependent module, name/version[-toolchain]versionsuffix.

dependent_easyconfig: String

Easyconfig filename of dependent.

edge_kind: String

changed, runtime, builddependency, or extension.

class: String

no-rebuild, review, or must-rebuild.

reason: String

Why this class was chosen.

eb_version: Option<String>

Newest EasyBuild version among the easystacks whose closure contains the dependent. Omitted when no easystack filename carried one.

struct StackEasystack

One deployed easystack file.

path: String

Repository path or filesystem path, used for the EasyBuild version in the filename and for the report.

text: String

File text.