mod package_config

module package_config

Layered TOML configuration for public package-profile definitions.

Variables

const PACKAGE_CONFIG_SCHEMA_VERSION: u32

Schema version this build reads. A layer declaring anything else is rejected rather than interpreted.

Functions

fn apply_package_layers(plan: &mut PackagePlan, layers: &[PackageConfigLayer]) -> Result<(), PackageConfigError>

Apply layers to a plan in order, later layers overriding earlier ones.

Every layer is validated before it is applied, so a malformed layer fails the call rather than half-modifying the plan.

Enums

enum AliasConstraint

Whether a foreign version constraint survives an alias mapping.

Preserve

Keep the constraint: the provider’s versions mean the same thing.

Drop

Discard it: the provider is a bundle whose versions do not correspond to the component’s, so carrying the constraint would be wrong.

enum DependencyAlias

Foreign dependency identity mapped to an EasyBuild provider.

Direct(String)

Preserve the foreign version constraint when provider versions have the same meaning.

Provider

Control how a component constraint applies to a containing provider.

provider: String

EasyBuild package that provides the foreign dependency.

constraint: AliasConstraint

Whether the foreign version constraint carries over.

Implementations

impl DependencyAlias

Functions

fn provider(&self) -> &str

The EasyBuild package this alias resolves to, either spelling.

enum PackageConfigError

Why a package configuration layer could not be read or applied.

UnsupportedSchema(u32)

The layer declares a schema this build does not read.

Toml(toml::de::Error)

The file is not valid TOML, or has a field this schema rejects.

Io(String, std::io::Error)

The file could not be read.

EmptyProfileName

A profile has no name, so no layer could ever match it.

EmptyPackageName

The package override blanks the name.

EmptyPackageVersion

The package override blanks the version.

EmptyEasyblock

The build override blanks the easyblock.

EmptyModuleclass

The build override blanks the moduleclass.

InvalidEasyconfigParameter(String)

A raw easyconfig parameter is not a name EasyBuild recognises, which would emit a recipe eb rejects.

EmptyDependencyRequirement

An added requirement has no package name.

EmptyDependencyRoles(String)

An added requirement lists no roles, so it would apply nowhere.

InvalidPatchFilename(String)

A patch names a path rather than a filename; EasyBuild takes the basename only.

MissingParent

A profile inherits from one that does not exist in the plan.

profile: String

Profile declaring the inheritance.

parent: String

Parent it names, which is absent.

DefaultProfileCount(usize)

After every layer applied, the plan has no single default profile.

enum PatchMergeMode

How a package layer combines its patches with artifacts extracted from the source recipe or preceding configuration layers.

Replace

The layer owns the complete patch list, including an explicitly empty list used to clear source-recipe patches.

Merge

Preserve existing patches, append new filenames, and replace an existing artifact when the layer supplies the same filename.

Structs and Unions

struct BuildPatch

Build-side overrides. Each None leaves the extracted value alone; a Some list replaces rather than appends, except where patches_mode says otherwise.

easyblock: Option<String>

EasyBuild easyblock class, e.g. CMakeMake.

build_systems: Option<Vec<String>>

Build systems the recipe uses, when the extraction guessed wrong.

source_root: Option<String>

Subdirectory of the unpacked source to build from.

config_options: Option<Vec<String>>

Configure flags, replacing any extracted set.

moduleclass: Option<String>

EasyBuild moduleclass, e.g. lib.

patches_mode: PatchMergeMode

Whether patches replaces the existing list or merges into it.

patches: Option<Vec<PatchArtifact>>

Patch artifacts. An explicitly empty list under Replace clears the patches the source recipe carried.

easyconfig_parameters: BTreeMap<String, EasyconfigValue>

Raw easyconfig parameters written through verbatim. Keys are validated against the known EasyBuild parameter names.

struct DependencyPatch

How foreign dependency names become EasyBuild ones.

aliases: BTreeMap<String, DependencyAlias>

Foreign name to EasyBuild provider, keyed by the foreign name.

virtuals: BTreeMap<String, String>

Virtual package to the concrete provider that satisfies it.

exclude_from_solve: Vec<String>

Foreign names the solve ignores entirely, for things the toolchain already supplies.

requirements: Vec<DependencyRequirement>

Requirements EasyBuild needs that the foreign recipe never declared.

struct DependencyRequirement

An EasyBuild-side requirement that foreign metadata may not declare.

name: String

EasyBuild package name required.

constraint: Option<String>

Version constraint, or None for any version.

roles: Vec<DependencyRole>

Build, run, or both. Defaults to run-only, and must not be empty.

features: BTreeMap<String, bool>

Feature flags gating this requirement: it applies only to a profile whose features match every entry.

struct PackageConfigLayer

One TOML layer of package configuration.

Layers apply in order over a plan extracted from a foreign recipe; a later layer overrides an earlier one. Every section is optional, so a layer states only what it changes.

schema_version: u32

Must equal PACKAGE_CONFIG_SCHEMA_VERSION.

package: Option<PackagePatch>

Package identity and metadata overrides.

build: Option<BuildPatch>

Build-system and easyconfig-parameter overrides.

dependencies: Option<DependencyPatch>

Dependency mapping, exclusions and additions.

profiles: Vec<ProfilePatch>

Profile definitions, matched to existing profiles by name.

Implementations

impl PackageConfigLayer

Functions

fn from_path(path: &Path) -> Result<Self, PackageConfigError>

Parse a layer from a file, resolving relative patch paths against the file’s own directory so a layer is movable with its patches.

fn from_toml_str(input: &str) -> Result<Self, PackageConfigError>

Parse a layer from TOML text, resolving patch sources against no directory and validating the result.

struct PackagePatch

Package identity overrides. None leaves the extracted value alone.

name: Option<String>

Rename the package, e.g. to EasyBuild’s capitalisation.

version: Option<String>

Override the version. Changing it records the recipe’s version as the upstream one, so the difference stays visible.

homepage: Option<String>

Project homepage for the emitted easyconfig.

description: Option<String>

Description for the emitted easyconfig.

license: Option<String>

License string for the emitted easyconfig.

struct ProfilePatch

One build variant of the package, matched to an existing profile by name.

name: String

Profile name, the key layers are matched on. Must not be empty.

inherits: Option<String>

Profile to inherit settings from. The parent must exist in the plan.

default: Option<bool>

Whether this is the default profile. Exactly one profile must be the default once every layer has applied.

versionsuffix: Option<Vec<String>>

Versionsuffix fragments, concatenated in order.

platform: Option<String>

Platform this profile targets, when it is restricted to one.

architecture: Option<String>

Architecture this profile targets, when it is restricted to one.

features: BTreeMap<String, bool>

Feature flags, which gate conditional dependencies and rules.

parameters: BTreeMap<String, String>

Free-form parameters consumed by conditions.

toolchain_options: BTreeMap<String, bool>

EasyBuild toolchain options such as pic or openmp.

config_options: Option<Vec<String>>

Configure flags for this profile, replacing the build-level set.

easyconfig_parameters: BTreeMap<String, EasyconfigValue>

Raw easyconfig parameters for this profile only.

verification_commands: Option<Vec<VerificationCommand>>

Commands proving the build works, run after installation.