mod eb_emit#

module eb_emit#

Emit next-generation EasyBuild easyconfigs from an existing recipe.

Surgical assignment/list rewrites: only toolchain, optional application version, and named dependency / build-dependency version fields change. All other source bytes stay verbatim.

Functions

fn dep_names_from_source(source: &str) -> Result<Vec<String>, EmitError>#

Collect package names from top-level dependencies and builddependencies.

fn dep_specs_from_source(source: &str) -> Result<Vec<SourceDepSpec>, EmitError>#

Scrape name + version + optional versionsuffix / SYSTEM / optional flag from dep lists. Does not evaluate the full EasyBuild DSL.

fn easyconfig_filename(name: &str, version: &str, toolchain: &Toolchain) -> String#

Derive the conventional EasyBuild easyconfig basename.

fn emit_next_generation(source: &str, params: &EmitParams) -> Result<EmitResult, EmitError>#

Emit next-generation easyconfig text and conventional filename from source text.

fn emit_next_generation_auto(source: &str, target_toolchain: &Toolchain, easyconfigs_dir: &Path, hierarchy: Option<&ToolchainHierarchy>, hierarchy_fixture: Option<&Path>, hand_overrides: &HashMap<String, String>, version: Option<String>, source_checksum: Option<String>) -> Result<EmitResult, EmitError>#

Auto-resolve dependency / build-dependency versions from an easyconfig universe using the target toolchain generation’s sub-toolchain hierarchy, then emit.

hand_overrides win over auto-resolved versions (same keys). Unresolved dependencies fail unless AutoResolveOpts::keep_old is set.

When hierarchy is None, uses hierarchy_for_with_tree: the hierarchy_fixture path, else a built-in fixture, else a hierarchy derived from the easyconfig tree itself.

fn emit_next_generation_auto_from_path(source_path: &Path, target_toolchain: &Toolchain, easyconfigs_dir: &Path, hierarchy: Option<&ToolchainHierarchy>, hierarchy_fixture: Option<&Path>, hand_overrides: &HashMap<String, String>, version: Option<String>, source_checksum: Option<String>) -> Result<EmitResult, EmitError>#

Path-based form of emit_next_generation_auto.

fn emit_next_generation_auto_from_path_with_opts(source_path: &Path, target_toolchain: &Toolchain, easyconfigs_dir: &Path, hierarchy: Option<&ToolchainHierarchy>, hierarchy_fixture: Option<&Path>, hand_overrides: &HashMap<String, String>, version: Option<String>, source_checksum: Option<String>, opts: &AutoResolveOpts) -> Result<EmitResult, EmitError>#

Path-based form of emit_next_generation_auto_with_opts.

fn emit_next_generation_auto_with_opts(source: &str, target_toolchain: &Toolchain, easyconfigs_dir: &Path, hierarchy: Option<&ToolchainHierarchy>, hierarchy_fixture: Option<&Path>, hand_overrides: &HashMap<String, String>, version: Option<String>, source_checksum: Option<String>, opts: &AutoResolveOpts) -> Result<EmitResult, EmitError>#

Like emit_next_generation_auto with explicit AutoResolveOpts.

fn emit_next_generation_from_path(path: &std::path::Path, params: &EmitParams) -> Result<EmitResult, EmitError>#

Read a source file and emit the next-generation recipe.

fn resolve_dep_versions_for_source(source: &str, target_toolchain: &Toolchain, easyconfigs_dir: &Path, hierarchy: Option<&ToolchainHierarchy>, hierarchy_fixture: Option<&Path>) -> Result<HashMap<String, String>, EmitError>#

Resolve dep + builddep versions named in source against easyconfigs_dir under the target generation’s hierarchy (strict: error on missing).

fn resolve_dep_versions_for_source_with_opts(source: &str, target_toolchain: &Toolchain, easyconfigs_dir: &Path, hierarchy: Option<&ToolchainHierarchy>, hierarchy_fixture: Option<&Path>, opts: &AutoResolveOpts) -> Result<(HashMap<String, String>, Vec<String>), EmitError>#

Resolve with options; returns (version map, warnings) including parse-skip notes and keep-old / versionsuffix pin messages.

Enums

enum EmitError#
MissingName#
MissingVersion#
MissingToolchain#
Rewrite(String)#
Hierarchy(HierarchyError)#
Parse(ParseError)#
UnresolvedDep(String, String, String, String)#

Structs and Unions

struct AutoResolveOpts#

Options for auto-resolve when emitting the next generation.

keep_old: bool#

When true, unresolved deps keep the source version (with a loud warning). Default false: unresolved deps fail the auto-bump.

struct EmitParams#

Parameters for producing a next-generation easyconfig.

toolchain: Toolchain#

Target toolchain generation (always rewritten).

version: Option<String>#

Optional new application version; when None, source version is kept.

dep_versions: HashMap<String, String>#

Per-dependency (and build-dependency) version overrides keyed by package name.

If the override string starts with a comparison operator (==, >=`, <=`, `>, <, ``!`), it replaces the entire version field of matching tuples. Otherwise the operator already present on the source version (if any) is preserved and only the version token is replaced.

source_checksum: Option<String>#

New sha256 for the source tarball, used only when version changes. When None and the version changes, the source checksum entry’s key is still renamed to the new versioned tarball name, but the checksum value is left stale and a warning is added to EmitResult::warnings.

struct EmitResult#

Result of a next-generation emit: rewritten text and conventional basename.

text: String#
filename: String#

EasyBuild filename: {name}-{version}-{toolchain_name}-{toolchain_version}.eb

warnings: Vec<String>#

Human-readable warnings about content that was not (or could not be) safely rewritten, e.g. a stale source checksum or an unreviewed patch set after a version bump. Callers should surface these to the user.