# eb-local.cpumask ::::{zig:module} eb-local.cpumask :file: src/cpumask.zig :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig `eb-local --cpu-target`: build for another CPU target on this machine. The target is an EESSI software subdirectory. A build for it runs in one of four routes: `native` (the host already is the target), `cpuid` (the host CPU shows the target's identity to every child process: CPUID faulting on x86_64, a masked `getauxval` and `/proc/cpuinfo` on aarch64), `kvm` and `tcg` (a virtual machine, run by `eb-local __vm-run`). This file holds the target and profile data, the route choice, the preflight decision, the files of the cpuid route and the provenance record. The process handling stays in main.zig. :::: ## Types ::::{zig:type} eb-local.cpumask.Arch :signature: pub const Arch = enum :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L34 The architectures a CPU target can have. :::{zig:field} eb-local.cpumask.Arch.x86_64 :signature: x86_64 :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L35 ::: :::{zig:field} eb-local.cpumask.Arch.aarch64 :signature: aarch64 :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L36 ::: :::{zig:function} eb-local.cpumask.Arch.host :signature: pub fn host() ?Arch :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L39 The architecture this program runs on, null when it has no profile. ::: :::: ::::{zig:type} eb-local.cpumask.Resolved :signature: pub const Resolved = union(enum) :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L73 What a `--cpu-target` word names. :::{zig:field} eb-local.cpumask.Resolved.subdir :signature: subdir: []const u8 :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L74 ::: :::{zig:field} eb-local.cpumask.Resolved.refused :signature: refused: []const u8 :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L76 A message for the user. ::: :::: ::::{zig:type} eb-local.cpumask.Profile :signature: pub const Profile = struct :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L112 One target's identity, as `profiles.conf` records it. :::{zig:field} eb-local.cpumask.Profile.subdir :signature: subdir: []const u8 :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L113 ::: :::{zig:field} eb-local.cpumask.Profile.arch :signature: arch: Arch :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L114 ::: :::{zig:field} eb-local.cpumask.Profile.vendor :signature: vendor: []const u8 = "" :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L115 ::: :::{zig:field} eb-local.cpumask.Profile.family :signature: family: u32 = 0 :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L116 ::: :::{zig:field} eb-local.cpumask.Profile.model :signature: model: u32 = 0 :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L117 ::: :::{zig:field} eb-local.cpumask.Profile.model_name :signature: model_name: []const u8 = "" :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L118 ::: :::{zig:field} eb-local.cpumask.Profile.gcc_march :signature: gcc_march: []const u8 = "" :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L119 ::: :::{zig:field} eb-local.cpumask.Profile.host_vendors :signature: host_vendors: []const []const u8 = &.{} :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L120 ::: :::{zig:field} eb-local.cpumask.Profile.needs :signature: needs: []const []const u8 = &.{} :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L121 ::: :::{zig:field} eb-local.cpumask.Profile.drop_flags :signature: drop_flags: []const []const u8 = &.{} :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L122 ::: :::{zig:field} eb-local.cpumask.Profile.rules :signature: rules: []const []const u8 = &.{} :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L123 ::: :::{zig:field} eb-local.cpumask.Profile.cpu_part :signature: cpu_part: []const u8 = "" :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L124 ::: :::{zig:field} eb-local.cpumask.Profile.gcc_cpu :signature: gcc_cpu: []const u8 = "" :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L125 ::: :::{zig:field} eb-local.cpumask.Profile.features :signature: features: []const []const u8 = &.{} :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L126 ::: :::{zig:field} eb-local.cpumask.Profile.hwcap :signature: hwcap: []const u8 = "0x0" :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L127 ::: :::{zig:field} eb-local.cpumask.Profile.hwcap2 :signature: hwcap2: []const u8 = "0x0" :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L128 ::: :::: ::::{zig:type} eb-local.cpumask.Mode :signature: pub const Mode = enum :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L285 What `--mask` asks for. :::{zig:field} eb-local.cpumask.Mode.auto :signature: auto :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L285 ::: :::{zig:field} eb-local.cpumask.Mode.cpuid :signature: cpuid :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L285 ::: :::{zig:field} eb-local.cpumask.Mode.kvm :signature: kvm :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L285 ::: :::{zig:field} eb-local.cpumask.Mode.tcg :signature: tcg :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L285 ::: :::: ::::{zig:type} eb-local.cpumask.Route :signature: pub const Route = enum :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L288 How the build runs. :::{zig:field} eb-local.cpumask.Route.native :signature: native :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L288 ::: :::{zig:field} eb-local.cpumask.Route.cpuid :signature: cpuid :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L288 ::: :::{zig:field} eb-local.cpumask.Route.kvm :signature: kvm :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L288 ::: :::{zig:field} eb-local.cpumask.Route.tcg :signature: tcg :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L288 ::: :::: ::::{zig:type} eb-local.cpumask.Host :signature: pub const Host = struct :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L291 What the choice of a route needs to know about this machine. :::{zig:field} eb-local.cpumask.Host.arch :signature: arch: Arch :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L292 ::: :::{zig:field} eb-local.cpumask.Host.vendor :signature: vendor: []const u8 = "" :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L294 vendor_id of an x86_64 CPU, empty on aarch64. ::: :::{zig:field} eb-local.cpumask.Host.flags :signature: flags: []const u8 = "" :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L296 The `flags` (x86_64) or `Features` (aarch64) line of /proc/cpuinfo. ::: :::{zig:field} eb-local.cpumask.Host.subdir :signature: subdir: ?[]const u8 = null :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L298 The EESSI subdirectory of this host, when it could be detected. ::: :::{zig:field} eb-local.cpumask.Host.faulting :signature: faulting: bool = false :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L300 CPUID faulting works (x86_64). ::: :::{zig:field} eb-local.cpumask.Host.kvm :signature: kvm: bool = false :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L302 /dev/kvm is usable. ::: :::{zig:field} eb-local.cpumask.Host.vm_helper :signature: vm_helper: bool = false :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L304 `eb-local __vm-run` exists in this binary. ::: :::: ::::{zig:type} eb-local.cpumask.Choice :signature: pub const Choice = union(enum) :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L308 The outcome of the route choice. :::{zig:field} eb-local.cpumask.Choice.route :signature: route: Route :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L309 ::: :::{zig:field} eb-local.cpumask.Choice.refuse :signature: refuse: []const u8 :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L311 The message for the user. ::: :::: ::::{zig:type} eb-local.cpumask.Observed :signature: pub const Observed = struct :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L383 What the build script saw inside the mask. A null field was not observable: the tool is missing. :::{zig:field} eb-local.cpumask.Observed.devfd :signature: devfd: bool :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L384 ::: :::{zig:field} eb-local.cpumask.Observed.archdetect :signature: archdetect: ?[]const u8 = null :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L386 The output of `eessi_archdetect.sh cpupath`: subdirectories separated by ':'. ::: :::{zig:field} eb-local.cpumask.Observed.archspec :signature: archspec: ?[]const u8 = null :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L388 What archspec names the host, null when it cannot be imported. ::: :::{zig:field} eb-local.cpumask.Observed.gcc :signature: gcc: ?[]const u8 = null :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L390 The -march (x86_64) or -mcpu (aarch64) value of `gcc -march=native`. ::: :::{zig:field} eb-local.cpumask.Observed.vendor :signature: vendor: ?[]const u8 = null :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L392 The CPUID vendor string of a probe run in the mask. ::: :::{zig:field} eb-local.cpumask.Observed.faulting :signature: faulting: ?bool = null :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L394 Whether CPUID faulting is active in the probe. ::: :::{zig:field} eb-local.cpumask.Observed.archspec_allowed :signature: archspec_allowed: bool = false :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L396 `--mask-allow-archspec-mismatch`: an archspec name other than the target's is noted, not refused. ::: :::: ::::{zig:type} eb-local.cpumask.Finding :signature: pub const Finding = struct :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L400 One preflight check and what it found. :::{zig:field} eb-local.cpumask.Finding.ok :signature: ok: bool :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L400 ::: :::{zig:field} eb-local.cpumask.Finding.text :signature: text: []const u8 :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L400 ::: :::: ::::{zig:type} eb-local.cpumask.Libs :signature: pub const Libs = struct :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L538 The compiled preload library and probe. :::{zig:field} eb-local.cpumask.Libs.preload :signature: preload: []const u8 :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L540 The preload library for the host architecture. ::: :::{zig:field} eb-local.cpumask.Libs.probe :signature: probe: []const u8 :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L541 ::: :::{zig:field} eb-local.cpumask.Libs.dir :signature: dir: []const u8 :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L542 ::: :::: ::::{zig:type} eb-local.cpumask.Provenance :signature: pub const Provenance = struct :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L714 What `easybuild/eb-local-build-mode.json` records. :::{zig:field} eb-local.cpumask.Provenance.target :signature: target: []const u8 :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L715 ::: :::{zig:field} eb-local.cpumask.Provenance.route :signature: route: Route :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L716 ::: :::{zig:field} eb-local.cpumask.Provenance.profile :signature: profile: []const u8 :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L718 The profile's subdirectory, empty for a route without one. ::: :::{zig:field} eb-local.cpumask.Provenance.host_cpu :signature: host_cpu: []const u8 :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L719 ::: :::{zig:field} eb-local.cpumask.Provenance.kernel :signature: kernel: []const u8 :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L720 ::: :::{zig:field} eb-local.cpumask.Provenance.version :signature: version: []const u8 :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L721 ::: :::{zig:field} eb-local.cpumask.Provenance.audit :signature: audit: []const u8 :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L723 "pass", "fail" or "skipped". ::: :::: ## Functions :::{zig:function} eb-local.cpumask.resolveTarget :signature: pub fn resolveTarget(a: Allocator, text: []const u8) Resolved :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L81 The subdirectory `text` names: a full subdirectory, or a short name that one known subdirectory ends in. ::: :::{zig:function} eb-local.cpumask.archOf :signature: pub fn archOf(subdir: []const u8) ?Arch :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L104 The architecture a subdirectory is for. ::: :::{zig:function} eb-local.cpumask.parseProfiles :signature: pub fn parseProfiles(a: Allocator, text: []const u8) []Profile :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L139 The profiles in `text`, in file order. ::: :::{zig:function} eb-local.cpumask.builtinProfiles :signature: pub fn builtinProfiles(a: Allocator) []Profile :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L199 The profiles that ship with eb-local. ::: :::{zig:function} eb-local.cpumask.findProfile :signature: pub fn findProfile(profiles: []const Profile, subdir: []const u8) ?Profile :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L204 The profile for `subdir`, or null. ::: :::{zig:function} eb-local.cpumask.rulesFile :signature: pub fn rulesFile(a: Allocator, p: Profile) []const u8 :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L210 The rule lines of `p` as cpuidmask reads them from CPUIDMASK_RULES. ::: :::{zig:function} eb-local.cpumask.maskedCpuinfo :signature: pub fn maskedCpuinfo(a: Allocator, p: Profile, host: []const u8) []const u8 :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L229 `host`, the text of /proc/cpuinfo, as it reads on the target: the identity fields of `p`, and without the flags `p` drops. Lines that name nothing the profile changes stay as they are. ::: :::{zig:function} eb-local.cpumask.cpuidProblem :signature: pub fn cpuidProblem(a: Allocator, target: []const u8, profile: ?Profile, host: Host) ?[]const u8 :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L325 Why the cpuid route cannot present `target` on `host`, or null when it can. ::: :::{zig:function} eb-local.cpumask.choose :signature: pub fn choose(a: Allocator, mode: Mode, target: []const u8, profile: ?Profile, host: Host) Choice :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L344 The route for `target`. The target the host already is needs no mask. ::: :::{zig:function} eb-local.cpumask.preflight :signature: pub fn preflight(a: Allocator, p: Profile, route: Route, obs: Observed) []const Finding :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L413 Compare what the detectors report with `p`. Every detector must name the target; a build that goes on with one that does not would install a tree labelled for one CPU and compiled for another. ::: :::{zig:function} eb-local.cpumask.refused :signature: pub fn refused(findings: []const Finding) bool :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L465 Whether any finding refuses the build. ::: :::{zig:function} eb-local.cpumask.cpuinfoField :signature: pub fn cpuinfoField(text: []const u8, key: []const u8) ?[]const u8 :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L473 The first value of `key` in /proc/cpuinfo text. ::: :::{zig:function} eb-local.cpumask.faultingAvailable :signature: pub fn faultingAvailable() bool :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L484 Whether the kernel lets this process turn on CPUID faulting. ::: :::{zig:function} eb-local.cpumask.kvmUsable :signature: pub fn kvmUsable() bool :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L493 Whether /dev/kvm can be opened for reading and writing. ::: :::{zig:function} eb-local.cpumask.readFile :signature: pub fn readFile(a: Allocator, path: []const u8, limit: usize) ?[]const u8 :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L498 The first `limit` bytes of the regular file `path`, or null. ::: :::{zig:function} eb-local.cpumask.readHost :signature: pub fn readHost(a: Allocator, subdir: ?[]const u8, vm_helper: bool) ?Host :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L506 This machine as the route choice sees it. `subdir` is the detected EESSI subdirectory of the host, `vm_helper` whether `__vm-run` exists. ::: :::{zig:function} eb-local.cpumask.hostModel :signature: pub fn hostModel(a: Allocator) []const u8 :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L521 A one-line name of the host CPU, for the provenance record. ::: :::{zig:function} eb-local.cpumask.kernelRelease :signature: pub fn kernelRelease(a: Allocator) []const u8 :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L530 The running kernel's release, from /proc/sys/kernel/osrelease. ::: :::{zig:function} eb-local.cpumask.cacheKey :signature: pub fn cacheKey(a: Allocator, triple: []const u8, libc: []const u8) []const u8 :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L568 The cache key of the compiled libraries: the sources, the compiler's target triple and the C library's version. A library built against one glibc does not load into every other. ::: :::{zig:function} eb-local.cpumask.ensureLibs :signature: pub fn ensureLibs(a: Allocator, envp: proc.Envp, path_env: []const u8, cache_home: []const u8, failure: *[]const u8) ?Libs :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L583 The preload library and probe for this host, compiled with the host's cc into `cache_home/eb-local/mask-KEY` on first use. A static binary cannot be preloaded into the dynamically linked programs of a build, so the library is built from the C source embedded here. ::: :::{zig:function} eb-local.cpumask.namespaceWords :signature: pub fn namespaceWords(a: Allocator, unshare: []const u8, setpriv: ?[]const u8, fake: []const u8) []const []const u8 :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L660 The words in front of the build command for the cpuid route: an unprivileged user and mount namespace that keeps the caller's uid (a mapped root makes OpenMPI's prterun refuse to start), with `fake` bound over /proc/cpuinfo. The ambient capabilities the namespace gives are dropped before the command runs when `setpriv` exists. ::: :::{zig:function} eb-local.cpumask.maskVariables :signature: pub fn maskVariables(a: Allocator, p: Profile, libs: Libs, rules_path: []const u8, hooks_path: []const u8, self_exe: []const u8, route: Route, allow_archspec: bool) []const [2][]const u8 :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L672 The variables the masked command gets. ::: :::{zig:function} eb-local.cpumask.provenanceJson :signature: pub fn provenanceJson(a: Allocator, p: Provenance) []const u8 :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L727 The text of easybuild/eb-local-build-mode.json. ::: :::{zig:function} eb-local.cpumask.writeProvenance :signature: pub fn writeProvenance(a: Allocator, dir: []const u8, text: []const u8) bool :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L751 Write `text` as `dir/name`, replacing what is there. ::: :::{zig:function} eb-local.cpumask.writeFile :signature: pub fn writeFile(a: Allocator, path: []const u8, bytes: []const u8, mode: linux.mode_t) bool :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L758 Write `bytes` to `path` with `mode`, replacing what is there. ::: ## Constants :::{zig:constant} eb-local.cpumask.hooks_py :signature: pub const hooks_py = @embedFile("mask_hooks_py") :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L27 EasyBuild hooks that chain the site's and pin the GROMACS SIMD level. ::: :::{zig:constant} eb-local.cpumask.strict_exit :signature: pub const strict_exit: u8 = 97 :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L31 The exit status of a process that cpuidmask stopped because the kernel has no CPUID faulting and CPUIDMASK_STRICT is set. ::: :::{zig:constant} eb-local.cpumask.known_subdirs :signature: pub const known_subdirs = ... :source: https://github.com/stackhands/eb-local/blob/629c1ef39cdece5bfa2145cc8e2e89ae7583d197/src/cpumask.zig#L52 The EESSI subdirectories eb-local knows by name. A short name resolves when it is the last component of exactly one of them. :::