Bug 11453

Summary: misconfigured "diff" utility
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Juro Bystricky <juro.bystricky>
Component: coreAssignee: Jussi Kukkonen <jku>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: jku, meta.mr.watcher, meta.watcher, randy.macleod
Version: 2.3   
Target Milestone: 2.4 M2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Juro Bystricky 2017-05-03 21:55:13 UTC
When building "core-image-minimal-initramfs-qemux86.cpio.gz",
the image contains the utility "diff". (due to update alternatives it is called diff.diffutils). This utility relies on another utility "pr" to be present (for paginated output?). The location of this utility is hardcoded in the "diff" utility as "/data/master-master/poky/build-repro-again/tmp/hosttools/pr", in other words the utility was detected from my local "hosttools" folder.
Comment 1 Jussi Kukkonen 2017-05-04 10:58:45 UTC
Is this known to break something (other than manually running "diff -l")?

Fixing the path is easy (set ac_cv_path_PR_PROGRAM) but then we'd have to RDEPEND on coreutils to actually have /usr/bin/pr ...
Comment 2 Ross Burton 2017-05-04 11:08:31 UTC
Assuming that its only diff -l that is broken then hardcoding the path and not adding a dependency seems right.

Juro, did you discover this by using diff -l, or some other way?
Comment 3 Juro Bystricky 2017-05-04 14:18:59 UTC
I found out by using diffoscope, binary comparison of two different builds,
showing the build directory path.
Another possible way (I think) to fix this would be to remove "pr" from HOSTTOOLS in the recipe.
Comment 4 Ross Burton 2017-05-04 14:41:41 UTC
Removing pr from HOSTTOOLS causes libav's configure to moan.  Lets tell diff what pr to use.  Jussi, mind taking this?
Comment 5 Jussi Kukkonen 2017-06-30 08:26:36 UTC
commit f1a5c7c53be36bbee3b7476b336bab5a04c2d46d
Author: Jussi Kukkonen <jussi.kukkonen@intel.com>
Date:   Fri Jun 9 10:36:18 2017 +0300

    diffutils: prevent host path leaks, set pr path
    
    Note that this just removes a host path leakage: diffutils still
    doesn't depend on coreutils so 'pr' might not actually be there
    on image (this only breaks "diff -l" so no big deal).
    
    (From OE-Core rev: 3f7fd738981752a8c34c6cf4a1f2d4c035b081ca)