Skip to content
Merged
9 changes: 6 additions & 3 deletions conda_smithy/configure_feedstock.py
Original file line number Diff line number Diff line change
Expand Up @@ -2039,9 +2039,12 @@ def _azure_specific_setup(jinja_env, forge_config, forge_dir, platform):
}
)
# fmt: off
if "docker_image" in data["config"] and platform == "linux":
config_rendered["DOCKER_IMAGE"] = data["config"]["docker_image"][-1]
if platform == "osx":
if platform == "linux":
if docker_image := data.get("config", {}).get("docker_image"):
config_rendered["DOCKER_IMAGE"] = docker_image[-1]
elif platform == "win":
config_rendered["build_platform"] = data["build_platform"]
elif platform == "osx":
if data["build_platform"] == "osx-64":
config_rendered["VMIMAGE"] = "macOS-15"
elif data["build_platform"] == "osx-arm64":
Expand Down
1 change: 1 addition & 0 deletions conda_smithy/templates/azure-pipelines-win.yml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ jobs:
{%- endif %}
UPLOAD_PACKAGES: $(UPLOAD_PACKAGES)
UPLOAD_TEMP: $(UPLOAD_TEMP)
build_platform: $(build_platform)
flow_run_id: azure_$(Build.BuildNumber).$(System.JobAttempt)
remote_url: $(Build.Repository.Uri)
sha: $(Build.SourceVersion)
Expand Down
6 changes: 4 additions & 2 deletions conda_smithy/templates/build_steps.sh.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ if [[ "${BUILD_WITH_CONDA_DEBUG:-0}" == 1 ]]; then
# - --clobber-file vs. none
# - none vs. --target-platform
{%- if conda_build_tool.startswith("conda-build") %}
conda debug \
CONDA_SUBDIR="${BUILD_PLATFORM}" conda debug \
"${RECIPE_ROOT}" \
-m "${CI_SUPPORT}/${CONFIG}.yaml" \
${EXTRA_CB_OPTIONS:-} \
Expand All @@ -150,6 +150,7 @@ if [[ "${BUILD_WITH_CONDA_DEBUG:-0}" == 1 ]]; then
-m "${CI_SUPPORT}/${CONFIG}.yaml" \
${EXTRA_CB_OPTIONS:-} \
${BUILD_OUTPUT_ID:+--output-name "${BUILD_OUTPUT_ID}"} \
--build-platform "${BUILD_PLATFORM}" \
--target-platform "${HOST_PLATFORM}"

rattler-build debug shell
Expand All @@ -165,7 +166,7 @@ else
# - none vs. --target-platform
# - --extra-meta a=b c=d vs. --extra-meta a=b --extra-meta c=d
{%- if conda_build_tool != "rattler-build" %}
{{ BUILD_CMD }} \
CONDA_SUBDIR="${BUILD_PLATFORM}" {{ BUILD_CMD }} \
"${RECIPE_ROOT}" \
-m "${CI_SUPPORT}/${CONFIG}.yaml" \
${EXTRA_CB_OPTIONS:-} \
Expand All @@ -179,6 +180,7 @@ else
--recipe "${RECIPE_ROOT}" \
-m "${CI_SUPPORT}/${CONFIG}.yaml" \
${EXTRA_CB_OPTIONS:-} \
--build-platform "${BUILD_PLATFORM}" \
--target-platform "${HOST_PLATFORM}" \
--extra-meta flow_run_id="${flow_run_id:-}" \
--extra-meta remote_url="${remote_url:-}" \
Expand Down
5 changes: 5 additions & 0 deletions conda_smithy/templates/github-actions.yml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ jobs:
{%- endif %}
STORE_BUILD_ARTIFACTS: {{ data.store_build_artifacts is true }}
UPLOAD_PACKAGES: {{ data.upload }}
{%- if data.build_platform.startswith("win") %}
build_platform: {{ data.build_platform }}
{%- endif %}
build_workspace_dir: {{ data.build_workspace_dir }}
docker_run_args: {{ data.docker_run_args }}
free_disk_space: {{ data.free_disk_space }}
Expand Down Expand Up @@ -231,6 +234,8 @@ jobs:
set "sha=%GITHUB_SHA%"
call ".scripts\run_win_build.bat"
env:
{#- BUILD_PLATFORM needed to distinguish emulated/native builds #}
BUILD_PLATFORM: {% raw %}${{ matrix.build_platform }}{% endraw %}
CI: github_actions
CONDA_BLD_PATH: {% raw %}${{ matrix.build_workspace_dir }}{% endraw %}
CONFIG: {% raw %}${{ matrix.CONFIG }}{% endraw %}
Expand Down
6 changes: 4 additions & 2 deletions conda_smithy/templates/run_osx_build.sh.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ if [[ "${BUILD_WITH_CONDA_DEBUG:-0}" == 1 ]]; then
if [[ "x${BUILD_OUTPUT_ID:-}" != "x" ]]; then
EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --output-id ${BUILD_OUTPUT_ID}"
fi
conda debug ./{{ recipe_dir }} -m ./.ci_support/${CONFIG}.yaml \
CONDA_SUBDIR="${BUILD_PLATFORM}" conda debug ./{{ recipe_dir }} -m ./.ci_support/${CONFIG}.yaml \
${EXTRA_CB_OPTIONS:-} \
--clobber-file ./.ci_support/clobber_${CONFIG}.yaml

Expand All @@ -176,6 +176,7 @@ if [[ "${BUILD_WITH_CONDA_DEBUG:-0}" == 1 ]]; then
rattler-build debug setup \
--recipe ./{{ recipe_dir }} \
-m ./.ci_support/${CONFIG}.yaml \
--build-platform "${BUILD_PLATFORM}" \
--target-platform "${HOST_PLATFORM}" \
${BUILD_OUTPUT_ID:+--output-name "${BUILD_OUTPUT_ID}"} \
${EXTRA_CB_OPTIONS:-}
Expand All @@ -189,7 +190,7 @@ else
fi
{% endif %}
{%- if conda_build_tool != "rattler-build" %}
{{ BUILD_CMD }} ./{{ recipe_dir }} -m ./.ci_support/${CONFIG}.yaml \
CONDA_SUBDIR="${BUILD_PLATFORM}" {{ BUILD_CMD }} ./{{ recipe_dir }} -m ./.ci_support/${CONFIG}.yaml \
--suppress-variables ${EXTRA_CB_OPTIONS:-} \
--clobber-file ./.ci_support/clobber_${CONFIG}.yaml \
--extra-meta flow_run_id="$flow_run_id" remote_url="$remote_url" sha="$sha"
Expand All @@ -198,6 +199,7 @@ else
{{ BUILD_CMD }} --recipe ./{{ recipe_dir }} \
-m ./.ci_support/${CONFIG}.yaml \
${EXTRA_CB_OPTIONS:-} \
--build-platform "${BUILD_PLATFORM}" \
--target-platform "${HOST_PLATFORM}" \
--extra-meta flow_run_id="$flow_run_id" \
--extra-meta remote_url="$remote_url" \
Expand Down
13 changes: 11 additions & 2 deletions conda_smithy/templates/run_win_build.bat.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ if "%PIXI_CACHE_DIR%"=="%MINIFORGE_HOME%" (
)
move /y pixi.toml pixi.toml.bak
set "arch=64"
if "%PROCESSOR_ARCHITECTURE%"=="ARM64" set "arch=arm64"
{#- TODO: Enable this line again once we have bootstrapped all the dependencies for a full base environment on win-arm64; emulate win-64 for now #}
{#- if "%PROCESSOR_ARCHITECTURE%"=="ARM64" set "arch=arm64" #}
powershell -NoProfile -ExecutionPolicy unrestricted -Command "(Get-Content pixi.toml.bak -Encoding UTF8) -replace 'platforms = .*', 'platforms = [''win-%arch%'']' | Out-File pixi.toml -Encoding UTF8"
:: Git on Windows needs to run post link scripts to properly set up SSL certificates
pixi config set --global run-post-link-scripts insecure
Expand Down Expand Up @@ -182,6 +183,10 @@ call :end_group

:: Build the recipe
echo Building recipe
{%- if conda_build_tool.startswith(("conda-build", "mambabuild")) %}
set "_OLD_CONDA_SUBDIR=%CONDA_SUBDIR%"
set "CONDA_SUBDIR=%BUILD_PLATFORM%"
{%- endif %}
{%- if conda_build_tool == "mambabuild" %}
conda-mambabuild.exe "{{ recipe_dir }}" -m .ci_support\%CONFIG%.yaml --suppress-variables %EXTRA_CB_OPTIONS%
{%- elif conda_build_tool == "conda-build+conda-libmamba-solver" %}
Expand All @@ -193,9 +198,13 @@ conda-build.exe "{{ recipe_dir }}" -m .ci_support\%CONFIG%.yaml --suppress-varia
{%- elif conda_build_tool == "conda-build" %}
conda-build.exe "{{ recipe_dir }}" -m .ci_support\%CONFIG%.yaml --suppress-variables %EXTRA_CB_OPTIONS%
{%- elif conda_build_tool == "rattler-build" %}
rattler-build.exe build --recipe "{{ recipe_dir }}" -m .ci_support\%CONFIG%.yaml %EXTRA_CB_OPTIONS% --target-platform %HOST_PLATFORM%
rattler-build.exe build --recipe "{{ recipe_dir }}" -m .ci_support\%CONFIG%.yaml %EXTRA_CB_OPTIONS% --build-platform %BUILD_PLATFORM% --target-platform %HOST_PLATFORM%
{%- endif %}
if !errorlevel! neq 0 exit /b !errorlevel!
{%- if conda_build_tool.startswith(("conda-build", "mambabuild")) %}
set "_OLD_CONDA_SUBDIR="
set "CONDA_SUBDIR=%_OLD_CONDA_SUBDIR%"
{%- endif %}

call :start_group "Inspecting artifacts"
:: inspect_artifacts was only added in conda-forge-ci-setup 4.9.4
Expand Down
24 changes: 24 additions & 0 deletions news/2622-build-platform.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
**Added:**

* <news item>

**Changed:**

* ``rattler-build`` and ``conda-build`` are now called explicit build platforms (via ``--build-platform`` and ``CONDA_SUBDIR``, respectively). (#2622)
* On Windows ARM machines, ``pixi`` will always provision ``win-64`` tooling while the ``win-arm64`` platform is being bootstrapped. (#2622)

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>