onload-devel: ship an open_onload.pc pkg-config file#334
Open
tcasett wants to merge 1 commit into
Open
Conversation
The devel package installs libonload_ext and onload/extensions.h but nothing tells pkg-config they exist, so downstreams hardcode -lonload_ext and the include path by hand. Add a pkg-config file so they can query it with `pkg-config --cflags --libs open_onload`. Do it through onload_install rather than the RPM spec so both packaging paths get it: debian/rules installs devel files through the same scripts/onload_install --headers call. - scripts/onload_misc/open_onload.pc.in: tracked template with a @Version@ token; onload_mkdist already copies onload_misc/ into the tarball - scripts/onload_install: install_pkgconfig renders the template and installs via install_f so it lands in the uninstall manifest; the version comes from onload_version_gen, the same source already used for onload_version.h - scripts/onload_misc/openonload.spec: list the file in %files devel
|
@tcasett A review form Claude 😄 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Onload ships the extensions library (
libonload_ext) and its header (onload/extensions.h) in the devel package, but nothing tellspkg-configthey exist. Anything that wants to build against Onload has to hardcode-lonload_extand the include path by hand. This adds a properopen_onload.pcso a downstream build can just dopkg-config --cflags --libs open_onloadand get the right flags.We've been carrying this as a local spec-file patch for a while (a
cat <<EOFheredoc bolted into%installthat writes the.pcinline). It works, but it only ever helped us and was a manual update each time. Here's a pull request so we don't have to be responsible for doing this ourselves forever :)New files and changes
Impact is really targeted and only touches what's necessary to reach parity with what we've been doing internally for a while:
scripts/onload_misc/open_onload.pc.in(new) - a real, tracked template with a@VERSION@token.onload_mkdistalready copies the wholeonload_misc/directory into the tarball, so no mkdist change is needed.scripts/onload_install- a smallinstall_pkgconfigfunction called from the headers flow. It renders the template, substitutes the version, and installs viainstall_fso the file is tracked in the uninstall manifest like every otheronload_misc/file. The version comes fromonload_version_gen, the same source already used two lines up foronload_version.h, so the.pcVersion:tracks the packaged release.scripts/onload_misc/openonload.spec- one line in%files devellisting the file.This update will work for debian installs as well, I think. It looks like
debian/rulesinstalls devel files through thesame
scripts/onload_install --headerscall, so RPM and DEB should both pick up the.pcfrom one place.Testing
Built the full RPM set from a clean tree on RHEL 9:
The file lands in the devel package at the expected path:
Because it's now a well-formed
.pcin the standard location, RPM's owndependency generator picks it up without any help:
Rendered contents, with the version substituted from
onload_version_gen:Debian notes
I have not built the Debian packages myself, so a second pair of eyes on the DEB devel package would be welcome (the code path is shared, but I'd rather someone confirm than take my word for it).