-
Notifications
You must be signed in to change notification settings - Fork 82
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
[INFRA] Use CPM #3288
[INFRA] Use CPM #3288
Conversation
Documentation preview available at https://docs.seqan.de/preview/seqan/seqan3/3288 |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3288 +/- ##
=======================================
Coverage 98.13% 98.13%
=======================================
Files 271 271
Lines 11955 11955
Branches 104 104
=======================================
Hits 11732 11732
Misses 223 223 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently I am a big fan of CPM and this PR is a big step in the right direction.
- Where do the changes of
gtest_build
->gtest_main
andbenchmark_build
->benchmark_main
come from? that is from having newer dependencies? - The workflows/CI has many
-j2
removed, was that on purpose?
I put some random annotation with my thoughts to some lines. I think that this PR already tackles so much, that it is good to go.
sed -i -E 's@(set \(SEQAN3_\S+_VERSION )[^\)]+\)@\1main)@g' $FILE | ||
sed -i -E 's@VERSION( \$\{SEQAN3_\S+_VERSION\})@GIT_TAG\1@g' $FILE | ||
sed -i -E 's@SEQAN3_(SDSL|CEREAL)_VERSION main@SEQAN3_\1_VERSION master@g' $FILE | ||
cat $FILE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do these lines do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically, making every package in build_system/package-lock.cmake
use GIT_TAG {main,master}
.
Not sure if we really need this cron, but I adapted it for now
|
||
- name: Configure tests | ||
run: | | ||
mkdir seqan3-build | ||
cd seqan3-build | ||
mkdir build && cd build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Random thoughts (no action required):
"pro-tip": mkdir build && cd $_
(I can't decide what I like more....)
configure_file ("@use_ccache_SOURCE_DIR@/ccache/CMakeLists.txt" | ||
"${CMAKE_CURRENT_BINARY_DIR}/test/cmake/seqan3_require_ccache.cmake" COPYONLY) | ||
endif () | ||
endif () |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Random thoughts (no action required):
I wonder if sometime in the future, something like this could be replaced by some CPM package.
seqan3_config_error ("The SDSL library is required, but wasn't found.") | ||
endif () | ||
else () | ||
seqan3_config_error ("The SDSL library is required, but wasn't found.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole block seems twisted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, because it needs to work for clones, source packages, and installed packages.
Ideally, there would be different scripts for those three, but it would require some rewriting of all the CMake stuff.
# Cannot be toggled on if initially set to off. | ||
cmake_dependent_option (SEQAN3_WITH_SEQAN2_CI "Build tests with SeqAn2." ON "DEFINED ENV{CI}" OFF) | ||
|
||
if (SEQAN3_WITH_SEQAN2 OR SEQAN3_WITH_SEQAN2_CI) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems a little over complicated. would vote for just the SEQAN3_WITH_SEQAN2 flag and the .github/workflow/xyz.yml file just have to set the flag on the command line when cmake is being called.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But then you would have to make sure that all ~10 workflows do set the flag.
It would also be possible to change the default for the option depending on whether CI
is set or not; but it wouldn't be updated if the env changes.
It's set in the environment, such that we don't need to update each workflow if the runners get more cores. I guess there is also a way to make it dynamic in the docker image, but it isn't for now.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CPM here we come!!!!
This should make things easier eventually. See https://github.com/cpm-cmake/CPM.cmake
Ideally, we would use CMake to create
seqan3-config.cmake
andseqan3-config-version.cmake
, i.e. use proper CMake packaging, which got a lot better since SeqAn3 was created.For now, I'm keeping the old way of packaging.
Overview
CPM.cmake
When running from a git clone,
build_system/CPM.cmake
downloads the actualCPM.cmake
and includes it.For source packages, the downloaded
CPM.cmake
replaces thebuild_system/CPM.cmake
file in the project.CPM
Dependencies are gathered by CPM.
Local packages (i.e., such found via
find_package
) can be used by setting the environment variableCPM_USE_LOCAL_PACKAGES
toON
, or passing-DCPM_USE_LOCAL_PACKAGES=ON
to CMake.Packages can also be overridden by passing
-D<DEPENDENCY>_SOURCE_DIR=<path>
to CMake.For example, with
-Ddoxygen_awesome_SOURCE_DIR=/path/to/doxygen-awesome
, thedoxygen-awesome
package will be used from/path/to/doxygen-awesome
.<DEPENDENCY>
refers to the value ofNAME
inbuild_system/package-lock.cmake
.Vendored
Vendored dependencies are included in the project and have a fixed path.
For example,
sdsl
is vendored ininclude/seqan3/vendor/sdsl-lite
.SeqAn2
SeqAn2 will be included when building tests if
SEQAN3_WITH_SEQAN2
is set toON
, orCI
is setSEQAN3_WITH_SEQAN2
isOFF
by default.If
CI
is set, you can pass-DSEQAN3_WITH_SEQAN2_CI=OFF
to CMake to disable SeqAn2.Werror
Warnings are treated as errors if
SEQAN3_WITH_WERROR
is set toON
(Default)SEQAN3_WITH_WERROR
isON
by default.You can pass
-DSEQAN3_WITH_WERROR=OFF
to CMake to disable treating warnings as errors.To do
seqan/cmake-scripts/ccache