mirror of
https://github.com/NixOS/nix
synced 2025-07-12 23:15: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
18
tests/ca/concurrent-builds.sh
Executable file
18
tests/ca/concurrent-builds.sh
Executable file
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Ensure that we can’t build twice the same derivation concurrently.
|
||||
# Regression test for https://github.com/NixOS/nix/issues/5029
|
||||
|
||||
source common.sh
|
||||
|
||||
sed -i 's/experimental-features .*/& ca-derivations ca-references/' "$NIX_CONF_DIR"/nix.conf
|
||||
|
||||
export NIX_TESTS_CA_BY_DEFAULT=1
|
||||
|
||||
clearStore
|
||||
|
||||
for i in {0..5}; do
|
||||
nix build --no-link --file ./racy.nix &
|
||||
done
|
||||
|
||||
wait
|
Loading…
Add table
Add a link
Reference in a new issue