Skip to content

Commit

Permalink
add --target-platform for rattler-build and add SYSTEM_VERSION_COMP…
Browse files Browse the repository at this point in the history
…AT=0
  • Loading branch information
wolfv committed Oct 1, 2024
1 parent 6cf9e87 commit 1bfdc34
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions conda_smithy/templates/build_steps.sh.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ else
{{ BUILD_CMD }} --recipe "${RECIPE_ROOT}" \
-m "${CI_SUPPORT}/${CONFIG}.yaml" \
${EXTRA_CB_OPTIONS:-} \
--target-platform "${HOST_PLATFORM}" \
--extra-meta flow_run_id="${flow_run_id:-}" \
--extra-meta remote_url="${remote_url:-}" \
--extra-meta sha="${sha:-}"
Expand Down
3 changes: 2 additions & 1 deletion conda_smithy/templates/run_osx_build.sh.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,11 @@ else
--extra-meta flow_run_id="$flow_run_id" remote_url="$remote_url" sha="$sha"

{%- else %}

export SYSTEM_VERSION_COMPAT=0
{{ BUILD_CMD }} --recipe ./{{ recipe_dir }} \
-m ./.ci_support/${CONFIG}.yaml \
--output-dir ${MINIFORGE_HOME}/conda-bld ${EXTRA_CB_OPTIONS:-} \
--target-platform "${HOST_PLATFORM}" \
--extra-meta flow_run_id="$flow_run_id" \
--extra-meta remote_url="$remote_url" \
--extra-meta sha="$sha"
Expand Down
2 changes: 1 addition & 1 deletion conda_smithy/templates/run_win_build.bat.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ 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" %}
conda.exe run rattler-build build --recipe "{{ recipe_dir }}" -m .ci_support\%CONFIG%.yaml %EXTRA_CB_OPTIONS%
conda.exe run rattler-build build --recipe "{{ recipe_dir }}" -m .ci_support\%CONFIG%.yaml %EXTRA_CB_OPTIONS% --target-platform %HOST_PLATFORM%
{%- endif %}
if !errorlevel! neq 0 exit /b !errorlevel!

Expand Down
4 changes: 4 additions & 0 deletions news/rattler-build-cross-compile.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
**Fixed:**

* fix cross-compilation with rattler-build by setting `--target-platform=${HOST_PLATFORM}` and
exporting `SYSTEM_VERSION_COMPAT=0` in the build script.

0 comments on commit 1bfdc34

Please sign in to comment.