diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 00000000..b8728fc8 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,12 @@ +# Faster linking for local dev rebuilds. +# Uses lld instead of the default bfd linker; requires `lld` from the flake +# devShell. Run `direnv reload` after changing flake.nix. +[target.x86_64-unknown-linux-gnu] +rustflags = ["-C", "link-arg=-fuse-ld=lld"] + +# Build first and run the resulting binary outside Cargo. This lets client, +# server, and test builds share the target cache without a long-lived +# `cargo run` process holding up another Cargo invocation. +[alias] +watch-client = ["watch", "--delay", "0.1", "--ignore", "**/common/src/proto/**", "--exec", "build --package client", "--shell", "workspace_manifest=$(cargo locate-project --workspace --message-format plain); exec ${workspace_manifest%Cargo.toml}target/debug/client client"] +watch-server = ["watch", "--why", "--delay", "0.1", "--ignore", "**/common/src/proto/**", "--exec", "build --package server", "--shell", "workspace_manifest=$(cargo locate-project --workspace --message-format plain); exec ${workspace_manifest%Cargo.toml}target/debug/server server"] diff --git a/.gitignore b/.gitignore index 51745b07..2ba94e12 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ tui-pages-cli/ tui-canvas-validation-core/ WEBSITE.md mutants*/ +AGENT_TESTING_NOTES.md diff --git a/Cargo.toml b/Cargo.toml index 0963c8a0..6808fe25 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -63,3 +63,15 @@ common = { path = "./common" } [patch.crates-io] tui-pages = { path = "tui-pages" } tui-canvas = { path = "tui-canvas" } + +# Fast dev loop: keep both workspace crates and dependencies cheap to compile. +# Backtraces still contain symbol names, but omit source line information. +[profile.dev] +opt-level = 0 +debug = 0 +incremental = true +overflow-checks = true + +[profile.dev.package."*"] +opt-level = 0 +debug = false diff --git a/README.md b/README.md index 1941fde6..70549ae5 100644 --- a/README.md +++ b/README.md @@ -20,8 +20,18 @@ libraries. Server and client: ``` -cargo watch --why -x 'run --package server -- server' -cargo watch -x 'run --package client -- client' +cargo watch-server +cargo watch-client +``` + +These aliases only watch each application's local dependency tree. They build +through Cargo, then run the binary separately so concurrent tests can reuse the +same build cache. + +To connect a client to a second server instance, override its gRPC endpoint: + +``` +GRPC_ENDPOINT='http://[::1]:50052' cargo watch-client ``` Client with tracing: diff --git a/client b/client index f8bc80a4..75221c3a 160000 --- a/client +++ b/client @@ -1 +1 @@ -Subproject commit f8bc80a415138e4eb5cb9b70523a9556250d21d4 +Subproject commit 75221c3adb22e3c6d8da59f9a93d5797d49bf7df diff --git a/common/proto/tables_data.proto b/common/proto/tables_data.proto index ba453903..a27afb5f 100644 --- a/common/proto/tables_data.proto +++ b/common/proto/tables_data.proto @@ -165,6 +165,9 @@ message PostTableDataResponse { // Revision committed for the inserted row. int64 row_revision = 4; + + // Journal created or updated by automatic accounting, when applicable. + optional int64 journal_id = 5; } // One row in a bulk insert request. @@ -251,6 +254,9 @@ message PutTableDataResponse { // Revision committed for the updated row. int64 row_revision = 4; + + // Journal updated by automatic accounting, when applicable. + optional int64 journal_id = 5; } message TableUpdateImpactRequest { diff --git a/common/src/proto/descriptor.bin b/common/src/proto/descriptor.bin index aaf51e5f..d840f0b6 100644 Binary files a/common/src/proto/descriptor.bin and b/common/src/proto/descriptor.bin differ diff --git a/common/src/proto/komp_ac.tables_data.rs b/common/src/proto/komp_ac.tables_data.rs index 4475787c..7a924291 100644 --- a/common/src/proto/komp_ac.tables_data.rs +++ b/common/src/proto/komp_ac.tables_data.rs @@ -72,6 +72,9 @@ pub struct PostTableDataResponse { /// Revision committed for the inserted row. #[prost(int64, tag = "4")] pub row_revision: i64, + /// Journal created or updated by automatic accounting, when applicable. + #[prost(int64, optional, tag = "5")] + pub journal_id: ::core::option::Option, } /// One row in a bulk insert request. #[derive(Clone, PartialEq, ::prost::Message)] @@ -181,6 +184,9 @@ pub struct PutTableDataResponse { /// Revision committed for the updated row. #[prost(int64, tag = "4")] pub row_revision: i64, + /// Journal updated by automatic accounting, when applicable. + #[prost(int64, optional, tag = "5")] + pub journal_id: ::core::option::Option, } #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct TableUpdateImpactRequest { diff --git a/flake.nix b/flake.nix index 9642b839..5c0adb5d 100644 --- a/flake.nix +++ b/flake.nix @@ -13,6 +13,8 @@ in { devShells.default = pkgs.mkShell { + LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [ pkgs.openssl ]; + buildInputs = with pkgs; [ mermaid-cli # Rust toolchain @@ -34,6 +36,8 @@ # C build tools (for your linker issue) gcc binutils + # Fast linker (lld) for quicker dev rebuilds + lld pkg-config # OpenSSL for crypto dependencies diff --git a/server b/server index f83ebc80..f57088e5 160000 --- a/server +++ b/server @@ -1 +1 @@ -Subproject commit f83ebc802a1847a42bf2b193b7e2f31e8d5c5a74 +Subproject commit f57088e548dd3afb14f018697a12e82b13863b42