8000 feat(buildsystem): add CMake Buildsytem by avinal · Pull Request #2075 · fossology/fossology · GitHub
[go: up one dir, main page]

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

feat(buildsystem): add CMake Buildsytem #2075

Merged
merged 2 commits into from
Nov 28, 2022

Conversation

avinal
Copy link
Member
@avinal avinal commented Aug 6, 2021

Description

This pull request adds a new build system based on CMake to this project. This is a big upgrade over decade-old Makefiles. With the new build system, we will be able to build/install/package FOSSology faster and support for many platforms and another build system.

Changes

  • Added CMake configuration for building, installing, testing, and packaging all the agents
  • Refactored source directories to better integrate with the new build system
  • Reworked the shell scripts and generated source files to make them more compatible with CMake as well as better in terms of overall compatibility with the latest tools.
  • Refactored test source

How to test

  • Check out the pull request branch
   git fetch https://github.com/avinal/fossology avinal/feat/buildsystem:buildsystem
   git checkout buildsystem
  • Make sure you have CMake and Ninja installed
  sudo apt install cmake ninja-build
  • Configure CMake, you may add additional variables to modify build
    • -DOFFLINE=ON - stops vendor generation
    • -DAGENTS="agent1;agent2;...;<agent>" - only configure these agents
    • -DTESTING=ON - enables configuring for tests
    • -DCMAKE_INSTALL_PREFIX=<path> - changes install prefix for the project
    • -DMONOPACK=ON - ununpack and adj2nest are packaged seperately
    • -GNinja - uses Ninja Generator instead of Unix Makefiles
    • -DCMAKE_BUILD_TYPE=<build-type> - choose from Debug, Release, RelWithDebInfo, MinSizeRel
  mkdir build && cd build
  cmake .. <add-variables-here-if-any>
  • Run Make or Ninja
  # For Unix Makefiles, by default, runs without parallel build jobs
  make -j<no-of-parallel-jobs>
  # For Ninja Generator, by default, runs parallel build jobs
  ninja -j<no-of-parallel-jobs>
  # common for all
  cmake --build .
  • Installing, may need to add sudo before the commands
  # For Unix Makefiles
  make install
  # For Ninja Generator
  ninja install
  • Testing, on local please consider switching to fossy user before running tests
  # For Unix Makefiles
  make test
  # For Ninja Generator
  ninja test
  # dedicated ctest command *see `ctest --help` for more options*
  ctest --parallel n
  • Packaging
  # For Unix Makefiles
  make package
  # For Ninja Generator
  ninja package
  • Follow the rest of the installation from here
  • To list all the possible targets
  # For Unix Makefiles
  make help
  # For Ninja Generator
  ninja -t targets

Known Bugs/Issue

  • While packaging with make symbolic links in the packages are accompanied with dereferenced targets too, prefer ninja for packaging
  • Coverage build may fail for some agents

Issues to create before merge

  • Fix tests for scheduler, ununpack and delagent units tests.
  • Add requirements for CMake version > 3.13 in Wiki
  • Update install from source instructions in Wiki
  • Add packaging instructions to use -DCMAKE_INSTALL_PREFIX:PATH="/usr" -DFO_SYSCONFDIR:PATH="/etc/fossology" before packaging to fix paths.

For More Information please see the blog: https://gsoc.avinal.space and wiki

Signed-off-by: Avinal Kumar avinal.xlvii@gmail.com

@avinal avinal marked this pull request as draft August 6, 2021 19:26
@avinal avinal force-pushed the avinal/feat/buildsystem branch from 65f1576 to 3237508 Compare August 7, 2021 07:50
@GMishx GMishx added enhancement needs code review needs test GSOC-21 Label to tag issues and pull request for GSOC 2021 activities labels Aug 9, 2021
Copy link
Member
@GMishx GMishx left a comment

Choose a reason for hiding this comment

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

Few suggestions and comments.

install/db/dbcreate.in Outdated Show resolved Hide resolved
install/defconf/fossology.conf.in Show resolved Hide resolved
src/genvendor/ComposerInstall Outdated Show resolved Hide resolved
src/genvendor/composer.json Outdated Show resolved Hide resolved
utils/fo-cleanold Outdated Show resolved Hide resolved
utils/fo-cleanold Outdated Show resolved Hide resolved
utils/fo-cleanold Outdated Show resolved Hide resolved
8000
utils/fo-cleanold Outdated Show resolved Hide resolved
utils/fo-cleanold Outdated Show resolved Hide resolved
@avinal
Copy link
Member Author
avinal commented Aug 10, 2021

Hello @NicolasToussaint, I did the changes in the fo-cleanold according to the latest shellcheck guidelines but it seems that some commands are broken after the changes. So I will be reverting them back to old. Although, thanks for pointing the logic errors :)

@avinal avinal force-pushed the avinal/feat/buildsystem branch from 9377629 to f66b889 Compare August 18, 2021 06:22
@github-actions github-actions bot added the has merge conflicts PR to be rebased label Aug 18, 2021
@github-actions
Copy link

This pull request has conflicts, please rebase with master to resolve those before we can evaluate the pull request.

@avinal avinal force-pushed the avinal/feat/buildsystem branch 2 times, most recently from ca9265e to dddb399 Compare August 18, 2021 06:47
@github-actions github-actions bot removed the has merge conflicts PR to be rebased label Aug 18, 2021
@avinal avinal force-pushed the avinal/feat/buildsystem branch from 1d0593e to 1364b30 Compare August 19, 2021 14:56
@avinal avinal mentioned this pull request Aug 19, 2021
5 tasks
@avinal
Copy link
Member Author
avinal commented Aug 26, 2021

I will be making some changes in a few days and then it will be ready for review. I apologize for the delay, got caught in placements and all. 😅

@github-actions
Copy link

This pull request has conflicts, please rebase with master to resolve those before we can evaluate the pull request.

@github-actions github-actions bot added the has merge conflicts PR to be rebased label Aug 29, 2021
@avinal avinal force-pushed the avinal/feat/buildsystem branch from b5244fd to dcf375a Compare August 29, 2021 09:52
@github-actions github-actions bot removed the has merge conflicts PR to be rebased label Aug 29, 2021
@avinal avinal force-pushed the avinal/feat/buildsystem branch 3 times, most recently from 4e6cbbc to 8234402 Compare October 4, 2021 07:26
@github-actions
Copy link
github-actions bot commented Aug 1, 2022

This pull request has conflicts, please rebase with master to resolve those before we can evaluate the pull request.

@GMishx GMishx force-pushed the avinal/feat/buildsystem branch from 3b7c79a to 6db1be6 Compare August 6, 2022 06:36
@github-actions github-actions bot removed the has merge conflicts PR to be rebased label Aug 6, 2022
@GMishx GMishx force-pushed the avinal/feat/buildsystem branch 2 times, most recently from 154e2df to a6dae34 Compare August 8, 2022 06:46
@github-actions github-actions bot added the has merge conflicts PR to be rebased label Aug 8, 2022
@github-actions
Copy link
github-actions bot commented Aug 8, 2022

This pull request has conflicts, please rebase with master to resolve those before we can evaluate the pull request.

@GMishx GMishx force-pushed the avinal/feat/buildsystem branch from a6dae34 to 35ad9ea Compare August 8, 2022 12:17
@github-actions github-actions bot removed the has merge conflicts PR to be rebased label Aug 8, 2022
@GMishx GMishx force-pushed the avinal/feat/buildsystem branch from 35ad9ea to 2a42f02 Compare August 10, 2022 08:09
@github-actions github-actions bot added the has merge conflicts PR to be rebased label Aug 24, 2022
@github-actions
Copy link

This pull request has conflicts, please rebase with master to resolve those before we can evaluate the pull request.

@GMishx GMishx force-pushed the avinal/feat/buildsystem branch from 2a42f02 to f913eed Compare August 25, 2022 08:27
@github-actions github-actions bot removed the has merge conflicts PR to be rebased label Aug 25, 2022
@GMishx GMishx force-pushed the avinal/feat/buildsystem branch 3 times, most recently from daebde3 to 607b353 Compare August 30, 2022 08:49
@GMishx GMishx added this to the 4.3.0 milestone Nov 9, 2022
@github-actions github-actions bot added the has merge conflicts PR to be rebased label Nov 11, 2022
@github-actions
Copy link

This pull request has conflicts, please rebase with master to resolve those before we can evaluate the pull request.

avinal and others added 2 commits November 14, 2022 14:41
- Add CMake Build Configuration for all agents
- Add CMake Install Configuration for all agents
- source generating scripts are moved to seperate folders i.e
  monk/generator nomos/generator
- vendor is produced under genvendor
- CMake addition modules added
- version.php.in substitution changed to cmake standards
- shell scripts updated to latest standards
- substitution rules changed in generated files
- add initial packaging config
- refactor debian folder
- add CMake testing configuration
- add support for running only few agents at a time
- refactored test source for new configuration
- both unit tests and functional test config added
- fix shell scripts
- add GitHub Actions CI
- added build, install, test and package configs
- fixed implicit include error in ojo
- Added logic for including changelogs, README and copyright to packages
- Minimum cmake 3.19 required for packaging, packaging config not generated below this version
- Update Minimum CMake version to 3.13
- Move all cmake related files to cmake directory

Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
Signed-off-by: Gaurav Mishra <mishra.gaurav@siemens.com>

!squish me

Signed-off-by: Gaurav Mishra <mishra.gaurav@siemens.com>
Signed-off-by: Gaurav Mishra <mishra.gaurav@siemens.com>
@GMishx GMishx force-pushed the avinal/feat/buildsystem branch from 607b353 to 14f8ea3 Compare November 14, 2022 09:20
@github-actions< 6D40 /a> github-actions bot removed the has merge conflicts PR to be rebased label Nov 14, 2022
@ag4ums ag4ums merged commit 37a8b9b into fossology:master Nov 28, 2022
@GMishx GMishx deleted the avinal/feat/buildsystem branch November 28, 2022 08:13
@avinal
Copy link
Member Author
avinal commented Nov 28, 2022

Finally 😍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement GSOC-21 Label to tag issues and pull request for GSOC 2021 activities needs code review needs test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0