You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sphinx/src/maintainer/knowledge_base.rst
+41-1Lines changed: 41 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -387,7 +387,8 @@ The rule of the thumb is:
387
387
- If it needs to be available on the target host, it goes in ``host``.
388
388
- If both conditions are true, it belongs in both.
389
389
390
-
However, there are some exceptions to this rule; most notably Python cross-compilation (see below).
390
+
However, there are some exceptions to this rule; most notably Python cross-compilation
391
+
(:ref:`see below <python_cross_compilation>`).
391
392
392
393
Cross-compilation examples
393
394
^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -484,6 +485,8 @@ but merely to provide a starting point with some guidelines. Please look at `oth
484
485
485
486
.. _other recipes for more examples: https://github.com/search?q=org%3Aconda-forge+path%3Arecipe%2Fmeta.yaml+%22%5Bbuild_platform+%21%3D+target_platform%5D%22&type=code
486
487
488
+
.. _python_cross_compilation:
489
+
487
490
Details about cross-compiled Python packages
488
491
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
489
492
@@ -526,6 +529,43 @@ All in all, this results in a setup where ``conda-build`` can run a ``$BUILD_PRE
526
529
their corresponding counterparts in ``$BUILD_PREFIX``) and sufficiently mimic that target
527
530
architecture.
528
531
532
+
.. _emulation:
533
+
534
+
Emulated builds
535
+
---------------
536
+
537
+
When cross-compilation is not possible, one can resort to emulation. This is a technique that uses
538
+
a virtual machine (`QEMU <https://www.qemu.org/>`__) to emulate the target platform, which has a
539
+
significant overhead. However, ``conda-build`` will see the target platform as native, so very
540
+
little changes are usually needed in the recipe.
541
+
542
+
To enable emulated builds, you must use the :ref:`provider` mapping in ``conda-forge.yml``.
543
+
This key maps a ``build_platform`` to a ``provider`` that will be used to emulate the platform.
544
+
``conda-smithy`` will know how to detect whether the provider supports that platform natively or
545
+
requires emulation, and will adjust the appropriate CI steps to ensure that QEMU runs the process.
546
+
Ensure changes are applied by :ref:`rerendering <dev_update_rerender>` the feedstock.
547
+
548
+
.. warning::
549
+
550
+
Emulated builds are very slow and incur an additional strain on conda-forge CI resources.
551
+
Whenever possible, please consider cross-compilation instead. Only use emulated builds as a last
552
+
resort.
553
+
554
+
Emulation examples
555
+
^^^^^^^^^^^^^^^^^^
556
+
557
+
Configure ``conda-forge.yml`` to emulate ``linux-ppc64le``, but use native runners for ``linux-64``
558
+
and ``linux-aarch64``. This works because ``linux-ppc64le`` is not natively supported by Azure, so
559
+
``conda-smithy`` will add QEMU steps to emulate it. However, ``linux-64`` and ``linux-aarch64`` are
560
+
natively supported by Azure and Travis CI, respectively, so no emulation is needed.
0 commit comments