Skip to content

[ci] Fail CI if missing override instead of just warning #19092

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ferdymercury
Copy link
Collaborator

@ferdymercury ferdymercury commented Jun 19, 2025

Currently, many override warnings remain unnoticed since the gcc-problem-matcher of the GitHub CI does not work correctly, and it's also easy to forget those annotations if you do not visit the "Files changed" tab.

If some devs later use dev=ON and testing=ON, this leads to failures for compilers that auto-enable -Winconsistent-missing-override.

To prevent this, we enable the suggest-override warning in the build of debian with dev=ON instead of in the one from alma, this way we are sure of always failing if some does a PR that forgets an override, forcing pull-requesters to fix their issues before merging.

Within this PR: also fix missing overrides uncovered by turning ON this flag in the dev=ON build.

@ferdymercury
Copy link
Collaborator Author

@pcanal I see a fatal error: module file '/github/home/ROOT-CI/build/lib/MultiProc.pcm' is out of date and needs to be rebuilt: module file out of date in https://github.com/root-project/root/actions/runs/15753057412/job/44402174612?pr=19092

Copy link

github-actions bot commented Jun 19, 2025

Test Results

    19 files      19 suites   3d 5h 18m 58s ⏱️
 3 007 tests  3 006 ✅ 0 💤 1 ❌
55 759 runs  55 758 ✅ 0 💤 1 ❌

For more details on these failures, see this check.

Results for commit 0c8d97e.

♻️ This comment has been updated with latest results.

@ferdymercury ferdymercury requested review from linev and guitargeek June 19, 2025 12:23
@ferdymercury ferdymercury reopened this Jun 19, 2025
@ferdymercury ferdymercury requested a review from pcanal June 19, 2025 21:12
@linev
Copy link
Member

linev commented Jun 23, 2025

Yes, this is also my observation.
But normally such error appears only when converting from old Makefiles to cmake-based testing.
Then normal compiled options are applied - and on some CI platforms warnings automatically causing errors.

@ferdymercury
Copy link
Collaborator Author

Thanks @linev for the feedback.

Btw, do you approve the changes in roottest/io ?

@@ -6,10 +6,5 @@ class RtObj : public T
public:
RtObj() {}
RtObj( const T & val ) : T(val) {}
ClassDefT(RtObj,1)
ClassDefOverride(RtObj,1)
Copy link
Member

Choose a reason for hiding this comment

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

Why using override here?
None of virtual method is override.
Also not sure if ClassDefT is equivalent to ClassDefOverride

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ClassDefT is deprecated. It contains exactly the same definition as ClassDef.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Wrt override: same explanation, if you derive from TObject, you need to use ClassDefOverride instead of ClassDef.

@@ -4,7 +4,7 @@ class A:public TObject{

public:
A(){}
ClassDef(A,1)
ClassDefOverride(A,1)
Copy link
Member

Choose a reason for hiding this comment

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

Same here - as long there are no new virtual methods override, there is no sense to use ClassDefOverride

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It derives from TObject, which has itself a ClassDef with virtual functions.

within the derived class, if you define ClassDef again, it redefines those virtual.
So you need ClassDefOverride.

@linev
Copy link
Member

linev commented Jun 24, 2025

Btw, do you approve the changes in roottest/io ?

For this part clearly Philippe @pcanal is responsible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants