Add new rules to automatically handle rpath patching, SO symlinking & misc files packaging#47807
Draft
chouquette wants to merge 15 commits intomainfrom
Draft
Add new rules to automatically handle rpath patching, SO symlinking & misc files packaging#47807chouquette wants to merge 15 commits intomainfrom
chouquette wants to merge 15 commits intomainfrom
Conversation
It will allow us to wrap our cc_binary and cc_shared_library and propagate the files that must be installed along, and traverse the build tree to automatically propagate (potentially patched) dependencies based on the final binary we want to ship.
It currently only provides rpath patching of cc_shared_library, but can later be extended to handle stripping. In a later step, it will also include providers for automatic dependency gathering but without requiring call sites changes
fixup remove comment from dd_ss_shared
It now handles both cc_shared_library & cc_binary the same way
It will walk the build tree to collect all files that need to be installed alongside a dependency and will allow us to drop the manual installation from omnibus recipes
This removes the explicit so_symlink invocation and start paving the way for automated dependency files collection & packaging
rpm serves as a POC to prove that we can now remove individual file installation & patching by leveraging the new aspect to do it for us
5a22faa to
1c4565d
Compare
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.
What does this PR do?
This PR adds a few new rules & aspect in order to simplify our dependencies management, and drop the need to manually patch rpath for our executables & shared libraries.
dd_cc_packagedmacro serves as a wrapper on top ofCcInfoorCcSharedLibrary. It can be used transparently just like acc_binaryorcc_shared_libraryexecutable, but also takes aninstalled_filesattribute, which can bundle a set of files along with the binary. At installation time, these files will be installed along with the executable and/or shared objects.dd_collect_dependenciesrule that leverages a new_collect_dd_packaging_aspectaspect. It automatically walks the build tree to find all binaries provided bydd_cc_packagedand includes theirinstalled_filesto the list of files to installMotivation
Getting rid of the manual
rewrite_rpathinvocations that are left in the omnibus recipes.At the end of the day, we want to:
Describe how you validated your changes
Mostly to be done through the CI and file inventory check, but also by manually building & installing openscap locally
Additional Notes
This is only at the POC level. It only handles zlib so prove that we can still build with a wrapped object, and since zlib is the most commonly used lib, it's a good candidate for this.
RPM is used as the example for automatic installation as it's only used in openscap, so it's simple to just remove it from
openscap.rband check that we don't miss any file afterward.All namings are debatable, no doc was provided until the API is settled.