Skip to content

Commit

Permalink
docs: update remote builder explanation
Browse files Browse the repository at this point in the history
Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com>
  • Loading branch information
mr-cal committed Aug 21, 2024
1 parent 2666a99 commit 8e826c5
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions docs/explanation/remote-build.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ snaps.

The legacy remote builder was deprecated because of its design. It retrieves
and tarballs remote sources and modifies the project's ``snapcraft.yaml``
file to point to the local tarballs.
file to point to the local tarballs. This caused many unexpected failures that
could not be reproduced locally.

Choosing a remote-builder
^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -84,37 +85,38 @@ Current
``--platform`` and ``--build-for``
**********************************

If ``--platform`` or ``--build-for`` are provided, Snapcraft will:

#. parse the project metadata for ``platforms`` or ``architectures`` keywords
#. create a build plan
#. filter the build plan with whichever of ``--build-for`` or ``--platform``
was specified
``--platform`` or ``--build-for`` can only be provided when the ``platforms``
and ``architectures`` keywords are not defined in the project metadata
(`[12]`_).

``--build-for`` and ``--platform`` are mutually exclusive keywords.

If a ``--build-for`` or ``--platform`` is provided that does not exist in the
project metadata, Snapcraft will fail (`[1]`_).
``core22`` snaps can only use ``--build-for``. ``core24`` and newer snaps
can use ``--platform`` or ``--build-for``.

The ``--platform`` keyword applies to ``core22`` projects because Snapcraft
will convert ``architectures`` entries to a ``platforms`` object by using the
``build-for`` entry of the ``architectures`` entry as the platform name.
``--platform`` and ``--build-for`` must be a single debian architecture.
A list of comma-separated architectures is not supported (`[11]`_).

Project platforms and architectures
***********************************

The ``snapcraft.yaml`` file is always parsed by the new remote builder.

If the project metadata contains a ``platforms`` or ``architectures`` entry,
Snapcraft will request a build for each unique ``build-for`` architecture.

.. note::

Launchpad does not support for cross-compiling and cannot distinguish
between ``build-on`` and ``build-for`` architectures.

If the project metadata does not contain a ``platforms`` or ``architectures``
entry and no ``--build-for`` or ``--platform`` are passed, Snapcraft will
request a build for the host's architecture.
request a build on and for the host's architecture.

The remote builder does not work for ``core20`` snaps because it cannot parse
the ``run-on`` keyword in a ``core20`` architecture entry (`[2]`_).

The remote builder does not work as expected for most ``platform`` definitions
because Launchpad does not properly parse the entry (`[3]`_).

Legacy
^^^^^^

Expand Down Expand Up @@ -164,13 +166,13 @@ Launchpad is not able to parse this notation (`[9]`_).
.. _`Launchpad account`: https://launchpad.net/+login
.. _`Launchpad`: https://launchpad.net/
.. _`build farm`: https://launchpad.net/builders
.. _`[1]`: https://github.com/canonical/snapcraft/issues/4881
.. _`[2]`: https://github.com/canonical/snapcraft/issues/4842
.. _`[3]`: https://github.com/canonical/snapcraft/issues/4858
.. _`[4]`: https://github.com/canonical/snapcraft/issues/4341
.. _`[5]`: https://bugs.launchpad.net/snapcraft/+bug/1885150
.. _`[6]`: https://github.com/canonical/snapcraft/issues/4144
.. _`[7]`: https://bugs.launchpad.net/snapcraft/+bug/1992557
.. _`[8]`: https://bugs.launchpad.net/snapcraft/+bug/2007789
.. _`[9]`: https://bugs.launchpad.net/snapcraft/+bug/2042167
.. _`[10]`: https://github.com/canonical/snapcraft/issues/4885
.. _`[11]`: https://github.com/canonical/snapcraft/issues/4990
.. _`[12]`: https://github.com/canonical/snapcraft/issues/4992

0 comments on commit 8e826c5

Please sign in to comment.