The script has become quite big so it is easier to maintain it in Rust
to add new features.
Ideally we would declare it as a single file cargo script, but that
still requires the nightly toolchain. So we make it a separate checks
crate with no dependencies, to make compilation fast.
It is a separate crate instead of a member of the workspace because
cargo insists on downloading the git dependencies of the fractal crate
before building the checks crate, which adds 20-30 seconds to the first
compilation. Sadly that means the IDEs will probably not be very helpful
when modifying it, and cargo commands run from the root of the workspace
need to point explicitly to the manifest with the `--manifest-path`
argument.
It is pre-compiled during `meson setup` and a symlink is created at
`hooks/checks-bin`, that is used by the pre-commit hook. It is a
requirement for me because I use different environments to compile
crates and to commit changes.
Incidentally, this fixes the check about sorting the POTFILEs
alphabetically.
Since the rust-stable Flatpak extension now supports it. This way we
don't need to depend on the llvm Flatpak extension, which simplifies
the configuration.
When newcomers follow the build instructions und use the pre-commit
hook, they can face an error message about toolchain not installed. I
added install instructions to fix this.
Signed-off-by: Marcus Fihlon <marcus@fihlon.swiss>
Now that the stable release is on the same codebase, it should be less
necessary to have 2 development builds.
Also since most performance issues have been fixed, it should not be
necessary anymore to build the nightly version in release mode.