Skip to content
Merged
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
5 changes: 4 additions & 1 deletion libs/opsqueue_python/opsqueue_python.nix
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ let
cargoExtraArgs = "--package opsqueue_python";
doCheck = false;
};
cargoArtifacts = craneLib.buildDepsOnly (commonArgs // { pname = pname; });
# The `cargo build` still catches the same errors as `cargo check`. The `nix build` executes them
# serially, this is the slowest part on CI. We have other CI linting steps, i.e. `cargo clippy`,
# that report these errors earlier.
cargoArtifacts = craneLib.buildDepsOnly (commonArgs // { cargoCheckCommand = "true"; });

wheelTail = "py3-abi3-linux_x86_64";
wheelName = "opsqueue-${version}-${wheelTail}.whl";
Expand Down
14 changes: 10 additions & 4 deletions opsqueue/opsqueue.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@ let
sources = import ../nix/sources.nix;
crane = import sources.crane { pkgs = pkgs; };
craneLib = crane.overrideToolchain (pkgs: rustToolchain);
extraFileFilter = path: _type: builtins.match "^.*\.(db|sql)$" path != null;
fileFilter = path: type: (extraFileFilter path type) || (craneLib.filterCargoSources path type);

# Only the files necessary to build the Rust-side and cache dependencies
sqlFileFilter = path: _type: builtins.match "^.*\.(db|sql)$" path != null;
rustCrateFileFilter =
path: type: (sqlFileFilter path type) || (craneLib.filterCargoSources path type);

# src = craneLib.cleanCargoSource ../.;
src = lib.cleanSourceWith {
src = ../.;
name = "opsqueue";
filter = fileFilter;
filter = rustCrateFileFilter;
};

crateName = craneLib.crateNameFromCargoToml { cargoToml = ./Cargo.toml; };
Expand All @@ -37,7 +40,10 @@ let
cargoExtraArgs = "--package opsqueue";
doCheck = true;
};
cargoArtifacts = craneLib.buildDepsOnly commonArgs;
# The `cargo build` still catches the same errors as `cargo check`. The `nix build` executes them
# serially, this is the slowest part on CI. We have other CI linting steps, i.e. `cargo clippy`,
# that report these errors earlier.
cargoArtifacts = craneLib.buildDepsOnly (commonArgs // { cargoCheckCommand = "true"; });
in
craneLib.buildPackage (
commonArgs
Expand Down
Loading