Open nick-owens-eero opened 10 months ago
archiver functionality is implemented in a class and classes can not be extended via bbappends etc. so it has to be implemented in original archiver.bbclass in core layer.
i understand that this would need to go upstream. it seems to me that the archiver class is not very extensible in this special case of dealing with work-shared recipes - is this something that should be fixed more generally, or keep on special casing it?
tentatively here is my fix, but i am not sure if this is correct.
diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass
index 4a5865d7b5..30aedd14d0 100644
--- a/meta/classes/archiver.bbclass
+++ b/meta/classes/archiver.bbclass
@@ -102,7 +102,7 @@ python () {
return
# TARGET_SYS in ARCHIVER_ARCH will break the stamp for gcc-source in multiconfig
- if pn.startswith('gcc-source'):
+ if pn.startswith('gcc-source') or pn.startswith('llvm-project-source'):
d.setVar('ARCHIVER_ARCH', "allarch")
def hasTask(task):
@@ -278,7 +278,7 @@ python do_ar_configured() {
pn = d.getVar('PN')
# "gcc-source-${PV}" recipes don't have "do_configure"
# task, so we need to run "do_preconfigure" instead
- if pn.startswith("gcc-source-"):
+ if pn.startswith("gcc-source-") or pn.startswith('llvm-project-source'):
d.setVar('WORKDIR', d.getVar('ARCHIVER_WORKDIR'))
bb.build.exec_func('do_preconfigure', d)
@@ -460,6 +460,7 @@ def create_diff_gz(d, src_orig, src, ar_outdir):
def is_work_shared(d):
pn = d.getVar('PN')
return pn.startswith('gcc-source') or \
+ (d.expand("${TMPDIR}/work-shared") in d.getVar('S')) or \
bb.data.inherits_class('kernel', d) or \
(bb.data.inherits_class('kernelsrc', d) and d.expand("${TMPDIR}/work-shared") in d.getVar('S'))
Your patch looks good imo, I would only change the last line:
@@ -460,6 +460,7 @@ def create_diff_gz(d, src_orig, src, ar_outdir):
def is_work_shared(d):
pn = d.getVar('PN')
- return pn.startswith('gcc-source') \
+ return pn.startswith('gcc-source') or pn.startswith('llvm-project-source') \
bb.data.inherits_class('kernel', d) or \
(bb.data.inherits_class('kernelsrc', d) and d.expand("${TMPDIR}/work-shared") in d.getVar('S'))
please sent it to oe-core mailing list so you can get more help on review
Describe the bug we use poky's archiver.bbclass to assist with open source copyright and license compliance. we do not redistribute parts of clang or llvm, but the archiver tasks still run when we otherwise want to use clang at build time.
the archiver tries to use a separate workdir for unpacking and patching, but this does not seem to work for
work-shared
cases likellvm-project-source
and needs to be special cased.do_unpack_and_patch
should be using the archiver's special workdir, but tries to apply patches to the non-archiver workdir in work-shared.there's also a race here when trying to build clang native itself - something about the archiver is deleting or moving the llvm source tree.
To Reproduce Steps to reproduce the behavior:
setup poky (master), meta-clang layers
append
to build/conf/local.conf
bitbake clang-native
Expected behavior archiver class should work with meta-clang / clang-native / llvm-project-source.
Screenshots
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context Add any other context about the problem here.