Skip to content

feat(stack): order builds against an installed module list - #15

Merged
HaoZeke merged 1 commit into
mainfrom
feat/stack-order-installed
Nov 3, 2026
Merged

HaoZeke merged 1 commit into
mainfrom
feat/stack-order-installed

Conversation

@HaoZeke

@HaoZeke HaoZeke commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

stack order against an installed module list

stack order sequenced every dependency the roots pin.
A module that was already installed still appeared in the order, and so did the dependencies that had been installed with it.
--filter-deps already dropped named dependencies, and a GCC or GCCcore recipe already resolved inside the synthetic GCC-family hierarchy that recipe hierarchy --export prints.
The order command had no way to take an installed module list.

--installed repeats.
A file is module -t avail, module spider -t, or Name/version.
A directory is an Lmod tree, read the same way as stack gap --installed.
The version is the full module version (OpenBLAS/0.3.27-foss-2025b).
A bare name matches nothing.
A listed module is left out of the order, and the walk does not enter its dependencies.
--filter-deps is applied first, so a filtered dependency is not counted as a leaf.
Stdout prints installed=<N> for how many modules the walk stopped at, then order=<path> builds=<N>.
eb_stack_order takes the same installed list and returns that count.

Before

eb-stack stack order \
  --easyconfigs fixtures/gromacs_2025_to_next/easyconfigs \
  --root GROMACS \
  --out /tmp/build-order-before.txt
order=/tmp/build-order-before.txt builds=5
fixtures/gromacs_2025_to_next/easyconfigs/foss-2025b/Python-3.12.3-foss-2025b.eb
fixtures/gromacs_2025_to_next/easyconfigs/foss-2025b/OpenMPI-5.0.3-foss-2025b.eb
fixtures/gromacs_2025_to_next/easyconfigs/foss-2025b/OpenBLAS-0.3.27-foss-2025b.eb
fixtures/gromacs_2025_to_next/easyconfigs/foss-2025b/FFTW-3.3.10-foss-2025b.eb
fixtures/gromacs_2025_to_next/easyconfigs/foss-2025b/GROMACS-2025.0-foss-2025b.eb

After

eb-stack stack order \
  --easyconfigs fixtures/gromacs_2025_to_next/easyconfigs \
  --root GROMACS \
  --installed fixtures/stack_order_installed/installed.txt \
  --filter-deps FFTW \
  --out /tmp/build-order.txt

fixtures/stack_order_installed/installed.txt names OpenBLAS/0.3.27-foss-2025b.

installed=1
order=/tmp/build-order.txt builds=3
fixtures/gromacs_2025_to_next/easyconfigs/foss-2025b/Python-3.12.3-foss-2025b.eb
fixtures/gromacs_2025_to_next/easyconfigs/foss-2025b/OpenMPI-5.0.3-foss-2025b.eb
fixtures/gromacs_2025_to_next/easyconfigs/foss-2025b/GROMACS-2025.0-foss-2025b.eb

OpenBLAS is the leaf the walk stopped at.
The Fastest Fourier Transform in the West (FFTW) library is absent because --filter-deps removed it before that walk.
GROMACS remains.

Tests

  • cargo +stable test --locked --all-targets exited 0.
    The library suite reported 803 passed; 0 failed.
    Every other suite reported 0 failed.
  • cargo +stable clippy --locked --all-targets -- -D warnings exited 0.
  • cargo +stable fmt --all --check exited 0.
  • cargo +stable package --locked verified eb_stack v0.4.0 (1533 files) and compiled the packaged crate.
  • python3 scripts/gen-llms-txt.py --check exited 0.
  • python3 -m prek run -a passed trailing-whitespace, end-of-file-fixer, check-yaml, check-toml, check-merge-conflict, check-added-large-files, detect-private-key, and codespell.

Repro

cargo +stable test --locked --lib build_order::tests::an_installed_module_is_a_leaf_and_its_dependencies_stay_out -- --exact
cargo +stable test --locked --lib build_order::tests::a_gcc_recipe_uses_the_synthetic_gcc_family_hierarchy -- --exact
cargo +stable test --locked --test stack_order_filter --test mcp_v1 mcp_stack_order_matches_the_cli
eb-stack stack order \
  --easyconfigs fixtures/gromacs_2025_to_next/easyconfigs \
  --root GROMACS \
  --installed fixtures/stack_order_installed/installed.txt \
  --filter-deps FFTW \
  --out /tmp/build-order.txt

Note

Medium Risk
Changes core build-order graph walking and what gets emitted to order/hash files; behavior is additive but mistakes could omit required builds if installed matching is wrong.

Overview
Adds stack order --installed (repeatable) so build orders skip modules already on the site and do not walk their dependencies, using the same module list / Lmod tree reader as stack gap --installed. --filter-deps still runs first, so filtered deps are not treated as installed leaves.

The dependency walk is implemented via build_order_against_installed / build_graph_against_installed in build_order.rs, wired through stack_order in workflows.rs and the CLI/MCP eb_stack_order (installed argument; JSON field installed count). Stdout gains installed=N before order=....

Docs, CHANGELOG, fixture fixtures/stack_order_installed/installed.txt, and integration tests cover CLI/MCP parity, Lmod trees, and interaction with --filter-deps.

Reviewed by Cursor Bugbot for commit c77ed27. Bugbot is set up for automated code reviews on this repo. Configure here.

`stack order` walked every dependency the roots pin, including modules already on the machine.
`--installed` now stops that walk at each listed module and leaves that module and its own dependencies out of the order.
`--filter-deps` still drops dependencies first, and the modules that remain follow the synthetic GCC-family hierarchy.
@HaoZeke
HaoZeke merged commit 72b91fb into main Nov 3, 2026
19 checks passed
@HaoZeke
HaoZeke deleted the feat/stack-order-installed branch November 4, 2026 09:44
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.

1 participant