mod jenkins

module jenkins

Read and write the build-list format a Jenkins easyconfigs pipeline consumes.

One easyconfig filename per line, each optionally followed by eb flags (OpenMPI-5.0.8-GCC-14.3.0.eb --hooks=/sw/.../mpi_hook.py). Lines starting with # are comments; the pipeline reads the rest top to bottom, so the order is the build order.

A new generation’s list keeps the site’s per-package flags from the previous one, the hooks, site easyblocks and licence acceptances. Flags that name a specific recipe revision (--from-commit, --from-pr) or excuse one build (--ignore-test-failure, --rebuild) describe the old version and are not carried.

Functions

fn carried_flags(previous: &[BuildListLine], name: &str) -> Vec<String>

The flags name carries over from previous, taken from its last line.

fn format_build_list<'a>(packages: impl IntoIterator<Item = &'a LockPackage>, options: &JenkinsOptions) -> String

Render packages, already in build order, as a Jenkins build list.

fn group_by_sections(list: &str, sections: &[Section], unfiled: &str) -> String

Regroup the entries of list under the sections a previous list files their packages in. Each entry line is kept as written, commented out or not and with its flags; within a section entries keep their order in list. Entries whose package no section names go under unfiled, last. The comment block before the first entry of list stays on top; other comments and headers of list are dropped.

fn package_name(file: &str) -> Option<&str>

The package name a build-list filename names: everything before the first - that a version follows (hwloc-CUDA-2.11.2-... is hwloc-CUDA). None when no version is found.

fn parse_build_list(text: &str) -> Vec<BuildListLine>

Parse a build list. Comment and blank lines are skipped.

fn parse_sections(text: &str) -> Vec<Section>

Read the sections of a build list, in file order.

Structs and Unions

struct BuildListLine

One non-comment line of a build list.

file: String

Easyconfig filename.

flags: Vec<String>

The flags after it, each with its leading dashes, in file order.

struct JenkinsOptions

Options for format_build_list.

previous: Vec<BuildListLine>

Previous lists whose per-package flags carry over.

gpu_systems: Vec<String>

Systems a CUDA module is restricted to with --include-systems, when non-empty. A module counts as CUDA when its name or versionsuffix says so.

only: Option<Vec<String>>

When set, only these package names are written. A pipeline that runs eb --robot on each line builds their dependencies anyway, so a list of roots keeps the site’s view at one line per application.

struct Section

A titled group of packages in a build list, as a #### Title #### header and the entries below it up to the next header.

title: String

The header text without its # marks.

packages: Vec<String>

Package names under the header, commented-out entries included: a line a site switched off still says where that package belongs.