Commit Graph

10641 Commits

Author SHA1 Message Date
Damien Elmes
dfae9f353a Exclude PyOxidizer from recursive checkout 2023-07-02 18:22:44 +10:00
Damien Elmes
8c712cd118 Support creating a standalone sync server 2023-07-02 18:22:44 +10:00
Damien Elmes
0f77de896d Fix building outside workspace
rslib/build.rs needs descriptors, even if env var not set
2023-07-02 18:22:44 +10:00
Damien Elmes
c6f429ab17 Add option to use LTO in release builds
Shrinks rslib.so from about 40MB to about 26MB, at the cost of considerably
higher build time in a release build.
2023-07-02 18:22:44 +10:00
Damien Elmes
56a1046ff8 Fix bundling
PyOxidizer binary is now going into a platform folder, and our Qt
deps moved.
2023-07-02 18:22:44 +10:00
Damien Elmes
b4bfc1a80d Let ninja/n2 do the configure invocation
I'd introduced maybe_reconfigure_build() after running into issues where
configure was not being invoked, but have discovered why that was happening:
the out folder path must be identical to the canonical path listed in
build.ninja, which it wasn't when a symlink was used. With this change,
we avoid having to invoke ninja twice, and get visibility into the
configure step.

This also makes rsbridge only depend on out/env, which prevents it from
being rebuilt when any reconfigure happens.
2023-07-02 18:22:44 +10:00
Damien Elmes
58c0f61d31 Fix progress not updating after one-way sync 2023-07-02 15:47:09 +10:00
Damien Elmes
35002a246a Fix Windows build 2023-07-02 15:17:29 +10:00
Damien Elmes
821b034b37 Fix clean build failure 2023-07-02 14:55:47 +10:00
Damien Elmes
d1a4aa352a Switch runner to release build 2023-07-02 10:31:07 +10:00
Damien Elmes
ab95b14c2e Add a shortcut to auto-format before running checks 2023-07-02 09:59:05 +10:00
Damien Elmes
5149cd13d4 Fix newly-added image occlusion notetype not syncing
https://forums.ankiweb.net/t/synchronisation-issue/31505/7
2023-07-01 22:10:29 +10:00
Damien Elmes
85c2769f80
Update Rust and Python deps (#2567)
* Update Python deps

* Update semver-compat Rust deps

* Update most crates to latest semver

* Update to latest axum-client-ip
2023-07-01 18:26:43 +10:00
Damien Elmes
c8458fce16
Update to Svelte 4, and update most other JS deps (#2565)
* eslint-plugin-svelte3 -> eslint-plugin-svelte

The former is deprecated, and blocks an update to Svelte 4.

Also drop unused svelte2tsx and types package.

* Drop unused symbols code for now

It may be added back in the future, but for now dropping it will save
200k from our editor bundle.

* Remove sass and caniuse-lite pins

The latter no longer seems to be required. The former was added to
suppress deprecation warnings when compiling the old bootstrap version
we have pinned. Those are hidden by the build tool now (though we really
need to address them at one point: https://github.com/ankitects/anki/issues/1385)

Also removed unused files section.

* Prevent proto compile from looking in node_modules/@types/sass

When deps are updated, tsc aborts because @types/sass is a dummy package
without an index.d.ts file.

* Filter Svelte warnings out of ./run

* Update to latest Bootstrap

This fixes the deprecation warnings we were getting during build:
bootstrap doesn't accept runtime CSS variables being set in Sass, as
it wants to apply transforms to the colors.

Closes #1385

* Start port to Svelte 4

- svelte-check tests have a bunch of failures; ./run works
- Svelte no longer exposes internals, so we can't use create_in_transition
- Also update esbuild and related components like esbuild-svelte

* Fix test failures

Had to add some more a11y warning ignores - have added
https://github.com/ankitects/anki/issues/2564 to address that in the
future.

* Remove some dependency pins

+ Remove sass, we don't need it directly

* Bump remaining JS deps that have a current semver

* Upgrade dprint/license-checker/marked

The new helper method avoids marked printing deprecation warnings to
the console.

Also remove unused lodash/long types, and move lodahs-es to devdeps

* Upgrade eslint and fluent packages

* Update @floating-ui/dom

The only dependencies remaining are currently blocked:

- Jest 29 gives some error about require vs import; may not be worth
investigating if we switch to Deno for the tests
- CodeMirror 6 is a big API change and will need work.

* Roll dprint back to an earlier version

GitHub dropped support for Ubuntu 18 runners, causing dprint's artifacts
to require a glibc version greater than what Anki CI currently has.
2023-07-01 16:21:53 +10:00
Damien Elmes
baa631c6ef Migrate proto build actions to ninja_gen; switch from dyn Error to anyhow 2023-06-30 19:37:02 +10:00
Damien Elmes
0bf4fddf40 Use a build input instead of build var for substituted binaries
The vars were not resolved when listed as inputs to other rules, which
was causing problems when using n2, and this approach is simpler.
2023-06-30 19:13:35 +10:00
Damien Elmes
324ef330e8 Update test for changed translation 2023-06-30 17:08:36 +10:00
Damien Elmes
ef68338d85 Update translations 2023-06-30 17:06:47 +10:00
Damien Elmes
f032242b65 Add must_use annotations to generated protobufs 2023-06-30 17:02:36 +10:00
BenYip
14bc02b431
Support more mime types for add_extension_based_on_mime (#2562)
* Support more mime types for add_extension_based_on_mime

* Add myself to CONTRIBUTORS
2023-06-29 15:22:04 +10:00
Abdo
df3fa5a0be
Make set_config_help_action work with submodules (#2561) 2023-06-28 11:46:02 +10:00
Damien Elmes
01f9c600af Use overriden node/protoc binaries as inputs
https://forums.ankiweb.net/t/getting-error-when-python-protoc-and-node-binary-path-set-in-environment/31615
2023-06-28 10:08:32 +10:00
Abdo
0100ae7431
Fix main window geometry/state not being restored in some cases (#2558)
Introduced by 19b08eb280

Report: https://forums.ankiweb.net/t/65-the-size-of-the-main-window-is-reset-every-time-it-is-closed-again/31364
2023-06-27 16:52:34 +10:00
Damien Elmes
9d4d6bd98b Use 127.0.0.1 instead of localhost
d5b5b861e2 (commitcomment-119760971)
2023-06-27 16:45:31 +10:00
Damien Elmes
5506f9bf2d Fix full template render choking on empty fields 2023-06-27 16:30:41 +10:00
Damien Elmes
dc56a2ca7d Rework RenderCardOutput::question/answer
Instead of flattening the output (which was missing FrontSide), alter
the behaviour of render() instead. The non-partial output is now exposed
via Protobuf, so the non-Python clients can take advantage of it.
2023-06-27 00:37:41 +10:00
Damien Elmes
84609cc505 Tweaks to web-watch
- Fix warning on Linux about conflicting args
- Use clear instead of printing a control char
- Print the rebuild time
- Perform a rebuild on initial invocation
2023-06-26 15:50:34 +10:00
Damien Elmes
d5b5b861e2 Move ts-run vars into ./run 2023-06-26 15:29:14 +10:00
Damien Elmes
21a03265a2 Rename sanity check fields avoid conflict with outer span 2023-06-26 15:04:58 +10:00
Damien Elmes
cf39455487 Handle invalid float mtimes in DB check
Likely an add-on or third-party tool created them, and they were breaking
DB queries for a user.

https://sqlite.org/stricttables.html could help us avoid this class of
issue in the future, though we'd need to check what client versions we'd
break with this change, and would need to change the 'sfld is an integer'
hack.
2023-06-26 13:40:54 +10:00
Damien Elmes
b2e7ab522b Remove some unused Rust dependencies 2023-06-24 19:30:29 +10:00
Damien Elmes
630b1267c2 Add ability to skip runner build
Slightly speeds up runs and checks when the runner hasn't changed.
In the future it might be worth splitting the runner into a separate
repo, so we can skip rebuilds except when we explicitly bump the version.
2023-06-23 17:41:31 +10:00
Damien Elmes
e9415b43f4 Migrate archive tool into runner
Also fix minilints declaring a stamp it wasn't creating. The same
approach is necessary with archives now too, as it no longer executes
under a standard "runner run".

For now, rustls is hard-coded - we could pass the desired TLS impl in
from the ./ninja script, but the runner is not recompiled frequently
anyway.
2023-06-23 17:41:31 +10:00
Damien Elmes
f71017a14e Update n2 for -d explain 2023-06-23 17:41:31 +10:00
Damien Elmes
40e1520acb Drop workspace-hack in favor of workspace deps
Workspace deps were introduced in Rust 1.64. They don't cover all the
cases that Hakari did unfortunately, but they are simpler to maintain,
and they avoid a couple of issues that Hakari had:

- It sometimes made updating dependencies harder due to the locked versions,
so you had to disable Hakari, do the updates, and then re-generate (
e.g. 943dddf28f)
- The current Hakari config was breaking AnkiDroid's build, as it was
stopping a cross-compile from functioning correctly.
2023-06-23 17:41:31 +10:00
Damien Elmes
5023356dd2 Make Command::run() accept a single string for convenience
We can fall back on the standard constructor when we have dynamic input
2023-06-23 11:31:39 +10:00
Damien Elmes
a96d5a920b Add copy_file to anki_io, and ensure strings parent folder is created 2023-06-22 19:33:34 +10:00
Damien Elmes
1ae60a3bb0 Fix build failure when n2 installed but ninja not 2023-06-22 12:50:58 +10:00
Damien Elmes
1be9c36863 Fix ts interface being output to wrong filenames 2023-06-22 09:58:12 +10:00
Damien Elmes
b7a3321232 Update translations 2023-06-22 09:49:11 +10:00
Damien Elmes
0173ebf384 Fix lack of progress/error when importing a .colpkg
We should be accessing the backend progress state, instead of the
collection's state.
2023-06-22 09:46:09 +10:00
Damien Elmes
b37063e20a More service generation refactoring
- Dropped the protobuf extensions in favor of explicitly listing out
methods in both services if we want to implement both, as it's clearer.
- Move Service/Method wrappers into a separate crate that the various
clients can import, to easily get at the list of backend services and
their correct indices and comments.
2023-06-22 09:46:09 +10:00
Damien Elmes
dee7860f08 Bump openssl version
Fixes a moderate-severity security issue
2023-06-22 09:46:09 +10:00
Damien Elmes
c0f73d5f97 Drop the generated method map
I'd been thinking it might be useful for a future API service, but
I think that's better implemented with more codegen, so we have a
statically-typed interface.
2023-06-22 09:46:09 +10:00
Damien Elmes
a31d669a90 Bump Mac and Windows builds to Qt 6.5.1
- Windows was on 6.4 as some users reported slowdowns; we'll need to
confirm whether they have come back in the next build.
- Linux has been held back due to https://bugreports.qt.io/browse/QTBUG-114635
2023-06-22 09:46:09 +10:00
Damien Elmes
823ca4c8a9 Split the Qt requirements into per-platform deps
Since more often than not, we can't use the same Qt version on all
platforms due to regressions.
2023-06-22 09:46:09 +10:00
Damien Elmes
7619891d4f Fix total note count not being logged in apkg import
https://forums.ankiweb.net/t/2-1-65-conflicting-import-message-when-importing-decks-with-v1-scheduler/31352/3
2023-06-22 09:46:09 +10:00
Damien Elmes
ba6325b47f Make some more fields/methods public
Continuation of https://github.com/ankitects/anki/issues/2494
2023-06-20 21:59:49 +10:00
Damien Elmes
c447999b4a Report actual error when DbError occurs 2023-06-20 21:58:27 +10:00
Damien Elmes
44c5fbac51 Fix tools/web-watch 2023-06-20 20:40:43 +10:00