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

Review and reorganize CMakeLists.txt file #12000

Merged
merged 9 commits into from
May 30, 2024

Conversation

marcusburghardt
Copy link
Member

Description:

This PR is improving the readability of CMakeLists.txt basically by:

  • Grouping similar entries
  • Organizing the output messages
  • Reviewing comments

Rationale:

Improve readability of CMakeLists.txt file to make easier to work on it.

Review Hints:

Besides the readability of the file and some changes in the output, the test is basically building the products and confirming everything that it still working as expected.

@marcusburghardt marcusburghardt added the refactoring Improvement which, once completed, will enable the project to progress faster. label May 16, 2024
@marcusburghardt marcusburghardt added this to the 0.1.74 milestone May 16, 2024
Copy link

Start a new ephemeral environment with changes proposed in this pull request:

Fedora Environment
Open in Gitpod

Oracle Linux 8 Environment
Open in Gitpod

Copy link

github-actions bot commented May 16, 2024

🤖 A k8s content image for this PR is available at:
ghcr.io/complianceascode/k8scontent:12000
This image was built from commit: fd7d236

Click here to see how to deploy it

If you alread have Compliance Operator deployed:
utils/build_ds_container.py -i ghcr.io/complianceascode/k8scontent:12000

Otherwise deploy the content and operator together by checking out ComplianceAsCode/compliance-operator and:
CONTENT_IMAGE=ghcr.io/complianceascode/k8scontent:12000 make deploy-local

CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Show resolved Hide resolved
@jan-cerny jan-cerny self-assigned this May 17, 2024
@jan-cerny
Copy link
Collaborator

/packit retest-failed

@jan-cerny
Copy link
Collaborator

/packit build

@jan-cerny
Copy link
Collaborator

@marcusburghardt Please have a look into the failing test testing-farm:centos-stream-8-x86_64:/static-checks. I have rerun it but it failed again. The error message hints that it might be legitimate:

-- Find Python Modules:
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find PY_jinja2 (missing: PY_JINJA2)
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  cmake/FindPythonModule.cmake:40 (find_package_handle_standard_args)
  CMakeLists.txt:150 (find_python_module)

@marcusburghardt marcusburghardt marked this pull request as draft May 23, 2024 11:01
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Used by openshift-ci bot. label May 23, 2024
@marcusburghardt
Copy link
Member Author

@marcusburghardt Please have a look into the failing test testing-farm:centos-stream-8-x86_64:/static-checks. I have rerun it but it failed again. The error message hints that it might be legitimate:

-- Find Python Modules:
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find PY_jinja2 (missing: PY_JINJA2)
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  cmake/FindPythonModule.cmake:40 (find_package_handle_standard_args)
  CMakeLists.txt:150 (find_python_module)

I could not reproduce it locally. I need to investigate it more in a VM similar to CI tests. Moved to Draft for now.

For better readability.
Also moved some conditionals used in build time after the definition
of variables.
Also ordred the python modules.
The options were not grouped and it was difficult to review. Once they
were grouped it was noticed some options not being showing in output
messages. They were included.
Thanks @jan-cerny for the hints.
@marcusburghardt marcusburghardt force-pushed the cmake_review branch 5 times, most recently from 532d3ca to 86a7602 Compare May 28, 2024 19:17
The set(Python_ADDITIONAL_VERSIONS 3 2) line was accidentaly moved after
find_package(PythonInterp REQUIRED), impacting in the value of
PYTHON_EXECUTABLE variable. It was noticed in a CI test for CentOS
Stream8 where the "/usr/bin/python3" was still poiting to "/usr/bin/python3.6"
while "/usr/bin/python3.11" was already present and this impacted the
detection of installed Python modules.
Few other improvements in readability were made in this commit.
@marcusburghardt
Copy link
Member Author

I believe the issue is now fixed in the last commit. Just waiting the CI tests to confirm.
More details in the commit message.

@marcusburghardt marcusburghardt marked this pull request as ready for review May 28, 2024 20:07
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Used by openshift-ci bot. label May 28, 2024
Copy link

codeclimate bot commented May 28, 2024

Code Climate has analyzed commit fd7d236 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 59.4% (0.0% change).

View more on Code Climate.

Copy link
Collaborator

@jan-cerny jan-cerny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have run make package_source, I copied the generated bz2 file to a new directory in /tmp and I extracted it there and I have built rhel9 product there.

Also, I have checked the CMake output in some of the "static-checks" GitHub CI jobs.

@jan-cerny jan-cerny merged commit 0d542f3 into ComplianceAsCode:master May 30, 2024
112 of 113 checks passed
@marcusburghardt marcusburghardt deleted the cmake_review branch May 30, 2024 08:16
@Mab879 Mab879 added the Infrastructure Our content build system label Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Infrastructure Our content build system refactoring Improvement which, once completed, will enable the project to progress faster.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants