Commit Graph

16 Commits

Author SHA1 Message Date
Eric Seidel db99e24726 perf: set panic=abort and drop backtrace features (#342)
Reduces binary size of the updater staticlib when linked into the
Flutter engine. On host macOS arm64 the dylib shrinks from 3.07 MB
to 2.56 MB; the biggest iOS savings come from dropping the DWARF
unwind tables (__eh_frame, __gcc_except_tab, __unwind_info) that
panic=unwind generates.

- panic = "abort" in [profile.release]: kills unwind-table generation
  and eliminates dead panic-unwinding code paths. We don't use
  catch_unwind anywhere in the library. log-panics still runs its
  panic hook before abort, so panic messages continue to surface to
  logcat/oslog during development.
- Drop `backtrace` feature from anyhow and `with-backtrace` from
  log-panics: removes gimli + addr2line + rustc_demangle (~65 KB of
  symbolication machinery) that customers can't read anyway. A
  future in-engine crash reporter will symbolize native stacks,
  making these features redundant.
2026-04-21 19:01:26 +00:00
dependabot[bot] 08b91f49d2 chore(deps): bump the library-deps group in /library with 5 updates (#332)
* chore(deps): bump the library-deps group in /library with 5 updates

Updates the requirements on [sha2](https://github.com/RustCrypto/hashes), [zip](https://github.com/zip-rs/zip2), [mockall](https://github.com/asomers/mockall), [mock_instant](https://github.com/museun/mock_instant) and [cbindgen](https://github.com/mozilla/cbindgen) to permit the latest version.

Updates `sha2` to 0.11.0
- [Commits](https://github.com/RustCrypto/hashes/compare/streebog-v0.11.0-pre.0...sha2-v0.11.0)

Updates `zip` to 8.5.0
- [Release notes](https://github.com/zip-rs/zip2/releases)
- [Changelog](https://github.com/zip-rs/zip2/blob/master/CHANGELOG.md)
- [Commits](https://github.com/zip-rs/zip2/compare/v3.0.0...v8.5.0)

Updates `mockall` to 0.14.0
- [Changelog](https://github.com/asomers/mockall/blob/master/CHANGELOG.md)
- [Commits](https://github.com/asomers/mockall/compare/v0.13.1...v0.14.0)

Updates `mock_instant` to 0.6.0
- [Commits](https://github.com/museun/mock_instant/compare/v0.5.1...v0.6.0)

Updates `cbindgen` to 0.29.2
- [Release notes](https://github.com/mozilla/cbindgen/releases)
- [Changelog](https://github.com/mozilla/cbindgen/blob/main/CHANGES)
- [Commits](https://github.com/mozilla/cbindgen/compare/0.28.0...0.29.2)

---
updated-dependencies:
- dependency-name: sha2
  dependency-version: 0.11.0
  dependency-type: direct:production
  dependency-group: library-deps
- dependency-name: zip
  dependency-version: 8.5.0
  dependency-type: direct:production
  dependency-group: library-deps
- dependency-name: mockall
  dependency-version: 0.14.0
  dependency-type: direct:production
  dependency-group: library-deps
- dependency-name: mock_instant
  dependency-version: 0.6.0
  dependency-type: direct:production
  dependency-group: library-deps
- dependency-name: cbindgen
  dependency-version: 0.29.2
  dependency-type: direct:production
  dependency-group: library-deps
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix: adapt sha2 0.11 hashing (no io::Write impl)

* refactor: reuse cache::hash_file in check_hash

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Eric Seidel <eric@shorebird.dev>
2026-04-08 16:16:41 -07:00
Eric Seidel adacb4190c refactor: replace serde_yaml with hand-rolled parser (#326)
serde_yaml is deprecated and pulls in unnecessary dependencies
(unsafe-libyaml, indexmap, hashbrown) for parsing our simple
flat key-value config file. Replace with a minimal hand-rolled
parser that handles exactly what shorebird.yaml needs.

Size impact (release build, macOS arm64):
  .a  (staticlib): -674 KB (26.1 MB → 25.4 MB)
  .dylib (cdylib): -169 KB (3.7 MB → 3.5 MB)
2026-04-02 16:46:55 -07:00
Eric Seidel 2057fd4f46 fix: resolve all Dependabot security vulnerabilities (#316)
Run `cargo update` to bump transitive dependencies, fixing 10 of 11
alerts (h2, ring, idna, mio, tokio, bytes, time, quinn-proto,
rustls-webpki, unsafe-libyaml).

Replace deprecated `tempdir` dev-dependency with `tempfile` to
eliminate the `remove_dir_all` vulnerability (the last alert).
2026-04-01 15:36:12 +00:00
Eric Seidel c6647a2dfe refactor: replace reqwest with ureq to reduce binary size (#317)
* refactor: replace reqwest with ureq to reduce binary size

reqwest's blocking API is built on top of its async implementation,
pulling in tokio, hyper, futures, and ~84 other transitive dependencies
even though we only make simple synchronous HTTP calls.

ureq is a synchronous-only HTTP client that eliminates the async
runtime entirely. This reduces transitive dependencies from 227 to 143
and the linked dylib from 4.5 MB to 3.7 MB (-18%). The .a archive
drops from 28 MB to 26 MB, but real savings will be larger once
linked into libflutter with dead code stripping.

The network API surface is unchanged — three functions (patch check,
file download, event reporting) using POST/GET with JSON.

* chore: add ureq to spell check dictionary

* refactor: use into_body() instead of body_mut() where response is consumed

* fix: simplify network error matching to avoid fragile string checks

Consolidate HostNotFound, ConnectionFailed, and all Io errors into
a single network-error arm instead of pattern-matching on error
message strings that could change across OS versions or locales.

* chore: add TODO for misleading network error message
2026-04-01 08:23:48 -07:00
Eric Seidel 6d0e4a1193 chore(deps): bump Rust and Dart dependencies (#315)
* chore(deps): bump Rust and Dart dependencies

Bump Rust dependencies in library/ and patch/:
- comde: 0.2.3 → 0.3.1 (library), 0.2.3 → 0.3.0 (patch)
- zip: 0.6.4 → 3.0.0 (breaking: FileOptions → SimpleFileOptions)
- android_logger: 0.13.0 → 0.15.0
- mockall: 0.12.1 → 0.13.1
- serial_test: 2.0.0 → 3.2.0
- cbindgen: 0.24.0 → 0.28.0

Bump Dart dev dependency in shorebird_code_push/:
- ffigen: upper bound <17.0.0 → <19.0.0

Updated zip API usage (FileOptions → SimpleFileOptions) and
adjusted test assertion for changed error message.

Binary size impact (macOS release, arm64):
- libupdater.a: +83 KB (+0.28%)
- libupdater.dylib: +34 KB (+0.75%)

Closes #206, #271, #273.

* chore: add EOCD to cspell dictionary

The zip 3.0 crate changed its error message to reference "EOCD"
(End of Central Directory), which cspell doesn't recognize.
2026-03-30 15:50:44 -07:00
Bryan Oltman 76f005940d feat: add uuid to updater state, patch check request (#300)
* feat: add uuid to updater state

* add client_id to patch check request

* cleanup

* comments

* cleanup

* more comments

* delete commented-out code

* Update library/src/cache/updater_state.rs

Co-authored-by: Eric Seidel <eric@shorebird.dev>

* formatting

---------

Co-authored-by: Eric Seidel <eric@shorebird.dev>
2025-10-29 15:57:06 -04:00
Bryan Oltman 38aadee1c5 feat: enable updater logging on windows (#256) 2024-12-18 14:10:37 -08:00
Bryan Oltman b4775d30dd feat: support macOS (#247)
* feat: support macOS

* fix tests
2024-12-05 17:53:45 -05:00
Bryan Oltman 0988c854af Revert "feat: generate a rollout group number on UpdaterState creation (#227)" (#231)
This reverts commit 8e7ec5a9b6.
2024-11-07 09:34:32 -05:00
Bryan Oltman 8e7ec5a9b6 feat: generate a rollout group number on UpdaterState creation (#227)
* feat: generate a rollout group number on UpdaterState creation

* update test

* use inclusive range
2024-10-30 17:40:46 -04:00
Bryan Oltman 3da6c38ef4 feat: add timestamp to patch events (#179)
* feat: add timestamp to patch events

* fix test
2024-06-20 15:47:59 -04:00
Bryan Oltman 390aa49cba feat: update patch manager to check signature on boot (#171)
* feat: store patch signature on disk with patch metadata

* add note about explicit lifetime

* fix tests

* feat: update patch manager to check signature on boot

* remove unused imports

* fix tests

* add log when no public key detected

* clean up log message

* pr feedback

* rename test

* rename tests null -> none

* change signature field name to hash_signature

* Add comment

* update print statements for clearer device logs

* fix test

* improve docs

* cleanup of signing error handling
2024-05-23 14:41:02 -04:00
Bryan Oltman 4685789e59 feat: store patch signature on disk with patch metadata (#170)
* feat: store patch signature on disk with patch metadata

* add note about explicit lifetime

* fix tests
2024-05-22 10:00:36 -04:00
Eric Seidel fe465ea1b1 chore: remove unused package (#142) 2024-04-19 21:00:33 +00:00
Bryan Oltman d5cbb5ac7b chore: check in Cargo.lock (#141) 2024-04-19 13:51:22 -07:00