rattler-build icon indicating copy to clipboard operation
rattler-build copied to clipboard

variant env vars not set for test scripts

Open minrk opened this issue 10 months ago • 3 comments

In conda-build, variant values are set as env vars in build and test scripts. #1056 reported this for build scripts which appears to be fixed by #1088, but only for build scripts. Test scripts appear to still lack these env vars.

I can work around this with:

test:
  script:
    file: script-name
    env:
      name: ${{ name }}

for any variables I use in the test, but I'm not sure if the inconsistency is intentional.

minrk avatar Jan 09 '25 10:01 minrk

This will actually prevent a ucx fix from having its effect on v1 recipes, since $target_platform is not set: https://github.com/conda-forge/ucx-split-feedstock/pull/207

minrk avatar Mar 06 '25 12:03 minrk

also related to this, CONDA_BUILD is not set in the test env, causing activation problems in some conda-forge infrastructure.

minrk avatar Jul 21 '25 22:07 minrk

Ideally, env_vars::vars and env_vars_from_variant would be run on the test env for consistency, but that seems tricky since the test apparently only has access to the final package, not the Output object, which these functions require. It's unclear to me how to get that information at test time, though it does seem to exist in package metadata. Any pointers, @wolfv?

minrk avatar Jul 22 '25 16:07 minrk

Looks like CONDA_BUILD is currently being set. Can anyone confirm?

dalcinl avatar Nov 25 '25 17:11 dalcinl