Commit graph

90 commits

Author SHA1 Message Date
Damien Elmes
43e05aff6c update Rust deps; add async_trait 2021-01-11 19:19:45 +10:00
Damien Elmes
2074bb03b6 update prost to new 0.7 release+auto stage changes
Allows us to drop slow git repo.
2020-12-28 10:12:35 +10:00
cecini
77a94c8a45 Update rslib dep nom 2020-12-15 08:19:52 +00:00
Damien Elmes
2f9ddadf2c switch to workspace for Rust code 2020-11-24 18:41:03 +10:00
Damien Elmes
fd4c1edc7f add native-tls in preparation for Linux-only ring 2020-11-15 14:02:53 +10:00
Damien Elmes
f83f0f08e2 drop El Capitan support 2020-11-12 20:03:41 +10:00
Damien Elmes
f24d80bac5 update to latest fluent libs, and integrate maximum digit handling
We now limit number of digits in our formatter, instead of relying
on an upstream patch.
2020-11-03 14:10:45 +10:00
Damien Elmes
a001029961 add shallow_since to a bunch of git deps 2020-11-03 11:42:11 +10:00
Damien Elmes
6cde50e475 ues native roots with rustls 2020-11-03 10:42:20 +10:00
Damien Elmes
c6e6c8a54d update env_logger, and minor dep updates 2020-11-03 09:04:57 +10:00
Damien Elmes
c62e2e1e58 reqwest was missing default-features = false
Still needed until we fix OpenSSL compilation on Linux
2020-11-02 21:53:24 +10:00
Damien Elmes
f620bfc3bf update rusqlite and pin-project
Thanks to Alan for the heads up
2020-11-02 18:26:19 +10:00
Damien Elmes
db0e0e78f8 update cargo deps; add script to copy them from rslib/ 2020-11-02 18:17:26 +10:00
Damien Elmes
ce3b08ac58 initial Bazel conversion
Running and testing should be working on the three platforms, but
there's still a fair bit that needs to be done:

- Wheel building + testing in a venv still needs to be implemented.
- Python requirements still need to be compiled with piptool and pinned;
need to compile on all platforms then merge
- Cargo deps in cargo/ and rslib/ need to be cleaned up, and ideally
unified into one place
- Currently using rustls to work around openssl compilation issues
on Linux, but this will break corporate proxies with custom SSL
authorities; need to conditionally use openssl or use
https://github.com/seanmonstar/reqwest/pull/1058
- Makefiles and docs still need cleaning up
- It may make sense to reparent ts/* to the top level, as we don't
nest the other modules under a specific language.
- rspy and pylib must always be updated in lock-step, so merging
rspy into pylib as a private module would simplify things.
- Merging desktop-ftl and mobile-ftl into the core ftl would make
managing and updating translations easier.
- Obsolete scripts need removing.
- And probably more.
2020-11-01 14:26:58 +10:00
Damien Elmes
2ed1507162 bump version 2020-10-02 10:22:21 +10:00
Damien Elmes
1a619073d7 bump version 2020-09-24 10:52:24 +10:00
Aleksa Sarai
da040372da rslib: disable bzip2 feature
We can't link against libzip2.so.1 when building manylinux wheels, but
the only dependency which required this was "zip" and we don't appear to
make use of bzip2 in Anki.

This fixes the following "make build" error on Linux:

  x maturin failed
    Caused by: Failed to ensure manylinux compliance
    Caused by: Your library is not manylinux compliant because it links the following forbidden libraries: ["libbz2.so.1"]

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2020-09-05 19:39:11 +10:00
Aleksa Sarai
96da137314 rs: remove most &mut references in BackendService
The previous implementation had some slightly questionable memory safety
properties (older versions of PyO3 didn't uphold the Rust aliasing rules
and would thus create multiple &mut references to #[pyclass] objects).
This explains why Backend has internal Mutex<T>s even though all of its
methods took &mut self.

The solution is to simply make all methods take &self, which luckily
doesn't pose too make issues -- most of the code inside Backend already
has sufficient locking. The only two things which needed to be
explicitly handled where:

1. "self.runtime" which was fairly easy to handle. All usages of
   the Runtime only require an immutable reference to create a new
   Handle, so we could switch to OnceCell which provides
   lazy-initialisation semantics without needing a more heavy-handed
   Mutex<tokio::runtime::Handle>.

2. "self.sync_abort" was simply wrapped in a Mutex<>, though some of the
   odd semantics of sync_abort (not being able to handle multiple
   processes synchronising at the same time) become pretty obvious with
   this change (for now we just log a warning in that case). In
   addition, switch to an RAII-style guard to make sure we don't forget
   to clear the abort_handle.

As a result, we now no longer break Rust's aliasing rules and we can
build with newer versions of PyO3 which have runtime checks for these
things (and build on stable Rust).

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2020-09-05 19:37:59 +10:00
Damien Elmes
f3c6d565b0 bump version 2020-08-31 11:07:54 +10:00
Damien Elmes
ed1af61fa6 use commit hash in reqwests dependency 2020-08-26 18:50:25 +10:00
Damien Elmes
2e923b0990 vendor reqwest for now, to support read/write timeouts
https://github.com/seanmonstar/reqwest/issues/870

adding back now that fix has been applied to a fork of tokio-io-timeout
2020-08-26 13:24:51 +10:00
Damien Elmes
2f6d816cdc bump version 2020-08-26 08:05:45 +10:00
Damien Elmes
a6f5d48cca Revert "vendor reqwest for now, to support read/write timeouts"
This reverts commit b3edeaac86.

The separate read and write timeouts were causing syncs to fail - a
long full upload would time out due to no read activity for example.
Reverting until a better fix can be put in place.
2020-08-25 13:28:54 +10:00
Damien Elmes
58c8609332 bump version 2020-08-24 11:28:22 +10:00
Damien Elmes
b3edeaac86 vendor reqwest for now, to support read/write timeouts
https://github.com/seanmonstar/reqwest/issues/870
2020-08-21 18:50:00 +10:00
Damien Elmes
4629dd38fb bump version 2020-08-09 13:44:59 +10:00
Damien Elmes
d3653ab6d5 bump version 2020-07-28 12:59:56 +10:00
Damien Elmes
7e78d12b99 bump version 2020-07-21 15:54:14 +10:00
Damien Elmes
56833f0ac7 panic fix was merged into hyper 0.13.7 2020-07-16 09:09:13 +10:00
Damien Elmes
22a87a4f3b vendor coarsetime so we can get the use after free fix 2020-07-13 13:34:37 +10:00
Damien Elmes
bbc75cdf5d update rslib/rspy deps 2020-07-12 11:38:25 +10:00
Damien Elmes
f5694a7e4a migrate card stats to backend
Currently this renders the HTML directly like the previous Python
implementation - doing it in JS would probably make more sense in the
future.
2020-06-15 17:22:16 +10:00
Damien Elmes
4092da9dbe use vendored hyper for panic fix 2020-06-11 13:30:35 +10:00
Damien Elmes
6207b1012f Revert "use trust-dns in reqwest"
This reverts commit f15abb5c58.

trust-dns has introduced its own issues, such as when resolv.conf is
inaccessible, or contains hostnames with certain characters
2020-06-08 22:03:24 +10:00
Damien Elmes
f15abb5c58 use trust-dns in reqwest
The default DNS resolution, if interrupted by an Abortable, will
cause a panic:

57ef271500/src/client/connect/dns.rs (L144)
2020-06-03 15:47:54 +10:00
Damien Elmes
42c34b60c0 use a shared async runtime instead of recreating each time 2020-06-02 09:35:27 +10:00
Damien Elmes
4d1e8d678d full upload/download HTTP code 2020-06-01 13:57:10 +10:00
Damien Elmes
f17dec9f2a start on HTTP client for syncing 2020-06-01 13:57:10 +10:00
Damien Elmes
3e156fdb49 bump version 2020-05-18 12:50:20 +10:00
Damien Elmes
17efa85d75 update rusqlite 2020-05-16 19:49:08 +10:00
Damien Elmes
d810ba5db9 template changes and card generation
Cloze cards are not yet supported, missing decks are not handled,
and more testing is still required.
2020-05-12 21:13:33 +10:00
Damien Elmes
4a2256aecb the start of note adding, and note type changes 2020-05-12 21:13:33 +10:00
Damien Elmes
f2b1796e22 update crate version
make check was missing this
2020-05-11 20:41:16 +10:00
Damien Elmes
2c102f87c4 update rslib version 2020-05-02 10:46:58 +10:00
Damien Elmes
91248aa8cf bump version 2020-04-28 08:57:56 +10:00
Damien Elmes
9b66ecd12d add socks support 2020-04-09 14:28:36 +10:00
Damien Elmes
76ecc9739e update rusqlite 2020-04-09 12:45:51 +10:00
Damien Elmes
68142ed32e Cow<str> workaround no longer required 2020-04-07 10:08:03 +10:00
Damien Elmes
b0ea1c24d0 update rusqlite for param count assert fix 2020-04-07 08:54:57 +10:00
Damien Elmes
ac54f85840 update tag handling
- tag list stored in a separate DB table
- non-wildcard searches now do full unicode case folding
(eg tag:masse matches 'Maße')
- wildcard matches do simple unicode case folding
- some functions haven't been updated yet, so ascii folding will
continue to be used in some operations
2020-04-03 19:34:46 +10:00