yubihsm-shell: fix checkPhase race condition

This passed locally but failed on hydra, guess my machine was too fast.
This commit is contained in:
Morgan Jones
2026-03-12 23:42:07 -07:00
parent f0785b7eb7
commit 4182634002
@@ -94,6 +94,12 @@ stdenv.mkDerivation (finalAttrs: {
# so we expect a failure here, but it should at least try to connect
yubihsm-connector -d </dev/null 1>&2 2>connector.log &
yubihsm_pid=$!
idx=0
while ! grep takeoff connector.log >/dev/null && [ $idx -lt 10 ]; do
idx=$((idx+1))
echo "Waiting for yubihsm-connector startup (try: $idx)" >&2
sleep 1
done
$out/bin/yubihsm-shell -Pv1 </dev/null || true
kill -INT "$yubihsm_pid" && { wait "$yubihsm_pid" || true; }
cat connector.log >&2