Unverified Commit 12a63c13 authored by Doron Behar's avatar Doron Behar Committed by GitHub
Browse files

hydra-check: add basic passthru.tests & drop redundant patch (#435888)

parents befb93b6 3a7a7108
Loading
Loading
Loading
Loading
+0 −15
Original line number Diff line number Diff line
diff --git a/Cargo.toml b/Cargo.toml
index bb8d370..7c5b7ac 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -35,6 +35,10 @@ anyhow = "1.0.89"
 insta.opt-level = 3
 similar.opt-level = 3
 
+# work around https://github.com/NixOS/nixpkgs/issues/427072
+[profile.release.package.hyper]
+opt-level = 0
+
 [lints.clippy]
 pedantic = { level = "warn", priority = -1 }
 cargo = { level = "warn", priority = -1 }
+28 −11
Original line number Diff line number Diff line
@@ -7,9 +7,12 @@
  stdenv,
  installShellFiles,
  versionCheckHook,
  testers,
  curl,
  cacert,
}:

rustPlatform.buildRustPackage rec {
rustPlatform.buildRustPackage (finalAttrs: rec {
  pname = "hydra-check";
  version = "2.0.4";

@@ -22,15 +25,6 @@ rustPlatform.buildRustPackage rec {

  cargoHash = "sha256-G9M+1OWp2jlDeSDFagH/YOCdxGQbcru1KFyKEUcMe7g=";

  patches =
    lib.optional (stdenv.hostPlatform.system == "x86_64-darwin")
      # work around rust 1.88 compiler / linker bug for x86_64-darwin. This is
      # applied conditionally because it will introduce a performance penalty on
      # other host platforms. NOTE: Please check the patch applies if you update
      # the package on a different platform (e.g x86_64-linux).
      # see: https://github.com/NixOS/nixpkgs/issues/427072
      ./fix-cargo-1_88-reqwest.patch;

  nativeBuildInputs = [
    pkg-config
    installShellFiles
@@ -53,6 +47,29 @@ rustPlatform.buildRustPackage rec {

  doInstallCheck = true;

  passthru.tests.mainCommand =
    testers.runCommand # allows internet access
      {
        name = "hydra-check-test";

        # only runs the test when internet access is confirmed:
        script = ''
          set -e
          if curl hydra.nixos.org > /dev/null; then
            hydra-check
          else
            echo "no internet access, skipping test"
          fi
          touch $out
        '';

        nativeBuildInputs = [
          finalAttrs.finalPackage
          curl
          cacert # for https connectivity
        ];
      };

  meta = {
    description = "Check hydra for the build status of a package";
    homepage = "https://github.com/nix-community/hydra-check";
@@ -65,4 +82,4 @@ rustPlatform.buildRustPackage rec {
    ];
    mainProgram = "hydra-check";
  };
}
})