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
, devCabalOptions
, ghc
, glibcLocales
, glibcLocales ? null
, gnugrep
, hpc-codecov
, hostPlatform
, jq
, lib
, postgrest
, python3
, runtimeShell
, stdenv
, weeder
, withTools
, yq
@@ -125,9 +128,13 @@ let
withEnv = postgrest.env;
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"
'' +
''
# clean up previous coverage reports
mkdir -p coverage
rm -rf coverage/*
@@ -185,7 +192,8 @@ let
echo "file://$(pwd)/coverage/hpc_index.html"
${ghc}/bin/hpc report coverage/postgrest.tix "''${_arg_leftovers[@]}"
fi
'';
''
);
coverageDraftOverlay =
checkedShellScript