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 treatment for C-style arrays in friendly class names #25477

Merged
merged 1 commit into from Dec 15, 2018

Conversation

makortel
Copy link
Contributor

I noticed that product class names like bar<foo<int[]>> lead to infinite loop within the friendly name system (to reproduce run edmToFriendlyClassName "bar<foo<int[]>>" ). I suppose that happens because the brackets [] have a special meaning in the regex syntax, and this replacement

std::string theSub = handleTemplateArguments(aMatch);
regex const eMatch(std::string("(^[^<]*)<")+aMatch+">");
result = regex_replace(result,eMatch,theSub+"$1");

ends up doing nothing when theSub is int[]. Rather than to mess with the regexes, this PR suggests to add a "standard rename" for C-style arrays.

Tested in 10_4_0_pre3, no changes expected.

@cmsbuild
Copy link
Contributor

The code-checks are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @makortel (Matti Kortelainen) for master.

It involves the following packages:

FWCore/Utilities

@cmsbuild, @smuzaffar, @Dr15Jones can you please review it and eventually sign? Thanks.
@Martin-Grunewald, @felicepantaleo, @wddgit this is something you requested to watch as well.
@davidlange6, @slava77, @fabiocos you are the release manager for this.

cms-bot commands are listed here

@makortel
Copy link
Contributor Author

@cmsbuild, please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 11, 2018

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/32129/console Started: 2018/12/11 23:27

@Dr15Jones
Copy link
Contributor

Given std::vector<int> becomes ints, maybe int[] should be intAs in order to keep the plural?

@makortel
Copy link
Contributor Author

(summarizing short discussion with @Dr15Jones for later reference)
So my intention is not to make C-style arrays to be persisted, but I encountered this when playing with CUDA and smart pointers for CUDA memory (and std::unique_ptr uses [] in the type name for array allocations). Eventually we should build abstractions on top of the unique_ptrs, so this really affects only simple testing.

@makortel
Copy link
Contributor Author

@Dr15Jones Sounds good (I used pointer as the example).

@makortel
Copy link
Contributor Author

@cmsbuild, please abort

@cmsbuild
Copy link
Contributor

Jenkins tests are aborted.

@cmsbuild
Copy link
Contributor

The code-checks are being triggered in jenkins.

@makortel
Copy link
Contributor Author

Done (squashed to the same commit).

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

Pull request #25477 was updated. @cmsbuild, @smuzaffar, @Dr15Jones can you please check and sign again.

@davidlange6
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 11, 2018

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/32131/console Started: 2018/12/12 00:43

@Dr15Jones
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 after it passes the integration tests. This pull request will now be reviewed by the release team before it's merged. @davidlange6, @slava77, @smuzaffar, @fabiocos (and backports should be raised in the release meeting by the corresponding L2)

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

Comparison job queued.

@makortel
Copy link
Contributor Author

I realized that this one is not sufficient to solve the problem I had in hand, but I end to infinite recursion because of std::function as a custom deleter of the unique_ptr (didn't try yet to understand why). I'm not sure though if we want to add support for std::function here. Anyway, my main dislike was the infinite recursion, so maybe we/I should look how change that to an exception?

@cmsbuild
Copy link
Contributor

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-25477/32131/summary.html

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 33
  • DQMHistoTests: Total histograms compared: 3136422
  • DQMHistoTests: Total failures: 1
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3136217
  • DQMHistoTests: Total skipped: 204
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 32 files compared)
  • Checked 137 log files, 14 edm output root files, 33 DQM output files

@fabiocos
Copy link
Contributor

@makortel not sure how to interpret you last remark: are you still willing to move forward with this code as approved by @Dr15Jones or are you having in mind some further update to this PR?

@makortel
Copy link
Contributor Author

@fabiocos We discussed with @Dr15Jones and came to the conclusion that it's better to have this PR in as it covers a corner case not covered before.

@fabiocos
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit e80cade into cms-sw:master Dec 15, 2018
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.

None yet

5 participants