Usage of `host_platform` in compiler activation scripts
Your question:
This issue stems from a discussion had during the v1-migration of tzdata: https://github.com/conda-forge/tzdata-feedstock/pull/34
Rattler-build sets the target_platform to noarch for a noarch: generic recipe.
conda-build does not do that.
This leads to the compiler-activation script
if [ "${CONDA_BUILD_STATE:-0}" = "BUILD" ] && [ "${target_platform:-@TARGET_PLATFORM@}" != "@TARGET_PLATFORM@" ]; then
echo "Not activating environment because this compiler is not expected."
else
activate_clang
fi
not being run, and therefore the wrong compilers being used.
For tzdata we ended up using the workaround of defining
build:
noarch: generic
script:
file: build.sh
env: { target_platform: "${{ host_platform }}" }
From the discussion the question
what should be the value of $target_platform for a noarch recipe be?
arose which is to be picked up in this seperate issue.
https://github.com/conda-forge/conda-forge-ci-setup-feedstock/pull/414 improves this situation somewhat, but does not handle the target_platform: noarch that rattler uses.