From aab745deddb5bf27a34fcd6bc21a79d107037019 Mon Sep 17 00:00:00 2001 From: 06kellyjac Date: Fri, 21 Jan 2022 22:34:38 +0000 Subject: [PATCH] cargo-geiger: 0.10.2 -> 0.11.2 --- .../tools/rust/cargo-geiger/default.nix | 40 +++++++++++++------ .../rust/cargo-geiger/update-cargo-lock.sh | 19 --------- 2 files changed, 28 insertions(+), 31 deletions(-) delete mode 100755 pkgs/development/tools/rust/cargo-geiger/update-cargo-lock.sh diff --git a/pkgs/development/tools/rust/cargo-geiger/default.nix b/pkgs/development/tools/rust/cargo-geiger/default.nix index bd71a14b4a04..28511223be04 100644 --- a/pkgs/development/tools/rust/cargo-geiger/default.nix +++ b/pkgs/development/tools/rust/cargo-geiger/default.nix @@ -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 ]; }; } diff --git a/pkgs/development/tools/rust/cargo-geiger/update-cargo-lock.sh b/pkgs/development/tools/rust/cargo-geiger/update-cargo-lock.sh deleted file mode 100755 index 6e077c6733f3..000000000000 --- a/pkgs/development/tools/rust/cargo-geiger/update-cargo-lock.sh +++ /dev/null @@ -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"