mod easyblock_skeleton¶
- module easyblock_skeleton¶
When a package owes an easyblock, and what a first draft of one looks like.
A package with variant options, a binary name that follows them, or hand-written test and sanity parameters carries logic that an easyconfig can only repeat as data, once per profile. That logic belongs in a software-specific easyblock, and the easyconfigs then lean on it.
owed_easyblockdecides whether a plan owes one.renderturns a plan into the Python module a human then completes, andapply_takeoverremoves from the plan what the module now owns, so the emitted recipes carry no variant flag the easyblock sets itself.Functions
- fn apply_takeover(plan: &mut PackagePlan)¶
Remove from the plan what the rendered easyblock owns.
Every option the class sets from a feature leaves the build-level and the profile
config_options, so the emitted recipes carry no-Dflag the easyblock passes itself. Each non-default profile gains one boolean easyconfig parameter per feature that drives the class and differs from the default profile, which is how a recipe selects its variant.
- fn derived_class(plan: &PackagePlan) -> String¶
The class EasyBuild derives from the software name.
- fn has_generic_easyblock(plan: &PackagePlan) -> bool¶
Whether the recipe resolves to a generic easyblock.
The plan names no easyblock or one other than the derived class, and no shipped module defines the derived class.
- fn module_filename(plan: &PackagePlan) -> String¶
File name of the module that holds the derived class, e.g.
wrf.py.
- fn owed_easyblock(plan: &PackagePlan) -> Option<OwedEasyblock>¶
What a generic-easyblock plan owes, or
Nonewhen no trigger applies.Three triggers, any one of which suffices:
two or more profiles whose
config_optionsdiffer from each other;test or sanity parameters written into the easyconfig, namely
sanity_check_paths,sanity_check_commands,test_cmd,testopts,pretestopts, orruntestas a string command;a binary named in the sanity files or commands that differs between profiles.
- fn render(plan: &PackagePlan) -> Result<String, String>¶
Render an easyblock skeleton from the plan.
The module derives the class EasyBuild looks up for the software name from the plan’s generic easyblock (
CMakeMakewhen the plan names none). It carries oneCUSTOMparameter per feature, aconfigure_stepthat maps each feature to the options the profiles set with it, atest_step, asanity_check_stepwith variant binary names templated on the feature that flips them, andmake_module_extra. It is a starting point that a human completes.The text is parsed back with
defined_classesand checked for line length and trailing whitespace before it is returned.
- fn ships_class(plan: &PackagePlan, class: &str) -> bool¶
Whether a shipped module defines
class.Uses the classes recorded on the artifact when the plan has been checked, and parses the module from disk otherwise.
Structs and Unions
- struct OwedEasyblock¶
Why a plan owes a software-specific easyblock.
- class_name: String¶
Class EasyBuild derives from the software name, e.g.
EB_WRFforWRF.
- variant_options: Vec<String>¶
Build-option differences between profiles, each naming the option and the profiles that carry it.
- parameters: Vec<String>¶
Hand-written test and sanity parameters, each naming the parameter and the scope that sets it.
- binaries: Vec<String>¶
Binary names that differ between profiles, each naming the profile.
Implementations
- impl OwedEasyblock¶
Functions
- fn evidence(&self) -> String¶
The profiles and parameters that would move into the class, one line per trigger.