insane: add checking to standardize how .bbappend files do FILESEXTRAPATHS
v2 cover insane: add checking to standardize how .bbappend files do FILESEXTRAPATHS
Change in V2:
- It is more reasonable to move the checking to insance.bbclass rather than create a new bbclass.
Test Steps:
1) Edit meta-yocto/recipes-core/busybox/busybox_%.bbappend and assigned FILESEXTRAPATHS incorrectly:
...
meta-yocto/recipes-core/busybox/busybox_%.bbappend +1 -1
@@ -1,2 +1,2 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" +FILESEXTRAPATHS := "${THISDIR}/${BPN}:"
...
2) bitbake busybox
...
ERROR: FILESEXTRAPATHS-variable, must always use _prepend (or _append)
type of assignment. Please assign it with the format of:
FILESEXTRAPATHS_append := ${THISDIR}/Your_Files_Path or
FILESEXTRAPATHS_prepend := ${THISDIR}/Your_Files_Path
in your bbappend file
ERROR: Failed to parse recipe: /home/jiahongxu/yocto/poky/meta/recipes-core/busybox/busybox_git.bb
...
//Hongxu
The following changes since commit 4d2ac6f6df2b3ef98699dd4f7afadb2d994222bb:
rootfs: Remove the extraneous install directory (2014-07-19 00:18:21 +0100)
are available in the git repository at:
git://git.pokylinux.org/poky-contrib hongxu/filesextrapaths
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=hongxu/filesextrapaths
Hongxu Jia (1):
insane: add checking to standardize how .bbappend files do
FILESEXTRAPATHS
meta/classes/insane.bbclass | 10 ++++++++++ meta/classes/utils.bbclass | 2 ++ meta/conf/bitbake.conf | 2 ++ 3 files changed, 14 insertions(+)
Signature · 1 line
1.8.1.2
PATCH v2 1/1 insane: add checking to standardize how .bbappend files do FILESEXTRAPATHS
When adding patches or config files from bbappend files, it requires the use of FILESEXTRAPATHS, which has been an issue and failure point for people starting to work with bitbake and oe-core.
We add checking to standardize how to use FILESEXTRAPATHS. Only the format of:
FILESEXTRAPATHS_append := ${THISDIR}/Your_Files_Path or FILESEXTRAPATHS_prepend := ${THISDIR}/Your_Files_Path
is acceptable.
[YOCTO #5412]
--- meta/classes/insane.bbclass | 10 ++++++++++ meta/classes/utils.bbclass | 2 ++ meta/conf/bitbake.conf | 2 ++ 3 files changed, 14 insertions(+)
meta/classes/insane.bbclass +10 -0
@@ -1022,6 +1022,16 @@ python () { # Check various variables ########################################################################### + # Checking ${FILESEXTRAPATHS} + extrapaths = (d.getVar("FILESEXTRAPATHS", True) or "") + if '__default' not in extrapaths.split(":"): + msg = "FILESEXTRAPATHS-variable, must always use _prepend (or _append)\n" + msg += "type of assignment. Please assign it with the format of:\n" + msg += " FILESEXTRAPATHS_append := ${THISDIR}/Your_Files_Path or\n" + msg += " FILESEXTRAPATHS_prepend := ${THISDIR}/Your_Files_Path\n" + msg += "in your bbappend file" + bb.fatal(msg) + if d.getVar('do_stage', True) is not None: bb.fatal("Legacy staging found for %s as it has a do_stage function. This will need conversion to a do_install or often simply removal to work with OE-core" % d.getVar("FILE", True))
meta/classes/utils.bbclass +2 -0
@@ -312,6 +312,8 @@ def explode_deps(s): def base_set_filespath(path, d): filespath = [] extrapaths = (d.getVar("FILESEXTRAPATHS", True) or "") + # Remove default flag which was used for checking + extrapaths = extrapaths.replace("__default:", "") # Don't prepend empty strings to the path list if extrapaths != "": path = extrapaths.split(":") + path
meta/conf/bitbake.conf +2 -0
@@ -311,6 +311,8 @@ FILES_${PN}-locale = "${datadir}/locale" FILE_DIRNAME = "${@os.path.dirname(d.getVar('FILE'))}" # FILESPATH is set in base.bbclass #FILESPATH = "${FILE_DIRNAME}/${PF}:${FILE_DIRNAME}/${P}:${FILE_DIRNAME}/${PN}:${FILE_DIRNAME}/${BP}:${FILE_DIRNAME}/${BPN}:${FILE_DIRNAME}/files:${FILE_DIRNAME}" +# This default was only used for checking +FILESEXTRAPATHS ?= "__default:" ################################################################## # General work and output directories for the build system.
Signature · 1 line
1.8.1.2