2020-03-13 18:49:34 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
hie_bios_flags() {
|
|
|
|
bazel build //compiler/damlc:damlc@ghci \
|
|
|
|
--output_groups=hie_bios \
|
|
|
|
--experimental_show_artifacts \
|
|
|
|
2>&1 \
|
|
|
|
| awk '
|
|
|
|
BEGIN { rts_opts = false }
|
|
|
|
/^>>>/ {
|
|
|
|
while ((getline line < substr($1, 4)) > 0) {
|
|
|
|
if (rts_opts) {
|
|
|
|
if (line == "-RTS") {
|
|
|
|
rts_opts = false
|
|
|
|
}
|
|
|
|
} else if (line == "+RTS") {
|
|
|
|
rts_opts = true
|
|
|
|
} else if (match(line, "-qg|-fexternal-interpreter")) {
|
2022-05-12 11:53:10 +03:00
|
|
|
} else if (match(line, "com_github_madler_zlib")) {
|
|
|
|
} else if (match(line, "grpc_haskell_core_cbits")) {
|
|
|
|
} else if (match(line, "-lmerged_cbits")) {
|
2020-03-13 18:49:34 +03:00
|
|
|
} else {
|
|
|
|
print line
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}'
|
|
|
|
}
|
|
|
|
if [[ -z "${HIE_BIOS_OUTPUT-}" ]]; then
|
|
|
|
hie_bios_flags
|
|
|
|
else
|
|
|
|
hie_bios_flags >"$HIE_BIOS_OUTPUT"
|
|
|
|
fi
|