Skip to content
Merged
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
20 changes: 13 additions & 7 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,18 @@

# odbc-sys links against a driver manager, and the C sources vendored by
# aws-lc-sys, libsqlite3-sys and zstd-sys need a compiler. Nothing here
# reaches for OpenSSL: SQLPage speaks TLS through rustls.
# reaches for OpenSSL: SQLPage speaks TLS through rustls. build.rs embeds
# the browser assets, so every cargo gate builds them with npm first.
cargoRuntime = pkgs: [
(rustToolchainFor pkgs)
pkgs.stdenv.cc
pkgs.unixodbc
pkgs.nodejs_26
];
buildBrowserAssets = ''
npm ci --ignore-scripts
npm run build
'';
# The database matrix runs prebuilt test binaries that link the unixODBC
# driver manager statically. It still reads ODBCSYSINI at run time and
# dlopens whatever absolute path this file names, so pointing that one
Expand Down Expand Up @@ -157,6 +163,9 @@
env = cargoEnv pkgs;
script = ''
cargo fmt --all -- --check
''
+ buildBrowserAssets
+ ''
cargo clippy --all-targets --all-features -- -D warnings
'';
};
Expand All @@ -165,18 +174,16 @@
description = "Run the Rust test suites against DATABASE_URL, or SQLite when it is unset";
packages = cargoRuntime pkgs;
env = cargoEnv pkgs;
script = ''
script = buildBrowserAssets + ''
cargo test "$@"
'';
};

test-browser = {
description = "Drive the components in a browser with Playwright";
packages = [ pkgs.nodejs_26 ] ++ cargoRuntime pkgs;
packages = cargoRuntime pkgs;
env = cargoEnv pkgs // playwrightEnv pkgs;
script = ''
npm ci --ignore-scripts
npm run build
script = buildBrowserAssets + ''
cd tests/end-to-end
npx playwright test "$@"
'';
Expand Down Expand Up @@ -223,7 +230,6 @@
(with pkgs; [
biome
hurl
nodejs_26
pkg-config
sqlite
])
Expand Down
Loading