mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-12-05 06:26:30 +01:00
docs(recorder): the recorder is documented as part of the komorebi repository
This commit is contained in:
1 parent
a0f7d871e5
commit
e499ebb774
8 files changed
+37
-104
No files matched your search
@@ -140,8 +140,8 @@ Tiers (the `tier` in each suite's `default.nix`; CI runs `fast` on every pull re
|
||||
|
||||
To run only some steps of a suite: `E2E_ONLY=stacks,monocle nix build --impure .#legacyPackages.x86_64-linux.vm.core-e2e -L`
|
||||
(a substring of the printed `module.function`; `KFDE_ONLY` is the old name).
|
||||
To record a run: `KOMOREBI_RECORDER=$(nix build ~/komorebi-recorder#komorebi-recorder --no-link --print-out-paths)
|
||||
nix build --impure .#legacyPackages.x86_64-linux.vm.core-lock -L` (the recorder's repository is private; `core-e2e` and
|
||||
To record a run: `KOMOREBI_RECORDER=$(nix build .#komorebi-recorder --no-link --print-out-paths)
|
||||
nix build --impure .#legacyPackages.x86_64-linux.vm.core-lock -L` (`core-e2e` and
|
||||
`core-lock` keep `recording-NAME.tar.gz`). Details, the library and how to add a suite:
|
||||
[docs/linux/dev/vm-tests.md](../linux/dev/vm-tests.md). The suites use a daemon
|
||||
built once with the constant stamp, so a new commit does not rebuild it.
|
||||
|
||||
@@ -402,11 +402,11 @@ the fake and fails on KDE has found a bug in the fake, the library or the daemon
|
||||
|
||||
## Recording a run with komorebi-recorder
|
||||
|
||||
`komorebi-recorder`'s repository is private, so it is not an input of the flake. A run that wants
|
||||
it builds it elsewhere and passes the store path, evaluating with `--impure`:
|
||||
`komorebi-recorder` is a package of this flake (`.#komorebi-recorder`), but the suites do not depend on it:
|
||||
a run that wants it builds it and passes the store path, evaluating with `--impure`:
|
||||
|
||||
```sh
|
||||
KOMOREBI_RECORDER=$(nix build ~/komorebi-recorder#komorebi-recorder --no-link --print-out-paths) \
|
||||
KOMOREBI_RECORDER=$(nix build .#komorebi-recorder --no-link --print-out-paths) \
|
||||
nix build --impure .#legacyPackages.x86_64-linux.vm.core-lock -L
|
||||
```
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ The rest of the crate never names a system API. [`platform`](../komorebi-recorde
|
||||
small modules (`clock`, `shell` and, as the recorder grows, `capture`, `power`, `session`, `trace`, `process`, `apps`
|
||||
and `window`), and `cfg` selects the directory behind it: `platform/macos/`, `platform/win/` or `platform/unsupported.rs`.
|
||||
Each host provides the same names with the same signatures. A missing or mismatched function is a compile error on the
|
||||
host being built, and on no other, so the Windows host is built from a Mac by `just check-windows` and by CI, and
|
||||
host being built, and on no other, so the Windows host is built from a Mac by `nix build .#checks.x86_64-linux.windows-clippy` and by CI, and
|
||||
`unsupported` (which exists so that the commands that only read a session directory work on a Linux agent box) is built
|
||||
only on a third OS.
|
||||
|
||||
@@ -103,7 +103,7 @@ schema, warnings, whether it was truncated and a cursor, and failures exit with
|
||||
|
||||
| Rule | Enforced by |
|
||||
|---|---|
|
||||
| Every host provides the same functions with the same signatures | the compiler, for the host being built; `just check-windows` and CI build the Windows host from a Mac; nothing builds `unsupported` |
|
||||
| Every host provides the same functions with the same signatures | the compiler, for the host being built; `nix build .#checks.x86_64-linux.windows-clippy` and CI build the Windows host from a Mac; nothing builds `unsupported` |
|
||||
| A timestamp in a session is on the master clock | convention, and the tests that place records at known times: the type is a plain `u64` |
|
||||
| An implementor of `Rules` answers every question that has no default | the type system: a missing method is E0046, proved by a `compile_fail` example on `Rules` |
|
||||
| Code that reads komorebi's output asks `Rules` and does not match on `Flavor` | convention only |
|
||||
|
||||
@@ -46,16 +46,17 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
## Development environment
|
||||
|
||||
The project is built with Nix. `nix develop` (or direnv, whose `.envrc` is `use flake`) provides the
|
||||
Rust toolchain with nightly `rustfmt`, `cargo-deny`, `cargo-nextest`, `ffmpeg`, `jq`, `just`,
|
||||
`resvg` and `ripgrep`, and sets `KOMOREBI_MAC_SRC` and `KOMOREBI_WINDOWS_SRC` (with `_COMMIT`) to the komorebi
|
||||
sources pinned in `flake.lock`. The tests that read komorebi's source need them, so run `cargo` inside
|
||||
the shell.
|
||||
The recorder is built in the komorebi repository, with Nix. `nix develop` provides the Rust toolchain with
|
||||
nightly `rustfmt`, `cargo-deny`, `cargo-nextest`, `ffmpeg`, `jq`, `just`, `resvg` and `ripgrep`, and on Linux the
|
||||
GStreamer libraries. The recorder indexes the log statements of the komorebi source around it
|
||||
(`komorebi-recorder/build.rs`), so the tests that read it need no setting: `KOMOREBI_SRC` and
|
||||
`KOMOREBI_COMMIT` are only for a build outside a checkout (nix).
|
||||
|
||||
The Windows code is type-checked from a Mac with `nix develop .#windows`, whose target is
|
||||
`x86_64-pc-windows-msvc`. Nothing there runs it: a change to a `cfg(windows)` line is first run by the
|
||||
`windows` job in CI.
|
||||
On a Windows machine, the steps in [docs/dev/windows-checkpoints.md](docs/dev/windows-checkpoints.md)
|
||||
The default `nix develop` shell cross-compiles for `x86_64-pc-windows-msvc`, which type-checks the Windows code
|
||||
from a Mac or Linux machine (`just` drops that target for the native recipes). `nix develop .#native` leaves the
|
||||
target out. Nothing there runs the Windows code: a change to a `cfg(windows)` line is first run by the
|
||||
Windows workflow in CI.
|
||||
On a Windows machine, the steps in [windows-checkpoints.md](dev/windows-checkpoints.md)
|
||||
say what to run and what to look for.
|
||||
|
||||
The icon is `komorebi-recorder/assets/watermelon.svg`. After changing it, run `just icon` to render the PNG that
|
||||
@@ -66,11 +67,13 @@ the windows set and the ICO that Windows embeds, and commit the three together.
|
||||
Before pushing, run
|
||||
|
||||
```sh
|
||||
just check
|
||||
just fmt
|
||||
just lint
|
||||
nix build -L .#checkSets.recorder-lint .#checkSets.recorder-test .#checkSets.fmt .#checkSets.deny
|
||||
```
|
||||
|
||||
which runs formatting, clippy and the tests for macOS, clippy for Windows, rustdoc with its warnings as
|
||||
errors for both hosts, and `cargo deny`. `just --list` shows the other recipes.
|
||||
which formats, runs the macros the codebase does not allow, and runs clippy and the tests of the recorder, the
|
||||
format checks and `cargo deny` of the workspace. `just --list` shows the other recipes.
|
||||
|
||||
## Commits
|
||||
|
||||
|
||||
@@ -196,5 +196,5 @@ desktop, so an analysis of a KDE session says so, as it does for Windows.
|
||||
prints nowhere, and start komorebi with `--log-level debug` and `RUST_LOG=komorebi=debug`.
|
||||
- **Investigating on any host.** A session is read the same everywhere. `ffmpeg` is needed only for `frames` and
|
||||
`selftest`.
|
||||
- **Changing code that has a host-specific part.** Provide the function on every host, and run `just check-windows` from a
|
||||
- **Changing code that has a host-specific part.** Provide the function on every host, and run `nix build .#checks.x86_64-linux.windows-clippy` from a
|
||||
Mac: it type-checks every `cfg(windows)` line, tests included.
|
||||
@@ -20,9 +20,9 @@ ls result-windows/bin
|
||||
```
|
||||
|
||||
Copy `komorebi-recorder.exe` to the Windows machine. The `windows` job of CI builds the same executables natively and
|
||||
uploads them, with the installer, as artifacts of the run. To check that the Windows code still type-checks
|
||||
without building it: `nix flake check` (the `komorebi-recorder-windows-clippy` check) or
|
||||
`nix develop .#windows --command cargo clippy --all-targets`.
|
||||
uploads them, with the komorebi installer that carries them, as artifacts of the run. To check that the Windows
|
||||
code still type-checks without building it: `nix build .#checks.x86_64-linux.windows-clippy` or, in the default
|
||||
`nix develop` shell, `cargo clippy -p komorebi-recorder --all-targets`.
|
||||
|
||||
## W0: what komorebi for Windows really sends
|
||||
|
||||
|
||||
Reference in new issue
Block a user