Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: cleanup #1610

Conversation

joergsteffens
Copy link
Member

During PR #1592 it turns out that a number of cmake config settings could be cleaner,
especially when it comes to macOS configuration.
Instead of integrating this in the bugfixing PR, this is now handled in this separate PR.

  • Short description and the purpose of this PR is present above this paragraph
  • Your name is present in the AUTHORS file (optional)

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-tool to have some simple automated checks run and a proper changelog record added.

General
  • Is the PR title usable as CHANGELOG entry?
  • Purpose of the PR is understood
  • Commit descriptions are understandable and well formatted
  • Check backport line
  • Required backport PRs have been created
Source code quality
  • Source code changes are understandable
  • Variable and function names are meaningful
  • Code comments are correct (logically and spelling)
  • Required documentation changes are present and part of the PR
Tests
  • Decision taken that a test is required (if not, then remove this paragraph)
  • The choice of the type of test (unit test or systemtest) is reasonable
  • Testname matches exactly what is being tested
  • On a fail, output of the test leads quickly to the origin of the fault

@bruno-at-bareos
Copy link
Contributor

bruno-at-bareos commented Jan 5, 2024

Today with cmake version 3.28.1 a new policy is visible.

I'm getting this new warning we may want to fix

-- ✓ system:virtualfull-deletedfiles (baseport=30581)
--      └─ ✓ system:virtualfull-deletedfiles:setup
--      └─ ✓ system:virtualfull-deletedfiles:01-full-backup
--      └─ ✓ system:virtualfull-deletedfiles:02-incremental-backup
--      └─ ✓ system:virtualfull-deletedfiles:03-incremental-backup
--      └─ ✓ system:virtualfull-deletedfiles:04-incremental-backup
--      └─ ✓ system:virtualfull-deletedfiles:05-consolidate
--      └─ ✓ system:virtualfull-deletedfiles:cleanup
CMake Warning (dev) at cmake/BareosCheckXattr.cmake:28 (exec_program):
  Policy CMP0153 is not set: The exec_program command should not be called.
  Run "cmake --help-policy CMP0153" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  Use execute_process() instead.
Call Stack (most recent call first):
  systemtests/tests/xattr/CMakeLists.txt:20 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

running cd "/bareos/git/build/systemtests/tests/xattr" && /usr/bin/setfattr --name=user.cmake-check --value=xattr-value xattr-test-file.txt  2>&1
-- ✓ system:xattr (baseport=30591)

Files to patch are the following

grep -Rn "exec_program(" *
cmake/BareosCheckChflags.cmake:27:  exec_program(
cmake/BareosCheckXattr.cmake:28:  exec_program(
cmake/uninstall.cmake:32:    exec_program(
cmake --help-policy CMP0153
CMP0153
-------

.. versionadded:: 3.28

The ``exec_program()`` command should not be called.

This command has long been superseded by the ``execute_process()``
command and has been deprecated since CMake 3.0.

CMake >= 3.28 prefer that this command never be called.
The ``OLD`` behavior for this policy is to allow the command to be called.
The ``NEW`` behavior for this policy is to issue a ``FATAL_ERROR`` when the
command is called.

This policy was introduced in CMake version 3.28.
CMake version 3.28.1 warns when the policy is not set and uses
``OLD`` behavior.  Use the ``cmake_policy()`` command to set it to ``OLD`` or
``NEW`` explicitly.

.. note::
  The ``OLD`` behavior of a policy is
  ``deprecated by definition``
  and may be removed in a future version of CMake.

@sebsura sebsura added the draft label Jan 11, 2024
joergsteffens and others added 13 commits January 11, 2024 17:26
std::find_if is sometimes declared as [[nodiscard]].  As such we
should not ignore its return value.

This commit also slightly refactors the code to remove the use of
std::find_if alltogether.
is_reloading can written to/ read from multiple different threads at
the same time.   As such we cannot just do a test-then-set
approach (even if each of those operations were atomic).  Instead we
need to atomically test _and_ set the flag to actually prevent two
different threads from entering.
The base config path may change on a reload!
@joergsteffens
Copy link
Member Author

Appiled changes for CMP0153.

@joergsteffens joergsteffens mentioned this pull request Jan 11, 2024
13 tasks
@joergsteffens
Copy link
Member Author

Replaced by #1661.

@joergsteffens joergsteffens deleted the dev/joergs/master/cmake-cleanup branch April 15, 2024 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants