Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/actions/setup-proteus/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,9 @@ runs:
uses: actions/cache@v5
with:
path: socrates/
key: socrates-${{ runner.os }}-${{ runner.arch }}-portable-${{ steps.runner-image.outputs.version }}-${{ steps.pins.outputs.socrates_ref }}-${{ hashFiles('tools/get_socrates.sh') }}
# Both files: get_socrates.sh sources the shared helpers in
# tools/_get_common.sh, so a change there also changes what is built.
key: socrates-${{ runner.os }}-${{ runner.arch }}-portable-${{ steps.runner-image.outputs.version }}-${{ steps.pins.outputs.socrates_ref }}-${{ hashFiles('tools/get_socrates.sh', 'tools/_get_common.sh') }}

- name: Build SOCRATES (cache miss)
if: steps.cache-socrates.outputs.cache-hit != 'true'
Expand Down
25 changes: 25 additions & 0 deletions docs/How-to/development_standards.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,31 @@ field sets) are written one entry per line with a trailing comma, grouped by
module under a header comment, and ordered alphabetically within each group.
This keeps two independent additions on different lines so they merge cleanly.

**Module install scripts**

The `tools/get_*.sh` scripts share one sourced library, `tools/_get_common.sh`.
It provides `portable_realpath`, the checkout root (`proteus_root`) and tools
directory (`proteus_tools_dir`), the `--force` and install-path argument split
(`get_parse_args`), the dirty-checkout guard (`guard_dirty_checkout`), the
GitHub SSH probe (`github_use_ssh`), the https-to-SSH URL rewrite
(`github_ssh_url`), and the pin reader (`resolve_module_pin`).

A new install script starts with the same bootstrap the existing ones use:

```bash
source "$(dirname "${BASH_SOURCE[0]}")/_get_common.sh" || exit 1
```

The `|| exit 1` is load-bearing: half the scripts set no `-e`, and one that
carried on past a failed `source` would run with `proteus_root` empty, putting
its work path at the filesystem root.

Add a helper to the library rather than copying one into a script, and give it
a parameter for the variation a caller needs: `get_socrates.sh` passes a git
pathspec to `guard_dirty_checkout` so its regenerable `make/Mk_cmd` does not
count as local work. The helpers target bash 3.2 and run the same with or
without `set -euo pipefail`, because the scripts differ on that.

**Editing shared files**

- When adding to the main coupling loop, add a stage function and call it rather
Expand Down
Loading
Loading