-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Move two StopReasonName arrays into source files #42628
Conversation
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-42628/36682
|
A new Pull Request was created by @hahnjo (Jonas Hahnfeld) for master. It involves the following packages:
@cmsbuild, @mandrenguyen, @clacaputo can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
@smuzaffar could you please test this PR with ROOT6 IBs? I hope this works around the problem while we work on a proper solution. |
please test with CMSSW_13_3_ROOT6_X |
test parameters:
|
please test for CMSSW_13_3_ROOT6_X |
please test lets test production arch/IB |
-1 Failed Tests: Build BuildI found compilation error when building: >> Compiling edm plugin /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_13_3_X_2023-08-21-2300/src/DQM/TrackingMonitor/src/V0Monitor.cc >> Compiling edm plugin /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_13_3_X_2023-08-21-2300/src/DQM/TrackingMonitor/src/VertexMonitor.cc >> Compiling edm plugin /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_13_3_X_2023-08-21-2300/src/DQM/TrackingMonitor/src/dEdxAnalyzer.cc >> Compiling edm plugin /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_13_3_X_2023-08-21-2300/src/DQM/TrackingMonitor/src/dEdxHitAnalyzer.cc /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_13_3_X_2023-08-21-2300/src/DQM/TrackingMonitor/src/TrackAnalyzer.cc: In member function 'void tadqm::TrackAnalyzer::bookHistosForHitProperties(dqm::legacy::DQMStore::IBooker&)': /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_13_3_X_2023-08-21-2300/src/DQM/TrackingMonitor/src/TrackAnalyzer.cc:718:33: error: invalid application of 'sizeof' to incomplete type 'const string []' {aka 'const std::__cxx11::basic_string []'} 718 | size_t StopReasonNameSize = sizeof(StopReasonName::StopReasonName) / sizeof(std::string); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_13_3_X_2023-08-21-2300/src/DQM/TrackingMonitor/src/TrackBuildingAnalyzer.cc: In member function 'void TrackBuildingAnalyzer::initHisto(dqm::legacy::DQMStore::IBooker&, const edm::ParameterSet&)': /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_13_3_X_2023-08-21-2300/src/DQM/TrackingMonitor/src/TrackBuildingAnalyzer.cc:332:33: error: invalid application of 'sizeof' to incomplete type 'const string []' {aka 'const std::__cxx11::basic_string []'} 332 | size_t StopReasonNameSize = sizeof(StopReasonName::StopReasonName) / sizeof(std::string); |
-1 Failed Tests: Build BuildI found compilation error when building: >> Compiling edm plugin /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_13_3_ROOT6_X_2023-08-21-2300/src/DQM/TrackingMonitor/src/V0Monitor.cc >> Compiling edm plugin /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_13_3_ROOT6_X_2023-08-21-2300/src/DQM/TrackingMonitor/src/VertexMonitor.cc >> Compiling edm plugin /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_13_3_ROOT6_X_2023-08-21-2300/src/DQM/TrackingMonitor/src/dEdxAnalyzer.cc >> Compiling edm plugin /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_13_3_ROOT6_X_2023-08-21-2300/src/DQM/TrackingMonitor/src/dEdxHitAnalyzer.cc /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_13_3_ROOT6_X_2023-08-21-2300/src/DQM/TrackingMonitor/src/TrackAnalyzer.cc: In member function 'void tadqm::TrackAnalyzer::bookHistosForHitProperties(dqm::legacy::DQMStore::IBooker&)': /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_13_3_ROOT6_X_2023-08-21-2300/src/DQM/TrackingMonitor/src/TrackAnalyzer.cc:718:33: error: invalid application of 'sizeof' to incomplete type 'const string []' {aka 'const std::__cxx11::basic_string []'} 718 | size_t StopReasonNameSize = sizeof(StopReasonName::StopReasonName) / sizeof(std::string); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_13_3_ROOT6_X_2023-08-21-2300/src/DQM/TrackingMonitor/src/TrackBuildingAnalyzer.cc: In member function 'void TrackBuildingAnalyzer::initHisto(dqm::legacy::DQMStore::IBooker&, const edm::ParameterSet&)': /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_13_3_ROOT6_X_2023-08-21-2300/src/DQM/TrackingMonitor/src/TrackBuildingAnalyzer.cc:332:33: error: invalid application of 'sizeof' to incomplete type 'const string []' {aka 'const std::__cxx11::basic_string []'} 332 | size_t StopReasonNameSize = sizeof(StopReasonName::StopReasonName) / sizeof(std::string); |
This works around root-project/root#13429 by not having std::string arrays in headers that are double-freed.
2c532f0
to
deae987
Compare
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-42628/36684
|
"NOT_STOPPED" // 11 (be careful, NOT_STOPPED needs to be the last, | ||
// its index differs from the enumeration value) | ||
}; | ||
extern const std::string StopReasonName[]; |
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.
How about making this
extern const std::string StopReasonName[]; | |
extern const std::array<std::string_view, static_cast<size_t>(StopReason::SIZE)>; |
?
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.
Please feel free to make further changes as necessary / wanted. This PR is meant to provide a minimal workaround for root-project/root#13429 which appears to work, up to your decision to merge or wait for a proper fix for the underlying problem in Cling (working on it).
Incidentally, I would argue that this array of names doesn't need any C++ data type, plain const char *
should be fine. I would still argue that it's better to move the strings into the source files because it means the compiler doesn't have to materialize them in all TUs that include this header, and I think it's not critical for performance.
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-b50767/34424/summary.html Comparison SummarySummary:
|
Testing against production IB doesn't seem to have worked, not sure if you want to restart that before considering a merge... |
please test |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-b50767/34440/summary.html Comparison SummarySummary:
|
+1 |
+1 |
This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @perrotta, @dpiparo, @antoniovilela, @rappoccio (and backports should be raised in the release meeting by the corresponding L2) |
+1
|
PR description:
This works around root-project/root#13429 by not having
std::string
arrays in headers that are double-freed.PR validation:
Not needed
PR backport:
Probably not needed.