Repository navigation
feat(stack): add build-list line numbers, module dumps and version-change.tsv - #10
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 682ea65. Configure here.
…ees.sh A non-interactive bash has no `module` function. The helper now sources `$LMOD_PKG/init/bash` or `$MODULESHOME/init/bash`, and exits 2 when neither exists. It sources the init with errexit and nounset off, then checks for the function. Purge and load output goes to a per-tree log instead of `/dev/null`. A failed purge or load, or a module that `module is-loaded` does not report, exits 1 with the module name and that log. The helper deletes earlier inventories before the first dump and writes none for a failed tree. A purged base tree or a stale file therefore never passes as an older or target inventory. The exit trap removes only the temporary file the helper is writing. The test covers the `MODULESHOME` init, `LMOD_PKG` precedence over `MODULESHOME`, and a missing init. It also covers a failed purge, a failed load that leaves no stale target, and a load that leaves the module unloaded.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Reproducer
The fixture has seven site modules, one per route:
What and why
U3, build-list and hooks lint.
stack providednow prints the one-based build-list line on everyprovidedandunparsedfinding.The hook and toolchain findings already had it, so a failing list can be fixed without a manual search.
U4, live module dumps.
scripts/dump-module-trees.shcaptures themodule -t availtrees of the site, the older European Environment for Scientific Software Installations (EESSI) version and the target EESSI version.Each tree comes from its own purged shell.
A non-interactive bash has no
modulefunction, so the helper sources$LMOD_PKG/init/bash, then$MODULESHOME/init/bash, and uses the first one that definesmodule.Lmod's init isn't safe under
set -eu, so the helper relaxes both around thesourceand checks for the function afterwards.With neither init present it exits 2 and writes nothing.
Purge and load output for each tree goes to
OUT_DIR/<tree>.module.log, so the inventory files hold only theavaillisting.A failed purge, a failed load, or a meta-module that
module is-loadeddoesn't report makes the helper exit 1, naming the tree and printing that log.Before the first dump it deletes
site.txt,eessi-older.txtandeessi-target.txt, so a failed run never leaves an earlier run's inventory forstack gapto read.A half-written
.tmpfile is removed on exit.The new
tests/gap_routes/one-per-route.txtfixture gives exactly one row in each tab-separated route file.U5,
version-change.tsv.stack gapnow writes one row per old version.Modules on the
in-stackroute aremovedand name their EESSI version.Excluded modules are
site-only, and the rest staygoneuntil EESSI provides them.This also fixes a malformed inline literal in the
src/shard.rsdoc comment.Sphinx failed on it at
shard.rst:70, because warnings count as errors here.Before and after
Before (exit 1):
After (exit 1):
Before,
stack gapwrote noversion-change.tsvfor the live-tree example indocs/orgmode/howto/module-gap.org, run with--out-dir /tmp/gap-mwe.After:
For the helper, the test
helper_fails_with_the_lmod_error_when_a_load_failsstubsmoduleso thatmodule load EESSI/2026.06fails, and leaves an oldeessi-target.txtin the output folder.The old helper sent the load error to
/dev/nulland stopped beforemv, so by its code the oldeessi-target.txtstayed behind forstack gapto read.The new helper exits 1.
Its test checks that standard error names
EESSI/2026.06and carries the stub's error.It also checks that no
eessi-target.txtis left.The script makes that run print the lines below, ending with the stub's error string:
With no
modulefunction and no Lmod init, the helper exits 2 before creating the output folder.The test
helper_exits_when_no_lmod_init_existschecks the exit code, the missing folder and thenot initializedtext.The script prints this full message:
Tests
cargo test --locked --test module_tree_dump_script: 7 passed, 0 failed.cargo test --locked --all-targets: 1449 passed, 0 failed, 10 ignored.cargo fmt --checkandcargo clippy --locked --all-targets -- -D warningspass.python3 scripts/gen-llms-txt.py --checkpasses, and the Sphinx build under-Wpasses.The helper tests use a stub
modulecommand throughBASH_ENV,MODULESHOMEorLMOD_PKG.They cover the init order, the missing init, a failed purge, a failed load, a module that isn't loaded afterwards, and stale inventories.
Repro
cargo fmt --check cargo clippy --locked --all-targets -- -D warnings cargo test --locked --all-targets cargo package --locked uvx prek run -a pixi run -e docs docbld scripts/check-doc-links.sh docs/build python3 scripts/gen-llms-txt.py --checkOn a real Lmod shell: