1- name : Haskell CI with Nix
1+ name : Nix CI
22
33on :
44 push :
@@ -10,8 +10,6 @@ permissions:
1010jobs :
1111 nix-ci :
1212 runs-on : ubuntu-latest
13- env :
14- NIX_CONFIG : accept-flake-config = true
1513
1614 steps :
1715 - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -25,34 +23,31 @@ jobs:
2523 - name : Enable Nix cache
2624 uses : DeterminateSystems/magic-nix-cache-action@565684385bcd71bad329742eefe8d12f2e765b39 # v13
2725
28- - name : Show toolchain versions from nix shell
29- shell : bash
26+ - name : Debug library environment
3027 run : |
31- nix develop --command bash -lc 'ghc --numeric-version'
32- nix develop --command bash -lc 'cabal --numeric-version'
33- nix develop --command bash -lc 'stack --numeric-version || true'
34- nix develop --command bash -lc 'fourmolu --version'
35-
36- - name : Check formatting
37- run : nix develop --command make format-check
38-
39- - name : Check cabal file
40- run : nix develop --command make cabal-check
41-
42- - name : Update cabal package index
43- run : nix develop --command make cabal-update
44-
45- - name : Configure the build
46- run : nix develop --command make configure
47-
48- - name : Build dependencies
49- run : nix develop --command make deps
50-
51- - name : Build the package
52- run : nix develop --command make build
53-
54- - name : Run tests
55- run : nix develop --command make test
56-
57- - name : Build documentation
58- run : nix develop --command make docs
28+ nix develop --command bash -c '
29+ echo "=== LD_LIBRARY_PATH ==="
30+ echo "${LD_LIBRARY_PATH:-<unset>}"
31+ echo ""
32+ echo "=== NIX_LDFLAGS (abbreviated) ==="
33+ echo "$NIX_LDFLAGS" | tr " " "\n" | grep "^-L" | sort -u
34+ echo ""
35+ echo "=== Test: compile with -lz -lbz2 and check RPATH ==="
36+ ghc_libdir=$(ghc --print-libdir)
37+ ghc_cc=$(python3 -c "data=open(\"$ghc_libdir/settings\").read(); print(dict(eval(data))[\"C compiler command\"])")
38+ echo "CC: $ghc_cc"
39+ cat > /tmp/test.c << CEOF
40+ #include <stdio.h>
41+ int main() { printf("hello\n"); return 0; }
42+ CEOF
43+ $ghc_cc -o /tmp/test_bin /tmp/test.c -lz -lbz2
44+ echo "=== RPATH on test binary ==="
45+ readelf -d /tmp/test_bin | grep -i "rpath\|runpath"
46+ echo "=== ldd ==="
47+ ldd /tmp/test_bin
48+ echo "=== Run ==="
49+ /tmp/test_bin
50+ '
51+
52+ - name : Build and test
53+ run : nix develop --command make ci
0 commit comments