eb-local.extend

module eb-local.extend  src/extend.zig[source][autodoc]

Run EasyBuild through EESSI-extend with no Slurm job.

EESSI-extend reads EESSI_USER_INSTALL, EESSI_PROJECT_INSTALL, EESSI_SITE_INSTALL and EESSI_CVMFS_INSTALL when it loads, and treats a present empty value as set (os.getenv(name) ~= nil). This allows at most one of those, then a shell sources the EESSI init, loads the module and execs eb. The module sets the hooks, the RPATH and EASYBUILD_UMASK; nothing here replaces them.

Types

pub const Mode = enum[source][autodoc]

The install EESSI-extend makes, chosen by which install variable is set: EESSI_USER_INSTALL, EESSI_PROJECT_INSTALL, EESSI_SITE_INSTALL or EESSI_CVMFS_INSTALL.

user[source]
project[source]
site[source]
cvmfs[source]
pub const Selection = struct[source][autodoc]

What select chose: the install mode, and the umask the launcher runs with for it, the one EESSI-extend sets for that mode.

mode: Mode[source]
umask: []const u8[source]

Process umask, as octal digits: 077, 002 or 022.

Error sets

pub const SelectError = error{...}[source][autodoc]

error.TooMany when more than one install variable is set, a present empty one included; tooMany says which.

error.TooMany

Functions

pub fn variable(mode: Mode) []const u8[source][autodoc]

The install variable that selects MODE.

pub fn engaged(env: *const std.process.Environ.Map) bool[source][autodoc]

EB_LOCAL_EESSI_EXTEND is how a caller that can pass only one program (an eb-stack target’s EasyBuild command) selects this launcher. Every argument is then eb’s. Empty and 0 leave the ordinary commands alone.

pub fn select(env: *const std.process.Environ.Map) SelectError!Selection[source][autodoc]

None of the four is a user install, and nothing is exported. On EESSI 2026.06 the module’s help text says $HOME/EESSI, and the loaded module uses $HOME/eessi without requiring that directory to exist. Exporting the uppercase path would make the module demand a directory it does not use.

pub fn tooMany(a: Allocator, env: *const std.process.Environ.Map) Allocator.Error![]u8[source][autodoc]

Why select refused: each install variable that is set, with its value, and what EESSI-extend does with them. With a project and a user variable it loads and makes a private user install; with a site or a cvmfs one and another it refuses to load. One of them is usually left from an earlier session.

pub fn apply(env: *std.process.Environ.Map) void[source][autodoc]

Drop the launcher switch, so a build that itself runs eb-local does not enter this mode again. Install variables are left as the caller set them.

pub fn initPath(a: Allocator, env: *const std.process.Environ.Map) Allocator.Error![]const u8[source][autodoc]

The EESSI init the script sources, with the script’s defaults for an unset or empty EESSI_CVMFS_REPO and EESSI_VERSION.

pub fn commandLine(a: Allocator, sel: Selection, eb_args: []const []const u8) Allocator.Error![]const []const u8[source][autodoc]

The argument vector that runs eb through EESSI-extend for sel: a bash with no profile and no rc file running the launcher script, with the umask and the mode as its first arguments and eb_args after them. The caller owns the slice, not the strings in it.

Constants

pub const cargo_linker = @embedFile("cargo-linker.sh")[source][autodoc]

Lines that drop a host Cargo linker and point Cargo at ${CC:-gcc} when rustc -vV prints a host. script includes this file, and dev prints the same bytes.

pub const script = script_before ++ cargo_linker ++ script_after[source][autodoc]

$1 is the umask, $2 is the mode, and the rest are eb’s arguments. EESSI’s init is not safe under nounset. The compat-layer ld goes on PATH even when rustc is absent: a failing command substitution under pipefail would exit before the module loads. WORKING_DIR is the caller’s: unset, the module’s default is /tmp/$USER, one per user, where a shared default would leave every other user’s build unable to write the first one’s directories. Once the module has loaded, eb runs only if EASYBUILD_INSTALLPATH is in the tree the install variable selects and no EASYBUILD_INSTALLPATH_SOFTWARE or _MODULES moves part of the install elsewhere. The Cargo linker lines are cargo_linker.