Bug 15211

Summary: meta-oe: nativesdk-graphviz: build uses $prefix-based search dirs bypassing sysroot
Product: [Build System, Metadata & Runtime] Other YP Layers Reporter: Daniel Klauer <daniel.klauer>
Component: layersAssignee: Unassigned <unassigned>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: Undecided CC: akuster808, daniel.klauer, poky.bs.watcher, poky.watcher, tgamblin, tim.orling
Version: unspecified   
Target Milestone: 0.0.0   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know
Attachments:
Description Flags
potential patch for graphviz recipe in meta-openembedded none

Description Daniel Klauer 2023-09-08 12:29:58 UTC
Created attachment 4974 [details]
potential patch for graphviz recipe in meta-openembedded

When building nativesdk-graphviz where $prefix is set to $SDKPATH, the graphviz configure script manually adds $prefix-based search directories, thus bypassing the recipe-sysroot. graphviz configure.ac contains the following:
```
# automatically check for other dependencies in $prefix first
if test "x${prefix}" != "x/usr"; then
	CPPFLAGS="$CPPFLAGS -I${prefix}/include"
	LDFLAGS="$LDFLAGS -L${prefix}/lib"
	PKG_CONFIG_PATH="$prefix/lib/pkgconfig$PATHSEPARATOR$PKG_CONFIG_PATH"
	export PKG_CONFIG_PATH
fi
```

If SDKPATH is set to something different than /usr (which it is by default), and the $SDKPATH location actually exists on the host system and contains similar but potentially incompatible libraries, the build could fail or be contaminated. For me this issue showed up because I had an older Yocto SDK installed, so $SDKPATH existed. Perhaps this is less of an issue since the default SDKPATH was changed to /usr/local/oe-sdk-hardcoded-buildpath, which is less likely to exist, but the fundamental issue remains (and also if you customize SDKPATH for whatever reason...).

I've also reported the issue upstream: https://gitlab.com/graphviz/graphviz/-/issues/2442

A potential patch for the graphviz build may be to simply remove that code block from configure.ac, since Yocto already takes care of setting all needed options through the environment anyways, but I'm not sure if that patch would be accepted upstream. (potential patch attached)
Comment 1 Trevor Gamblin 2023-09-14 14:43:55 UTC
Bugzilla is not for meta-openembedded. Could you send this patch to the meta-oe mailing list?
Comment 3 Daniel Klauer 2023-10-04 10:58:33 UTC
Oh OK, I'll send it to the mailing list instead, thanks.