Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
[target.aarch64-apple-darwin]
rustflags = [
"-C", "link-arg=-Wl,-rpath,/Library/Developer/CommandLineTools/usr/lib",
"-Z", "threads=8",
]

[target.aarch64-apple-darwin.env]
Expand All @@ -10,7 +11,10 @@ DYLD_FALLBACK_LIBRARY_PATH = "/Library/Developer/CommandLineTools/usr/lib"
DYLD_LIBRARY_PATH = "/Library/Developer/CommandLineTools/usr/lib"

[target.x86_64-apple-darwin]
rustflags = ["-C", "link-arg=-Wl,-rpath,/Library/Developer/CommandLineTools/usr/lib"]
rustflags = [
"-C", "link-arg=-Wl,-rpath,/Library/Developer/CommandLineTools/usr/lib",
"-Z", "threads=8",
]

[target.x86_64-apple-darwin.env]
LIBCLANG_PATH = "/Library/Developer/CommandLineTools/usr/lib"
Expand All @@ -31,16 +35,19 @@ rustflags = []
rustflags = [
"-C", "target-feature=+crt-static",
"-C", "link-args=-static -static-libgcc -static-libstdc++",
"-Z", "threads=8",
]

# --- Windows (MSVC) ---
[target.x86_64-pc-windows-msvc]
# Usually no special flags are needed, but you can add linker hints if needed
rustflags = []
rustflags = ["-Z", "threads=8"]

[build]
incremental = true
# Parallel compilation will use default (all available cores)
rustflags = ["-Z", "threads=8"]

# Cranelift is not the default codegen backend. It drops aws-lc-sys C symbols
# (`__aws_lc_0_41_0_*`) when linking kalamdb-server on aarch64-apple-darwin.

# Use sparse registry protocol for faster dependency resolution
[registries.crates-io]
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
env:
CARGO_TERM_COLOR: always
RUST_VERSION: "1.92.0"
CARGO_ENCODED_RUSTFLAGS: ""
RUSTC_WRAPPER: ""
CARGO_BUILD_RUSTC_WRAPPER: ""
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/cli-cluster-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ permissions:
env:
CARGO_TERM_COLOR: always
RUST_VERSION: "1.92.0"
CARGO_ENCODED_RUSTFLAGS: ""
RUSTC_WRAPPER: ""
CARGO_BUILD_RUSTC_WRAPPER: ""
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ on:

env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
CARGO_ENCODED_RUSTFLAGS: ""

jobs:
analyze:
Expand Down
38 changes: 33 additions & 5 deletions .github/workflows/dart-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ permissions:
env:
CARGO_TERM_COLOR: always
RUST_VERSION: "1.92.0"
CARGO_ENCODED_RUSTFLAGS: ""
RUSTC_WRAPPER: ""
CARGO_BUILD_RUSTC_WRAPPER: ""
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
Expand Down Expand Up @@ -185,7 +186,7 @@ jobs:
id: run_tests
continue-on-error: true
shell: bash
working-directory: link/sdks/dart
working-directory: link/sdks/dart/link
env:
KALAMDB_URL: "http://localhost:2900"
KALAMDB_USER: "admin"
Expand All @@ -197,6 +198,33 @@ jobs:
set -euo pipefail
bash ./test.sh

- name: Run Kalam Sync tests
id: run_sync_tests
continue-on-error: true
shell: bash
working-directory: link/sdks/dart/sync
env:
KALAM_INTEGRATION_TEST: "1"
KALAMDB_URL: "http://localhost:2900"
KALAMDB_USER: "admin"
KALAMDB_PASSWORD: "kalamdb123"
run: |
set -euo pipefail
flutter analyze
flutter test

- name: Run Kalam Sync generator tests
id: run_generator_tests
continue-on-error: true
shell: bash
working-directory: link/sdks/dart/generator
run: |
set -euo pipefail
flutter pub run build_runner build
flutter analyze
dart test
flutter test flutter_test/generated_action_runtime_e2e_test.dart

- name: Parse Dart SDK test counts
if: always()
id: parse_badge
Expand Down Expand Up @@ -301,10 +329,10 @@ jobs:
if-no-files-found: ignore

- name: Fail if Dart SDK tests failed
if: always() && steps.run_tests.outcome != 'success'
if: ${{ always() && (steps.run_tests.outcome != 'success' || steps.run_sync_tests.outcome != 'success' || steps.run_generator_tests.outcome != 'success') }}
shell: bash
run: |
echo "Dart SDK tests failed" >&2
echo "One or more Dart package test suites failed" >&2
exit 1

update_badge:
Expand Down Expand Up @@ -392,8 +420,8 @@ jobs:

- name: Publish Dart package
shell: bash
working-directory: link/sdks/dart
working-directory: link/sdks/dart/link
run: |
set -euo pipefail
chmod +x ./publish.sh
./publish.sh
./publish.sh
1 change: 1 addition & 0 deletions .github/workflows/python-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ on:

env:
CARGO_TERM_COLOR: always
CARGO_ENCODED_RUSTFLAGS: ""
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"

jobs:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/react-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ permissions:
env:
CARGO_TERM_COLOR: always
RUST_VERSION: "1.92.0"
CARGO_ENCODED_RUSTFLAGS: ""
WASM_PACK_VERSION: "0.15.0"
KALAMDB_URL: "http://127.0.0.1:2900"
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ permissions:
env:
CARGO_TERM_COLOR: always
RUST_VERSION: "1.92.0"
CARGO_ENCODED_RUSTFLAGS: ""
WASM_PACK_VERSION: "0.15.0"
PG_EXTENSION_MAJOR: "16"
PG_EXTENSION_FLAVOR: "pg16"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/rust-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ permissions:
env:
CARGO_TERM_COLOR: always
RUST_VERSION: "1.92.0"
CARGO_ENCODED_RUSTFLAGS: ""
RUSTC_WRAPPER: ""
CARGO_BUILD_RUSTC_WRAPPER: ""
CRITICAL_COVERAGE_MIN_PCT: "90.0"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/rust-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ permissions:
env:
CARGO_TERM_COLOR: always
RUST_VERSION: "1.92.0"
CARGO_ENCODED_RUSTFLAGS: ""
RUSTC_WRAPPER: ""
CARGO_BUILD_RUSTC_WRAPPER: ""
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/typescript-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ permissions:
env:
CARGO_TERM_COLOR: always
RUST_VERSION: "1.92.0"
CARGO_ENCODED_RUSTFLAGS: ""
WASM_PACK_VERSION: "0.15.0"
RUSTC_WRAPPER: ""
CARGO_BUILD_RUSTC_WRAPPER: ""
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
- 'link/sdks/rust/Cargo.toml'
- 'link/sdks/rust/**'
- 'link/sdks/typescript/**/package.json'
- 'link/sdks/dart/pubspec.yaml'
- 'link/sdks/dart/**/pubspec.yaml'
- 'link/sdks/python/pyproject.toml'
- 'link/sdks/python/Cargo.toml'
- 'versions.json'
Expand Down Expand Up @@ -48,4 +48,4 @@ jobs:
shell: bash
run: |
set -euo pipefail
python3 scripts/versions.py verify
python3 scripts/versions.py verify
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ ui/package-lock.json
/target_cli_option_matrix
/target_sec
/target_cli_smoke_run
/link/sdks/dart/build
/link/sdks/dart/.dart_tool
/link/sdks/dart/link/build
/link/sdks/dart/link/.dart_tool
/vendor
/link/sdks/typescript/.wasm-cargo-home-test1
/link/sdks/typescript/.wasm-cargo-home-test2
Expand Down Expand Up @@ -143,3 +143,5 @@ cli/kalam.toml
/examples/live-okf-context-sync/data3
/examples/live-okf-context-sync/data5
/specs/033-unified-backend-pgwire/validation
/link/sdks/dart/.dart_tool
rust-toolchain.toml
6 changes: 3 additions & 3 deletions .ignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ docs/plans/*.png
**/target/
**/.wasm-cargo-home/
**/.wasm-target/
link/sdks/dart/lib/src/generated/
link/sdks/dart/build/
link/sdks/dart/.dart_tool/
link/sdks/dart/link/lib/src/generated/
link/sdks/dart/link/build/
link/sdks/dart/link/.dart_tool/

# Runtime output.
logs/
Expand Down
7 changes: 5 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ Keep context small. Read only the files needed for the current task. Do not scan
- `cli/`: CLI and smoke tests.
- `link/`: SDK bridge workspace.
- `link/sdks/typescript/`: TypeScript SDK.
- `link/sdks/dart/`: Dart SDK. `link/sdks/dart/lib/src/generated` is generated; regenerate via `link/sdks/dart/build.sh`.
- `link/sdks/dart/link/`: `kalam_link` Dart transport SDK. `lib/src/generated` is generated; regenerate via its `build.sh`.
- `link/sdks/dart/sync/`: `kalam_sync` Flutter local-first runtime.
- `link/sdks/dart/generator/`: `kalam_sync_generator` action generator.
- `link/kalam-link-dart/`: Rust bridge for Dart.
- `pg/`: PostgreSQL extension.
- `benchv2/`: benchmarks.
Expand Down Expand Up @@ -62,6 +64,7 @@ Keep context small. Read only the files needed for the current task. Do not scan

## Build And Test

- Local check/test/run stays on the default dev profile. No `--release` unless packaging.
- Batch compile feedback. For multi-file changes, finish an edit batch, then run one check and capture output, for example `cargo check > batch_compile_output.txt 2>&1`.
- When there are multiple compiler errors, fix them from one captured output file instead of repeatedly running `cargo check`.
- Use `cargo nextest run` for tests unless explicitly told otherwise.
Expand All @@ -77,7 +80,7 @@ Keep context small. Read only the files needed for the current task. Do not scan
- Backend run: `cd backend && cargo run --bin kalamdb-server`
- Backend fast check (local dev, no S3/mimalloc/tracing): `cargo check -p kalamdb-server`
- Backend prod-like build: `cargo build -p kalamdb-server --no-default-features --features embedded-ui,mimalloc,traceability,cloud-aws`
- CLI build: `cd cli && cargo build --release`
- CLI build: `cd cli && cargo build`
- CLI smoke: `cd cli && KALAMDB_SERVER_URL="http://localhost:3000" KALAMDB_ROOT_PASSWORD="mypass" cargo test --test smoke -- --nocapture`
- Full sweep: start the backend server, then run `./scripts/test-all.sh` from the repo root.
- Rust SDK (fast iteration): `cargo check -p kalam-client --features native-sdk,consumer,healthcheck`.
Expand Down
20 changes: 13 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,13 +260,17 @@ find . -name package.json -not -path '*/node_modules/*'

## 6. Compile and Test the Dart SDK

The Dart and Flutter SDK lives in `link/sdks/dart/`.
The Dart and Flutter packages live under `link/sdks/dart/`:

Do not edit `link/sdks/dart/lib/src/generated/` by hand. Those files are generated.
- `link/` publishes `kalam_link`;
- `sync/` publishes `kalam_sync`;
- `generator/` publishes `kalam_sync_generator`.

Do not edit `link/sdks/dart/link/lib/src/generated/` by hand. Those files are generated.

### Build the SDK and native artifacts

From `link/sdks/dart/`:
From `link/sdks/dart/link/`:

```bash
./build.sh
Expand Down Expand Up @@ -298,7 +302,7 @@ FRB_GENERATE=always ./build.sh
The supported wrapper is:

```bash
cd link/sdks/dart
cd link/sdks/dart/link
./test.sh
```

Expand All @@ -316,7 +320,7 @@ Start the backend first when you want the e2e part to run:
cd backend
cargo run

cd ../link/sdks/dart
cd ../link/sdks/dart/link
./test.sh
```

Expand All @@ -340,7 +344,9 @@ Examples:
- PG extension change: `./pg/test.sh`
- Admin UI change: `cd ui && npm run build && npm test`
- TypeScript SDK change: `cd link/sdks/typescript/client && ./test.sh`
- Dart SDK change: `cd link/sdks/dart && ./test.sh`
- Dart transport change: `cd link/sdks/dart/link && ./test.sh`
- Dart sync change: `cd link/sdks/dart/sync && flutter analyze && flutter test`
- Dart generator change: `cd link/sdks/dart/generator && flutter analyze && dart test`

For cross-cutting changes, use the repo-wide sweep after starting the backend server:

Expand All @@ -352,4 +358,4 @@ For cross-cutting changes, use the repo-wide sweep after starting the backend se

- If you change architecture or execution flow, update the relevant docs in `docs/architecture/` or `docs/architecture/decisions/`.
- If you change anything under `link/sdks/**`, update the matching SDK docs in the `KalamSite` repo as well.
- Keep commands in this file aligned with the actual scripts in `backend/`, `cli/`, `pg/`, `ui/`, and `link/sdks/`.
- Keep commands in this file aligned with the actual scripts in `backend/`, `cli/`, `pg/`, `ui/`, and `link/sdks/`.
Loading
Loading