continuwuity/nix/checks/default.nix
aviac ec3564e8aa
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m34s
Update flake hashes / update-flake-hashes (pull_request) Successful in 53s
Documentation / Build and Deploy Documentation (push) Successful in 1m3s
Release Docker Image / Build linux-amd64 (release) (pull_request) Successful in 5m29s
Checks / Prek / Pre-commit & Formatting (push) Successful in 2m38s
Release Docker Image / Build linux-arm64 (release) (pull_request) Successful in 6m49s
Release Docker Image / Build linux-amd64 (release) (push) Successful in 6m53s
Release Docker Image / Create Multi-arch Release Manifest (pull_request) Successful in 8s
Release Docker Image / Build linux-arm64 (release) (push) Successful in 6m44s
Checks / Prek / Clippy and Cargo Tests (push) Successful in 10m30s
Release Docker Image / Create Multi-arch Release Manifest (push) Successful in 17s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 28m34s
Release Docker Image / Build linux-amd64 (max-perf) (pull_request) Successful in 15m12s
Release Docker Image / Build linux-arm64 (max-perf) (pull_request) Successful in 15m4s
Release Docker Image / Create Max-Perf Manifest (pull_request) Successful in 7s
Release Docker Image / Build linux-amd64 (max-perf) (push) Successful in 23m34s
Release Docker Image / Build linux-arm64 (max-perf) (push) Successful in 12m19s
Release Docker Image / Create Max-Perf Manifest (push) Successful in 16s
chore: use upstream rust-jemalloc-sys-unprefixed after flake.lock update
2025-10-27 12:55:21 +00:00

108 lines
3.4 KiB
Nix

{ inputs, ... }:
{
perSystem =
{
self',
lib,
pkgs,
...
}:
let
uwulib = inputs.self.uwulib.init pkgs;
rocksdbAllFeatures = self'.packages.rocksdb.override {
enableJemalloc = true;
enableLiburing = true;
};
commonAttrs = (uwulib.build.commonAttrs { }) // {
buildInputs = [
pkgs.liburing
pkgs.rust-jemalloc-sys-unprefixed
rocksdbAllFeatures
];
nativeBuildInputs = [
pkgs.pkg-config
# bindgen needs the build platform's libclang. Apparently due to "splicing
# weirdness", pkgs.rustPlatform.bindgenHook on its own doesn't quite do the
# right thing here.
pkgs.rustPlatform.bindgenHook
];
env = {
LIBCLANG_PATH = lib.makeLibraryPath [ pkgs.llvmPackages.libclang.lib ];
LD_LIBRARY_PATH = lib.makeLibraryPath [
pkgs.liburing
pkgs.rust-jemalloc-sys-unprefixed
rocksdbAllFeatures
];
}
// uwulib.environment.buildPackageEnv
// {
ROCKSDB_INCLUDE_DIR = "${rocksdbAllFeatures}/include";
ROCKSDB_LIB_DIR = "${rocksdbAllFeatures}/lib";
};
};
cargoArtifacts = self'.packages.continuwuity-all-features-deps;
in
{
# taken from
#
# https://crane.dev/examples/quick-start.html
checks = {
continuwuity-all-features-build = self'.packages.continuwuity-all-features-bin;
continuwuity-all-features-clippy = uwulib.build.craneLibForChecks.cargoClippy (
commonAttrs
// {
inherit cargoArtifacts;
cargoClippyExtraArgs = "-- --deny warnings";
}
);
continuwuity-all-features-docs = uwulib.build.craneLibForChecks.cargoDoc (
commonAttrs
// {
inherit cargoArtifacts;
# This can be commented out or tweaked as necessary, e.g. set to
# `--deny rustdoc::broken-intra-doc-links` to only enforce that lint
env.RUSTDOCFLAGS = "--deny warnings";
}
);
# Check formatting
continuwuity-all-features-fmt = uwulib.build.craneLibForChecks.cargoFmt {
src = uwulib.build.src;
};
continuwuity-all-features-toml-fmt = uwulib.build.craneLibForChecks.taploFmt {
src = pkgs.lib.sources.sourceFilesBySuffices uwulib.build.src [ ".toml" ];
# taplo arguments can be further customized below as needed
taploExtraArgs = "--config ${inputs.self}/taplo.toml";
};
# Audit dependencies
continuwuity-all-features-audit = uwulib.build.craneLibForChecks.cargoAudit {
inherit (inputs) advisory-db;
src = uwulib.build.src;
};
# Audit licenses
continuwuity-all-features-deny = uwulib.build.craneLibForChecks.cargoDeny {
src = uwulib.build.src;
};
# Run tests with cargo-nextest
# Consider setting `doCheck = false` on `continuwuity-all-features` if you do not want
# the tests to run twice
continuwuity-all-features-nextest = uwulib.build.craneLibForChecks.cargoNextest (
commonAttrs
// {
inherit cargoArtifacts;
partitions = 1;
partitionType = "count";
cargoNextestPartitionsExtraArgs = "--no-tests=pass";
}
);
};
};
}