Missing env vars in build script
Many env vars are missing in the build scripts ($PY_VER, $STDLIB_DIR, $SP_DIR) if no dependencies.host section is defined but python {{ python }} is in dependencies.build. The docs state that if there is no depencies.hosts, then it is assumed to be the same as dependencies.build but here it is not the case. You can see this in the source here.
Indeed. I believe conda-build has this behavior for backwards compatibility - something we don't have to be so concerned about. It does simplify things in a few places to only use the host env and remove a corner case. Do you find it very painful? Would love to hear your experiences.
Thanks for your response :)
I think its fair to break from conda build, but if you are doing that then the docs should reflect that (see my link above).
It definitely confused me when I was migrating my build over from conda build/mambabuild because due to bash just defaulting to empty strings it meant I was potentially writing files in completely different places. Like, it's pretty dangerous for
mv /some/path "${SP_DIR}/path"
to suddenly become /data!
@wolfv so it seems that for build variables, though SHLIB_EXT is available in the tests section, PY_VER is not. So if this is needed for doing file structure tests (c.f. https://github.com/conda-forge/staged-recipes/pull/29440/files#r2002297833) then is the recommendation to manually set the version yourself and export it to a local environment variable, like
- export PY_VER=$(python -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')")
(which to be clear is easy enough to do, but just wanted to check I'm not missing something more general)?