Skip to contentSkip to conversation

archiver.bbclass: remove workdir from patchdir

PATCH New [email protected] 1 participant 1 message Nov 21, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 archiver.bbclass: remove workdir from patchdir

From: Changqing Li <[email protected]>

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'

---
 meta/classes/archiver.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/archiver.bbclass +1 -1
index a95c899a0f..d963d28f43 100644
@@ -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')
 
Signature · 1 line
2.34.1