Skip to content

fix: Default cross builds to the ffi feature#181

Merged
palango merged 1 commit into
mainfrom
palango/cross-build-features
Jun 12, 2026
Merged

fix: Default cross builds to the ffi feature#181
palango merged 1 commit into
mainfrom
palango/cross-build-features

Conversation

@palango

@palango palango commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

What

make android passed an empty FEATURES through to cross/Makefile, which builds with --no-default-features — so no cfg_select! branch in crates/threshold-bls-ffi/src/lib.rs was compiled in and all four Android .so files exported no symbols. make ios had the same problem via the locally-run cross build, producing an empty .a. Any consumer linking the C ABI from threshold.h (e.g. the JNA-based React Native bindings) would fail at runtime with UnsatisfiedLinkError.

This defaults FEATURES ?= ffi in both Makefiles. The root Makefile needs its own default because the android target passes -e FEATURES="$(FEATURES)" into Docker, and an empty-but-set environment variable would defeat a ?= default downstream. Overrides via make android FEATURES=... still work.

Verification

  • Dry-runs show --features ffi reaching cargo on all three paths: the root android target, the env-var route Docker uses, and local cross invocation (make ios)
  • A host build with the exact cargo flags exports all 25 threshold.h symbols (blind, combine, keygen, partial_sign, …); the featureless build exports zero
  • The full Docker+NDK cross-compilation itself is unchanged — only the feature flag reaching it

make android passed an empty FEATURES through to the cross Makefile,
which builds with --no-default-features, so all Android .so files (and
iOS .a via make ios) were produced without any cfg_select! branch and
exported no symbols. Default FEATURES to ffi in both Makefiles so the
C ABI from threshold.h is actually compiled in; overrides via
make android FEATURES=... still work.
@palango palango merged commit 0025630 into main Jun 12, 2026
11 checks passed
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.

1 participant