@@ -1775,6 +1775,7 @@ def bundle_conda(
17751775 env_output ["RECIPE_DIR" ] = metadata .path
17761776 env_output ["MSYS2_PATH_TYPE" ] = "inherit"
17771777 env_output ["CHERE_INVOKING" ] = "1"
1778+ _set_env_variables_for_build (metadata , env_output )
17781779 for var in utils .ensure_list (metadata .get_value ("build/script_env" )):
17791780 if "=" in var :
17801781 val = var .split ("=" , 1 )[1 ]
@@ -3060,13 +3061,7 @@ def construct_metadata_for_test(recipedir_or_package, config):
30603061 return m , hash_input
30613062
30623063
3063- def write_build_scripts (m , script , build_file ):
3064- # TODO: Prepending the prefixes here should probably be guarded by
3065- # if not m.activate_build_script:
3066- # Leaving it as is, for now, since we need a quick, non-disruptive patch release.
3067- with utils .path_prepended (m .config .host_prefix , False ):
3068- with utils .path_prepended (m .config .build_prefix , False ):
3069- env = environ .get_dict (m = m )
3064+ def _set_env_variables_for_build (m , env ):
30703065 env ["CONDA_BUILD_STATE" ] = "BUILD"
30713066
30723067 # hard-code this because we never want pip's build isolation
@@ -3098,6 +3093,17 @@ def write_build_scripts(m, script, build_file):
30983093 if "replacements" in env :
30993094 del env ["replacements" ]
31003095
3096+
3097+ def write_build_scripts (m , script , build_file ):
3098+ # TODO: Prepending the prefixes here should probably be guarded by
3099+ # if not m.activate_build_script:
3100+ # Leaving it as is, for now, since we need a quick, non-disruptive patch release.
3101+ with utils .path_prepended (m .config .host_prefix , False ):
3102+ with utils .path_prepended (m .config .build_prefix , False ):
3103+ env = environ .get_dict (m = m )
3104+
3105+ _set_env_variables_for_build (m , env )
3106+
31013107 work_file = join (m .config .work_dir , "conda_build.sh" )
31023108 env_file = join (m .config .work_dir , "build_env_setup.sh" )
31033109 with open (env_file , "w" ) as bf :
0 commit comments