eb-local.foreign

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

Host and container paths that must not leak into a build.

eb-local doctor reports entries of PERL5LIB, PYTHONPATH, R_LIBS*, JULIA_LOAD_PATH, JULIA_DEPOT_PATH, NODE_PATH, CMAKE_PREFIX_PATH and PKG_CONFIG_PATH, and compiler-wrapper variables, that resolve outside the approved prefixes. CARGO_TARGET_*_LINKER, CARGO_BUILD_RUSTC_WRAPPER, RUSTC_WORKSPACE_WRAPPER, R_MAKEVARS_USER and R_MAKEVARS_SITE are wrapper variables. RUSTFLAGS and CARGO_TARGET_*_RUSTFLAGS are flag strings, so they are not paths. It also reports the timezone /etc/localtime resolves to, a bind mount of that file, and host library directories a container runtime injected. A build drops the foreign entries only when build.clear_foreign_prefixes is set.

Types

pub const Code = enum[source][autodoc]

What doctor prints for one finding. The words are in main.zig, so a how-to that shows a line can be checked against that format.

none[source]
list_keep[source]
list_drop[source]
wrap_keep[source]
wrap_drop[source]
timezone[source]
timezone_bind[source]
host_lib[source]
host_none[source]
pub const Finding = struct[source][autodoc]

One reported path: name is the variable, path the entry or target.

code: Code[source]
name: []const u8 = ""[source]
path: []const u8 = ""[source]

Functions

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

Prefixes a path may sit under: the EESSI repository, the install prefix, the four EESSI install variables, extra (the site’s approved prefixes), eb-local’s RPATH wrapper directory and its cache.

pub fn scan(a: Allocator, env: *const std.process.Environ.Map, prefixes: []const []const u8, clear: bool, mountinfo: []const u8) Allocator.Error![]Finding[source][autodoc]

Findings for this shell. clear selects the words doctor uses; it does not change the environment.

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

Drop foreign entries from env. An empty path list is removed. A compiler-wrapper variable that resolves outside the prefixes is removed. Approved entries stay. Nothing is added.

Constants

pub const path_lists = ...[source][autodoc]

Path-list variables doctor inspects, besides every R_LIBS*.

pub const compiler_vars = ...[source][autodoc]

Compiler variables whose value is a program or a path. CCACHE_*, SCCACHE_* and CMAKE_*_COMPILER_LAUNCHER are recognised by name.