From 1bfdc34eb6694d44149de1eb57f34b9ff08f5cdc Mon Sep 17 00:00:00 2001 From: Wolf Vollprecht Date: Mon, 30 Sep 2024 23:17:34 +0200 Subject: [PATCH] add `--target-platform` for rattler-build and add SYSTEM_VERSION_COMPAT=0 --- conda_smithy/templates/build_steps.sh.tmpl | 1 + conda_smithy/templates/run_osx_build.sh.tmpl | 3 ++- conda_smithy/templates/run_win_build.bat.tmpl | 2 +- news/rattler-build-cross-compile.rst | 4 ++++ 4 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 news/rattler-build-cross-compile.rst diff --git a/conda_smithy/templates/build_steps.sh.tmpl b/conda_smithy/templates/build_steps.sh.tmpl index 15ef26f6d..f52810fda 100644 --- a/conda_smithy/templates/build_steps.sh.tmpl +++ b/conda_smithy/templates/build_steps.sh.tmpl @@ -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:-}" diff --git a/conda_smithy/templates/run_osx_build.sh.tmpl b/conda_smithy/templates/run_osx_build.sh.tmpl index 7cfd248e9..e9fcd73d3 100644 --- a/conda_smithy/templates/run_osx_build.sh.tmpl +++ b/conda_smithy/templates/run_osx_build.sh.tmpl @@ -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" diff --git a/conda_smithy/templates/run_win_build.bat.tmpl b/conda_smithy/templates/run_win_build.bat.tmpl index 6f33c0e0f..374d9c509 100644 --- a/conda_smithy/templates/run_win_build.bat.tmpl +++ b/conda_smithy/templates/run_win_build.bat.tmpl @@ -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! diff --git a/news/rattler-build-cross-compile.rst b/news/rattler-build-cross-compile.rst new file mode 100644 index 000000000..fee8ca025 --- /dev/null +++ b/news/rattler-build-cross-compile.rst @@ -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.