mirror of
https://github.com/simplex-chat/haskell.nix.git
synced 2026-06-03 09:17:32 +00:00
Adding materialize call to a derivation should not prevent nix form building it concurrently with other derivations. This test makes sure that is the case.
29 lines
800 B
Nix
29 lines
800 B
Nix
{ n }:
|
|
# This test makes sure that adding materialize function call with no materialized files
|
|
# does not impact performance by reducing the ability of nix to perform concurrent
|
|
# builds.
|
|
let
|
|
inherit (import ../../. {}) pkgs;
|
|
hello = pkgs.haskell-nix.materialize { materialized = null; } (pkgs.runCommand "hello" {} ''
|
|
echo ${n}
|
|
echo EVENT start hello
|
|
sleep 2
|
|
echo EVENT end hello
|
|
echo hello > $out
|
|
'');
|
|
world = pkgs.haskell-nix.materialize { materialized = null; } (pkgs.runCommand "world" {} ''
|
|
echo ${n}
|
|
echo EVENT start world
|
|
sleep 3
|
|
echo EVENT end world
|
|
echo world > $out
|
|
'');
|
|
hello-world = pkgs.runCommand "hello-world" {} ''
|
|
cat ${hello} > $out
|
|
echo ' '
|
|
cat ${world} > $out
|
|
'';
|
|
in hello-world
|
|
|
|
|