0
0
mirror of https://github.com/signalapp/libsignal.git synced 2024-09-20 03:52:17 +02:00
Commit Graph

22 Commits

Author SHA1 Message Date
Jordan Rose
f1fb1302b7 swift: Add a Benchmarks package for local profiling 2024-03-12 17:03:45 -07:00
Alex Konradi
8959e64ed1
Build TESTING_ functions for Android test
Run tests that call native TESTING_ functions on Android. This requires 
building a separate version of libsignal_jni.so with the testing functions 
included. The test code is still omitted from the published artifacts.
2024-02-15 16:53:05 -05:00
Jordan Rose
88a25e889e Collect acknowledgments for libsignal's Cargo dependencies 2023-12-11 16:39:33 -08:00
Jordan Rose
98fd87ee9b Android: Add very basic Curve25519 benchmarks 2022-12-02 17:14:06 -08:00
Jordan Rose
300b57fa9e Java: Add a ProGuard file to preserve our JNI bindings 2022-03-29 17:08:48 -07:00
Jordan Rose
6f681780cb gitignore: Fix new Java build directory paths 2022-03-11 13:31:13 -08:00
Jordan Rose
43054913ed Java: Always include Mac and Windows support when publishing
Rather than have a separate "testable" artifact, always include Mac
and Windows versions of libsignal_jni.so when publishing
signal-client-java *and* libsignal_server (though not when just
building locally).

Also, finally attach these tasks to the correct step (processResources
rather than compileJava).
2022-03-10 13:36:26 -08:00
Jordan Rose
7931bf0812 java: Build a separate libsignal-server artifact
Reorganize the Gradle build with three targets:

- signal-client-java (client/)
- signal-client-android (android/)
- libsignal-server (server/)

plus an additional shared/ directory for sources shared between
client/ and server/.

This maintains the distinction between signal-client-java (the Java
parts, plus a Linux libsignal_jni.so for running tests outside of the
Android emulator) and signal-client-android (contains the Android JNI
libraries, plus any Android-specific code, which for now is just
AndroidSignalProtocolLogger, which the app doesn't even use).

The new libsignal-server is built very similarly to
signal-client-java, but only contains the Java sources relevant for
the server...plus the base org.whispersystems.libsignal classes from
the original libsignal-protocol-java, because some of them are
referenced directly in our generated Native.java. (We can improve on
this in the future.) The "testable" artifact that includes macOS and
Windows versions of libsignal_jni.so is now only built for
libsignal-server, not signal-client-java; our Android development
happens on Linux, but server development happens on multiple
platforms.

Tests were recently reorganized into a top-level tests/ directory, but
now there's been another reorganization:

- client/src/test/ - tests to run on any clients
- android/src/androidTest/ - tests to run only on Android devices /
  emulators (currently none)
- server/src/test/ - tests to run specifically for the server
  (currently none)
- shared/test/ - does not exist to avoid running the same tests twice

There are no tests to run "only not on Android devices", and it's
currently assumed that all server functionality is tested by the
client tests. The Android device tests run all the client tests as
well (by direct path reference). This may not be the "best" Gradle
layout, but it's at least straightforward to read the Gradle files.

For now there's still only one native library built for both
signal-client-java and libsignal-server, but that could change in the
future.
2022-03-10 09:14:55 -08:00
Jordan Rose
0b9dffdd88 Java: Update to Gradle 7.4, and several other build system updates
- Switch to the modern maven-publish plugin.

- Bump the Android target SDK version to 30 to match the app.
  (The minimum is still 19.)

- Bump the Java source compatibility version to 1.8.

- Bump the Android command line tools used in Docker to match the app.

- Bump the JDK used in Docker to OpenJDK 11, matching the app.

- Switch to the androidx testing libraries for emulator testing.

- Drop unused trove4j Gradle plugin.

- Lots of cleanup and refactoring.
2022-03-07 16:51:19 -08:00
Jordan Rose
3fd42d7a60 Move package.json inside the node/ directory
Previously all APIs were available through the top-level index.ts, but
now the zkgroup APIs are in their own module. To access that in the
old packaging required writing

    import * from '@signalapp/signal-client/node/dist/zkgroup'

This commit moves the package root into the node/ directory to
eliminate the 'node/' component, then adds a top-level, precompiled
zkgroup.js/.d.ts so that clients can use

    import * from '@signalapp/signal-client/zkgroup'
2021-11-08 16:40:50 -08:00
Jordan Rose
c65df8524d java: Build a "testable" signal-client-java as well
This is like signal-client-java, but also contains dylibs for Mac and
Windows for testing purposes. Gradle will automatically fetch these
artifacts from the corresponding GitHub release.
2021-11-01 16:54:46 -07:00
Ehren Kret
3ed0ff84a3 Increase local JNI frame to 8192 for all JNI calls
This is overkill for most calls but multi-recipient messages require
potentially a lot of objects. The codegen is in the way of making a
surgical change at the moment so hitting it with a broad fix for
now. May return to add a conditional to the macro definition later.
2021-09-09 12:25:37 -05:00
Nora Trapp
720d796f76 Add support for M1 and Catalyst architectures via cocoapods 2021-06-10 11:34:10 -07:00
Jordan Rose
2d059643e1 Node: allow Rust async blocks to wait on JavaScript futures
Neon provides a way to expose *synchronous* JavaScript functions from
Rust. This means that if Rust wants to wait for the result of a
JavaScript promise, it can at best return a callback to continue its
work when the promise resolves. This does not naturally compose with
Rust's `async`, which works in terms of Futures.

This commit adds a new crate, signal-neon-futures, that provides
functionality for (1) wrapping JavaScript futures so they can be
awaited on in Rust, and (2) producing a JavaScript promise that wraps
a Rust future. It does so by synchronously resuming execution of the
Rust future whenever an awaited JavaScript promise is resolved.
2021-02-04 10:22:58 -08:00
Jordan Rose
b4a34f48ad node: Support for electron-rebuild
This allows the Desktop client to add this module as a dependency and
have its existing build process take care of building it against the
correct version of Electron. (Within the repo, `yarn build` calling
`electron-build-env` is still necessary; a plain `electron-rebuild`
seems to get confused.)
2020-11-11 11:06:05 -08:00
Jordan Rose
be56945a70 Add a Yarn-based Node package for signal-client
There's very little here yet, just enough to test something.
2020-11-10 11:00:54 -08:00
Jack Lloyd
0fbd07ca81 Modify libsignal-protocol-java to use Rust via JNI
Removes device consistency code (unused)
Removes decryption callbacks (unused)
2020-11-05 17:59:09 -05:00
Jordan Rose
dd2bef9c5e Track Cargo.lock for more consistent builds
Normally library repositories wouldn't commit their Cargo.lock, but
these libraries are built into staticlibs or cdylibs and thus escape
the crates.io ecosystem for versioning. In particular, recording exact
dependencies keeps us from having multiple versions of the same crate
unexpectedly.
2020-11-05 10:41:57 -08:00
Jack Lloyd
cddd0d86ed Ignore .orig and .rej files from patch 2020-11-04 16:48:50 -05:00
Jordan Rose
79441611a7 gitignore Swift's build directory too 2020-10-16 14:28:15 -07:00
Jack Lloyd
b6fcd32ae3 Ignore editor backups 2020-07-30 13:49:20 -04:00
Ehren Kret
3bd6d58de2 Create initial commit of signal protocol rust
This supports XEd25519 and has some protobuf compilation going on but
not much else yet at this point.
2020-04-20 21:24:31 -07:00