Skip to content

Conversation

@KyrylR
Copy link
Contributor

@KyrylR KyrylR commented Jan 6, 2026

Fixes:

  • macOS (x86_64 and arm64): uint_fast16_t is u16, not usize
  • Android (Bionic libc): uint_fast16_t is u32, not u16
  • jet FFI calls failing on Intel Mac and Android

Because of the previous setup I have encountered failures the one below:
Blockstream/gdk#221

@KyrylR KyrylR marked this pull request as ready for review January 6, 2026 14:36
@KyrylR
Copy link
Contributor Author

KyrylR commented Jan 6, 2026

I verified this fix on the Intel Mac only; for Android, it will require some time

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I am not sure about the

#[cfg(not(target_arch = "wasm32"))]
pub type c_uint_fast64_t = usize;

Because of: https://en.cppreference.com/w/c/types/integer.html

image

As far as I understand on 32-bit platforms like armv7 because we are using the usize this thing could fail

@apoelstra
Copy link
Collaborator

apoelstra commented Jan 6, 2026

I verified this fix on the Intel Mac only; for Android, it will require some time

I'll take it anyway. This is definitely an improvement, in that it at least separates out the arches a bit to make it easy to edit individual ones.

@apoelstra
Copy link
Collaborator

If this approach doesn't work, another thing we can do is just patch the C code to #define these types as fixed-size ones which have Rust equivalents. We don't need the speed benefit that the Elements integration needs.

@KyrylR
Copy link
Contributor Author

KyrylR commented Jan 6, 2026

Verified via Docker for the Android build

apoelstra
apoelstra previously approved these changes Jan 6, 2026
Copy link
Collaborator

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 7a77539; successfully ran local tests

@apoelstra
Copy link
Collaborator

Tagged and published.

apoelstra added a commit that referenced this pull request Jan 6, 2026
…nd Android

7a77539 Bump simplicity-sys version to 0.6.1 (Kyryl R)
4126e2e fix ffi for platform-specific uint_fast types for macOS and Android (Kyryl R)

Pull request description:

  Fixes: 
  
  - macOS (x86_64 and arm64): uint_fast16_t is u16, not usize
  - Android (Bionic libc): uint_fast16_t is u32, not u16
  - jet FFI calls failing on Intel Mac and Android
  
  Because of the previous setup I have encountered failures the one below:
  Blockstream/gdk#221


ACKs for top commit:
  apoelstra:
    ACK 7a77539; successfully ran local tests


Tree-SHA512: e37f218916f086af480baf341756c94f27fc59700e38fe99595743bbae1f5d7dd2fc4b8f9734a189f8249ad857666dcd608abc981a1df9d47f5924e94a3bf01a
@KyrylR
Copy link
Contributor Author

KyrylR commented Jan 6, 2026

Should I bump simplicity-lang version now?

UPD: bumped, let me know if there is a need to revert or update something

@KyrylR
Copy link
Contributor Author

KyrylR commented Jan 6, 2026

Merged in: 7f42b53

@KyrylR KyrylR closed this Jan 6, 2026
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