Bug 12706

Summary: sanity.bbclass: test for build host references leakage
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Juro Bystricky <juro.bystricky>
Component: coreAssignee: Ross Burton <ross.burton>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: Medium+ CC: meta.mr.watcher, meta.watcher, randy.macleod, stephano
Version: 2.5   
Target Milestone: 4.99   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Juro Bystricky 2018-04-22 10:27:51 UTC
There are numerous cases where various build host references ended up in distributed packages. This is a bug, and some might even argue also a security issue, as build host machine internals may be revealed (i.e. username).
Anyway, these are mostly easy to discover, simply comparing two builds in two different folders (diffoscope recommended).
The leakage falls generally in to these two categories:

1. ptest files: We generally copy Makefile and various additional files generated by "configure" on the build host. If you look at various ptest recipes, virtually all of them use "sed" to remove references to "HOSTTOOLS", "recipe-sysroot" etc. Not all references are caught all the time, hecnce a snity test would help here.

2. Debug packages: We use "-fdebug-prefix-map" to remove build host references. 
However, some recipes may need more fine-tuning (i.e. glibc) as not all references are covered. This can cause additional reproducibility issues: if -dbg packages are binary different, then gnu-debug-link contains different checksum in packages referencing the debug packages as well, hence causing non-debug packages to be binary different as well. This is easily observed with MACHINE such as qemuarm, gemumips. 

I am not sure about performance hit of the new sanity checks. If the performance hit is deemed unacceptable, maybe a conditional checks (i.e. only when BUILD_REPRODUCIBLE_BINARIES=1) will be an option.
Comment 1 Juro Bystricky 2018-04-23 14:43:18 UTC
So basically files need to checked for embedded ${WORKDIR}
Comment 2 Ross Burton 2020-01-30 12:38:33 UTC
This is done if you enable the build-paths QA test.