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.
This commit is contained in:
Andrew Marshall 2024-04-01 13:58:03 -04:00
parent d8fe5e6c92
commit 7d63c77405

View file

@ -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 ''