-
Notifications
You must be signed in to change notification settings - Fork 27
Replace NonCopyable uses with explicitly deleted ctors #238
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
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #238 +/- ##
===========================================
- Coverage 66.25% 66.24% -0.01%
===========================================
Files 1131 1130 -1
Lines 57959 57955 -4
Branches 4394 4394
===========================================
- Hits 38398 38394 -4
Misses 19561 19561 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
38b7898 to
9c9402d
Compare
|
Compilation errors detected for ODC: |
It seems that ODC, and maybe a few others, depend on NonCopyable through transitive #include dependencies (which have now disappeared). I feel the best way to fix this is to create PRs on the failing downstream projects to introduce the needed #include. |
|
The downstream changes to fix ODC are at ecmwf/odc#48. |
|
Thanks. Have merged the changes in odc. |
7573dbc to
57fcd34
Compare
|
Similar issues (e.g. transitive #include dependencies on NonCopyable) found in FDB are fixed and awaiting review: ecmwf/fdb#207 |
57fcd34 to
9a74806
Compare
|
Following a comment from @pmaciel, the non-copyable classes now follow the rule of 5 (https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#rc-five). n.b. this means only that the classes that were updated, by removing inheritance of NonCopyable, have been made to follow this rule. It is likely that other classes in eckit do not strictly adhere to the rule of 5. |
e1137c4 to
ec5f1a8
Compare
|
Similar issues (e.g. transitive #include dependencies on NonCopyable) found in GribJump are fixed and awaiting review: ecmwf/gribjump#79 |
|
@marcosbento can you please create a eckit jira issue to track the items for 2.0? |
ec5f1a8 to
c88daa1
Compare
|
It is a good idea to identify all issues now and make fixes in all packages, but could we not also keep a deprecation so that existing packages can transition independently? I am thinking about being able to update eckit and eg perhaps multio in ifs-bundle (including older cycles ) without needing to update everything else. What would be required to achieve this? |
@wdeconinck To deprecate But removing the use of The only way to still allow downstream packages to compile, would be to leave the "unnecessary" So, for me, the mission (should we choose to accept it) is to remove all uses of |
Done! See ECKIT-645... |
This is, given my understanding, the goal. We want to remove use of 'non-copyable' in as many projects as we can without requiring additional coordination, then remove its use in eckit. Then we can declare it deprecated. |
|
Agreed that this is the goal. Removing this class should be one of the items on the list of breaking API changes for eckit 2.0.0, due in 2026 |
|
I understand that relying on transitive includes is a bug and not a deprecation issue in e.g. odc and therefore it is indeed a hotfix to odc to make that problem disappear. A hotfix is in those projects is warranted I think for this, for the case where eckit makes a release before a SR including odc. |
c112dcb to
f25bae1
Compare
|
Can we declare NonCopyable deprecated? |
@Ozaq suggested to remove the Once this PR is accepted, I'm glad to create a standalone PR just to add the |
merged |
f25bae1 to
4a3b465
Compare
|
We now have a ✅ on the build! |
4a3b465 to
023105f
Compare
23ffbbc to
4ce5bcd
Compare
4ce5bcd to
1841804
Compare
Replaces NonCopyable uses with explicitly deleted ctors and replace uses of OnlyMovable.
1841804 to
da1ba2a
Compare
Description
An attempt to modernize the code base, by removing the use of the "old style" NonCopyable in favour of explicitly deleting copy/move ctor/assignment operators. Uses of OnlyMovable are also removed, in favour of explicitly deleted/defaulted copy/move ctor/assignment operators.
This follows the advice of the CppCoreGuidelines, which states
= deleteis preferred -- see the discussion here.Important: Since downstream project use
NonCopyablethrough transitive #include dependencies, the proposed changes effectively cause build failures -- i.e. older version of odc, fdb, gribjump, ... won't be able to build against versions of eckit with these changes!Contributor Declaration
By opening this pull request, I affirm the following:
🌦️ >> Documentation << 🌦️
https://sites.ecmwf.int/docs/dev-section/eckit/pull-requests/PR-238