-
-
Notifications
You must be signed in to change notification settings - Fork 174
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
Bump minimum CMake to 3.19 and introduce version ranges #2358
Conversation
@drew-parsons I think this will help when bumping different parts of the FEniCS eco-system, making it easier to provide minimal bounds (If we introduce this in Basix as well). |
This is probably safe. Would want to check conda support but almost certainly their cmake is up to date. Ubuntu 20.04 focal has cmake 3.16. But we're already not able to (simply) build dolfinx 0.5 because of the use of C++20 features (std::span), not supported by gcc-9. So for that reason ubuntu 20.04 support is not an impediment (it will have to be left on dolfinx 0.4). Might want to consider if we're happy with that ubuntu situation, or whether people building dolfinx manually on ubuntu 20.04 should still be supported. The policy is on a best-effort basis, so can instead just ask such users to upgrade to a more recent ubuntu release. @francesco-ballarin might have an opinion on dropping old ubuntu support, because of the Google colab fiasco. |
@jorgensd @drew-parsons I am fine with dropping support for ubuntu 20.04, my FEM on Colab pipeline is very mildly dependent on upstream ubuntu packages: due (as you call it) to that fiasco I basically have to rebuild and package any dependency anyway in my own workflow. I've just checked:
|
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.
It would also be good if DOLFINx explicitly specified it's dependency on UFCx through ranges rather than implicitly through its own version number.
PR now coupled with: FEniCS/ffcx#535 I guess we want something similar in BASIX (we currently have no version requirement of basix, which I guess is wrong)? @garth-wells @mscroggs |
cpp/dolfinx/CMakeLists.txt
Outdated
@@ -147,7 +147,7 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/common/version.h DESTINATION ${CMAKE_I | |||
include(CMakePackageConfigHelpers) | |||
write_basic_package_version_file(${CMAKE_BINARY_DIR}/dolfinx/DOLFINXConfigVersion.cmake | |||
VERSION ${DOLFINX_VERSION} | |||
COMPATIBILITY ExactVersion) | |||
COMPATIBILITY AnyNewerVersion) |
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.
Why not same minor version?
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.
I agree with Jack, COMPATIBILITY SameMinorVersion
is I think more appropriate, at least at this stage in dolfinx' development. Otherwise 0.6.0 would be considered compatible with 0.5.2.
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.
That does not work with the version ranges unfortunately.
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.
Does SameMinorVersion give the same problem as ExactVersion? I would have expected it to allow any patch version with the same major.minor. If it doesn't work that way then fair enough. If AnyNewerVersion is used here, then it would be possible to exclude 0.6 in the client program by using ...<0.6
with the find_package version.
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.
I will test it again tomorrow, but as far as I can recall it had the same issues. I would say it is up to the developer of the other package (me in the case of DOLFINx-MPC) to set sensible ranges in find_package
in my cmake file, similarly to how you would pin, or set version ranges in Python packages.
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.
Likely you already thought of it, but one thought in regards to testing SameMinorVersion
, both packages (dolfinx and dolfinx_mpc) would need cmake_minimum_required(VERSION 3.19)
. i.e. dolfinx_mpc would also need that updated alongside the version range.
…x into dokken/cmake_version_range
Summary of write_basic_package_version_file(${CMAKE_BINARY_DIR}/dolfinx/DOLFINXConfigVersion.cmake
VERSION ${DOLFINX_VERSION}
COMPATIBILITY AnyNewerVersion) in
Point 1. can be thought of as a lower bound on the version you can use, similar to how one usually set version requirements in Python. |
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.
I'd like to have this merged in for a bit of in-the-wild testing prior to the 0.6.0 release.
I've just hit this problem in practice while trying to package @jorgensd 's dolfinx-mpi for debian. ExactVersion in cpp/dolfinx/CMakeLists.txt means that dolfinx 0.5.2 is not compatible with the dolfinx 0.5.1 requested by dolfinx-mpc, even when patched with a version range 0.5.1...<0.6 (note the I think the patch to cpp/dolfinx/CMakeLists.txt should declare The changes to the .yml files would need to be reverted before merging this PR. |
@drew-parsons If we run with SameMinorVersion, one would force the user to use: find_package(DOLFINX 0.6.0...<0.7.0 REQUIRED) I.e. something like: find_package(DOLFINX 0.6.0...0.7.0 REQUIRED) is not accepted and throws: CMake Error at CMakeLists.txt:93 (find_package):
Could not find a configuration file for package "DOLFINX" that is
compatible with requested version range "0.6.0...0.7.0".
The following configuration files were considered but not accepted:
/usr/local/dolfinx-real/lib/cmake/dolfinx/DOLFINXConfig.cmake, version: 0.6.0.0 I find it very strange that we force people to bump the version of their code whenever we release a version of DOLFINx. |
You're absolutely right, this is the key point. Will the API be substantially changing in every 0.x release, requiring users to modify their existing code? Across 0.4 to 0.5, and 0.6, that has been the case, and I was proposing we'd want the At some point the API changes would slow down, at which point it would be time to make a 1.0 release. At that point the policy could change to If no major API changes are expected, but new major versions are wanted anyway (not semantic versioning), or if we want to just leave it to users to manage version compatibility themselves, then |
Im not sure we should enforce this on the user. Some of the API changes every minor release, but it doesn’t necessarily mean that it will break every package based on DOLFINx. I guess we need to decide something. What do you think @jhale ? |
My understanding of the discussions so far is that we aim to use Semantic Versioning 2.0. That means that public API changes will automatically lead to a major version bump once we go past Whether an API change actually breaks a downstream package is not important (e.g. they only use a limited subset of the API). It is for downstream users and developers to test and make that determination. |
If we want to go that route, I would suggest we use |
P.S. I don't see why downstream developers should be in anyway tied into to DOLFINx's version numbering. If I want to have my downstream package at version 0.1 and it's compatible with DOLFINx 0.5...<0.7 then I should be able to do it? |
Cmake 3.19 added version ranges: https://cmake.org/cmake/help/latest/release/3.19.html
back in november 2020. This would make it easier for DOLFINx extensions to specify requirements on DOLFINx.
For instance:
v0.5.1 was just released with some bug fixes, and no changes in the API.
I need to rewrite my CMakeLists.txt for dolfinx_mpc to support this change. With version ranges, I would be able to specify
which would result in:
when using
v0.5.1
.For more rules regarding ranges see:
https://cmake.org/cmake/help/latest/command/find_package.html#basic-signature