Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python bindings? #550

Closed
chadfurman opened this issue Jan 4, 2024 · 5 comments
Closed

Python bindings? #550

chadfurman opened this issue Jan 4, 2024 · 5 comments

Comments

@chadfurman
Copy link

Did a quick search and couldn't find anything recent or intuitively usable. I see some issues with desktop-based compilation, as well (specifically someone trying to use it for a MacOS app). I also note your desktop clients are (were?) using Electron.

I'm guessing it's quite a large lift for python bindings, even with something like PyO3 hidden behind compiler flags? I saw an attempt at https://github.com/freedomofpress/signal-protocol but as of December 2023 this is now deprecated (and the last commit was 3 years ago, regardless).

@jrose-signal
Copy link
Contributor

Yeah, I'm afraid that'd be a large additional maintenance burden for us, since none of Signal's official apps use Python.

One thing that's possible, though I can't quite recommend it, would be to go through the C FFI layer used by the Swift bindings. This layer is even more subject to change than the Rust or Swift APIs since we consider it an implementation detail, but it wouldn't require modifying any Rust code or even building it yourself to get started, since we attach binary artifacts of libsignal-ffi to the GitHub releases (currently, this is not a promise).

I'm going to close this to indicate we (Signal) have no immediate plans to pursue Python bindings. Feel free to discuss further in the Development section of https://community.signalusers.org, though!

@jrose-signal jrose-signal closed this as not planned Won't fix, can't repro, duplicate, stale Jan 4, 2024
@usergoodvery
Copy link

Hi
Are there build instructions for building the C FFI layer (without needing to build swift itself)?

@jrose-signal
Copy link
Contributor

The swift/build_ffi.sh script doesn't actually depend on Swift, so you can try that. If you have further questions, you can ask them on the community forums.

@usergoodvery
Copy link

Thanks I have previously tried that, but couldn't get past the "Unrecognized option: 'pretty'" and couldn't run cargo rustc --pretty=expanded errors. I was targeting one of your older APIs V22.0...

@jrose-signal
Copy link
Contributor

Things are only guaranteed to work with the pinned nightly toolchain in any particular release. So if you're using v0.22.0, you'll need to either downgrade your rustc appropriately, or backport changes from later versions of the build script. That's on you, though, we don't provide support for any of this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants