build: bump oqs to 0.11.0 and patch oqs-sys to bindgen 0.72 so the binding builds on rust:1.98-alpine - #24
Merged
Merged
Conversation
…nding builds on rust:1.98-alpine The relay's rust:1.98-alpine base (Alpine 3.24, libclang 22) fails to compile the crypto binding: bindgen 0.71 emits the forward-declared `OQS_SIG` (typedef'd in sig_stfl.h before its definition in sig.h) as an opaque struct under libclang 22, so `oqs` hits E0609 "no field alg_version on type &OQS_SIG". Reproduced with a two-line header inside the image: bindgen 0.71.1 + libclang 22 -> opaque, bindgen 0.71.1 + libclang 21 -> full struct, bindgen 0.72.1 + libclang 22 -> full struct. oqs-sys 0.11.0 on crates.io still requires bindgen 0.71. Upstream bumped it to 0.72 in liboqs-rust#289 (commit 4ca07ba) without a release; that commit is the published 0.11.0 tree plus the one-line bump, with the same liboqs 0.13.0 submodule, so pin it via [patch.crates-io]. The `musl-node-binding` CI job moves to the same rust:1.98-alpine digest the relay will ship. Algorithm identifiers used by paramant-core (ML-DSA-65, ML-KEM-768, SPHINCS+-SHA2-128f-simple, Falcon-512) are identical in liboqs 0.12.0 and 0.13.0. `cargo test --locked --workspace` passes on glibc, and the ML-DSA-65 / ML-KEM-768 KAT suites pass inside rust:1.98-alpine against the musl build of paramant-core-node. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XJk2nCLCLmi3F71qkCUn7N
Apolloccrypt
force-pushed
the
chore/oqs-0.11
branch
from
September 2, 2026 13:48
deaba5f to
b90b3c5
Compare
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.
Why
paramant-relay's dependabot PR Apolloccrypt/paramant-relay#313 (rust 1.95-alpine -> 1.98-alpine) fails to build the crypto binding with
error[E0609]: no field alg_version on type &OQS_SIG. Pinning rust at 1.95 was the stopgap; this PR fixes the actual cause so the relay can build on a current toolchain.Root cause (measured inside
rust:1.98-alpine@sha256:a10e64dd..., Alpine 3.24, clang 22.1.3)liboqs's
sig_stfl.hforward-declarestypedef struct OQS_SIG OQS_SIG;beforesig.hdefines it. bindgen 0.71 resolves that typedef to the incomplete declaration under libclang 22 and emitsOQS_SIGas an opaque{ _address: u8 }, so every field access inoqsfails. Two-line reproduction (typedef struct Foo Foo; typedef struct Foo { int a; const char *b; } Foo;):struct Foo_address)a,ba,bThe rustc version is irrelevant:
rust-toolchain.tomlpins 1.95.0, and the failure reproduces with that toolchain inside the 1.98 image.Change
oqs0.10.1 -> 0.11.0 (oqs-sys0.11.0, vendored liboqs 0.12.0 -> 0.13.0). API changes inoqs0.11 are additive (keypair_derand, UOV); no source changes in paramant-core.oqs-sys0.11.0 on crates.io still requires bindgen0.71. Upstream bumped it to0.72in build(deps): update bindgen requirement from 0.71 to 0.72 open-quantum-safe/liboqs-rust#289 (commit4ca07ba) but has not released a new oqs-sys.[patch.crates-io]pins that commit: it is the published 0.11.0 tree plus that one-line bump (verified:Cargo.toml.origandbuild.rsof the crates.io tarball are byte-identical to the parent commita67875e;git diff a67875e 4ca07ba -- oqs-sysis the singlebindgenline; liboqs submodule is tag0.13.0/21b3f8bin both). Cargo.lock now resolves bindgen 0.72.1.musl-node-bindingCI job: base image moved to the samerust:1.98-alpinedigest the relay Dockerfile will ship, so this job goes red if the base ever breaks the binding again.deny.toml:allow-gitfor the liboqs-rust repo, since[sources] unknown-git = "deny"would otherwise fail theaudit * denyjob on the patched source.cargo deny checkpasses locally (advisories, bans, licenses, sources).Byte-compatibility
OQS_SIG_alg_ml_dsa_65,OQS_SIG_alg_ml_kem_768,OQS_SIG_alg_sphincs_sha2_128f_simple,OQS_SIG_alg_falcon_512exist unchanged in liboqs 0.12.0 and 0.13.0 headers.tests/kat/ml-dsa-65.json(50 @noble-anchored vectors) andml-kem-768.jsonverify unchanged.node --test crypto/*.test.js) passes against the binding built from this branch: 144 pass, 0 fail.Tests
cargo test --locked --workspace(glibc, Fedora, libclang 21): all suites pass, 0 failed.rust:1.98-alpine(musl):cargo build --locked --release -p paramant-core-nodesucceeds, generatedsig_bindings.rscontains theOQS_SIGfields, andcargo test --locked --release -p paramant-core --test kat_ml_dsa_65 --test kat_ml_kem_768 --test proptest_sigpasses (2 + 2 + 1).Follow-up
PARAMANT_CORE_COMMIT(Dockerfile) andPARAMANT_CORE_SHA(test.yml) to this commit together with the rust 1.98-alpine bump; that PR supersedes #313.[patch.crates-io]block once an oqs-sys > 0.11.0 ships with bindgen >= 0.72.🤖 Generated with Claude Code
https://claude.ai/code/session_01XJk2nCLCLmi3F71qkCUn7N