From 7d63c7740545dc0eefb8348c273240877ad24b94 Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Mon, 1 Apr 2024 13:58:03 -0400 Subject: [PATCH] ruby: improve failure message when missing cargoHash Without this, doing e.g. `pkgs.mkRuby` without a `cargoHash` param would mean that the `fetchCargoTarball` drv was not a FOD and thus had no network access and would give confusing network failure messages. This forces specifying non-null `cargoHash` if it is actually being used, while allowing it to still be `null` when not needed. --- pkgs/development/interpreters/ruby/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/interpreters/ruby/default.nix b/pkgs/development/interpreters/ruby/default.nix index 9ec7a448b59f..8aed13444198 100644 --- a/pkgs/development/interpreters/ruby/default.nix +++ b/pkgs/development/interpreters/ruby/default.nix @@ -125,7 +125,7 @@ let cargoDeps = if yjitSupport then rustPlatform.fetchCargoTarball { inherit (finalAttrs) src; sourceRoot = "${finalAttrs.pname}-${version}/${finalAttrs.cargoRoot}"; - hash = cargoHash; + hash = assert cargoHash != null; cargoHash; } else null; postUnpack = opString rubygemsSupport ''