Patch review
cover Patch review
PLease review this next set of patches for dunfell and have comments back by end of day Thursday.
Passed a-full on autobuilder:
https://autobuilder.yoctoproject.org/typhoon/#/builders/83/builds/1603
The following changes since commit b4a92a20a683a74423fd5a833d5c016f63dba2b4:
freetype: fix CVE-2020-15999, backport from 2.10.4 (2020-11-13 05:57:16 -1000)
are available in the Git repository at:
git://git.openembedded.org/openembedded-core-contrib stable/dunfell-nut
http://cgit.openembedded.org/openembedded-core-contrib/log/?h=stable/dunfell-nut
Alexander Kanavin (2):
ptest-runner: fix upstream version check
glib-2.0: correct build with latest meson
Anibal Limon (1):
ptest-runner: Bump to 2.4.0
Joshua Watt (3):
classes/reproducible: Move to library code
lib/oe/reproducible: Fix error when no git HEAD
lib/oe/reproducible.py: Fix git HEAD check
Khem Raj (1):
ptest-runner: Backport patch to fix inappropriate ioctl error
Mark Jonas (1):
libbsd: Remove BSD-4-Clause from main package
Mingli Yu (1):
python3: add ldconfig rdepends for python3-ctypes
meta/classes/reproducible_build.bbclass | 90 +--------------
meta/lib/oe/reproducible.py | 104 ++++++++++++++++++
.../glib-2.0/meson.cross.d/common-linux | 2 +-
meta/recipes-devtools/python/python3_3.8.2.bb | 1 +
meta/recipes-support/libbsd/libbsd_0.10.0.bb | 3 +-
...-runner_2.3.2.bb => ptest-runner_2.4.0.bb} | 5 +-
6 files changed, 114 insertions(+), 91 deletions(-)
create mode 100644 meta/lib/oe/reproducible.py
rename meta/recipes-support/ptest-runner/{ptest-runner_2.3.2.bb => ptest-runner_2.4.0.bb} (87%)Signature · 1 line
2.17.1
PATCH 1/9 libbsd: Remove BSD-4-Clause from main package
From: Mark Jonas <[email protected]>
libbsd contains a multitude of licenses. For (commercial) projects the 3rd clause of the BSD-4-Clause license can be problematic. But only a few man pages use this license. This means that the main package containing the binary library itself is not under BSD-4-Clause ruling.
--- meta/recipes-support/libbsd/libbsd_0.10.0.bb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
meta/recipes-support/libbsd/libbsd_0.10.0.bb +2 -1
@@ -27,7 +27,8 @@ HOMEPAGE = "https://libbsd.freedesktop.org/wiki/" # License: ISC-Original # License: public-domain # License: public-domain-Colin-Plumb -LICENSE = "BSD-4-Clause & ISC & PD" +LICENSE = "BSD-3-Clause & BSD-4-Clause & ISC & PD" +LICENSE_${PN} = "BSD-3-Clause & ISC & PD" LIC_FILES_CHKSUM = "file://COPYING;md5=2120be0173469a06ed185b688e0e1ae0" SECTION = "libs"
Signature · 1 line
2.17.1
PATCH 2/9 classes/reproducible: Move to library code
In reply to Steve SakomanFrom: Joshua Watt <[email protected]>
Moves most of the python code used for dealing with the source date epoch to library code.
--- meta/classes/reproducible_build.bbclass | 90 +---------------------- meta/lib/oe/reproducible.py | 95 +++++++++++++++++++++++++ 2 files changed, 98 insertions(+), 87 deletions(-) create mode 100644 meta/lib/oe/reproducible.py
meta/classes/reproducible_build.bbclass +3 -87
@@ -70,100 +70,16 @@ do_deploy_source_date_epoch[sstate-plaindirs] = "${SDE_DEPLOYDIR}" addtask do_deploy_source_date_epoch_setscene addtask do_deploy_source_date_epoch before do_configure after do_patch -def get_source_date_epoch_from_known_files(d, sourcedir): - source_date_epoch = None - newest_file = None - known_files = set(["NEWS", "ChangeLog", "Changelog", "CHANGES"]) - for file in known_files: - filepath = os.path.join(sourcedir, file) - if os.path.isfile(filepath): - mtime = int(os.lstat(filepath).st_mtime) - # There may be more than one "known_file" present, if so, use the youngest one - if not source_date_epoch or mtime > source_date_epoch: - source_date_epoch = mtime - newest_file = filepath - if newest_file: - bb.debug(1, "SOURCE_DATE_EPOCH taken from: %s" % newest_file) - return source_date_epoch - -def find_git_folder(d, sourcedir): - # First guess: WORKDIR/git - # This is the default git fetcher unpack path - workdir = d.getVar('WORKDIR') - gitpath = os.path.join(workdir, "git/.git") - if os.path.isdir(gitpath): - return gitpath - - # Second guess: ${S} - gitpath = os.path.join(sourcedir, ".git") - if os.path.isdir(gitpath): - return gitpath - - # Perhaps there was a subpath or destsuffix specified. - # Go looking in the WORKDIR - exclude = set(["build", "image", "license-destdir", "patches", "pseudo", - "recipe-sysroot", "recipe-sysroot-native", "sysroot-destdir", "temp"]) - for root, dirs, files in os.walk(workdir, topdown=True): - dirs[:] = [d for d in dirs if d not in exclude] - if '.git' in dirs: - return root - - bb.warn("Failed to find a git repository in WORKDIR: %s" % workdir) - return None - -def get_source_date_epoch_from_git(d, sourcedir): - source_date_epoch = None - if "git://" in d.getVar('SRC_URI'): - gitpath = find_git_folder(d, sourcedir) - if gitpath: - import subprocess - source_date_epoch = int(subprocess.check_output(['git','log','-1','--pretty=%ct'], cwd=gitpath)) - bb.debug(1, "git repository: %s" % gitpath) - return source_date_epoch - -def get_source_date_epoch_from_youngest_file(d, sourcedir): - if sourcedir == d.getVar('WORKDIR'): - # These sources are almost certainly not from a tarball - return None - - # Do it the hard way: check all files and find the youngest one... - source_date_epoch = None - newest_file = None - for root, dirs, files in os.walk(sourcedir, topdown=True): - files = [f for f in files if not f[0] == '.'] - - for fname in files: - filename = os.path.join(root, fname) - try: - mtime = int(os.lstat(filename).st_mtime) - except ValueError: - mtime = 0 - if not source_date_epoch or mtime > source_date_epoch: - source_date_epoch = mtime - newest_file = filename - - if newest_file: - bb.debug(1, "Newest file found: %s" % newest_file) - return source_date_epoch - -def fixed_source_date_epoch(): - bb.debug(1, "No tarball or git repo found to determine SOURCE_DATE_EPOCH") - return 0 - python create_source_date_epoch_stamp() { + import oe.reproducible + epochfile = d.getVar('SDE_FILE') # If it exists we need to regenerate as the sources may have changed if os.path.isfile(epochfile): bb.debug(1, "Deleting existing SOURCE_DATE_EPOCH from: %s" % epochfile) os.remove(epochfile) - sourcedir = d.getVar('S') - source_date_epoch = ( - get_source_date_epoch_from_git(d, sourcedir) or - get_source_date_epoch_from_known_files(d, sourcedir) or - get_source_date_epoch_from_youngest_file(d, sourcedir) or - fixed_source_date_epoch() # Last resort - ) + source_date_epoch = oe.reproducible.get_source_date_epoch(d, d.getVar('S')) bb.debug(1, "SOURCE_DATE_EPOCH: %d" % source_date_epoch) bb.utils.mkdirhier(d.getVar('SDE_DIR'))
meta/lib/oe/reproducible.py new file +95 -0
95 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH 3/9 lib/oe/reproducible: Fix error when no git HEAD
In reply to Steve SakomanFrom: Joshua Watt <[email protected]>
Fixes an error that occurs when attempting to get the timestamp of the latest commit when there is no HEAD in the git repository. The easiest way to trigger this condition is to use the 'subdir=' option when specifying a 'git://' SRC_URI.
--- meta/lib/oe/reproducible.py | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-)
meta/lib/oe/reproducible.py +17 -8
@@ -47,14 +47,23 @@ def find_git_folder(d, sourcedir): return None def get_source_date_epoch_from_git(d, sourcedir): - source_date_epoch = None - if "git://" in d.getVar('SRC_URI'): - gitpath = find_git_folder(d, sourcedir) - if gitpath: - import subprocess - source_date_epoch = int(subprocess.check_output(['git','log','-1','--pretty=%ct'], cwd=gitpath)) - bb.debug(1, "git repository: %s" % gitpath) - return source_date_epoch + if not "git://" in d.getVar('SRC_URI'): + return None + + gitpath = find_git_folder(d, sourcedir) + if not gitpath: + return None + + # Check that the repository has a valid HEAD; it may not if subdir is used + # in SRC_URI + p = subprocess.run(['git', 'rev-parse', 'HEAD'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=gitpath) + if p.returncode != 0: + bb.debug(1, "%s does not have a valid HEAD: %s" % (gitpath, p.stdout.decode('utf-8'))) + return None + + bb.debug(1, "git repository: %s" % gitpath) + p = subprocess.run(['git','log','-1','--pretty=%ct'], check=True, stdout=subprocess.PIPE, cwd=gitpath) + return int(p.stdout.decode('utf-8')) def get_source_date_epoch_from_youngest_file(d, sourcedir): if sourcedir == d.getVar('WORKDIR'):
Signature · 1 line
2.17.1
PATCH 4/9 lib/oe/reproducible.py: Fix git HEAD check
In reply to Steve SakomanFrom: Joshua Watt <[email protected]>
The check for a git HEAD still wasn't quite correct because it was using the .git directory as the current working directory. Instead, it should be passed as the --git-dir argument when running git. Running git rev-parse HEAD in a .git directory with no HEAD reports 'HEAD' and exits with success but then 'git log' will fail, which is not what we want.
--- meta/lib/oe/reproducible.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
meta/lib/oe/reproducible.py +2 -2
@@ -56,13 +56,13 @@ def get_source_date_epoch_from_git(d, sourcedir): # Check that the repository has a valid HEAD; it may not if subdir is used # in SRC_URI - p = subprocess.run(['git', 'rev-parse', 'HEAD'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=gitpath) + p = subprocess.run(['git', '--git-dir', gitpath, 'rev-parse', 'HEAD'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) if p.returncode != 0: bb.debug(1, "%s does not have a valid HEAD: %s" % (gitpath, p.stdout.decode('utf-8'))) return None bb.debug(1, "git repository: %s" % gitpath) - p = subprocess.run(['git','log','-1','--pretty=%ct'], check=True, stdout=subprocess.PIPE, cwd=gitpath) + p = subprocess.run(['git', '--git-dir', gitpath, 'log', '-1', '--pretty=%ct'], check=True, stdout=subprocess.PIPE) return int(p.stdout.decode('utf-8')) def get_source_date_epoch_from_youngest_file(d, sourcedir):
Signature · 1 line
2.17.1
PATCH 5/9 ptest-runner: Bump to 2.4.0
In reply to Steve SakomanFrom: Anibal Limon <[email protected]>
Add support for un ptests in multiple directories, useful in multilib builds.
Changes,
1e9a845 Add support to specify multiple folder for ptest-runner 287ba30 Makefile: Fix TEST_LDFLAGS gcc cmdline position
[YOCTO #12604]
---
.../{ptest-runner_2.3.2.bb => ptest-runner_2.4.0.bb} | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
rename meta/recipes-support/ptest-runner/{ptest-runner_2.3.2.bb => ptest-runner_2.4.0.bb} (90%)meta/recipes-support/ptest-runner/ptest-runner_2.4.0.bb renamed from meta/recipes-support/ptest-runner/ptest-runner_2.3.2.bb +2 -2
@@ -7,8 +7,8 @@ HOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/ptest-runner2/about/" LICENSE = "GPLv2+" LIC_FILES_CHKSUM = "file://LICENSE;md5=751419260aa954499f7abaabaa882bbe" -SRCREV = "7015e9199ce748c0717addeebe7a8c47448bab03" -PV = "2.3.2+git${SRCPV}" +SRCREV = "1e9a84585909b970cc8850d3ea02a7215dcfa5a3" +PV = "2.4.0+git${SRCPV}" SRC_URI = "git://git.yoctoproject.org/ptest-runner2 \ "
Signature · 1 line
2.17.1
PATCH 6/9 ptest-runner: fix upstream version check
In reply to Steve SakomanFrom: Alexander Kanavin <[email protected]>
--- meta/recipes-support/ptest-runner/ptest-runner_2.4.0.bb | 1 + 1 file changed, 1 insertion(+)
meta/recipes-support/ptest-runner/ptest-runner_2.4.0.bb +1 -0
@@ -12,6 +12,7 @@ PV = "2.4.0+git${SRCPV}" SRC_URI = "git://git.yoctoproject.org/ptest-runner2 \ " +UPSTREAM_VERSION_UNKNOWN = "1" S = "${WORKDIR}/git"
Signature · 1 line
2.17.1
PATCH 7/9 ptest-runner: Backport patch to fix inappropriate ioctl error
In reply to Steve SakomanFrom: Khem Raj <[email protected]>
The srcrev bump is actually bring single commit [1] on top of 2.4.0 which fixes ptest runs with messges like
ERROR: Unable to detach from controlling tty, Inappropriate ioctl for device
--- meta/recipes-support/ptest-runner/ptest-runner_2.4.0.bb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
meta/recipes-support/ptest-runner/ptest-runner_2.4.0.bb +2 -2
@@ -7,8 +7,8 @@ HOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/ptest-runner2/about/" LICENSE = "GPLv2+" LIC_FILES_CHKSUM = "file://LICENSE;md5=751419260aa954499f7abaabaa882bbe" -SRCREV = "1e9a84585909b970cc8850d3ea02a7215dcfa5a3" -PV = "2.4.0+git${SRCPV}" +SRCREV = "834670317bd3f6e427e1ac461c07ada6b8936dfd" +PV .= "+git${SRCPV}" SRC_URI = "git://git.yoctoproject.org/ptest-runner2 \ "
Signature · 1 line
2.17.1
PATCH 8/9 glib-2.0: correct build with latest meson
In reply to Steve SakomanFrom: Alexander Kanavin <[email protected]>
--- meta/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-linux | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-linux +1 -1
@@ -2,4 +2,4 @@ have_proc_self_cmdline = true [binaries] -env = "/usr/bin/env" +env = '/usr/bin/env'
Signature · 1 line
2.17.1
PATCH 9/9 python3: add ldconfig rdepends for python3-ctypes
In reply to Steve SakomanFrom: Mingli Yu <[email protected]>
The ctypes module needs to use "ldconfig -p" to find the library path and it simply has below logic if no ldconfig installed.
except OSError:
pass
Before the patch:
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
from ctypes.util import
find_librarylib_path=find_library('archive')print(lib_path)
None
After the patch:
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
from ctypes.util import
find_librarylib_path=find_library('archive')print(lib_path)
libarchive.so.13
--- meta/recipes-devtools/python/python3_3.8.2.bb | 1 + 1 file changed, 1 insertion(+)
meta/recipes-devtools/python/python3_3.8.2.bb +1 -0
@@ -345,6 +345,7 @@ FILES_${PN}-man = "${datadir}/man" # See https://bugs.python.org/issue18748 and https://bugs.python.org/issue37395 RDEPENDS_libpython3_append_libc-glibc = " libgcc" +RDEPENDS_${PN}-ctypes_append_libc-glibc = " ${MLPREFIX}ldconfig" RDEPENDS_${PN}-ptest = "${PN}-modules ${PN}-tests unzip bzip2 libgcc tzdata-europe coreutils sed" RDEPENDS_${PN}-ptest_append_libc-glibc = " locale-base-tr-tr.iso-8859-9" RDEPENDS_${PN}-tkinter += "${@bb.utils.contains('PACKAGECONFIG', 'tk', 'tk tk-lib', '', d)}"
Signature · 1 line
2.17.1