From c9b15d52f09e05273912f8e223adcb7ef245ae84 Mon Sep 17 00:00:00 2001 From: Javier Tia Date: Tue, 15 Sep 2026 15:39:00 -0600 Subject: [PATCH] Stop asserting a mechanism for the ring-only rule The guard justified forbidding aws-lc-rs by the libc the agent cross-compiles against. No build has ever targeted that libc: every triple built is a glibc one, and no published feed carries a musl or 32-bit ARM target to build against. The obvious replacement is also false, which is why this records what was measured rather than a better-sounding reason. Building this crate for x86_64-avocado-linux-gnu without the cross toolchain on PATH fails inside ring's own build.rs with ToolNotFound for x86_64-avocado-linux-gcc, so ring carries C and assembly and needs a cross C compiler like any other. "ring is pure Rust, aws-lc-rs is not" does not distinguish them. A wrong reason is worse than none on a constraint like this. The next person to widen the target set checks whether the stated condition still holds, finds it never applied, and reasonably concludes the rule is stale - which is how a real constraint gets dropped. Recording the rule as inherited convention, naming both refuted explanations and the measurement that would settle it, leaves that reader with something they can act on instead. Only the comment changes. Both cargo tree queries and the three-way exit contract are untouched, so a tree that passed before passes now. Signed-off-by: Javier Tia --- agent/scripts/check-provider.sh | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/agent/scripts/check-provider.sh b/agent/scripts/check-provider.sh index 0f7ee05..d19d9af 100755 --- a/agent/scripts/check-provider.sh +++ b/agent/scripts/check-provider.sh @@ -3,11 +3,33 @@ # check-provider.sh - enforce the ring-only rustls crypto provider for the # Container Dev Mode device agent. # -# aws-lc-rs is forbidden in this crate (assumption A9: the agent cross-compiles -# against the musl SDK, which clears only the `ring` stack - the same rule -# avocado-conn enforces). This guard fails the build if aws-lc-rs ever resolves -# into the dependency tree, and also asserts that `ring` IS present so a guard -# that cannot see the tree at all can never masquerade as a pass. +# aws-lc-rs is forbidden in this crate; ring is the permitted provider. The rule +# is inherited from avocado-conn, which enforces the same one. +# +# The reason is NOT established here, and two plausible-sounding ones have +# already turned out to be wrong, so this comment states only what was measured. +# +# - "the agent cross-compiles against the musl SDK, which clears only ring." +# No build has targeted musl. Every triple built so far is a glibc one +# (x86_64-avocado-linux-gnu), and no published feed carries a 32-bit ARM or +# musl target to build against. +# - "ring is pure Rust, so unlike aws-lc-rs it needs no C toolchain." +# False. Measured 2026-09-15: building this crate for +# x86_64-avocado-linux-gnu without the cross toolchain on PATH fails inside +# ring's own build.rs with +# `ToolNotFound: failed to find tool "x86_64-avocado-linux-gcc"`, then +# `error: failed to run custom build command for ring v0.17.14`. ring +# carries C and assembly and needs a cross C compiler like any other. +# +# What would settle it is a measurement nobody has taken: build this crate for +# each target with aws-lc-rs substituted for ring and record which targets fail +# and how. Until then, treat the constraint as inherited convention that holds +# in practice, not as a conclusion with a mechanism behind it. Do not write a +# third mechanism into this comment without that measurement. +# +# This guard fails the build if aws-lc-rs ever resolves into the dependency +# tree, and also asserts that `ring` IS present so a guard that cannot see the +# tree at all can never masquerade as a pass. # # Exit contract (three-way, deliberately NOT a bare `! cargo tree`): # 0 - clean ring-only tree (aws-lc-rs absent, ring present)