Skip to content

Usage of host_platform in compiler activation scripts #2691

@claudiushaag

Description

@claudiushaag

Your question:

This issue stems from a discussion had during the v1-migration of tzdata: conda-forge/tzdata-feedstock#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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions