diff mbox series

package.py: replace all files unconditionally when copy debug sources

Message ID 20250930080055.1164699-1-changqing.li@windriver.com
State Accepted, archived
Commit 8898f97b4acc9d5c2c6583c91d05327f9093133e
Headers show
Series package.py: replace all files unconditionally when copy debug sources | expand

Commit Message

Changqing Li Sept. 30, 2025, 8 a.m. UTC
From: Changqing Li <changqing.li@windriver.com>

This is for fixing reproducible issue for package like:
intel-speed-select-src. For intel-speed-select, one of the debug sources
is /usr/src/debug/intel-speed-select/1.0/include/linux/thermal.h,
file include/linux/thermal.h under ${S} (kernel-sources)
link file include/linux/thermal.h under ${B}, which link to ${S}/include/uapi/linux/thermal.h

During copy debug sources, sources under ${S} copied first, then sources
under ${B} is copied. mtime of ${S}/include/linux/thermal.h and
${S}/include/uapi/linux/thermal.h are decided by when it is fetched, so
it is not determinate, maybe same or different.

For cpio, if the in file is older than or the same as the exist file,
cpio will not replace the exist file with warning "cpio: xxx not created:
newer or same age version exists".  And this will cause
intel-speed-select-src maybe not reproducible.

And option '-u' for cpio, first, this will make the copied file
determistic. Second, source files under ${B} should have higher priority
then ${S}, it may be generated during build, the target is more likely
to use this file.

Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
 meta/lib/oe/package.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/lib/oe/package.py b/meta/lib/oe/package.py
index ce69151e5d..baaa0cba02 100644
--- a/meta/lib/oe/package.py
+++ b/meta/lib/oe/package.py
@@ -1016,7 +1016,7 @@  def copydebugsources(debugsrcdir, sources, d):
             cmd += "fgrep -zw '%s' | " % prefixmap[pmap]
             # Remove prefix in the source paths
             cmd += "sed 's#%s/##g' | " % (prefixmap[pmap])
-            cmd += "(cd '%s' ; cpio -pd0mlL --no-preserve-owner '%s%s' 2>/dev/null)" % (pmap, dvar, prefixmap[pmap])
+            cmd += "(cd '%s' ; cpio -pd0mlLu --no-preserve-owner '%s%s' 2>/dev/null)" % (pmap, dvar, prefixmap[pmap])
 
             try:
                 subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)