external packages: use CPM packages instead of third-party directory#1963
Merged
BareosBot merged 22 commits intobareos:masterfrom Oct 23, 2024
Merged
Conversation
9641e4b to
04f1cc0
Compare
19 tasks
def2293 to
f7cb545
Compare
Member
Author
pstorz
approved these changes
Oct 23, 2024
- remove from third-party - move USE_SYSTEM_CLI11 to BareosCpmPackages.cmake - remove set_target_properties IMPORTED_GLOBAL as TRUE by default with find/add_librairy - gtests: remove extra third \n in expected cli help output with CLI11 2.4.2 cli --help will output no more extra line Signed-off-by: Bruno Friedmann <bruno.friedmann@bareos.com>
- remove from third-party - move `USE_SYSTEM_XXHASH` to BareosCpmPackages - remove set_target_properties IMPORTED_GLOBAL as TRUE by default with find/add_library
Signed-off-by: Bruno Friedmann <bruno.friedmann@bareos.com>
Instead of using CPMLicense.cmake, we now emit a YAML file that contains a bit of meta-data for the packages that were added via CPM. This YAML file can then be consumed by pr-tool update-license to generate a proper LICENSE.txt
Add a new cmake option CPM_ONLY. Setting this to ON will * add all CPM packages * stop further configuration Effectively this will make CPM fetch all packages, using cached packages when available, and exit. Thus the resulting CMAKE_BINARY_DIR will contain the CPM packages and the YAML file `cpm-packages.yaml` that provides a list of the packages along with some meta-information.
The find module for xxHash will now check if building for x86_64, check if the xxh_x86dispatch.h header is available and set XXHASH_ENABLE_DISPATCH if both is true.
After carefully re-reviewing xxHash's CMakeLists.txt we can use it. The offending parts were: * setting policies * these are always set in the CMake versions we require * overriding CMAKE_BUILD_TYPE * mitigated by reordering the includes in our CMakeLists.txt * overriding BUILD_SHARED_LIBS * has no (global) effect The remaining custom code detects if dispatching is possible and sets the flag accordingly.
adds the infer_license package that can guess what license a given license-text is. also update all other pipenv packages
update-license will now fetch the licenses from the CPM packages we consume. To achieve this we run `cmake -DCPM_ONLY=ON -DUSE_LOCAL_PACKAGES=OFF`, consume the resulting cpm-packages.yaml to find the license files and reformat them into debian copyright format. On a source tree that doesn't support CPM_ONLY (i.e. Bareos 23 and older) the old behaviour is retained.
to avoid a duplicate when this license is added using the CPM license discovery mechanism in the near future, we remove it from the template.
debian 12+ wants to build fully disconnected and all packages we need are available in the distro. This patch loosens the software versions CPM requires and adds dependencies to the Debian control file.
freebsd wants to build fully disconnected and all packages we need are available in ports. This patch adds required dependencies to the port's Makefile.
Enable FetchContent and disable CPM_USE_LOCAL_PACKAGES when building a universal client. The point of the universal client is to have as few dependencies as possible. Thus, we should bundle as much as we can, so we don't accidentally introduce new dependencies.
depending on the version cli11 emits more or less whitespace at the end of the help output. By trimming the end of the output, the test now works with different versions of CLI11.
this adds devtools/install-pip-tools.sh. The script will export the pip-tools directory of the current commit to ~/.local/lib/bareos-tools, (re-)create the pipenv environment and put symlinks for the tools into the first writable directory in your $PATH.
d1e465d to
e0b83aa
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.
This is an alternative PR to #1911
$CMAKE_BINARY_DIRCPM_ONLY-mode to our CMake, so you can run only CPMTODO:
pr-tool update-licensework with CPM licensesdevtools/template/LICENSE.txt(some CPM licenses already exist, so we'd have duplicates)Please check
If you have any questions or problems, please give a comment in the PR.
Helpful documentation and best practices
Checklist for the reviewer of the PR (will be processed by the Bareos team)
Make sure you check/merge the PR using
devtools/pr-toolto have some simple automated checks run and a proper changelog record added.General
Required backport PRs have been createdSource code quality
Tests