Open yvan-sraka opened 1 year ago
we could use some bash snippet that uses case
to match against unsupported combinations? Or use a regex?
GPT-4 seems to know better than me how to write bash script … this should do the job:
#!/bin/bash
platform="${PLATFORM:-}"
compiler_nix_name="${COMPILER_NIX_NAME:-}"
target_platform="${TARGET_PLATFORM:-}"
minimal="${MINIMAL:-}"
iog="${IOG:-}"
case "${compiler_nix_name}-${target_platform}" in
"ghc8107"-*js*| "ghc928"-*js*) exit 1 ;;
esac
case "${platform}-${target_platform}" in
*x86_64-darwin*-static*| *aarch64-darwin*-windows*| *x86_64-darwin*-windows*) exit 1 ;;
*aarch64-linux*-windows*) exit 1 ;;
esac
if [[ "${target_platform}" == *-static* && "${minimal}" == "false" ]]; then
exit 1
fi
if [[ "${minimal}" == "true" && "${iog}" == "true" ]]; then
exit 1
fi
if [[ "${target_platform}" == *-js* && "${platform}" == *darwin* && "${minimal}" == "false" ]]; then
exit 1
fi
Currently, there is nothing that forbid
devx
GitHub Action users of using unsupported combinations of inputs, as defined in the exclude list of the job that populate ghcr.io withdevx
devshell closure.I'm not sure what would be the best way to achieve that? I can suggest to just add this small python script that would fail if it encounters a conflict (I didn't test it yet):