Merge pull request #156104 from 06kellyjac/cargo-geiger
This commit is contained in:
commit
7800a323ce
2 changed files with 28 additions and 31 deletions
|
@ -1,27 +1,20 @@
|
|||
{ stdenv, lib, fetchFromGitHub
|
||||
, rustPlatform, pkg-config, openssl
|
||||
# testing packages
|
||||
, cargo-insta
|
||||
# darwin dependencies
|
||||
, Security, CoreFoundation, libiconv
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "cargo-geiger";
|
||||
version = "0.10.2";
|
||||
version = "0.11.2";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "rust-secure-code";
|
||||
repo = pname;
|
||||
rev = "${pname}-${version}";
|
||||
sha256 = "1z920p8i3gkjadyd6bqjk4i5yr5ds3m3sbcnf7plcqr69dsjr4b8";
|
||||
sha256 = "sha256-KkOLDSnLneal3m+CrYKKIoeO61rjXEDq4GK3kPwQxj4=";
|
||||
};
|
||||
|
||||
cargoSha256 = "1wf9758gyaxgyajjzy5phirg922n9wv0qmy67zjmxj56ayf0l9lm";
|
||||
|
||||
checkPhase = ''
|
||||
${cargo-insta}/bin/cargo-insta test
|
||||
'';
|
||||
cargoSha256 = "sha256-i7xDEzZAN2ubW1Q6MhY+xsb9XiUajNDHLdtDuO5r6jA=";
|
||||
|
||||
buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ Security libiconv ];
|
||||
nativeBuildInputs = [ pkg-config ];
|
||||
|
@ -33,10 +26,33 @@ rustPlatform.buildRustPackage rec {
|
|||
export NIX_CFLAGS_COMPILE="-F${CoreFoundation}/Library/Frameworks $NIX_CFLAGS_COMPILE"
|
||||
'';
|
||||
|
||||
# skip tests with networking or other failures
|
||||
checkFlags = [
|
||||
"--skip serialize_test2_quick_report"
|
||||
"--skip serialize_test3_quick_report"
|
||||
"--skip serialize_test6_quick_report"
|
||||
"--skip serialize_test2_report"
|
||||
"--skip serialize_test3_report"
|
||||
"--skip serialize_test6_report"
|
||||
"--skip test_package::case_2"
|
||||
"--skip test_package::case_3"
|
||||
"--skip test_package::case_6"
|
||||
"--skip test_package_update_readme::case_2"
|
||||
"--skip test_package_update_readme::case_3"
|
||||
"--skip test_package_update_readme::case_5"
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Detects usage of unsafe Rust in a Rust crate and its dependencies";
|
||||
homepage = "https://github.com/rust-secure-code/cargo-geiger";
|
||||
changelog = "https://github.com/rust-secure-code/cargo-geiger/blob/${pname}-${version}/CHANGELOG.md";
|
||||
description = "Detects usage of unsafe Rust in a Rust crate and its dependencies";
|
||||
longDescription = ''
|
||||
A cargo plugin that detects the usage of unsafe Rust in a Rust crate and
|
||||
its dependencies. It provides information to aid auditing and guide
|
||||
dependency selection but it can not help you decide when and why unsafe
|
||||
code is appropriate.
|
||||
'';
|
||||
license = with licenses; [ asl20 /* or */ mit ];
|
||||
maintainers = with maintainers; [ evanjs ];
|
||||
maintainers = with maintainers; [ evanjs jk ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# This updates cargo-lock.patch for the diesel version listed in default.nix.
|
||||
|
||||
set -eu -o verbose
|
||||
|
||||
here=$PWD
|
||||
version=$(cat default.nix | grep '^ version = "' | cut -d '"' -f 2)
|
||||
checkout=$(mktemp -d)
|
||||
git clone -b "cargo-geiger-$version" --depth=1 https://github.com/rust-secure-code/cargo-geiger "$checkout"
|
||||
cd "$checkout"
|
||||
|
||||
rm -f rust-toolchain
|
||||
cargo generate-lockfile
|
||||
git add -f Cargo.lock
|
||||
git diff HEAD -- Cargo.lock > "$here"/cargo-lock.patch
|
||||
|
||||
cd "$here"
|
||||
rm -rf "$checkout"
|
Loading…
Reference in a new issue