Skip to contentSkip to conversation

docs: Document the GO_SRCURI_DESTSUFFIX variable

PATCH In review Ryan Eatmon 2 participants 2 messages May 31, 2024 – Jun 5, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 docs: Document the GO_SRCURI_DESTSUFFIX variable

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.

---
 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(+)
documentation/migration-guides/migration-5.1.rst +5 -0
index b43fecc2d..453c9fcc0 100644
@@ -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:
 
documentation/ref-manual/classes.rst +6 -0
index 9520d0bf7..e1854814a 100644
@@ -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.
documentation/ref-manual/variables.rst +12 -0
index 07b5b6f95..9e9b5449a 100644
@@ -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
Signature · 1 line
2.17.1
#1 lore raw

Hi Ryan

Many thanks for the patch!
I have a few minor improvements to suggest...

Quoted 16 lines · Ryan Eatmon

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.

---
  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(+)
documentation/migration-guides/migration-5.1.rst +0 -0
index b43fecc2d..453c9fcc0 100644

documentation/migration-guides/migration-5.1.rst See :ref:`all supported distributions <system-requirements-supported-distros>`. · line 98

Quoted 5 lines
documentation/migration-guides/migration-5.1.rst +2 -0
@@ -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``/

Quoted 11 lines
documentation/migration-guides/migration-5.1.rst +3 -0
+correctly with the new :term:`UNPACKDIR` methodology::
+
+   SRC_URI = "...;destsuffix=${GO_SRCURI_DESTSUFFIX}"
 
  .. _migration-5.1-systemd-changes:
 
documentation/ref-manual/classes.rst +0 -0
index 9520d0bf7..e1854814a 100644

documentation/ref-manual/classes.rst The :ref:`ref-classes-go` class supports building Go programs. The behavior of · line 936

Quoted 5 lines
documentation/ref-manual/classes.rst +2 -0
@@ -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 :)

Quoted 12 lines
documentation/ref-manual/classes.rst +4 -0
+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.
documentation/ref-manual/variables.rst +0 -0
index 07b5b6f95..9e9b5449a 100644

documentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 3233

Quoted 6 lines
documentation/ref-manual/variables.rst +3 -0
@@ -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

documentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 3238

Quoted 5 lines
documentation/ref-manual/variables.rst +5 -0
+      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.

documentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 3245

Quoted 7 lines
documentation/ref-manual/variables.rst +4 -0
+      :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.