Skip to content

Commit 61e118e

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/aocc-infra
2 parents ea387ac + 79863f2 commit 61e118e

96 files changed

Lines changed: 4341 additions & 880 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
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.

.github/workflows/bespoke-build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ on:
3030
- iwyu
3131
- jakt
3232
- lfortran
33+
- lua
3334
- mads
3435
- micropython
3536
- nasm
@@ -40,7 +41,6 @@ on:
4041
- pythran
4142
- rocm
4243
- ruby
43-
- rust-cg-gcc
4444
- rust-linux
4545
- vala
4646
version:

.github/workflows/cefs-gc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
runs-on: ['admin']
2222
steps:
2323
- name: Clean workspace
24-
run: find "$GITHUB_WORKSPACE" -mindepth 1 -delete
24+
run: sudo find "$GITHUB_WORKSPACE" -mindepth 1 -delete
2525
- uses: actions/checkout@v5
2626
- name: Set up environment
2727
run: make ce

.github/workflows/lin-lib-build.yaml

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ on:
1111
description: 'Compiler'
1212
default: 'popular-compilers-only'
1313
required: true
14+
branch:
15+
description: 'infra branch to clone (defaults to main)'
16+
default: 'main'
17+
required: false
1418
workflow_call:
1519
inputs:
1620
library:
@@ -23,6 +27,11 @@ on:
2327
default: 'popular-compilers-only'
2428
required: true
2529
type: string
30+
branch:
31+
description: 'infra branch to clone (defaults to main)'
32+
default: 'main'
33+
required: false
34+
type: string
2635

2736
jobs:
2837
librarybuild:
@@ -56,10 +65,32 @@ jobs:
5665
5766
echo "language=$LANGUAGE" >> $GITHUB_OUTPUT
5867
echo "library_name=$LIBRARY_NAME" >> $GITHUB_OUTPUT
68+
# actions/upload-artifact rejects forward slashes in artifact names, so
69+
# provide a sanitized variant for use in the failure-artifact step.
70+
echo "library_safe=${LIBRARY_NAME//\//-}" >> $GITHUB_OUTPUT
5971
echo "Detected language: $LANGUAGE, library: $LIBRARY_NAME"
6072
6173
- name: Download build script
62-
run: curl -sL "https://raw.githubusercontent.com/compiler-explorer/infra/refs/heads/main/init/start-builder.sh" -o "/tmp/start-builder.sh"
74+
run: curl -sL "https://raw.githubusercontent.com/compiler-explorer/infra/refs/heads/${{ inputs.branch || 'main' }}/init/start-builder.sh" -o "/tmp/start-builder.sh"
6375

6476
- name: Build libraries
65-
run: cd /tmp && chmod +x start-builder.sh && ./start-builder.sh "${{ secrets.CONAN_PASSWORD }}" "${{ steps.extract.outputs.language }}" "${{ steps.extract.outputs.library_name }}" "${{ inputs.compiler }}"
77+
run: cd /tmp && chmod +x start-builder.sh && ./start-builder.sh "${{ secrets.CONAN_PASSWORD }}" "${{ steps.extract.outputs.language }}" "${{ steps.extract.outputs.library_name }}" "${{ inputs.compiler }}" "${{ inputs.branch || 'main' }}"
78+
79+
- name: Upload build failure artifacts
80+
if: failure()
81+
uses: actions/upload-artifact@v4
82+
with:
83+
name: build-failure-${{ inputs.compiler }}-${{ steps.extract.outputs.library_safe }}-${{ github.run_id }}
84+
path: |
85+
/tmp/*.cpp
86+
/tmp/*.ii
87+
/tmp/*.c
88+
/tmp/*.s
89+
/tmp/*.sh
90+
/tmp/ce-cefs-temp/staging/**/cemakelog*.txt
91+
/tmp/ce-cefs-temp/staging/**/cecmakelog.txt
92+
/tmp/ce-cefs-temp/staging/**/ceconfiglog.txt
93+
/tmp/ce-cefs-temp/staging/**/cemakeclean.txt
94+
/tmp/ce-cefs-temp/staging/**/ceinstall_*.txt
95+
if-no-files-found: warn
96+
retention-days: 14

.github/workflows/package-fxc.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Package FXC
2+
run-name: Package FXC compilers from the Windows SDK
3+
4+
on:
5+
workflow_dispatch:
6+
7+
jobs:
8+
package-fxc:
9+
runs-on: windows-latest
10+
steps:
11+
- uses: actions/checkout@v5
12+
- shell: pwsh
13+
run: .\msvc-install\fxc-install.ps1
14+
env:
15+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
16+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

.github/workflows/start_staging.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ jobs:
1818

1919
steps:
2020
- name: Update infra
21-
run: cd /home/ubuntu/infra && git pull
22-
- name: Set build number
23-
run: ce builds set_current ${{ github.event.inputs.buildnumber }} --branch ${{ github.event.inputs.branch }} --confirm
24-
- name: Start environment
25-
run: ce environment start
21+
run: cd /home/ubuntu/infra && git pull && make ce
22+
- name: Blue-green deploy to staging
23+
run: ce --env staging blue-green deploy --branch ${{ github.event.inputs.branch }} --skip-confirmation --no-notify ${{ github.event.inputs.buildnumber }}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,7 @@ node_modules
1818
/uv.lock
1919
/lambda/.build_site_packages
2020
*.egg-info
21+
22+
# Claude Code runtime/per-user state (committed config lives in .claude/agents, .claude/commands, etc.)
23+
.claude/scheduled_tasks.lock
24+
.claude/settings.local.json

.pre-commit-config.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ repos:
1313
- id: check-toml
1414
- id: detect-private-key
1515
- repo: https://github.com/astral-sh/ruff-pre-commit
16-
rev: v0.12.9
16+
rev: v0.15.15
1717
hooks:
1818
- id: ruff
1919
args: [ --fix, --preview ]
2020
- id: ruff-format
2121
args: [ --preview ]
2222
- repo: https://github.com/pre-commit/mirrors-mypy
23-
rev: v1.17.1
23+
rev: v2.1.0
2424
hooks:
2525
- id: mypy
2626
additional_dependencies:
@@ -35,8 +35,10 @@ repos:
3535
rev: 3.0.0
3636
hooks:
3737
- id: shellcheck
38+
# severity is CLI-only (not a valid .shellcheckrc directive); gate on errors.
39+
args: ["--severity=error"]
3840
- repo: https://github.com/antonbabenko/pre-commit-terraform
39-
rev: v1.100.0
41+
rev: v1.106.0
4042
hooks:
4143
- id: terraform_fmt
4244
- id: terraform_validate

.shellcheckrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
disable=SC2164 # cd and popd
22
disable=SC2043 # loop will only execute once
3-
severity=error

CLAUDE.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ When writing, especially PRs and commit messages:
2323
- Build events lambda package: `make events-lambda-package`
2424
- **NEVER USE THE SYSTEM PYTHON** - always use `uv` to invoke python or pytest or to run experiments with python syntax
2525

26+
## Documentation
27+
28+
This repository has extensive documentation in the `docs/` directory. Before making changes to a subsystem, read the relevant documentation first. Existing CLI commands, library configuration, and infrastructure patterns are already documented -- don't reinvent or guess at behavior that's written down.
29+
2630
## Important Workflow Requirements
2731

2832
- ALWAYS run pre-commit hooks before committing: `make pre-commit`
@@ -207,6 +211,16 @@ The CLI system (`bin/ce`) uses Click framework with a modular command structure:
207211
"""Subcommand description."""
208212
```
209213

214+
## Admin Instance
215+
216+
The admin instance runs fish as its default shell, so `ce` is not in its path. Use the full path when running commands remotely:
217+
218+
```bash
219+
bin/ce admin exec /home/ubuntu/infra/bin/ce conan restart
220+
```
221+
222+
After restarting the conan proxy, wait ~10 seconds before making requests to it -- it returns 502 while starting up.
223+
210224
## GitHub Workflow Integration
211225

212226
The `ce workflows` command group provides functionality to trigger GitHub Actions workflows:
@@ -602,7 +616,7 @@ Library YAML settings, build types, library types (`cshared`, `shared`, `static`
602616

603617
The `ce_install build-status` command group manages build failure records on the Conan proxy server. Failed builds are tracked so they are not re-attempted; these commands allow clearing that status.
604618

605-
- **`ce_install build-status list-failed`** - List failed builds (requires at least one of `--library` or `--compiler-version`)
619+
- **`ce_install build-status list-failed`** - List failed builds (requires at least one of `--library` or `--compiler-version`; optional `--version` to filter by library version)
606620
- **`ce_install build-status clear-for-library LIBRARY [--version VERSION]`** - Clear failures for a library
607621
- **`ce_install build-status clear-for-compiler COMPILER_VERSION`** - Clear failures for a compiler (e.g. `g141`, `clang1400`)
608622

0 commit comments

Comments
 (0)