fix(cerro-torre): make the full Ada container build compile end-to-end#42
Merged
Conversation
The stapeln#17 smoke canary surfaced that cerro-torre's full upstream
Ada build never compiles to completion. Root causes, all fixed here:
- alire.toml: the `proven` dependency was pinned to ../proven/bindings/ada,
a path that exists nowhere in the repo, so `alr build` aborted at
manifest load ("Pin path is not a valid directory"). `proven` is unused
(commented out in cerro_torre.gpr and every `with Proven.*`). Disabled
the dependency and removed the dead pin.
- alire.toml: gnatcoll/ada_toml/json were declared but never `with`-ed by
any source (code uses the in-tree CT_JSON). Resolving them pulled in
libgpr/xmlada, which fail to compile against the build toolchain.
Disabled until actually consumed.
- src: genuine semantic defects in the `complete` feature set that had
never compiled — `String_Access` ambiguity between GNAT.OS_Lib and
Ada.Strings.Unbounded (cerro_cli, cerro_export_oci, cerro_import_debian),
To_String applied to the Version record instead of Version.Upstream,
Bytes_To_Hex applied to an already-hex Unbounded_String, and an
unqualified aggregate in a Vectors.Append call.
- Containerfile: the alr release zip lays the binary out as bin/alr, so
the old `unzip -d /usr/local/bin` + `chmod /usr/local/bin/alr` failed;
install the located binary instead. Also COPY tests/ (a Source_Dir of
cerro_torre.gpr for every Feature_Set) and run `alr -n build` so the
toolchain is auto-provisioned non-interactively.
Verified by reproducing `alr build` on Ubuntu 24.04 (the container base):
the full build now succeeds and produces a working `ct` binary.
https://claude.ai/code/session_01744NnsooPgw5S6JK11fAaw
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Follow-up to the stapeln#17 maintenance pass. The non-blocking
container-stack-smokecanary (#38/#39) surfaced that cerro-torre'sfull upstream Ada build never compiles to completion — the issue
explicitly scoped out of #17. This PR fixes the real root causes so the
image builds end-to-end.
Root cause(s) & fix
Reproduced locally with
alr buildon Ubuntu 24.04 (the exactada-builderbase image), since the in-containerdocker buildisblocked here by environment network policy (see Blocker below).
provenpin → hard failure at manifest load.alire.tomlpinnedprovento../proven/bindings/ada, a path that exists nowhere inthe repo.
alr buildaborted immediately withPin path is not a valid directory.provenis entirely unused — thewith "proven"incerro_torre.gprand everywith Proven.*in thesources are commented out. Disabled the dependency and removed the dead
pin. (This is the specific "Ada/proven" failure the task described.)
Unused heavy crates → toolchain-incompatible builds.
gnatcoll/ada_toml/jsonwere declared inalire.tomlbutnever
with-ed by any source (the code uses the in-treeCT_JSONpackage). Resolving them dragged in
libgpr/xmlada, which fail tocompile against the build toolchain (
gpr-*.adb: "time_t" undefinedunder external GNAT 14;
NO_IMPLEMENTATION_EXTENSIONSviolations injson_adaunder Alire's GNAT 15). Disabled until actually consumed.Genuine pre-existing source defects in the
completefeature set(importer/exporter code that had never compiled):
String_Accessambiguity betweenGNAT.OS_Liband the unit-leveluse Ada.Strings.Unbounded(cerro_cli.adb,cerro_export_oci.adb,cerro_import_debian.adb) — now qualified asGNAT.OS_Lib.String_Access.To_String (M.Metadata.Version)applied to theVersionrecordinstead of
…Version.Upstream(the convention already used elsewherein the same file).
Bytes_To_Hex (M.Provenance.Upstream_Hash.Digest)applied to analready-hex
Unbounded_Stringrather than a rawSHA256_Digest—replaced with
To_String.Vectors.Appendcall — type-qualified asDependency_Reference'(…).Containerfile correctness:
bin/alr, so the oldunzip -d /usr/local/bin+chmod /usr/local/bin/alrwould fail(
No such file or directory). Now installs the located binary(layout-robust).
COPY tests/ tests/—testsis aSource_Dirofcerro_torre.gprfor every
Feature_Set(it holds thect_test_*mains), so theproject does not build without it.
alr -n buildso the toolchain is auto-provisioned without blockingon stdin in a non-TTY build.
Verification
alr buildin a clean context mirroring the Containerfile'sCOPYset(
alire.toml,cerro_torre.gpr,src/,tests/; no systemgnat, soAlire auto-selects+downloads
gnat_native/gprbuildexactly as thecontainer would) now succeeds end-to-end and produces a working
ct:Blocker (environment, not code)
The full in-container
docker buildcould not be demonstrated inthis environment due to network-policy constraints (not Containerfile
defects):
cgr.dev/chainguard/wolfi-base(runtime stage) →403 Forbidden.docker.io/library/ubuntu:24.04→ intermittent429unauthenticatedpull-rate limit.
curl https://github.com/...fails withself-signed certificate in certificate chain: the egress TLS-inspectingproxy's root CA is trusted on the host but not in the container image. Per
instructions this was reported rather than worked around (no
curl -k/CA injection).
The Ada/
provenroot cause itself is fully fixed and verified via thehost reproduction on the identical Ubuntu 24.04 base.
Test plan
container-stack-smokecanary buildscerro-torre/Containerfilewith docker + podman in CI (where the registry/proxy constraints
above do not apply).
ct --versionruns in the resulting image.https://claude.ai/code/session_01744NnsooPgw5S6JK11fAaw
Generated by Claude Code