nix: test script without glibc locales

glibcLocales is not available e.g. on darwin. This change allows
running various dev tools on darwin, and other theoretical
non-glibc systems.
This commit is contained in:
Robert Vollmert
2022-06-07 21:36:38 +02:00
committed by Robert
parent a9035bba2f
commit e3252a6e9e
+11 -3
View File
@@ -3,13 +3,16 @@
, checkedShellScript , checkedShellScript
, devCabalOptions , devCabalOptions
, ghc , ghc
, glibcLocales , glibcLocales ? null
, gnugrep , gnugrep
, hpc-codecov , hpc-codecov
, hostPlatform
, jq , jq
, lib
, postgrest , postgrest
, python3 , python3
, runtimeShell , runtimeShell
, stdenv
, weeder , weeder
, withTools , withTools
, yq , yq
@@ -125,9 +128,13 @@ let
withEnv = postgrest.env; withEnv = postgrest.env;
withTmpDir = true; withTmpDir = true;
} }
'' (
# required for `hpc markup` in CI; glibcLocales is not available e.g. on Darwin
lib.optionalString (stdenv.isLinux && hostPlatform.libc == "glibc") ''
export LOCALE_ARCHIVE="${glibcLocales}/lib/locale/locale-archive" export LOCALE_ARCHIVE="${glibcLocales}/lib/locale/locale-archive"
'' +
''
# clean up previous coverage reports # clean up previous coverage reports
mkdir -p coverage mkdir -p coverage
rm -rf coverage/* rm -rf coverage/*
@@ -185,7 +192,8 @@ let
echo "file://$(pwd)/coverage/hpc_index.html" echo "file://$(pwd)/coverage/hpc_index.html"
${ghc}/bin/hpc report coverage/postgrest.tix "''${_arg_leftovers[@]}" ${ghc}/bin/hpc report coverage/postgrest.tix "''${_arg_leftovers[@]}"
fi fi
''; ''
);
coverageDraftOverlay = coverageDraftOverlay =
checkedShellScript checkedShellScript