mod shadow

module shadow

Report site-layer recipes that shadow a module the EESSI base stack provides.

A site layer is the software EESSI does not install. When the site module path is searched first, a recipe whose name is already a base-stack module hides that module. stack shadow reads the site recipes and the base inventory from crate::gap::inventory_from_module_source, the loader stack gap uses for --installed, and reports each shadow.

EasyBuild’s installed module version is the software version, then crate::build_order::MODULE_VERSION_TOOLCHAIN_SEPARATOR, then the toolchain, then the versionsuffix. See crate::build_order::installed_module_version. A base version is the same software version when it equals the recipe version (plus its versionsuffix) or continues with that separator. A recipe versionsuffix also has to end the base version, so a CUDA variant does not count as the same version as the plain build. A name the base lists with an empty version set is unversioned: the loader records a bare name that way.

Variables

const SHADOW_DIFFERENT: &str

The base stack installs this name at a different software version.

const SHADOW_KINDS: &[&str]

Report order: an exact version, then another version, then a bare name.

const SHADOW_SAME: &str

The recipe’s software version is one the base stack already installs.

const SHADOW_UNVERSIONED: &str

The base stack lists this name and records no version.

Functions

fn classify(recipes: &[Candidate], base: &ModuleInventory) -> Vec<ShadowHit>

Classify site recipes against a base inventory. Names match without regard to case. A name the inventory does not have is the site layer and is left out.

fn load_base(paths: &[PathBuf]) -> Result<ModuleInventory>

Load every --base path and merge them into one inventory.

Each path goes through inventory_from_module_source. Names that differ only by case share one key, the spelling of the first path that named it.

fn run(request: &ShadowRequest) -> Result<ShadowReport>

Read the site recipes and the base inventory, and report every shadow.

fn same_software_version(version: &str, versionsuffix: Option<&str>, module_version: &str) -> bool

Whether module_version is the recipe’s software version.

The base string comes from inventory_from_module_source, which keeps the Lmod spelling, toolchain included. Equality covers a listing that stored only the software version (and versionsuffix). A longer module version matches when it continues with MODULE_VERSION_TOOLCHAIN_SEPARATOR, which is how installed_module_version attaches the toolchain. A recipe versionsuffix has to end that module version: the suffix is part of the version token, as Candidate stores it (for example -CUDA-12.6.0).

Structs and Unions

struct ShadowHit

One site recipe whose name the base stack already provides.

kind: String

SHADOW_SAME, SHADOW_DIFFERENT, or SHADOW_UNVERSIONED.

path: String

Easyconfig path the recipe was parsed from.

name: String

Package name, as the recipe spells it.

version: String

Software version, without the versionsuffix.

versionsuffix: Option<String>

Recipe versionsuffix, including its leading separator when set.

base: Vec<String>

Base module versions that decided the kind. Matching versions for SHADOW_SAME; every recorded version for SHADOW_DIFFERENT; empty for SHADOW_UNVERSIONED.

struct ShadowReport

What stack shadow found.

hits: Vec<ShadowHit>

Shadows, in SHADOW_KINDS order, then by name and path.

recipes: usize

Site recipes that parsed.

base_names: usize

Distinct base-stack names, matched without regard to case.

stdout: String

Text for stdout. JSON when the request asked for it.

Implementations

impl ShadowReport

Functions

fn count(&self, kind: &str) -> usize

How many hits have this kind.

fn failure(&self) -> Option<String>

The stderr line when a recipe shadows the base, or None when none do.

struct ShadowRequest

Arguments for stack shadow.

easyconfigs: Vec<PathBuf>

Site-layer easyconfig trees, or individual .eb files. Repeatable.

base: Vec<PathBuf>

EESSI base module trees or listings. Repeatable. Merged the way stack gap merges repeated --installed paths.

json: bool

Print one JSON document instead of the text report.