Skip to contentSkip to conversation

docs: update examples to add branch info to git URIs

PATCH Superseded Michael Opdenacker 2 participants 3 messages Mar 9, 2022 – Mar 10, 2022 1 message not in the archive

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 docs: update examples to add branch info to git URIs

Branch information is now mandatory for git:// and gitsm:// URIs

---
 documentation/dev-manual/common-tasks.rst | 56 +++++++++++------------
 documentation/ref-manual/classes.rst      |  5 +-
 documentation/ref-manual/variables.rst    |  2 +-
 3 files changed, 29 insertions(+), 34 deletions(-)
documentation/dev-manual/common-tasks.rst +26 -30
index 1caf953901..34f086bf1f 100644
@@ -1402,13 +1402,11 @@ the revision with :term:`SRCPV`. Here
 is an example from the recipe
 ``meta/recipes-kernel/blktrace/blktrace_git.bb``::
 
-   SRCREV = "d6918c8832793b4205ed3bfede78c2f915c23385"
+   SRCREV = "366d30b9cdb20345c5d064af850d686da79b89eb"
 
-   PR = "r6"
-   PV = "1.0.5+git${SRCPV}"
+   PV = "1.3.0+git${SRCPV}"
 
-   SRC_URI = "git://git.kernel.dk/blktrace.git \
-              file://ldflags.patch"
+   SRC_URI = "git://git.kernel.dk/blktrace.git;branch=master"
 
 If your :term:`SRC_URI` statement includes URLs pointing to individual files
 fetched from a remote server other than a version control system,
@@ -2372,41 +2370,39 @@ following example shows this::
 
    CFLAGS:prepend = "-I ${S}/include "
 
-In the following example, ``mtd-utils`` is a makefile-based package::
+In the following example, ``lz4`` is a makefile-based package::
 
-   SUMMARY = "Tools for managing memory technology devices"
-   SECTION = "base"
-   DEPENDS = "zlib lzo e2fsprogs util-linux"
-   HOMEPAGE = "http://www.linux-mtd.infradead.org/"
-   LICENSE = "GPL-2.0-or-later"
-   LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
-       file://include/common.h;beginline=1;endline=17;md5=ba05b07912a44ea2bf81ce409380049c"
+   SUMMARY = "Extremely Fast Compression algorithm"
+   DESCRIPTION = "LZ4 is a very fast lossless compression algorithm, providing compression speed at 400 MB/s per core, scalable with multi-cores CPU. It also features an extremely fast decoder, with speed in multiple GB/s per core, typically reaching RAM speed limits on multi-core systems."
+   HOMEPAGE = "https://github.com/lz4/lz4"
 
-   # Use the latest version at 26 Oct, 2013
-   SRCREV = "9f107132a6a073cce37434ca9cda6917dd8d866b"
-   SRC_URI = "git://git.infradead.org/mtd-utils.git \
-       file://add-exclusion-to-mkfs-jffs2-git-2.patch \
-       "
+   LICENSE = "BSD-2-Clause | GPL-2.0-only"
+   LIC_FILES_CHKSUM = "file://lib/LICENSE;md5=ebc2ea4814a64de7708f1571904b32cc \
+                       file://programs/COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+                       file://LICENSE;md5=d57c0d21cb917fb4e0af2454aa48b956 \
+                       "
 
-   PV = "1.5.1+git${SRCPV}"
+   PE = "1"
 
-   S = "${WORKDIR}/git"
+   SRCREV = "d44371841a2f1728a3f36839fd4b7e872d0927d3"
 
-   EXTRA_OEMAKE = "'CC=${CC}' 'RANLIB=${RANLIB}' 'AR=${AR}' 'CFLAGS=${CFLAGS} -I${S}/include -DWITHOUT_XATTR' 'BUILDDIR=${S}'"
+   SRC_URI = "git://github.com/lz4/lz4.git;branch=release;protocol=https \
+              file://CVE-2021-3520.patch \
+              "
+   UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>.*)"
 
-   do_install () {
-       oe_runmake install DESTDIR=${D} SBINDIR=${sbindir} MANDIR=${mandir} INCLUDEDIR=${includedir}
-   }
+   S = "${WORKDIR}/git"
 
-   PACKAGES =+ "mtd-utils-jffs2 mtd-utils-ubifs mtd-utils-misc"
+   # Fixed in r118, which is larger than the current version.
+   CVE_CHECK_IGNORE += "CVE-2014-4715"
 
-   FILES:mtd-utils-jffs2 = "${sbindir}/mkfs.jffs2 ${sbindir}/jffs2dump ${sbindir}/jffs2reader ${sbindir}/sumtool"
-   FILES:mtd-utils-ubifs = "${sbindir}/mkfs.ubifs ${sbindir}/ubi*"
-   FILES:mtd-utils-misc = "${sbindir}/nftl* ${sbindir}/ftl* ${sbindir}/rfd* ${sbindir}/doc* ${sbindir}/serve_image ${sbindir}/recv_image"
+   EXTRA_OEMAKE = "PREFIX=${prefix} CC='${CC}' CFLAGS='${CFLAGS}' DESTDIR=${D} LIBDIR=${libdir} INCLUDEDIR=${includedir} BUILD_STATIC=no"
 
-   PARALLEL_MAKE = ""
+   do_install() {
+           oe_runmake install
+   }
 
-   BBCLASSEXTEND = "native"
+   BBCLASSEXTEND = "native nativesdk"
 
 Splitting an Application into Multiple Packages
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
documentation/ref-manual/classes.rst +2 -3
index cba9793332..ffb2176e43 100644
@@ -170,8 +170,7 @@ example use for this class.
    are extracted into the subdirectory expected by the default value of
    :term:`S`::
 
-           SRC_URI = "git://example.com/downloads/somepackage.rpm;subpath=${BP}"
-
+      SRC_URI = "git://example.com/downloads/somepackage.rpm;branch=master;subpath=${BP}"
 
    See the ":ref:`bitbake-user-manual/bitbake-user-manual-fetching:fetchers`" section in the BitBake User Manual for
    more information on supported BitBake Fetchers.
@@ -477,7 +476,7 @@ recipe that fetches from an alternative URI (e.g. Git) instead of a
 tarball. Following is an example::
 
    BBCLASSEXTEND = "devupstream:target"
-   SRC_URI:class-devupstream = "git://git.example.com/example"
+   SRC_URI:class-devupstream = "git://git.example.com/example;branch=master"
    SRCREV:class-devupstream = "abcd1234"
 
 Adding the above statements to your recipe creates a variant that has
documentation/ref-manual/variables.rst +1 -1
index 005456f0c4..efc3fcf8d4 100644
@@ -6455,7 +6455,7 @@ system and gives an overview of their function and contents.
       from the default value of :term:`S`, you must set it specifically so the
       source can be located::
 
-         SRC_URI = "git://path/to/repo.git"
+         SRC_URI = "git://path/to/repo.git;branch=master"
          S = "${WORKDIR}/git"
 
    :term:`SANITY_REQUIRED_UTILITIES`
Signature · 1 line
2.25.1
#1 lore raw

Hi Michael,

Quoted 18 lines · Michael Opdenacker via lists.yoctoproject.org

Branch information is now mandatory for git:// and gitsm:// URIs

---
  documentation/dev-manual/common-tasks.rst | 56 +++++++++++------------
  documentation/ref-manual/classes.rst      |  5 +-
  documentation/ref-manual/variables.rst    |  2 +-
  3 files changed, 29 insertions(+), 34 deletions(-)
documentation/dev-manual/common-tasks.rst +0 -1
index 1caf953901..34f086bf1f 100644
@@ -1402,13 +1402,11 @@ the revision with :term:`SRCPV`. Here
  is an example from the recipe
  ``meta/recipes-kernel/blktrace/blktrace_git.bb``::
 
-   SRCREV = "d6918c8832793b4205ed3bfede78c2f915c23385"

documentation/dev-manual/common-tasks.rst the revision with :term:`SRCPV`. Here · line 1410

Quoted 10 lines
documentation/dev-manual/common-tasks.rst +3 -4
+   SRCREV = "366d30b9cdb20345c5d064af850d686da79b89eb"
 
-   PR = "r6"
-   PV = "1.0.5+git${SRCPV}"
+   PV = "1.3.0+git${SRCPV}"
 
-   SRC_URI = "git://git.kernel.dk/blktrace.git \
-              file://ldflags.patch"
+   SRC_URI = "git://git.kernel.dk/blktrace.git;branch=master"
 

Would be better if we had an example with a non-master branch? I see you rplaced mtd-utils with lz4 below so maybe a similar change can be made here?

Quoted 72 lines
documentation/dev-manual/common-tasks.rst +23 -25
  If your :term:`SRC_URI` statement includes URLs pointing to individual files
  fetched from a remote server other than a version control system,
@@ -2372,41 +2370,39 @@ following example shows this::
 
     CFLAGS:prepend = "-I ${S}/include "
 
-In the following example, ``mtd-utils`` is a makefile-based package::
+In the following example, ``lz4`` is a makefile-based package::
 
-   SUMMARY = "Tools for managing memory technology devices"
-   SECTION = "base"
-   DEPENDS = "zlib lzo e2fsprogs util-linux"
-   HOMEPAGE = "https://urldefense.proofpoint.com/v2/url?u=http-3A__www.linux-2Dmtd.infradead.org_&d=DwIDAg&c=_sEr5x9kUWhuk4_nFwjJtA&r=LYjLexDn7rXIzVmkNPvw5ymA1XTSqHGq8yBP6m6qZZ4njZguQhZhkI_-172IIy1t&m=QMieOh9nbIBS9SSii-FPQIjYKRoWkrrMH0lHC0zUBQjeE5CyvQvLCW2AnhdDjkp6&s=IH9Cg3SGu1_z_nLHAc0T0gK1IVKNgx1qioonvcMd5DY&e= "
-   LICENSE = "GPL-2.0-or-later"
-   LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
-       file://include/common.h;beginline=1;endline=17;md5=ba05b07912a44ea2bf81ce409380049c"
+   SUMMARY = "Extremely Fast Compression algorithm"
+   DESCRIPTION = "LZ4 is a very fast lossless compression algorithm, providing compression speed at 400 MB/s per core, scalable with multi-cores CPU. It also features an extremely fast decoder, with speed in multiple GB/s per core, typically reaching RAM speed limits on multi-core systems."
+   HOMEPAGE = "https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_lz4_lz4&d=DwIDAg&c=_sEr5x9kUWhuk4_nFwjJtA&r=LYjLexDn7rXIzVmkNPvw5ymA1XTSqHGq8yBP6m6qZZ4njZguQhZhkI_-172IIy1t&m=QMieOh9nbIBS9SSii-FPQIjYKRoWkrrMH0lHC0zUBQjeE5CyvQvLCW2AnhdDjkp6&s=cFqbOb6M8UnVlEYErAMywY0qGo0oMtoZndqi1ZeQwfQ&e= "
 
-   # Use the latest version at 26 Oct, 2013
-   SRCREV = "9f107132a6a073cce37434ca9cda6917dd8d866b"
-   SRC_URI = "git://git.infradead.org/mtd-utils.git \
-       file://add-exclusion-to-mkfs-jffs2-git-2.patch \
-       "
+   LICENSE = "BSD-2-Clause | GPL-2.0-only"
+   LIC_FILES_CHKSUM = "file://lib/LICENSE;md5=ebc2ea4814a64de7708f1571904b32cc \
+                       file://programs/COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+                       file://LICENSE;md5=d57c0d21cb917fb4e0af2454aa48b956 \
+                       "
 
-   PV = "1.5.1+git${SRCPV}"
+   PE = "1"
 
-   S = "${WORKDIR}/git"
+   SRCREV = "d44371841a2f1728a3f36839fd4b7e872d0927d3"
 
-   EXTRA_OEMAKE = "'CC=${CC}' 'RANLIB=${RANLIB}' 'AR=${AR}' 'CFLAGS=${CFLAGS} -I${S}/include -DWITHOUT_XATTR' 'BUILDDIR=${S}'"
+   SRC_URI = "git://github.com/lz4/lz4.git;branch=release;protocol=https \
+              file://CVE-2021-3520.patch \
+              "
+   UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>.*)"
 
-   do_install () {
-       oe_runmake install DESTDIR=${D} SBINDIR=${sbindir} MANDIR=${mandir} INCLUDEDIR=${includedir}
-   }
+   S = "${WORKDIR}/git"
 
-   PACKAGES =+ "mtd-utils-jffs2 mtd-utils-ubifs mtd-utils-misc"
+   # Fixed in r118, which is larger than the current version.
+   CVE_CHECK_IGNORE += "CVE-2014-4715"
 
-   FILES:mtd-utils-jffs2 = "${sbindir}/mkfs.jffs2 ${sbindir}/jffs2dump ${sbindir}/jffs2reader ${sbindir}/sumtool"
-   FILES:mtd-utils-ubifs = "${sbindir}/mkfs.ubifs ${sbindir}/ubi*"
-   FILES:mtd-utils-misc = "${sbindir}/nftl* ${sbindir}/ftl* ${sbindir}/rfd* ${sbindir}/doc* ${sbindir}/serve_image ${sbindir}/recv_image"
+   EXTRA_OEMAKE = "PREFIX=${prefix} CC='${CC}' CFLAGS='${CFLAGS}' DESTDIR=${D} LIBDIR=${libdir} INCLUDEDIR=${includedir} BUILD_STATIC=no"
 
-   PARALLEL_MAKE = ""
+   do_install() {
+           oe_runmake install
+   }
 
-   BBCLASSEXTEND = "native"
+   BBCLASSEXTEND = "native nativesdk"
 
  Splitting an Application into Multiple Packages
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
documentation/ref-manual/classes.rst +0 -0
index cba9793332..ffb2176e43 100644

documentation/ref-manual/classes.rst example use for this class. · line 174

Quoted 7 lines
documentation/ref-manual/classes.rst +1 -2
@@ -170,8 +170,7 @@ example use for this class.
     are extracted into the subdirectory expected by the default value of
     :term:`S`::
 
-           SRC_URI = "git://example.com/downloads/somepackage.rpm;subpath=${BP}"
-
+      SRC_URI = "git://example.com/downloads/somepackage.rpm;branch=master;subpath=${BP}"
 

s/master/main/ (or devel)

documentation/ref-manual/classes.rst recipe that fetches from an alternative URI (e.g. Git) instead of a · line 479

Quoted 8 lines
documentation/ref-manual/classes.rst +1 -1
     See the ":ref:`bitbake-user-manual/bitbake-user-manual-fetching:fetchers`" section in the BitBake User Manual for
     more information on supported BitBake Fetchers.
@@ -477,7 +476,7 @@ recipe that fetches from an alternative URI (e.g. Git) instead of a
  tarball. Following is an example::
 
     BBCLASSEXTEND = "devupstream:target"
-   SRC_URI:class-devupstream = "git://git.example.com/example"
+   SRC_URI:class-devupstream = "git://git.example.com/example;branch=master"

s/master/main/ (or devel)

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

Quoted 13 lines
documentation/ref-manual/classes.rst +0 -0
     SRCREV:class-devupstream = "abcd1234"
 
  Adding the above statements to your recipe creates a variant that has
documentation/ref-manual/variables.rst +1 -1
index 005456f0c4..efc3fcf8d4 100644
@@ -6455,7 +6455,7 @@ system and gives an overview of their function and contents.
        from the default value of :term:`S`, you must set it specifically so the
        source can be located::
 
-         SRC_URI = "git://path/to/repo.git"
+         SRC_URI = "git://path/to/repo.git;branch=master"

s/master/main/ (or devel)

Cheers,
Quentin

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

Hi again Quentin,

Quoted 4 lines · Michael Opdenacker via lists.yoctoproject.org

I agree this is an issue. We never know when this upstream will change.

The challenge though is to find a suitable example which also includes an EXTRA_OEMAKE, because that's what the corresponding paragraph is about.

Oops, I was actually talking about the lz4 package, which is just fine here as it doesn't use the "master" branch.
I'll do my best to remove "branch=master" from the patch.

Michael.

Signature · 3 lines
Michael Opdenacker, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com