Skip to content

fix: drop ring from TLS path; bump aarch64 wheel base to manylinux_2_28#277

Merged
bradhe merged 3 commits into
developfrom
feature/aws-lc-rs-tls
May 14, 2026
Merged

fix: drop ring from TLS path; bump aarch64 wheel base to manylinux_2_28#277
bradhe merged 3 commits into
developfrom
feature/aws-lc-rs-tls

Conversation

@socksy
Copy link
Copy Markdown
Contributor

@socksy socksy commented May 13, 2026

tower login fails inside python:3.11-slim-bookworm on aarch64. The handshake to api.tower.dev errors out. Same wheel works on Alpine and on x86_64.

Cause: rustls uses ring as its crypto provider (because reqwest/rustls-tls pulls it in), and ring's aarch64 asm gets miscompiled by manylinux2014's toolchain (CentOS 7, GCC 4.8) for glibc 2.36+.

Two changes, either one would fix it:

  1. Bump the aarch64 wheel base from manylinux2014 to manylinux_2_28 (AlmaLinux 8, GCC 8+).
  2. Replace ring with aws-lc-rs as the rustls provider — swap every reqwest/rustls-tls* feature for the -no-provider variant and install aws_lc_rs::default_provider() at startup.

Also patches scripts/rust-client-templates/Cargo.mustache so the next regen of tower-api keeps the aws-lc-rs feature, and removes the now-dead CFLAGS_aarch64_unknown_linux_gnu ring workaround from the workflow.

Repro

Before, on an arm64 host:

$ docker run --rm -it --platform linux/arm64 python:3.11-slim-bookworm bash
# pip install tower==0.3.61
# tower login
... Failed to create device login ticket: error sending request for url (https://api.tower.dev/v1/login/device)

After, wheel built from this branch in the same container:

# tower login
... Please open the following URL in your browser:
https://app.tower.dev/login/device?user_code=...

socksy added 2 commits May 13, 2026 11:59
The aarch64 linux-cross job built wheels in the CentOS 7 / GCC 4.8
toolchain that ships with manylinux2014. Switching to manylinux_2_28
(AlmaLinux 8, GCC 8+) gives the build a newer assembler, which avoids
a class of miscompilations in crates that ship hand-written aarch64
asm.
reqwest's rustls-tls feature implicitly enables rustls/ring, which
pulls ring v0.17 into the TLS path. ring's aarch64 build produces
TLS signature-verify failures on some glibc builds of our wheels.

Swap every reqwest TLS feature to the *-no-provider variant and
install aws-lc-rs as the process-wide default CryptoProvider at CLI
startup. The install is also called at the tower-uv reqwest entry
point so its standalone unit test (which bypasses App::new) has a
provider installed before the first TLS handshake.

After this change, `cargo tree -i ring` is empty.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 13, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 32c77e7a-7b33-41b5-9a94-a98855616f50

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/aws-lc-rs-tls

Comment @coderabbitai help to get the list of available commands and usage tips.

scripts/rust-client-templates/Cargo.mustache hardcodes `rustls-tls` in
the generated reqwest dep. Patch the template so the next
generate-rust-api-client.sh run preserves the aws-lc-rs feature
choice instead of reverting tower-api's Cargo.toml.

The CFLAGS_aarch64_unknown_linux_gnu workaround in build-binaries.yml
existed only to coax ring's build script into detecting ARMv8. With
ring gone from the dep tree, the workaround is dead.
@bradhe bradhe merged commit df1a41b into develop May 14, 2026
52 of 56 checks passed
@bradhe bradhe deleted the feature/aws-lc-rs-tls branch May 14, 2026 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants