Commit Graph

41 Commits

Author SHA1 Message Date
Felix Angelov da86c12fca ci: add build_patch_artifacts workflow (#2) 2023-04-06 11:57:33 -05:00
Felix Angelov e680fe83ca ci: add rust workflow (#1) 2023-04-06 11:06:39 -05:00
Felix Angelov 5055c397e8 feat(updater): use try_exists instead of exists (#218) 2023-04-03 11:08:47 -05:00
Felix Angelov 60a931f0d9 fix(updater): use all base library paths (#206) 2023-03-31 12:44:12 -05:00
Felix Angelov d541d466a8 chore(updater): add context to base and patch files (#203) 2023-03-29 18:47:49 -05:00
Eric Seidel 47522ed63e Add more docs on updater directory 2023-03-29 08:36:03 -07:00
Felix Angelov c923105a7c fix(updater): hash mismatch (#192) 2023-03-28 19:01:42 -05:00
Felix Angelov 0ba3f0169c refactor(updater): remove diff check (#191) 2023-03-28 15:31:21 -07:00
Eric Seidel b6ead34de4 Add instructions for building libupdater.a with Flutter's NDK
Flutter uses a very old NDK (v16 iirc) but thankfully it pulls
down it's Android NDK into third_party/android_tools/ndk.  Update
our instructions to explain how to use that ndk when building.

If we don't link against that ndk the arm64 version seems to work
fine, but the arm32 version seems to depend on an extra symbol
which the older ndk does not expose.  Linking against the correct
ndk gets rust to do the right thing.

There was a separate change to fix a *second* missing symbol
caused by the ring crate (from rustls, from reqwests) depending
on getauxval, but that we changed by exposing a stub copy
from the flutter engine code for now.
2023-03-28 12:41:02 -07:00
Eric Seidel 0afcb65950 feat: Add patch command for use by cli (#179) 2023-03-27 14:58:52 -05:00
Eric Seidel 6da2bd453e feat: Teach rust side to validate hashes when installing (#171) 2023-03-24 17:53:40 -05:00
Eric Seidel 0d113ab094 feat: Add support for diff patches (#163)
Co-authored-by: Felix Angelov <felix@shorebird.dev>
2023-03-24 19:59:35 +00:00
Felix Angelov fbba2912ba docs: minor update to UPDATING_ENGINE.md 2023-03-22 16:17:52 -05:00
Eric Seidel 587d88d88d Update UPDATING_ENGINE.md 2023-03-22 14:05:48 -07:00
Eric Seidel 05e3d75982 Create UPDATING_ENGINE.md
These are incomplete but better than nothing.
2023-03-22 13:51:00 -07:00
Eric Seidel 30e76e46f7 fix: don't crash repeatedly on bad patches
Combined with the fix in the engine:
https://github.com/shorebirdtech/engine/commit/4288ae1125e38a772c6cc8a918ed020c276534a4
This makes it so the updater no longer crashes repeatedly with bad patches.  Previously
1. the engine was not successfully reporting a patch bad before crashing (now it does just before crashing).
2. With that fixed, the patch was getting marked bad, but because we were sending the "current" patch to the server, the server would tell us to download a new one every time (which we would not check against our bad patches) and we'd repeatedly boot of a "new" known-bad patch.  This is now fixed to both send the latest_installed_patch to the server (as patch_version) as well as refusing to install known bad patches.
3. Fixed the cache to destroy itself on version change (which I expect could hit us when an app upgrades its cache might not get cleared).
4. Also fixed tests being flakey because TempDir cleans up after itself when it goes out of scope (thus needs to be held at the test-lifetime scope rather than inside init_for_testing).
2023-03-21 10:46:07 -07:00
Eric Seidel 1220e63f9e Expose "report_launch_failure" so engine can call it. (#97) 2023-03-20 17:32:03 -05:00
Felix Angelov e453093192 chore: update base url to api.shorebird.dev (#93) 2023-03-20 14:33:54 -05:00
Felix Angelov 730df4c4d3 refactor(updater): create PatchCheckRequest struct (#92) 2023-03-17 17:44:27 -05:00
Eric Seidel 1eb9340ad6 Separate patch download/install
This separates patch download from install, which makes it possible for us to later asynchronously download patches into the downloads spot and then install them on completion.

This also makes marking patches good/bad actually do something and tests that it does something.

We're still quite aways away from actually validating patches and having good/bad be meaningful (for example good/bad are never called by the engine code yet) but this is a step in that direction.

activate_latest_bootable_patch is also only used the "set bad" codepath, and isn't even used when installing patches (those still manually set the current slot).

This also makes it so the slot index is now optional, which makes slightly more sense?  And would be needed in the case where you have a single bad patch installed in slot 1, with slot 0 empty/invalid and you resolve to a "None" selected.

Lots more to do here, but this is a start.
2023-03-17 13:53:04 -07:00
Felix Angelov f5103bc1e8 refactor(updater): conform to new backend interfaces (#90) 2023-03-17 13:00:35 -05:00
Felix Angelov d0eaf8d330 chore(updater): dart format (#85) 2023-03-17 10:08:34 -05:00
Eric Seidel 1f8842e5b5 feat: Add two more rust tests (#82) 2023-03-16 11:18:30 -07:00
Eric Seidel e188d61085 feat: Start adding rust tests. (#81) 2023-03-16 12:01:44 -05:00
Felix Angelov ab8ef34ca0 refactor(updater): remove client_id (#78) 2023-03-15 14:18:29 -05:00
Felix Angelov d4c84ea9cf chore: rename product_id to app_id (#77) 2023-03-15 14:11:13 -05:00
Eric Seidel dfcc356e27 Remove duplicate imports 2023-03-15 09:49:07 -07:00
Eric Seidel e9e1b8a0f4 refactor: Use methods instead of free functions with UpdateState (#74) 2023-03-15 09:45:18 -07:00
Eric Seidel d6bb3b9f12 chore: fix TODO about libapp.txt (#73) 2023-03-15 11:29:24 -05:00
Eric Seidel a50c1d3126 docs: Add ability to mark patches good/bad (not used yet) (#70) 2023-03-14 14:41:28 -07:00
Eric Seidel df1bf4a50d docs: Document intended updater arch (#63) 2023-03-14 12:43:38 -07:00
Eric Seidel f9e8ad5099 Move current_platform and current_arch to config.rs 2023-03-13 09:50:53 -07:00
Eric Seidel 98bcdd96bc Log the outbound json 2023-03-13 09:38:31 -07:00
Eric Seidel 53d092c20d Log network responses in rust 2023-03-13 09:24:04 -07:00
Eric Seidel b18ac7b947 feature: Teach the rust updater library about shorebird.yaml (#54) 2023-03-10 23:49:19 -06:00
Felix Angelov da702e4ce9 chore: resolve analysis warnings (#53) 2023-03-09 15:51:27 -08:00
Felix Angelov edc020611a feat: upgrade shorebird tools to new API (#52) 2023-03-09 17:38:01 -06:00
Eric Seidel eacc7e8b87 Make updater library thread safe
This was needed so that it could be called from Dart as well as flutter_main/C++.

It turns out flutter_main does not run on the "ui thread", so when Dart was calling
into the updater it would panic due to thinking the updater (which was using a thread local) was not yet initialized.

Also added the log-panics crate on Android so that panics appear in adb logcat.
2023-03-08 13:03:13 -08:00
Eric Seidel 52ec7f3c4e refactor: split updater library into layers (#47) 2023-03-08 11:11:10 -06:00
Eric Seidel 6199b33b24 chore: Fix .gitignores (#28) 2023-03-07 02:21:28 +00:00
Eric Seidel f757251162 chore: Fix the rust build (#27) 2023-03-06 15:06:31 -08:00