Message ID | 20240531221025.11778-1-reatmon@ti.com |
---|---|
State | New, archived |
Headers | show |
Series | [master] docs: Document the GO_SRCURI_DESTSUFFIX variable | expand |
Hi Ryan Many thanks for the patch! I have a few minor improvements to suggest... On 6/1/24 00:10, Ryan Eatmon wrote: > Add the needed entries for the GO_SRCURI_DESTSUFFIX variable and why it > is needed. Also update the go.class and 5,1 migration file with the same > information. > > Signed-off-by: Ryan Eatmon <reatmon@ti.com> > --- > documentation/migration-guides/migration-5.1.rst | 5 +++++ > documentation/ref-manual/classes.rst | 6 ++++++ > documentation/ref-manual/variables.rst | 12 ++++++++++++ > 3 files changed, 23 insertions(+) > > diff --git a/documentation/migration-guides/migration-5.1.rst b/documentation/migration-guides/migration-5.1.rst > index b43fecc2d..453c9fcc0 100644 > --- a/documentation/migration-guides/migration-5.1.rst > +++ b/documentation/migration-guides/migration-5.1.rst > @@ -94,6 +94,11 @@ See :ref:`all supported distributions <system-requirements-supported-distros>`. > > Go language changes > ~~~~~~~~~~~~~~~~~~~ > +The :term:`SRC_URI` for your Go module recipe must include setting the > +destsuffix parameter to :term:`GO_SRCURI_DESTSUFFIX` in order to build s/destsuffix/``destsuffix``/ > +correctly with the new :term:`UNPACKDIR` methodology:: > + > + SRC_URI = "...;destsuffix=${GO_SRCURI_DESTSUFFIX}" > > .. _migration-5.1-systemd-changes: > > diff --git a/documentation/ref-manual/classes.rst b/documentation/ref-manual/classes.rst > index 9520d0bf7..e1854814a 100644 > --- a/documentation/ref-manual/classes.rst > +++ b/documentation/ref-manual/classes.rst > @@ -932,6 +932,12 @@ The :ref:`ref-classes-go` class supports building Go programs. The behavior of > this class is controlled by the mandatory :term:`GO_IMPORT` variable, and > by the optional :term:`GO_INSTALL` and :term:`GO_INSTALL_FILTEROUT` ones. > > +The :term:`SRC_URI` for your Go module recipe must include setting the > +destsuffix parameter to :term:`GO_SRCURI_DESTSUFFIX` in order to build s/destsuffix/``destsuffix``/ here too :) > +correctly with the new :term:`UNPACKDIR` methodology:: > + > + SRC_URI = "...;destsuffix=${GO_SRCURI_DESTSUFFIX}" > + > To build a Go program with the Yocto Project, you can use the > :yocto_git:`go-helloworld_0.1.bb </poky/tree/meta/recipes-extended/go-examples/go-helloworld_0.1.bb>` > recipe as an example. > diff --git a/documentation/ref-manual/variables.rst b/documentation/ref-manual/variables.rst > index 07b5b6f95..9e9b5449a 100644 > --- a/documentation/ref-manual/variables.rst > +++ b/documentation/ref-manual/variables.rst > @@ -3228,6 +3228,18 @@ system and gives an overview of their function and contents. > packages, but it can be overridden by a recipe to filter out other > subdirectories if needed. > > + :term:`GO_SRCURI_DESTSUFFIX` > + The :term:`SRC_URI` for your Go module recipe must include setting the > + destsuffix parameter to :term:`GO_SRCURI_DESTSUFFIX` in order to build Same here > + correctly with the new :term:`UNPACKDIR` methodology:: > + > + SRC_URI = "...;destsuffix=${GO_SRCURI_DESTSUFFIX}" > + > + You should not need to set GO_SRCURI_DESTSUFFIX yourself. By default, Here, you should also introduce GO_SRCURI_DESTSUFFIX through ":term:". This way, we can hunt for instances of a variable without a proper reference. > + :term:`GO_SRCURI_DESTSUFFIX` is defined as:: > + > + GO_SRCURI_DESTSUFFIX = "${S}/src/${GO_IMPORT}/" > + > :term:`GO_WORKDIR` > When using Go Modules, the current working directory must be the directory > containing the ``go.mod`` file, or one of its subdirectories. When the Otherwise, it looks great to me. Thanks in advance for the update. Cheers Michael.
diff --git a/documentation/migration-guides/migration-5.1.rst b/documentation/migration-guides/migration-5.1.rst index b43fecc2d..453c9fcc0 100644 --- a/documentation/migration-guides/migration-5.1.rst +++ b/documentation/migration-guides/migration-5.1.rst @@ -94,6 +94,11 @@ See :ref:`all supported distributions <system-requirements-supported-distros>`. Go language changes ~~~~~~~~~~~~~~~~~~~ +The :term:`SRC_URI` for your Go module recipe must include setting the +destsuffix parameter to :term:`GO_SRCURI_DESTSUFFIX` in order to build +correctly with the new :term:`UNPACKDIR` methodology:: + + SRC_URI = "...;destsuffix=${GO_SRCURI_DESTSUFFIX}" .. _migration-5.1-systemd-changes: diff --git a/documentation/ref-manual/classes.rst b/documentation/ref-manual/classes.rst index 9520d0bf7..e1854814a 100644 --- a/documentation/ref-manual/classes.rst +++ b/documentation/ref-manual/classes.rst @@ -932,6 +932,12 @@ The :ref:`ref-classes-go` class supports building Go programs. The behavior of this class is controlled by the mandatory :term:`GO_IMPORT` variable, and by the optional :term:`GO_INSTALL` and :term:`GO_INSTALL_FILTEROUT` ones. +The :term:`SRC_URI` for your Go module recipe must include setting the +destsuffix parameter to :term:`GO_SRCURI_DESTSUFFIX` in order to build +correctly with the new :term:`UNPACKDIR` methodology:: + + SRC_URI = "...;destsuffix=${GO_SRCURI_DESTSUFFIX}" + To build a Go program with the Yocto Project, you can use the :yocto_git:`go-helloworld_0.1.bb </poky/tree/meta/recipes-extended/go-examples/go-helloworld_0.1.bb>` recipe as an example. diff --git a/documentation/ref-manual/variables.rst b/documentation/ref-manual/variables.rst index 07b5b6f95..9e9b5449a 100644 --- a/documentation/ref-manual/variables.rst +++ b/documentation/ref-manual/variables.rst @@ -3228,6 +3228,18 @@ system and gives an overview of their function and contents. packages, but it can be overridden by a recipe to filter out other subdirectories if needed. + :term:`GO_SRCURI_DESTSUFFIX` + The :term:`SRC_URI` for your Go module recipe must include setting the + destsuffix parameter to :term:`GO_SRCURI_DESTSUFFIX` in order to build + correctly with the new :term:`UNPACKDIR` methodology:: + + SRC_URI = "...;destsuffix=${GO_SRCURI_DESTSUFFIX}" + + You should not need to set GO_SRCURI_DESTSUFFIX yourself. By default, + :term:`GO_SRCURI_DESTSUFFIX` is defined as:: + + GO_SRCURI_DESTSUFFIX = "${S}/src/${GO_IMPORT}/" + :term:`GO_WORKDIR` When using Go Modules, the current working directory must be the directory containing the ``go.mod`` file, or one of its subdirectories. When the
Add the needed entries for the GO_SRCURI_DESTSUFFIX variable and why it is needed. Also update the go.class and 5,1 migration file with the same information. Signed-off-by: Ryan Eatmon <reatmon@ti.com> --- documentation/migration-guides/migration-5.1.rst | 5 +++++ documentation/ref-manual/classes.rst | 6 ++++++ documentation/ref-manual/variables.rst | 12 ++++++++++++ 3 files changed, 23 insertions(+)