mirror of
https://github.com/NixOS/nix
synced 2025-07-12 06:35:08 +02:00
Properly lock the builds of CA derivations
Make sure that we can’t build the same derivation twice at the same time. Fix https://github.com/NixOS/nix/issues/5029
This commit is contained in:
parent
1af3f63be5
commit
8707773965
4 changed files with 42 additions and 2 deletions
15
tests/ca/racy.nix
Normal file
15
tests/ca/racy.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
# A derivation that would certainly fail if several builders tried to
|
||||
# build it at once.
|
||||
|
||||
|
||||
with import ./config.nix;
|
||||
|
||||
mkDerivation {
|
||||
name = "simple";
|
||||
buildCommand = ''
|
||||
mkdir $out
|
||||
echo bar >> $out/foo
|
||||
sleep 3
|
||||
[[ "$(cat $out/foo)" == bar ]]
|
||||
'';
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue