Bug 15211 - meta-oe: nativesdk-graphviz: build uses $prefix-based search dirs bypassing sysroot
Summary: meta-oe: nativesdk-graphviz: build uses $prefix-based search dirs bypassing s...
Status: RESOLVED INVALID
Alias: None
Product: Other YP Layers
Classification: Build System, Metadata & Runtime
Component: layers (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Undecided normal
Target Milestone: 0.0.0
Assignee: Unassigned
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2023-09-08 12:29 UTC by Daniel Klauer
Modified: 2023-10-04 10:58 UTC (History)
6 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments
potential patch for graphviz recipe in meta-openembedded (3.22 KB, patch)
2023-09-08 12:29 UTC, Daniel Klauer
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.