Commit graph

52 commits

Author SHA1 Message Date
Damien Elmes
35ba493ed1 Bump version 2022-06-24 16:02:39 +10:00
Damien Elmes
afca4b63cf Update to Qt 6.3.1 2022-06-18 09:02:07 +10:00
Damien Elmes
c793602010 Bump version 2022-05-28 10:40:26 +10:00
Damien Elmes
2afe18c914 Bump version 2022-05-20 18:01:41 +10:00
Damien Elmes
88e09e78c5 Bump version 2022-04-20 16:40:49 +10:00
Damien Elmes
f8f06a9aa8 Bump version 2022-04-09 11:43:27 +10:00
Damien Elmes
1a4e708ec7 Update to latest rules_rust, which unblocks the tokio upgrade
Rust version has been pinned, as 1.59 gets stuck compiling pyo3_macros,
and appears to have other issues:
https://github.com/rust-lang/rust/issues/94390
2022-03-03 19:48:17 +10:00
Damien Elmes
19d11486cb Update rules_nodejs 2022-02-25 16:19:26 +10:00
Damien Elmes
1ac84d9454 update to edition 2021 2021-11-18 20:51:10 +10:00
Damien Elmes
ed7d090097 bump version 2021-10-26 14:14:20 +10:00
Damien Elmes
ba88e78c87 improve PyQt install
- use a single script for all PyQt versions
- add hashes
- add a new ./run-qt5.14 script for testing with PyQt5.14
2021-10-23 10:56:17 +10:00
Damien Elmes
6bc1cd68f2 add hashes to most Python deps
pyqt still to do
2021-10-23 08:54:34 +10:00
Damien Elmes
91ac32484a pip/ -> python/ 2021-10-18 19:50:40 +10:00
Damien Elmes
45dc83a79b switch to node 16.x for macOS aarch64 support 2021-10-16 18:07:39 +10:00
Damien Elmes
19cddac8a8 remove duplicate clang format file 2021-10-16 16:54:35 +10:00
Damien Elmes
484de62e72 download wheels using rules_python 2021-10-15 16:02:26 +10:00
Damien Elmes
32cf761e7b expose pyqt6 packages - not yet used 2021-10-15 10:47:53 +10:00
Damien Elmes
f209a72b7c move node_modules into root folder [action required]
Recommend removing ts/node_modules folder before attempting to
build after this update.

This moves ts/node_modules into the root of the project to work around
https://github.com/ankitects/anki/pull/1405#issuecomment-936213861

Also fixes the sass errors shown when running scripts/svelte-check
2021-10-07 11:42:27 +10:00
Damien Elmes
5d7eb8c425 update to latest rules_nodejs & switch to ts_project
ts_library() is deprecated and will presumably be dropped from a
future rules_nodejs, and it wasn't working with the jest tests
after updating, so we switch over to ts_project().

There are some downsides:

- It's a bit slower, as the worker mode doesn't appear to function
at the moment.
- Getting it working with a mix of source files and generated files
was quite tricky, especially as things behave differently on Windows,
and differently when editing with VS Code. Solved with a small patch
to the rules, and a wrapper script that copies everything into the
bin folder first. To keep VS Code working correctly as well, the built
files are symlinked into the source folder.
- TS libraries are not implicitly linked to node_modules, so they
can't be imported with an absolute name like "lib/proto" - we need
to use relative paths like "../lib/proto" instead. Adjusting "paths"
in tsconfig.json makes it work for TS compilation, but then it fails
at the esbuild stage. We could resolve it by wrapping the TS
libraries in a subsequent js_library() call, but that has the downside
of losing the transient dependencies, meaning they need to be listed
again.  Alternatively we might be able to solve it in the future by
adjusting esbuild, but for now the paths have been made relative to
keep things simple.

Upsides:

- Along with updates to the Svelte tooling, Svelte typing has improved.
All exports made in a Svelte file are now visible to other files that
import them, and we no longer rebuild the Svelte files when TS files
are updated, as the Svelte files do no type checking themselves, and
are just a simple transpilation. Svelte-check now works on Windows again,
and there should be no errors when editing in VS Code after you've
built the project. The only downside seems to be that cmd+clicking
on a Svelte imports jumps to the .d.ts file instead of the original now;
presumably they'll fix that in a future plugin update.
- Each subfolder now has its own tsconfig.json, and tsc can be called
directly for testing purposes (but beware it will place build products
in the source tree): ts/node_modules/.bin/tsc -b ts
- We can drop the custom esbuild_toolchain, as it's included in the
latest rules_nodejs.

Other changes:

- "image_module_support" is moved into lib/, and imported with
<reference types=...>
- Images are now imported directly from their npm package; the
extra copy step has been removed.

Windows users may need to use "bazel clean" before building this,
due to old files lying around in the build folder.
2021-10-01 12:52:53 +10:00
Damien Elmes
2b1ba8f039 bump version 2021-09-21 16:30:15 +10:00
Damien Elmes
1f5a49fe42 bump version 2021-08-29 13:42:37 +10:00
Damien Elmes
7f2c3cf477 bump version 2021-08-19 22:10:45 +10:00
Damien Elmes
091dba2b05 bump version 2021-07-31 11:00:32 +10:00
Damien Elmes
4388ca0a2e drop Rust Analyzer Bazel rule
With proper excludes set up, starting it outside of Bazel is similarly
fast, and unit tests work correctly. It also makes initial Bazel startup
faster, as the Rust sources no longer need to be fetched.
2021-07-19 23:27:11 +10:00
Damien Elmes
f0ce1cfc9d rename workspace
I'd forgotten that Bazel "helpfully" adds __init__.py files into folders
that match the workspace name, breaking imports.
2021-07-10 23:58:53 +10:00
Damien Elmes
e3b53fc078 split out remaining tags, stats, media and rendering 2021-07-10 23:16:18 +10:00
Damien Elmes
5255409093 refactor protobuf handling for split/import
In order to split backend.proto into a more manageable size, the protobuf
handling needed to be updated. This took more time than I would have
liked, as each language handles protobuf differently:

- The Python Protobuf code ignores "package" directives, and relies
solely on how the files are laid out on disk. While it would have been
nice to keep the generated files in a private subpackage, Protobuf gets
confused if the files are located in a location that does not match
their original .proto layout, so the old approach of storing them in
_backend/ will not work. They now clutter up pylib/anki instead. I'm
rather annoyed by that, but alternatives seem to be having to add an extra
level to the Protobuf path, making the other languages suffer, or trying
to hack around the issue by munging sys.modules.
- Protobufjs fails to expose packages if they don't start with a capital
letter, despite the fact that lowercase packages are the norm in most
languages :-( This required a patch to fix.
- Rust was the easiest, as Prost is relatively straightforward compared
to Google's tools.

The Protobuf files are now stored in /proto/anki, with a separate package
for each file. I've split backend.proto into a few files as a test, but
the majority of that work is still to come.

The Python Protobuf building is a bit of a hack at the moment, hard-coding
"proto" as the top level folder, but it seems to get the job done for now.

Also changed the workspace name, as there seems to be a number of Bazel
repos moving away from the more awkward reverse DNS naming style.
2021-07-10 19:17:05 +10:00
Damien Elmes
14263c7a79 move protobuf into separate folder in preparation for multiple files 2021-07-09 21:02:40 +10:00
Damien Elmes
171e2c4b46 update to latest rules_rust
- bumps rust version to 1.53
- drops support for incremental building, which is currently
disabled in stable Rust releases due to bugs. 'cargo check' can still
be used to quickly check things compile
2021-06-21 13:09:36 +10:00
Damien Elmes
585072635d bump version 2021-05-04 16:24:28 +10:00
Damien Elmes
cc91868092 move esbuild into separate repo
Most of our changes have been upstreamed, but the toolchain change
probably won't be merged soon, and a separate git repo will make it
easier to track upstream changes.

@hgiesel output_css=True will need to be changed to output_css="foo.css"
instead
2021-04-15 10:53:49 +10:00
Damien Elmes
fb1111623f update to latest esbuild 2021-04-07 14:54:40 +10:00
Damien Elmes
d52a34d414 update to latest Rust 2021-03-27 20:49:10 +10:00
Damien Elmes
2338998304 update to the latest rules_rust + security framework update 2021-03-27 19:28:19 +10:00
Damien Elmes
9dfa0301a2 bump version 2021-03-27 16:35:03 +10:00
Damien Elmes
06b0b4d68b vendor Svelte rules
The separate repo made it difficult to update the rules, and made things
more complicated than they needed to be.
2021-03-20 15:04:19 +10:00
Damien Elmes
647291f0cc bump version 2021-03-10 11:11:45 +10:00
Damien Elmes
b2b2d76ca7 bump version 2021-03-09 14:44:20 +10:00
Damien Elmes
fbc341ecff bump version
2.1.40 is another bugfix release; a 2.1.41 beta is expected to follow
within a few days
2021-02-07 13:56:11 +10:00
Damien Elmes
f3582e40c8 bump version
2.1.39 will become a cherry-picked bugfix release
2021-01-30 14:38:58 +10:00
Damien Elmes
e9dee35885 add clang-format for backend.proto formatting 2021-01-09 17:08:50 +10:00
Damien Elmes
ffd28e00e0 bump version 2020-12-26 10:36:42 +10:00
Damien Elmes
7e39686cd9 use protobuf binaries to reduce initial compile times 2020-12-23 19:49:44 +10:00
Damien Elmes
ccc99d0ccf bump version 2020-12-16 20:29:45 +10:00
Damien Elmes
45b5b7cc3a update rules_rust + persistent_worker 2020-12-10 15:35:37 +10:00
Damien Elmes
ca755175a2 bump version 2020-12-09 12:53:11 +10:00
Damien Elmes
2c0a8a25c5 trial rust worker 2020-12-03 09:28:14 +10:00
Damien Elmes
f4470f7a9e update Rust version 2020-11-25 09:02:49 +10:00
Damien Elmes
1c8dce3b6d add bazel version check for external consumers 2020-11-11 10:33:49 +10:00
Damien Elmes
4f8b19dcfb fix external consumption of ts rules, and simplify import path 2020-11-05 11:01:52 +10:00