add checking to standardize how .bbappend files do FILESEXTRAPATHS
cover add checking to standardize how .bbappend files do FILESEXTRAPATHS
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: Please assign FILESEXTRAPATHS 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_1.22.1.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):
add checking to standardize how .bbappend files do FILESEXTRAPATHS
meta/classes/base.bbclass | 1 + meta/classes/filesextrapaths_check.bbclass | 10 ++++++++++ meta/classes/utils.bbclass | 2 ++ meta/conf/bitbake.conf | 2 ++ 4 files changed, 15 insertions(+) create mode 100644 meta/classes/filesextrapaths_check.bbclass
Signature · 1 line
1.8.1.2
PATCH 1/1 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/base.bbclass | 1 + meta/classes/filesextrapaths_check.bbclass | 10 ++++++++++ meta/classes/utils.bbclass | 2 ++ meta/conf/bitbake.conf | 2 ++ 4 files changed, 15 insertions(+) create mode 100644 meta/classes/filesextrapaths_check.bbclass
meta/classes/base.bbclass +1 -0
@@ -9,6 +9,7 @@ inherit utils inherit utility-tasks inherit metadata_scm inherit logging +inherit filesextrapaths_check OE_IMPORTS += "os sys time oe.path oe.utils oe.data oe.package oe.packagegroup oe.sstatesig oe.lsb oe.cachedpath" OE_IMPORTS[type] = "list"
meta/classes/filesextrapaths_check.bbclass new file +10 -0
@@ -0,0 +1,10 @@ +python __anonymous() { + # Checking ${FILESEXTRAPATHS} + extrapaths = (d.getVar("FILESEXTRAPATHS", True) or "") + if '__default' not in extrapaths.split(":"): + msg = "Please assign FILESEXTRAPATHS 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\n" + bb.fatal(msg) +}
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
I think it is more reasonable to move the checking to insance.bbclass
rather than create a new bbclass.
Please drop this, V2 incoming.
//Hongxu
Quoted 75 lines · Hongxu Jia
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_Pathis acceptable.
[YOCTO #5412]
Signed-off-by Hongxu Jia <[email protected]>--- meta/classes/base.bbclass | 1 + meta/classes/filesextrapaths_check.bbclass | 10 ++++++++++ meta/classes/utils.bbclass | 2 ++ meta/conf/bitbake.conf | 2 ++ 4 files changed, 15 insertions(+)create mode 100644 meta/classes/filesextrapaths_check.bbclass
meta/classes/base.bbclass +1
-0@@ -9,6 +9,7 @@ inherit utils inherit utility-tasks inherit metadata_scm inherit logging +inherit filesextrapaths_check OE_IMPORTS += "os sys time oe.path oe.utils oe.data oe.package oe.packagegroup oe.sstatesig oe.lsb oe.cachedpath" OE_IMPORTS[type] = "list"meta/classes/filesextrapaths_check.bbclass new file +10
-0@@ -0,0 +1,10 @@ +python __anonymous() { + # Checking ${FILESEXTRAPATHS} + extrapaths = (d.getVar("FILESEXTRAPATHS", True) or "") + if '__default' not in extrapaths.split(":"): + msg = "Please assign FILESEXTRAPATHS 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\n" + bb.fatal(msg) +}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(":") + pathmeta/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.