2024-05-28 19:43:04 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2006-03-01 15:25:08 +02:00
|
|
|
source common.sh
|
|
|
|
|
2024-06-16 13:51:46 +03:00
|
|
|
TODO_NixOS
|
|
|
|
|
2009-03-18 15:15:55 +02:00
|
|
|
clearStore
|
2006-03-01 15:25:08 +02:00
|
|
|
|
2016-04-25 16:26:07 +03:00
|
|
|
path=$(nix-build dependencies.nix --no-out-link)
|
2006-03-01 15:25:08 +02:00
|
|
|
|
2014-02-26 18:58:53 +02:00
|
|
|
# Test nix-store -l.
|
|
|
|
[ "$(nix-store -l $path)" = FOO ]
|
|
|
|
|
|
|
|
# Test compressed logs.
|
|
|
|
clearStore
|
|
|
|
rm -rf $NIX_LOG_DIR
|
2014-08-21 22:50:19 +03:00
|
|
|
(! nix-store -l $path)
|
2017-11-20 18:50:49 +02:00
|
|
|
nix-build dependencies.nix --no-out-link --compress-build-log
|
2014-02-26 18:58:53 +02:00
|
|
|
[ "$(nix-store -l $path)" = FOO ]
|
2022-02-06 15:52:04 +02:00
|
|
|
|
|
|
|
# test whether empty logs work fine with `nix log`.
|
2023-12-19 00:04:25 +02:00
|
|
|
builder="$(realpath "$(mktemp)")"
|
2022-02-06 15:52:04 +02:00
|
|
|
echo -e "#!/bin/sh\nmkdir \$out" > "$builder"
|
|
|
|
outp="$(nix-build -E \
|
2024-11-01 15:56:50 +02:00
|
|
|
'with import '"${config_nix}"'; mkDerivation { name = "fnord"; builder = '"$builder"'; }' \
|
2022-02-06 15:52:04 +02:00
|
|
|
--out-link "$(mktemp -d)/result")"
|
|
|
|
|
|
|
|
test -d "$outp"
|
|
|
|
|
|
|
|
nix log "$outp"
|