Skip to content

feat(dev): --lock records what a dev environment resolved to, --locked loads it again - #333

Merged
HaoZeke merged 2 commits into
mainfrom
feat/dev-lock
Nov 19, 2026
Merged

HaoZeke merged 2 commits into
mainfrom
feat/dev-lock

Conversation

@HaoZeke

@HaoZeke HaoZeke commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

eb-local dev --lock MODULE... runs the dev lines in a bash child and writes eb-local.lock in the working directory, one line of JSON:

{"schema_version":1,"kind":"dev-lock","stack":"EESSI/2026.06","eessi_version":"2026.06","cpu_target":"x86_64/amd/zen4","accelerator_target":"","modules":["EESSI/2026.06","GCCcore/15.2.0","FFTW/3.3.10-GCC-15.2.0","buildenv/default-GCC-15.2.0"]}

modules is LOADEDMODULES in load order, the build environment among them. Nothing is written when the lines load no module.

eb-local dev --locked prints lines that:

  • purge first, as --pure does;
  • load exactly the lock's modules, each by its full name, so Lmod resolves nothing;
  • load none of them, and say why, when the shell's EESSI_SOFTWARE_SUBDIR is not the lock's cpu_target. Node types with the same CPU target share their binaries, so a lock written on one loads on the other.

Refused before any line is printed: no lock file, a file that is not a dev lock, a lock of another stack.module, a name that is not a module name, a CPU target with characters outside [A-Za-z0-9/_.-], and a MODULE on the --locked line. --json and --envrc work with --locked.

Checked

The zig workflow on the branch: 577 tests on x86_64 and aarch64 (575 on the branch below it). Two new tests cover writing, replacing and not writing the lock, the printed lines and their behaviour in bash on the same and on another CPU target, and each refusal. CI has no Lmod, so the tests supply LOADEDMODULES; it has not been run against a real module environment.

Closes #332

…d loads it again

dev --lock runs the dev lines in a bash child and writes eb-local.lock:
stack, EESSI version, CPU and accelerator target, and LOADEDMODULES in
load order. dev --locked prints lines that purge, load exactly that
list by full name, and load none of it when the shell's CPU target is
not the lock's. A lock of another stack, a file that is not a lock and
a name that is not a module name are refused.
@HaoZeke
HaoZeke merged commit cfa923e into main Nov 19, 2026
8 checks passed
@HaoZeke
HaoZeke deleted the feat/dev-lock branch November 19, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dev: nothing records what a dev environment resolved to

1 participant