]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
archiver.bbclass: remove workdir from patchdir
authorChangqing Li <changqing.li@windriver.com>
Fri, 21 Nov 2025 10:52:11 +0000 (18:52 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 1 Dec 2025 23:59:49 +0000 (23:59 +0000)
Remove build path from patchdir, file name will change from
series.subdir._master_build_tmp_work_corei7-64-wrs-linux_thin-provisioning-tools_1.1.0_sources_cargo_home_bitbake_libc-0.2.155
to
series.subdir._sources_cargo_home_bitbake_libc-0.2.155.

This can also avoid the following error when the build path is long:
File: '/layers/oe-core/meta/classes/archiver.bbclass', lineno: 262, function: do_ar_original
     0258:            series = os.path.join(ar_outdir, 'series')
 *** 0262:        with open(series, 'a') as s:
     0263:            s.write('%s -p%s\n' % (os.path.basename(local), parm['striplevel']))

Exception: OSError: [Errno 36] File name too long: '/path/to/series.subdir._path_to_tmp_work_x86-64-v3-wrs-linux_thin-provisioning-tools_1.1.0_sources_cargo_home_bitbake_libc-0.2.155'

Signed-off-by: Changqing Li <changqing.li@windriver.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
meta/classes/archiver.bbclass

index a95c899a0f8900df8692d15927960c8322468dd2..d963d28f432d0aab6f977ccd2e3336095fe347b5 100644 (file)
@@ -252,7 +252,7 @@ python do_ar_original() {
         _, _, local, _, _, parm = bb.fetch.decodeurl(patch)
         patchdir = parm.get('patchdir')
         if patchdir:
-            series = os.path.join(ar_outdir, 'series.subdir.%s' % patchdir.replace('/', '_'))
+            series = os.path.join(ar_outdir, 'series.subdir.%s' % patchdir.replace(d.getVar('WORKDIR'), '').replace('/', '_'))
         else:
             series = os.path.join(ar_outdir, 'series')