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

159 Commits

Author SHA1 Message Date
Jordan Rose
9d774c4d59 CocoaPods-related infrastucture improvements
- Skip building for Catalyst in pull request testing, but make up for
  it in the "Slow Tests".

- Update the README now that the Arm Mac simulator is a Tier 2 Rust
  target.

- Remove workaround for one-time incompatibility with the Arm Mac
  simulator.
2022-07-29 10:47:45 -07:00
Jordan Rose
f456227f17 Java: drop cargo-ndk for building for Android
We can provide the necessary information in environment variables and
save a host dependency.
2022-07-25 17:11:36 -07:00
Jordan Rose
036b85db26 Update 'boring' to build more cleanly for Android 2022-07-25 16:29:40 -07:00
Jordan Rose
c8a334f511 GitHub: Add a "slow tests" CI that runs nightly
(but only if there have been any changes)

For now this is just exercising the Docker build, but I think we
should put some of the CocoaPods testing in here too, if not more of
the regular pull request testing.
2022-07-25 14:57:13 -07:00
Chris Eager
8035a70509
[feature] CDS2 attestation
Implements (a subset of) Intel's DCAP attestation,
making heavy use of 'boring' for X509 and ECDSA.
Cds2Client is now ready for use!

Co-authored-by: Jordan Rose <jrose@signal.org>
Co-authored-by: Ravi Khadiwala <ravi@signal.org>
2022-07-22 12:23:57 -07:00
Jordan Rose
018b056b08 CI: set RUST_BACKTRACE=1 for more information on rare panics 2022-07-19 16:10:54 -07:00
Jordan Rose
2abfd24e11 Support cross-compilation for BoringSSL on Linux and Windows
Update to a revision of BoringSSL that supports cross-compilation to
AArch64 for both Linux and Windows (from an x86_64 host of the same
OS), and provide the necessary environment variables for the Linux
cross-build.
2022-06-30 10:59:29 -07:00
Jordan Rose
2ccfe4eb72 GitHub: Remove "ref" field from Publish to NPM action
In the past manually-run GitHub Actions could only be run from a
branch, so specifying a tag to build had to be done explicitly. That's
no longer true, so we can remove that field.
2022-06-28 12:53:23 -07:00
Jordan Rose
15c09ad419 GitHub: Improve Rust CI
- Combine stable and nightly job definitions in the workflow file
- Build bins along with benches
- Use --all-features for tests and bins and Clippy, to make sure the
  maximum amount of code is tested. (If we ever have code omitted when
  a feature is turned on, we may want to add more test configuration.)
2022-06-24 10:56:28 -07:00
Jordan Rose
366b030841 Re-apply "device transfer: replace picky with boring"
This reverts commit 09c043c54a.
2022-06-22 16:33:21 -07:00
Jordan Rose
09c043c54a Revert "device transfer: replace picky with boring"
We need to work out more kinks cross-compiling boring-sys, so revert
this for now. (But keep the fix to use the correct Android NDK.)
2022-06-22 15:56:21 -07:00
Jordan Rose
36795d019c GitHub: Update publishing workflows for BoringSSL dependency
We need to install nasm on Windows.
2022-06-21 16:17:43 -07:00
Chris Eager
2b0b5119f2
device transfer: replace picky with boring
Upcoming work in `attest` requires additional X509 support, and swapping these libraries 
is a negligible impact on binary size. This uses a fork of `cloudflare/boring`, as
we have some additions that haven’t yet been contributed upstream.
2022-06-16 13:14:17 -07:00
Jordan Rose
41e0a269a7 Node: Test with plain 'mocha' instead of 'electron-mocha'
...which drops our dependency on Electron altogether. We originally
tested with electron-mocha to more closely resemble the Desktop app,
but libsignal-client doesn't actually use anything Electron-specific,
and because it uses N-API we don't have to sync up versions exactly
(and indeed we haven't been updating the Electron in this repo as
often as the Desktop app has taken new Electrons).

Two benefits of this: you can now run the tests on headless systems
(see the change to the CI script), and `yarn install` has less to
download.
2022-04-12 12:50:53 -07:00
Jordan Rose
66c6da4ce1 GitHub: Don't build JNI artifacts in the private repo
We only use them in the public repo; no sense wasting time and space.
2022-04-06 11:50:07 -07:00
Jordan Rose
29998598e3 GitHub: Pin cbindgen version rather than using what's installed 2022-04-04 12:25:33 -07:00
Jordan Rose
93bfcea1ce Build the JNI component of libsignal-server for M1 Macs too 2022-04-04 12:25:33 -07:00
Jordan Rose
0542686e70 Update artifact/package/module names across all three app languages
- Java: org.whispersystems:signal-client-java ->
    org.signal:libsignal-client
- Java: org.whispersystems:signal-client-android ->
    org.signal:libsignal-android
- Java: org.whispersystems:libsignal-server ->
    org.signal:libsignal-server
- Swift: SignalClient -> LibSignalClient
- NPM: @signalapp/signal-client -> @signalapp/libsignal-client
- Repository: github.com/signalapp/libsignal-client ->
    github.com/signalapp/libsignal
2022-03-23 10:49:09 -07:00
Jordan Rose
1e33d9073d GitHub: Move "Swift Package" CI job to Linux
Pros:

- Linux executors are cheaper on GitHub's CI, when running in the
  private repository.

- Checks that the Swift package can still be built and tested on
  Linux, even though that's not a primary goal.

Cons:

- Removed the code coverage report. It's possible to do this on Linux
  as well, but we haven't been using this as a primary tool, and it's
  still possible to check locally (particularly by running in Xcode).
  The coverage of the Rust tests is more interesting anyway, and we
  haven't had an automated report for *that*.

Neutral:

- Moved the SwiftLint run to the "Swift CocoaPod" job, since SwiftLint
  isn't installed on GitHub's Linux images by default. Even though
  "Swift CocoaPod" is the longest job at the moment and we may want to
  shorten it, the SwiftLint action is quick anyway.
2022-03-17 16:11:43 -07:00
Jordan Rose
d8ab51df1e GitHub: apt-get update for "Publish to NPM" action too 2022-03-11 13:46:36 -08:00
Jordan Rose
633a955a29 GitHub: apt-get update before apt-get install 2022-03-08 15:34:10 -08:00
Dennis Ameling (he/him)
f889089362
NPM: publish releases for Linux arm64 (#450) 2022-02-17 14:31:19 -08:00
Dennis Ameling
a16837fc3e node: Add Windows arm64 prebuilds to CI 2022-01-21 10:50:06 +02:00
Jordan Rose
974b7d22ca GitHub: Move fuzz target checking to the stable Rust toolchain job
...because the fuzz target doesn't have a lockfile, and crates don't
generally support arbitrary nightly versions. See
https://github.com/dtolnay/proc-macro2/issues/307 for an example.
2021-12-10 10:43:47 -08:00
Jordan Rose
3e68ca0d0e GitHub: when testing the NPM package, test the prebuilt N-API module
node-gyp-build should make sure that we don't build the Rust library
*again*, but if we do by accident, the tests should still run against
what we're going to submit, which is what's in the prebuilds/
directory.
2021-12-03 11:49:02 -08:00
Jordan Rose
13af5a5429 Node: Build for M1 Macs too
This requires building on the macOS 11 GitHub runner; the 10.15 runner
isn't set up for cross-compiling when not using Xcode.
2021-12-03 11:47:34 -08:00
Jordan Rose
92564b8711 Fix NPM publishing for move to node/package.json 2021-11-09 10:47:19 -08:00
Jordan Rose
ba8e5b4d61 When publishing to NPM, build against the same Node we tested against
For N-API builds this shouldn't matter, but currently the latest Node
headers don't let us build correctly on Windows, so we need to pin
to *something*.
2021-11-09 10:24:00 -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
a00cfd1e90 GitHub: When a release is tagged, build and publish JNI artifacts
This will be used to build a "testable" signal-client-java.jar that
includes native libraries for macOS and Windows in addition to Linux.
This is something zkgroup already has; in particular it allows
developers working on the server to use the zkgroup APIs even if they
run macOS or Windows on their individual machines.
2021-11-01 12:53:56 -07:00
Jordan Rose
9a569f2ffe Standardize license headers
...to have a period after "Signal Messenger, LLC."

...except for the Java sources, which still need a cleanup pass.
2021-10-28 17:27:30 -07:00
Jordan Rose
53338501a3 GitHub: update CI branch filters for master -> main change 2021-10-14 15:37:02 -07:00
Jordan Rose
d6fc73b27a Update dependencies
- cargo update
- But stay on our fork of curve25519-dalek (pinned at 3.0.0)
- Update x25519-dalek from 1.0 to 1.1 (instead of 1.2) to stay
  compatible with curve25519-dalek
- Update cpufeatures to 2.1 to match our dependencies
- Note that updating picky* resulted in more duplicate crates (rand*)
- Pin num-bigint-dig to a build that supports Cargo's -Zbuild-std,
  because xargo + autocfg has stopped working with the new toolchain
- Remove xargo in favor of -Zbuild-std
2021-10-06 10:58:44 -07:00
Jordan Rose
78bfc21a32 Bump rust-toolchain to nightly-2021-09-19 (same as zkgroup)
This provides newer armv8 intrinsics, as well as support for the
aarch64-apple-ios-sim target.
2021-10-05 18:01:50 -07:00
Jordan Rose
a1f45b0af2 Add bin/update_versions.py to make it easier to do a release
We were already *reading* all these files (to check that the versions
were in sync); might as well *write* all the files as well.
2021-10-01 16:55:33 -07:00
Jordan Rose
b56f02e8fa Add release instructions (for Signal engineers) 2021-09-30 12:32:15 -07:00
Jordan Rose
093d82115c GitHub: Make sure lockfiles don't get rewritten during testing
Otherwise, we're not testing what we think we're testing.
2021-09-27 14:44:12 -07:00
Graeme Connell
9aa79c0c59 Client-side rust-only HSM enclave library. 2021-09-21 12:07:27 -06:00
Ehren Kret
973f7545b0 Install proper NDK version to fix Java CI 2021-09-13 18:33:46 -05:00
Jordan Rose
e80339c15f protocol: Add a fuzz target that runs interactions between two clients
Based on the fuzzing input, this simulates message sends and receives,
out-of-order delivery, dropped messages, and session resets, solely to
find bugs in happy-path interaction between two clients.
2021-08-13 16:09:04 -07:00
Ruben De Smet
036661b60c
Add rust stable to tests 2021-08-03 11:31:36 +02:00
Jordan Rose
33128d5f45 GitHub: Run Rust tests for a 32-bit platform as well
While Desktop and iOS only support 64-bit platforms, both 32-bit and
64-bit Android are supported.
2021-07-02 10:29:20 -07:00
Nora Trapp
720d796f76 Add support for M1 and Catalyst architectures via cocoapods 2021-06-10 11:34:10 -07:00
Jordan Rose
f33c060f44 GitHub: add more paths that don't need PR testing 2021-05-18 16:01:28 -07:00
Jordan Rose
21f12c9197 GitHub: "Publish to NPM" action should always check out the same ref
Typo fix
2021-05-18 15:56:15 -07:00
Jordan Rose
c570d7fe00 GitHub: when publishing to NPM, allow custom tags (besides "latest") 2021-04-28 10:58:59 -07:00
Jordan Rose
8db505b4f7 GitHub: add a workflow to publish a tag to NPM
And remove the old copy_repo.sh used to generate
libsignal-client-node.
2021-04-28 10:50:27 -07:00
Jordan Rose
f3cece493a PR testing: only verify that Native.d.ts is up to date once 2021-04-28 10:49:58 -07:00
Jordan Rose
a9417bf323 GitHub: add FUNDING.yml to match other public repositories 2021-03-25 18:03:04 -07:00
Jordan Rose
1142c5f43c CI: Add a check for code size growth in the arm64 Android library
Sample output:

    current build is 0% larger than v0.3.4 (current: 1957208 bytes, v0.3.4: 1949016 bytes)
       0.1.5: *********** (1079472 bytes)
       0.1.6: *********** (1153216 bytes)
       0.1.7: *********** (1153216 bytes)
       0.2.0: ************ (1222832 bytes)
       0.2.2: ************* (1267888 bytes)
       0.2.2: ************** (1382592 bytes)
       0.2.3: *************** (1489088 bytes)
       0.3.4: ******************* (1949016 bytes)
     current: ******************* (1957208 bytes)
2021-03-15 18:40:47 -07:00
Jordan Rose
56afeb885c By default, skip Rust tests that take over 10s in debug builds
We'll still run them in CI, but we don't need to run them locally.
2021-03-10 09:54:49 -08:00
Jordan Rose
324f925717
Merge pull request #216 from signalapp/jrose/clippy-tests-fixup
GitHub: Fix Clippy invocation for real
2021-02-22 14:05:51 -08:00
Jordan Rose
9f4880ac8b
Merge pull request #204 from signalapp/jrose/swift-prebuild-rust-library-only
CocoaPods: Build the Rust library as part of installing the CocoaPod
2021-02-22 13:11:14 -08:00
Jordan Rose
9d895b119a GitHub: Fix Clippy invocation for real 2021-02-22 11:31:48 -08:00
Jordan Rose
21875d82f4 Fix or mark-as-allowed Clippy lints in tests
And tweak the GitHub Clippy enforcement so this doesn't regress.
2021-02-22 09:46:25 -08:00
Jordan Rose
cca1eccc17 GitHub: Fix output for duplicate dependency checking 2021-02-19 10:49:20 -08:00
Jordan Rose
319d20993b GitHub: install iOS device target for pod lib lint testing
This will run the prepare_command specified by the podspec, which
means it will try to build both simulator and device versions of
libsignal-ffi. This also means we don't need the separate "Build Rust
for iOS" test.
2021-02-18 17:02:32 -08:00
Jordan Rose
bfff69c962 Revert "Merge pull request #163 from signalapp/jrose/cocoapods-binary-compat"
This reverts commit 55a6ae7c83, reversing
changes made to 04202b28fd.
2021-02-18 15:56:07 -08:00
Dennis Ameling
5bfbe24c2d Fix typo in Actions workflow 2021-02-13 01:51:52 +01:00
Dennis Ameling
0042e0d60c Add Node multi-arch support 2021-02-13 01:45:37 +01:00
Jack Lloyd
4689606d63 Add a script to verify the crate and package versions match 2021-02-10 13:10:13 -05:00
Jordan Rose
afe2c3029e
Merge pull request #183 from signalapp/jrose/fix-duplicate-crate-checking
Fix our duplicate crate checking, then resolve duplicate crates
2021-02-05 09:56:06 -08:00
Jordan Rose
da1d0937c5 Fix our duplicate crate checking, then resolve duplicate crates
Updated the following crates to resolve duplication of cfg-if,
which is a macro-only crate anyway.

- backtrace
- getrandom
- log (relaxed the version on it as well)
- polyval (still not at latest because it uses a newer cpuid-bool than
  sha2 does)
- sha2
2021-02-04 17:31:47 -08:00
Jordan Rose
8385f6e73d GitHub: Fix Node tests by running yarn tsc
Previously taken care of by the "prepare" script, but that had to be
removed so that the same package.json worked here and in the artifact
repo.
2021-02-04 16:07:33 -08:00
Jordan Rose
42a3c1e7e3 Swift: Use CocoaLumberjack directly instead of SignalCoreKit's OWSLog
This removes the dependency on a CocoaPod that's not in the main
registry.
2021-02-02 12:04:50 -08:00
Jordan Rose
7210f6b86f Node: Autogenerate libsignal_client.d.ts like we do Native.java
This collects doc comments of the form "ts: <some TS declaration>",
which can be written manually *or* generated by the various "bridge"
macros. If the declaration looks like a function, it also does some
substitution of Rust types for TypeScript types, to make
autogeneration easier.
2021-01-26 15:48:13 -08:00
Jack Lloyd
3de3c72b93 Build benchmarks 2021-01-15 15:28:32 -05:00
Jack Lloyd
4dee42675e Pin cargo-ndk tool to 1.0.0 2021-01-11 15:33:55 -05:00
Jordan Rose
baba4519de Swift: Generate signal_ffi.h offline, like Native.java
- Verify its correctness with build_ffi.sh --verify-ffi
- Regenerate with build_ffi.sh --generate-ffi

This simplifies the header search logic for both SwiftPM and
CocoaPods, as well as saving on build time by avoiding cbindgen.

The tweak to cbindgen.toml to prefer typedef-based structs and enums
is sidestepping an incompatibility between cbindgen 0.15.0 (which
GitHub has installed) and 0.16.0 (which allows reusing a release build
directory as well as a debug one).
2021-01-04 13:41:07 -08:00
Jordan Rose
7b3093ddbb Add a --verify option to gen_java_decl.py
And bump the copyright years to 2021.
2021-01-04 12:08:26 -08:00
Jack Lloyd
fbcdbaf3c4 Cross build the Rust code for iOS
Hopefully avoiding bugs like #117
2020-12-14 13:36:27 -05:00
Jordan Rose
997c399884 Rust: Move deny-warnings behavior into CI
Warnings don't need to be immediately fixed locally, and they make it
harder to test with newer nightlies. CI is the place to enforce it.
2020-12-10 14:22:20 -08:00
Jordan Rose
24920e9d4d Start factoring out common parts of the FFI and JNI libraries 2020-12-10 11:16:19 -08:00
Jordan Rose
788a979895
Merge pull request #95 from signalapp/jrose/napi-runtime
Node: Switch to Neon's napi-runtime and JsBox
2020-12-08 12:28:51 -08:00
Jordan Rose
1c85744376 Swift: connect Rust's 'log' to SignalCoreKit's OWSLogger
We're not actually logging anything yet, but this will let us do so.
The logging is initialized using a static constructor so that clients
of SignalCoreKit don't have to do any additional setup. This requires
an ObjC file instead of a Swift one. (When running as a Swift package,
logs will just go to stderr via NSLog.)
2020-12-08 09:46:16 -08:00
Jordan Rose
9a21e7babc Node: Switch to Neon's napi-runtime and JsBox
We lose the ability to define classes in Rust, but we probably want to
be doing that in TypeScript anyway.
2020-12-04 10:44:58 -08:00
Jordan Rose
77a5451c1f Add flake8 for checking our Python scripts
We only have one for now, but we can start enforcing this now.
2020-11-30 11:02:57 -08:00
Jordan Rose
f52bf8af40 GitHub: fix automated testing /outside/ of PRs 2020-11-18 15:02:48 -08:00
Jordan Rose
22d88047b9
Merge pull request #67 from signalapp/jrose/shellcheck
Enforce that our scripts are Shellcheck-clean
2020-11-17 12:08:34 -08:00
Jordan Rose
84bb14072f Enforce that our scripts are Shellcheck-clean 2020-11-16 18:24:02 -08:00
Jordan Rose
9173ec7bae GitHub: simplify path filtering using dorny/paths-filter@v2 2020-11-16 15:20:32 -08:00
Jack Lloyd
2f47d125d1
Merge pull request #57 from signalapp/jack/ignore-other-workflows
Have each language ignore changes to other workflow scripts
2020-11-12 18:17:11 -05:00
Jack Lloyd
d06380f271
Merge pull request #55 from signalapp/jack/fix-swift-lints
Fix some Swift lint warnings
2020-11-12 18:05:51 -05:00
Jack Lloyd
cb3be1ec55 Have each language ignore changes to other workflow scripts 2020-11-12 17:53:48 -05:00
Jack Lloyd
44e794a7ba Add --strict to the invocation of swiftlint in CI 2020-11-12 17:51:47 -05:00
Jack Lloyd
3718aeb566
Merge pull request #51 from signalapp/jack/workflow-ignores
Update GH actions to ignore changes to bridges
2020-11-12 17:33:38 -05:00
Jack Lloyd
05085b627f Account for rust/bridge/node existing 2020-11-12 16:16:21 -05:00
Jordan Rose
9dc5f615ec
Merge pull request #53 from signalapp/jrose/workspace-default-members
Rust: don't build any bridge/* crates by default
2020-11-12 10:42:18 -08:00
Jordan Rose
1d00de7cdc Rust: don't build any bridge/* crates by default
Some of them have external requirements that may not be installed.
2020-11-12 10:30:07 -08:00
Jack Lloyd
c70cd49df2 Use our pinned nightly for Node builds 2020-11-12 12:30:26 -05:00
Jack Lloyd
6fa03b2eb4 Update GH actions to ignore changes to bridges
Swift doesn't care if JNI bridge changed, similarly for Java and the C ABI
2020-11-12 11:17:01 -05:00
Jordan Rose
7b37cf0547 Fix CocoaPod build to respect rust-toolchain
Also stop checking out libsignal-ffi.git for no reason during PR
testing.
2020-11-11 11:47:30 -08:00
Jordan Rose
f493188942 GitHub: PR testing for Node 2020-11-11 11:06:05 -08:00
Jordan Rose
d712408527 Tighten up CocoaPod PR testing now that libsignal-client is public 2020-11-09 13:55:38 -08:00
Jack Lloyd
82dbf03905
Merge pull request #42 from signalapp/jack/pin-the-nightly
Pin nightly to a specific date
2020-11-09 15:55:00 -05:00
Jack Lloyd
8076087e89 Remove override 2020-11-09 15:41:38 -05:00
Jack Lloyd
d9e33d0251 Pin nightly to a specific date 2020-11-09 15:39:29 -05:00
Jack Lloyd
2ece8fc4c2
Merge pull request #39 from signalapp/jack/gh-action-ignores
Update workflow ignores
2020-11-09 08:45:20 -05:00
Jordan Rose
58d6de1a5a GitHub: Only test CocoaPod for iOS Sim, not macOS 2020-11-06 15:05:16 -08:00
Jack Lloyd
57e150948c Update workflow ignores
Rust should ignore Java/Swift only changes

Java should ignore Swift

Swift should ignore Java

Paper beats rock
2020-11-06 17:53:42 -05:00