We run clippy twice: once to generate the JSON format for the code
quality report, and the second time to get the real output which
should be faster because the build is cached.
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.
It seems weird to mix cargo build data with build artifacts. And since
we need to copy the binary to the proper location anyway, let's just use
a different directory than `src`.
To the pre-commit checks, we add the checks about translatable strings,
as well as the check about sorting in blp-resources.in.
We also run `blueprint-compiler format` in CI to make sure that we have
consistent formatting.
There are issues currently with the only flatpak-arch64 CI runner that
prevents us from merging anything.
This means that the nightly aarch64 Flatpak will not be updated as long
as the problem is not fixed.
Given that they are built in release mode, they already take longer to
compile.
If we run cargo test, they will be compiled again in debug mode and are
very likely to reach the timeout.
The rust-nightly Flatpak SDK extension is deprecated, and my attempts
to bundle it in a Flatpak manifest have failed.
This removes a few nice features like the index page, or types linking
to their docs in the corresponding crate's docs.
Instead we will use the flatpak-cargo-generator script from
flatpak-builder-tools for Flathub builds.
This is not a problem for reproducible builds since everything has a
hash (commit or Cargo.lock).