Skip to content
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

Add ability to conditionally apply [[deprecated]] #35390

Merged
merged 3 commits into from
Sep 29, 2021

Conversation

Dr15Jones
Copy link
Contributor

PR description:

  • added conditional CMS_DEPRECATED macro which is only turned on if USE_CMS_DEPRECATED is set
  • made non esConsumes related EventSetup get calls CMS_DEPRECATED. Some minor code changes were applied to reduce redundant warning messages (e.g. a deprecated function internally calling another deprecated function).
  • made use of legacy module types CMS_DEPRECATED

PR validation:

Code was compiles with and without USE_CMS_DEPRECATED set. When deprecations are turned on, expected warnings were generated.

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-35390/25491

  • This PR adds an extra 28KB to repository

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @Dr15Jones (Chris Jones) for master.

It involves the following packages:

  • FWCore/Framework (core)
  • FWCore/Utilities (core)

@makortel, @smuzaffar, @cmsbuild, @Dr15Jones can you please review it and eventually sign? Thanks.
@makortel, @felicepantaleo, @wddgit this is something you requested to watch as well.
@perrotta, @dpiparo, @qliphy you are the release manager for this.

cms-bot commands are listed here

@Dr15Jones
Copy link
Contributor Author

please test

NOTE the conditional is off so will not show up in the test

@makortel
Copy link
Contributor

Effectively implements #31021, even if still turned off.

@makortel
Copy link
Contributor

What about legacy edm::OutputModule that is being flagged by the static analyzer?

@Dr15Jones
Copy link
Contributor Author

What about legacy edm::OutputModule that is being flagged by the static analyzer?

When I did a very quick check on that file, I didn't find it. I'm not sure we have legacy OutputModules anymore.

@makortel
Copy link
Contributor

Ah right, was removed already in #29633.

@@ -258,6 +244,26 @@ namespace edm {
bool requireTokens() const { return requireTokens_; }

private:
template <typename HolderT>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is just the old get call renamed. I did this to avoid having multiple "deprecated" messages happening in the case someone called a deprecated function that then called the deprecated get. In that case you'd get one warning at the callers site and a second one in EventSetupRecord.h itself. Moving the implementation to a private function that isn't annotated avoids that.

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-d68ae9/18875/summary.html
COMMIT: 4c91e9d
CMSSW: CMSSW_12_1_X_2021-09-23-1100/slc7_amd64_gcc900
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/35390/18875/install.sh to create a dev area with all the needed externals and cmssw changes.

The following merge commits were also included on top of IB + this PR after doing git cms-merge-topic:

You can see more details here:
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-d68ae9/18875/git-recent-commits.json
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-d68ae9/18875/git-merge-result

Found compilation warnings

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 12 differences found in the comparisons
  • DQMHistoTests: Total files compared: 40
  • DQMHistoTests: Total histograms compared: 3211080
  • DQMHistoTests: Total failures: 17
  • DQMHistoTests: Total nulls: 1
  • DQMHistoTests: Total successes: 3211040
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: -0.004 KiB( 39 files compared)
  • DQMHistoSizes: changed ( 312.0 ): -0.004 KiB MessageLogger/Warnings
  • Checked 169 log files, 37 edm output root files, 40 DQM output files
  • TriggerResults: no differences found

@makortel
Copy link
Contributor

@smuzaffar Do you have any comments? The changes look good to me.

@smuzaffar
Copy link
Contributor

@makortel looks good, with -DUSE_CMS_DEPRECATED it generates nearly 4K warnings (1238 unique warnings) [a]. Once this is merge then I can enable the USE_CMS_DEPRECATED macro for dev area only.

[a]

FWCore/ParameterSet/interface/ParameterSetDescriptionFillerBase.h:106:65: warning: 'EDAnalyzer' is deprecated [-Wdeprecated-declarations]
  106 |     static const std::string& extendedBaseType(EDAnalyzer const*) { return kExtendedBaseForEDAnalyzer; }

@makortel
Copy link
Contributor

Hmh, that makes me wonder if warnings from FWCore headers (as opposed to user code) that needs to use legacy module types (until we actually remove the support) could cause more confusion than help in getting code migrated.

@Dr15Jones
Copy link
Contributor Author

Hmh, that makes me wonder if warnings from FWCore headers (as opposed to user code) that needs to use legacy module types (until we actually remove the support) could cause more confusion than help in getting code migrated.

My thinking is to see how it goes and if it is causing an issue, we can try to do a bit of code rearranging to see if they can be avoided for compliant code. [I did a bit of that already.]

@Dr15Jones
Copy link
Contributor Author

Also, I separated the esConsumes from the legacy module into two different commits so we could easily undo to the legacy one if it proves to be to verbose.

@Dr15Jones
Copy link
Contributor Author

@makortel @smuzaffar so what is the verdict?

@makortel
Copy link
Contributor

Let's try it out. Anyway this PR alone doesn't change behavior even in the dev areas.

@makortel
Copy link
Contributor

+1

@cmsbuild
Copy link
Contributor

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, @qliphy (and backports should be raised in the release meeting by the corresponding L2)

@qliphy
Copy link
Contributor

qliphy commented Sep 29, 2021

+1

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

Successfully merging this pull request may close these issues.

5 participants