|
| 1 | +Discover newly-released git tags on `bemanproject/*` repos and propose |
| 2 | +infra + compiler-explorer changes to expose them. |
| 3 | + |
| 4 | +The infra repo (this one) hosts `bin/yaml/libraries.yaml`. The |
| 5 | +compiler-explorer repo lives in a sibling directory (look around |
| 6 | +`../compiler-explorer` or `../compiler-explorer-*`); its config file is |
| 7 | +`etc/config/c++.amazon.properties`. If you can't find a sibling clone, |
| 8 | +ask the user to point at the right path before continuing. |
| 9 | + |
| 10 | +## Where things live |
| 11 | + |
| 12 | +Both groups now live under shared `beman:` parents that declare common |
| 13 | +settings (`build_type`, `check_file`, `target_prefix`, `type`, and a |
| 14 | +templated `repo: bemanproject/{{ context[-1] | replace('beman_', '', 1) }}`): |
| 15 | + |
| 16 | +- **Tagged versions** — `libraries.c++.beman.beman_<lib>` (no `if:`, |
| 17 | + default archive method). |
| 18 | +- **Trunk** — `libraries.c++.nightly.beman.beman_<lib>` (inherits |
| 19 | + `if: nightly` and `method: nightlyclone` from the surrounding |
| 20 | + `nightly:` group). |
| 21 | + |
| 22 | +Most leaves only declare `targets:`. Genuine overrides today: |
| 23 | +`beman_iterator_interface` (cmake / staticliblink / package_install) |
| 24 | +and `beman_scope` (`target_prefix: ''` because its only tag is |
| 25 | +`0.0.1`). Per-target `target_prefix: ''` is also used for individual |
| 26 | +non-`v`-prefixed tags within otherwise-`v`-prefixed libraries |
| 27 | +(e.g. `beman_any_view`'s `1.0.0`, several `beman_exemplar` versions). |
| 28 | + |
| 29 | +## What to do |
| 30 | + |
| 31 | +1. **Enumerate beman libraries.** The authoritative list is the keys |
| 32 | + under `libraries.c++.nightly.beman` in `bin/yaml/libraries.yaml` |
| 33 | + (it's a superset, including repos that have no tags yet). Don't |
| 34 | + hard-code names. |
| 35 | +2. **Fetch tags via `gh api`** for each repo, e.g. |
| 36 | + `gh api repos/bemanproject/<name>/tags --jq '.[].name'`. Skip repos |
| 37 | + with no tags. Exclude pre-release / rc / alpha / beta tags unless |
| 38 | + the user asks otherwise. |
| 39 | +3. **Compare against what's already configured.** Look at the keys and |
| 40 | + targets under `libraries.c++.beman` to see which `(target_prefix + |
| 41 | + target_name)` strings are already present, and compute the diff |
| 42 | + against the GitHub tag list. |
| 43 | +4. **If there are no new tags, stop and report that to the user.** Do |
| 44 | + not open empty PRs. |
| 45 | +5. **Add the new tagged versions** under `libraries.c++.beman`. Match |
| 46 | + the existing style: |
| 47 | + - If the lib doesn't have an entry yet, add a child whose only key |
| 48 | + is `targets:`. Common settings are inherited from the parent. |
| 49 | + - When all of a lib's tags are `v`-prefixed, list bare versions |
| 50 | + under `targets:` and rely on the parent's `target_prefix: v`. |
| 51 | + - For tags missing the `v`, add a per-target dict with |
| 52 | + `target_prefix: ''`: |
| 53 | + ```yaml |
| 54 | + - name: 1.0.0 |
| 55 | + target_prefix: '' |
| 56 | + ``` |
| 57 | + - When **none** of a lib's tags are `v`-prefixed, override at the |
| 58 | + entry level with `target_prefix: ''` (see `beman_scope`). |
| 59 | + - `beman_iterator_interface` is the only built lib; preserve its |
| 60 | + `cmake` / `lib_type: static` / `staticliblink` / `package_install` |
| 61 | + overrides if you're adding a new tag for it. |
| 62 | + - Don't introduce `method: nightlyclone` here; the default `archive` |
| 63 | + method is correct for tagged versions. |
| 64 | +6. **Validate locally** before committing: |
| 65 | + ```bash |
| 66 | + bin/ce_install list 'libraries/c++/beman/**' |
| 67 | + bin/ce_install --dry-run --dest ~/opt/compiler-explorer install \ |
| 68 | + 'libraries/c++/beman/beman_<lib> <ver>' |
| 69 | + ``` |
| 70 | + For at least the new tags, run a real install into |
| 71 | + `~/opt/compiler-explorer` and confirm the install path |
| 72 | + (`libs/beman_<lib>/<target_prefix><ver>/`) contains the expected |
| 73 | + `include/`. Note the install dir uses `target_prefix + target_name`, |
| 74 | + so a tag `v0.1.0` installs at `libs/beman_<lib>/v0.1.0/` and a |
| 75 | + bare `0.0.1` tag installs at `libs/beman_<lib>/0.0.1/`. |
| 76 | +7. **Update the compiler-explorer config.** Open |
| 77 | + `etc/config/c++.amazon.properties` in the sibling clone and extend |
| 78 | + each affected `libs.beman_<lib>.versions=...` list. Use the same |
| 79 | + compact version key style the file already uses (e.g. `0.1.0` → |
| 80 | + `010`, `2.1.1` → `211`). The `path` entry must match the install |
| 81 | + directory created by `ce_install`, including the `v` prefix when |
| 82 | + present (so `0.1.0` from a `v0.1.0` tag becomes |
| 83 | + `.../beman_<lib>/v0.1.0/include`, while `0.0.1` from a bare |
| 84 | + `0.0.1` tag becomes `.../beman_<lib>/0.0.1/include`). |
| 85 | +8. **Run `npm run test:props`** in the compiler-explorer repo to make |
| 86 | + sure the property file is still valid. |
| 87 | +9. **Open two PRs**, one in each repo, on a fresh branch. Match the |
| 88 | + style of the existing PRs (see compiler-explorer/infra#2111 and |
| 89 | + compiler-explorer/compiler-explorer#8683): |
| 90 | + - Infra branch first, then reference its PR number from the |
| 91 | + compiler-explorer PR description. |
| 92 | + - Don't bypass pre-commit hooks. Terraform-related hook failures on |
| 93 | + a workstation without `terraform` installed are environmental, not |
| 94 | + a real failure — but everything else must pass. |
| 95 | +10. **Report back** the full list of tags added per library and the two |
| 96 | + PR URLs so the user can review. |
| 97 | + |
| 98 | +## Things to skip |
| 99 | + |
| 100 | +- Repos with zero tags (e.g. `beman_execution`, `beman_map`, |
| 101 | + `beman_net`, `beman_span`, `beman_task` at time of writing). Their |
| 102 | + `libraries.c++.nightly.beman.<name>` trunk entries stay; nothing |
| 103 | + needs to be added under `libraries.c++.beman`. |
| 104 | +- Pre-release / rc / alpha / beta tags. |
| 105 | +- Re-running the discovery for repos that already have the latest tag |
| 106 | + configured. |
| 107 | + |
| 108 | +## Notes |
| 109 | + |
| 110 | +- Pre-commit will run tests and lint. `make pre-commit` (infra) and |
| 111 | + `npm run test:props` (compiler-explorer) must be clean. |
| 112 | +- Don't touch `c++.amazonwin.properties` unless the user asks — the |
| 113 | + Windows path for these libs hasn't been wired up. |
| 114 | +- Don't touch the `libraries.c++.nightly.beman.*` entries; their |
| 115 | + `main` trunk install is independent of tagged releases. |
0 commit comments