dprint: enable doCheck with some skips
For a preparation task, replace fetchCrate with fetchFromGitHub - https://github.com/dprint/dprint/blob/0.47.6/Cargo.lock - https://github.com/dprint/dprint/tree/0.47.6/crates/test-plugin And skips some tests which cannot be succeeded even if setting DPRINT_CACHE_DIR
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
stdenv,
|
stdenv,
|
||||||
fetchCrate,
|
fetchFromGitHub,
|
||||||
rustPlatform,
|
rustPlatform,
|
||||||
installShellFiles,
|
installShellFiles,
|
||||||
testers,
|
testers,
|
||||||
@@ -13,21 +13,30 @@ rustPlatform.buildRustPackage rec {
|
|||||||
pname = "dprint";
|
pname = "dprint";
|
||||||
version = "0.47.6";
|
version = "0.47.6";
|
||||||
|
|
||||||
src = fetchCrate {
|
# Prefer repository rather than crate here
|
||||||
inherit pname version;
|
# - They have Cargo.lock in the repository
|
||||||
hash = "sha256-7tGzSFp7Dnu27L65mqFd7hzeFFDfe1xJ6cMul3hGyJs=";
|
# - They have WASM files in the repository which will be used in checkPhase
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "dprint";
|
||||||
|
repo = "dprint";
|
||||||
|
rev = "refs/tags/${version}";
|
||||||
|
hash = "sha256-zyiBFZbetKx0H47MAU4JGauAmthcuEdJMl93M6MobD8=";
|
||||||
};
|
};
|
||||||
|
|
||||||
cargoHash = "sha256-y3tV3X7YMOUGBn2hCmxsUUc9QQleKEioTIw7SGoBvSQ=";
|
cargoHash = "sha256-XuzxoJgJJl4Blw1lDnCG3faEqL9U40MhZEb9LYjiaSs=";
|
||||||
|
|
||||||
# Tests fail because they expect a test WASM plugin. Tests already run for
|
|
||||||
# every commit upstream on GitHub Actions
|
|
||||||
doCheck = false;
|
|
||||||
|
|
||||||
nativeBuildInputs = lib.optionals (stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
|
nativeBuildInputs = lib.optionals (stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
|
||||||
installShellFiles
|
installShellFiles
|
||||||
];
|
];
|
||||||
|
|
||||||
|
checkFlags = [
|
||||||
|
# Require creating directory and network access
|
||||||
|
"--skip=plugins::cache_fs_locks::test"
|
||||||
|
"--skip=utils::lax_single_process_fs_flag::test"
|
||||||
|
# Require cargo is running
|
||||||
|
"--skip=utils::process::test"
|
||||||
|
];
|
||||||
|
|
||||||
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
||||||
export DPRINT_CACHE_DIR="$(mktemp -d)"
|
export DPRINT_CACHE_DIR="$(mktemp -d)"
|
||||||
installShellCompletion --cmd dprint \
|
installShellCompletion --cmd dprint \
|
||||||
|
|||||||
Reference in New Issue
Block a user