One-click build-and-deploy for trusted compiler authors - #67
Conversation
Compilers can opt in via an `install: <ce_install pattern>` field in compilers.yaml (clang_hana and clang_barry to start). Their generated workflows gain an on-by-default "Install to Compiler Explorer after a successful build" dispatch input and an install job, so authors like Hana no longer need to build, wait, and then ask an admin (or remember a second workflow) to deploy. The install job only fires for manual dispatches — scheduled builds stay with the admin node's nightly install — and only when the build reports a fresh OK: the daily-build composite action now exposes its status output, so SKIPPED (unchanged source) or failed builds never (re-)install. install-compilers.yml becomes a reusable workflow (workflow_call) that the generated jobs invoke, while keeping its manual dispatch trigger for ad-hoc installs. It now always uses --enable nightly and --force, matching how it was actually used; note scripts passing the removed enable_nightly/force inputs will be rejected by GitHub. The pattern reaches the script via an env var with globbing disabled, so input can't smuggle shell syntax. Also: drop an accidental duplicate clang_hana entry (the generator just wrote the same file twice), and update README/CLAUDE.md for the new flow. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR adds an opt-in “one-click” build-and-deploy path for trusted compiler authors by extending the compiler generator to optionally append an install phase after a successful manual dispatch build, using a shared reusable install workflow.
Changes:
- Added an
install:field tocompilers.yamland updatedmake_builds.pyto generate dispatch inputs + aninstalljob gated on manual dispatch + freshOKbuild status. - Converted
install-compilers.ymlinto a reusable workflow (workflow_call) and simplified it to always perform the nightly forced install. - Updated documentation (README + CLAUDE.md) and removed a duplicate
clang_hanaentry.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents the new “build + optional install” author flow and updates the gh example. |
| make_builds.py | Generates dispatch input/output wiring and conditional install job for opted-in compilers. |
| compilers.yaml | Adds install: patterns for clang_hana and clang_barry and removes duplicate entry. |
| CLAUDE.md | Documents the new install: field and reusable install workflow. |
| .github/workflows/install-compilers.yml | Makes install workflow reusable (workflow_call) and always installs with nightly+force. |
| .github/workflows/build-daily-clang_hana.yml | Generated: adds install input, propagates build status output, and adds install job. |
| .github/workflows/build-daily-clang_barry.yml | Generated: adds install input, propagates build status output, and adds install job. |
| .github/actions/daily-build/action.yml | Exposes status as a composite action output for downstream job gating. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| run: | | ||
| ENABLE_FLAG="" | ||
| if [[ "${{ inputs.enable_nightly }}" == "true" ]]; then | ||
| ENABLE_FLAG="--enable nightly" | ||
| fi | ||
| FORCE_FLAG="" | ||
| if [[ "${{ inputs.force }}" == "true" ]]; then | ||
| FORCE_FLAG="--force" | ||
| fi | ||
| sudo bin/ce_install --check-user nobody $ENABLE_FLAG install $FORCE_FLAG ${{ inputs.compilers }} | ||
| set -f | ||
| sudo bin/ce_install --check-user nobody --enable nightly install --force $COMPILERS |
There was a problem hiding this comment.
Declining this one: it pattern-matches "unquoted expansion = injection" without asking what the injected thing could do that the actor can't already do.
The env-var + set -f handling is about shell injection — the input can't execute commands on the runner. Passing extra flags to ce_install is a far weaker capability, and one dispatchers legitimately have: everyone who can dispatch this workflow has write access (so could edit the workflow itself), and "arbitrary ce_install" is an accepted endpoint for this group — infra's sibling install.yml even treats flag-in-the-input as a feature, and it's been used that way in practice.
The suggested -- terminator also degrades the failure mode: today --force gcc in the box does what the author obviously meant; with -- it becomes a filter word matching nothing, i.e. a quiet no-op. The workflow_call path is unaffected either way — its patterns are literals from compilers.yaml, reviewed at PR time.
Reinstate enable_nightly and force on install-compilers.yml (for both dispatch and workflow_call), now defaulting off: a bare pattern like "gcc" means something very different with nightly enabled, so that must be a deliberate choice. The build-triggered install passes both explicitly — reinstalling a freshly built nightly is exactly the forced case. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Lets trusted compiler authors (Hana, Barry) build and deploy their compilers with a single "Run workflow" click, instead of build → wait → ask an admin to
ce_installby hand.How it works
compilers.yamlentries can opt in withinstall: <ce_install pattern>(added forclang_hanaandclang_barry; it's one field to extend to others).installjob that calls the shared install workflow with the baked-in pattern — nothing for the author to type or get wrong.OK: thedaily-buildcomposite action now declares itsstatusoutput, soSKIPPED(source unchanged) or failed builds never (re-)install. A stale-repo dispatch skips the build, and with it the install.install-compilers.ymlbecomes a reusable workflow (workflow_call) invoked by the generated jobs, keeping its manual dispatch with theenable_nightly/forceoptions intact — both now defaulting off, since a bare pattern likegccmeans something very different with nightly enabled. The build-triggered install passesenable_nightly: true, force: trueexplicitly (reinstalling a freshly built nightly is exactly the forced case). The pattern reaches the script via env vars with globbing disabled, so the input can't smuggle shell syntax.Also
clang_hanaentry (the generator wrote the same file twice).Behaviour note: the only manual-dispatch change is
enable_nightlydefaulting off (previously on) — installing a nightly by hand now needs the tickbox. An audit (org-wide code search + all local checkouts) found no script dispatching this workflow; the only reference was the READMEghexample, updated here.Validation
Only the two opted-in generated workflows changed — all other
build-daily-*.ymlregenerate byte-identically. Pre-commit suite passes (yaml check, regeneration up-to-date, tests). An independent review verified the event/skip semantics against documented GitHub Actions behaviour:inputsis empty onschedule, the implicitsuccess()check skipsinstallwhendaily-buildfails or is skipped, and job-leveluses: ./…runs the called workflow at the caller's commit. Suggested end-to-end test:gh workflow run build-daily-clang_hana.ymland watch the build → install chain deployhana-clang-trunk.🤖 Generated with Claude Code