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

Replace deprecated std::auto_ptr with std::unique_ptr and move some header files out of src #9

Merged
merged 2 commits into from Feb 23, 2022

Conversation

guitargeek
Copy link
Contributor

@guitargeek guitargeek commented Feb 14, 2022

See the commit messages for more details. Now everything compiles without warnings and errors for me, so no further PRs are expected.

And sorry, I accidentally triggered GitHub to close #8 for good by pushing the wrong branch! This is the same PR as before, but with also the commit moving the header files and with a fix that should resolve the test problems in the previous PR, where a std::move was missing.

This fixes more compilation erros that I have when building
this package on Arch Linux.
@cmsbuild
Copy link
Contributor

A new Pull Request was created by @guitargeek (Jonas Rembser) for branch cms/CORAL_2_3_21py3.

@cmsbuild, @smuzaffar, @iarspider can you please review it and eventually sign? Thanks.
@perrotta, @dpiparo, @qliphy you are the release manager for this.
cms-bot commands are listed here

@iarspider
Copy link
Contributor

please test

@iarspider
Copy link
Contributor

please test for slc7_amd64_gcc11

@cmsbuild
Copy link
Contributor

-1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-c0f4a3/22404/summary.html
COMMIT: f5903ed
CMSSW: CMSSW_12_3_X_2022-02-13-2300/slc7_amd64_gcc10
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-externals/coral/9/22404/install.sh to create a dev area with all the needed externals and cmssw changes.

External Build

I found compilation error when building:

>> Entering Package LCG/MonitoringService
Entering library rule at LCG/MonitoringService
>> Entering Package LCG/ConnectionService
Entering library rule at LCG/ConnectionService
+ '[' '' == set ']'
error: Bad exit status from /data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/tmp/rpm-tmp.dJAlPh (%build)


RPM build errors:
Bad exit status from /data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/tmp/rpm-tmp.dJAlPh (%build)



@cmsbuild
Copy link
Contributor

-1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-c0f4a3/22405/summary.html
COMMIT: f5903ed
CMSSW: CMSSW_12_3_X_2022-02-12-1100/slc7_amd64_gcc11
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-externals/coral/9/22405/install.sh to create a dev area with all the needed externals and cmssw changes.

External Build

I found compilation error when building:

>> Entering Package LCG/MonitoringService
Entering library rule at LCG/MonitoringService
>> Entering Package LCG/ConnectionService
Entering library rule at LCG/ConnectionService
+ '[' '' == set ']'
error: Bad exit status from /data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/tmp/rpm-tmp.IjLRyh (%build)


RPM build errors:
line 37: It's not recommended to have unversioned Obsoletes: Obsoletes: cms+coral+CORAL_2_3_21-e505304864e8a0af44b6b70e2d1fd01a
Bad exit status from /data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/tmp/rpm-tmp.IjLRyh (%build)


@guitargeek
Copy link
Contributor Author

Hi, sorry I can't login to see what the actual error is. Can you please copy paste the CI compiler error here so hopefully I can find a easy fix? Thanks!

@iarspider
Copy link
Contributor

/data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/tmp/BUILDROOT/e505304864e8a0af44b6b70e2d1fd01a/opt/cmssw/slc7_amd64_gcc11/cms/coral/CORAL_2_3_21-e505304864e8a0af44b6b70e2d1fd01a/src/LCG/OracleAccess/src/Query.cpp:172:74: error: use of deleted function 'std::unique_ptr<_Tp, _Dp>::unique_ptr(const std::unique_ptr<_Tp, _Dp>&) [with _Tp = coral::OracleAccess::OracleStatement; _Dp = std::default_delete<coral::OracleAccess::OracleStatement>]'
  172 |   m_cursor = new coral::OracleAccess::Cursor( statement, *m_outputBuffer );
      |                                                                          ^
In file included from /data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/slc7_amd64_gcc11/external/gcc/11.2.1-f478fee2760dbd22aaabb4e3a8fe1640/include/c++/11.2.1/memory:76,
                 from /cvmfs/cms-ib.cern.ch/nweek-02719/slc7_amd64_gcc11/external/boost/1.78.0-87d9f13f181dd2996465c6fdbf185bf9/include/boost/smart_ptr/detail/sp_counted_impl.hpp:35,
                 from /cvmfs/cms-ib.cern.ch/nweek-02719/slc7_amd64_gcc11/external/boost/1.78.0-87d9f13f181dd2996465c6fdbf185bf9/include/boost/smart_ptr/detail/shared_count.hpp:27,
                 from /cvmfs/cms-ib.cern.ch/nweek-02719/slc7_amd64_gcc11/external/boost/1.78.0-87d9f13f181dd2996465c6fdbf185bf9/include/boost/smart_ptr/shared_ptr.hpp:17,
                 from /cvmfs/cms-ib.cern.ch/nweek-02719/slc7_amd64_gcc11/external/boost/1.78.0-87d9f13f181dd2996465c6fdbf185bf9/include/boost/shared_ptr.hpp:17,
                 from /cvmfs/cms-ib.cern.ch/nweek-02719/slc7_amd64_gcc11/external/boost/1.78.0-87d9f13f181dd2996465c6fdbf185bf9/include/boost/date_time/time_clock.hpp:17,
                 from /cvmfs/cms-ib.cern.ch/nweek-02719/slc7_amd64_gcc11/external/boost/1.78.0-87d9f13f181dd2996465c6fdbf185bf9/include/boost/thread/thread_time.hpp:9,
                 from /cvmfs/cms-ib.cern.ch/nweek-02719/slc7_amd64_gcc11/external/boost/1.78.0-87d9f13f181dd2996465c6fdbf185bf9/include/boost/thread/detail/platform_time.hpp:11,
                 from /cvmfs/cms-ib.cern.ch/nweek-02719/slc7_amd64_gcc11/external/boost/1.78.0-87d9f13f181dd2996465c6fdbf185bf9/include/boost/thread/pthread/condition_variable.hpp:9,
                 from /cvmfs/cms-ib.cern.ch/nweek-02719/slc7_amd64_gcc11/external/boost/1.78.0-87d9f13f181dd2996465c6fdbf185bf9/include/boost/thread/condition_variable.hpp:16,
                 from /cvmfs/cms-ib.cern.ch/nweek-02719/slc7_amd64_gcc11/external/boost/1.78.0-87d9f13f181dd2996465c6fdbf185bf9/include/boost/thread/condition.hpp:13,
                 from /data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/tmp/BUILDROOT/e505304864e8a0af44b6b70e2d1fd01a/opt/cmssw/slc7_amd64_gcc11/cms/coral/CORAL_2_3_21-e505304864e8a0af44b6b70e2d1fd01a/include/LCG/CoralBase/boost_thread_headers.h:15,
                 from /data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/tmp/BUILDROOT/e505304864e8a0af44b6b70e2d1fd01a/opt/cmssw/slc7_amd64_gcc11/cms/coral/CORAL_2_3_21-e505304864e8a0af44b6b70e2d1fd01a/include/LCG/CoralKernel/RefCounted.h:4,
                 from /data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/tmp/BUILDROOT/e505304864e8a0af44b6b70e2d1fd01a/opt/cmssw/slc7_amd64_gcc11/cms/coral/CORAL_2_3_21-e505304864e8a0af44b6b70e2d1fd01a/include/LCG/CoralKernel/ILoadableComponent.h:4,
                 from /data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/tmp/BUILDROOT/e505304864e8a0af44b6b70e2d1fd01a/opt/cmssw/slc7_amd64_gcc11/cms/coral/CORAL_2_3_21-e505304864e8a0af44b6b70e2d1fd01a/include/LCG/CoralKernel/Service.h:4,
                 from /data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/tmp/BUILDROOT/e505304864e8a0af44b6b70e2d1fd01a/opt/cmssw/slc7_amd64_gcc11/cms/coral/CORAL_2_3_21-e505304864e8a0af44b6b70e2d1fd01a/src/LCG/OracleAccess/src/Query.cpp:6:
/data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/slc7_amd64_gcc11/external/gcc/11.2.1-f478fee2760dbd22aaabb4e3a8fe1640/include/c++/11.2.1/bits/unique_ptr.h:468:7: note: declared here
  468 |       unique_ptr(const unique_ptr&) = delete;
      |       ^~~~~~~~~~
In file included from /data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/tmp/BUILDROOT/e505304864e8a0af44b6b70e2d1fd01a/opt/cmssw/slc7_amd64_gcc11/cms/coral/CORAL_2_3_21-e505304864e8a0af44b6b70e2d1fd01a/src/LCG/OracleAccess/src/Query.cpp:9:
/data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/tmp/BUILDROOT/e505304864e8a0af44b6b70e2d1fd01a/opt/cmssw/slc7_amd64_gcc11/cms/coral/CORAL_2_3_21-e505304864e8a0af44b6b70e2d1fd01a/src/LCG/OracleAccess/src/Cursor.h:19:48: note:   initializing argument 1 of 'coral::OracleAccess::Cursor::Cursor(std::unique_ptr<coral::OracleAccess::OracleStatement>, const coral::AttributeList&)'
   19 |       Cursor( std::unique_ptr<OracleStatement> statement,
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
gmake: *** [tmp/slc7_amd64_gcc11/src/LCG/OracleAccess/src/lcg_OracleAccess/Query.cpp.o] Error 1

@cmsbuild
Copy link
Contributor

Pull request #9 was updated.

@guitargeek
Copy link
Contributor Author

Thanks for letting me know! I see now that I missed another std::move, which I didn't realize because I forgot to compile the OracleAccess subpackage. I hope it works now!

@iarspider
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-c0f4a3/22425/summary.html
COMMIT: 5856019
CMSSW: CMSSW_12_3_X_2022-02-14-2300/slc7_amd64_gcc10
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-externals/coral/9/22425/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-c0f4a3/22425/git-recent-commits.json
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-c0f4a3/22425/git-merge-result

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 8388 differences found in the comparisons
  • DQMHistoTests: Total files compared: 46
  • DQMHistoTests: Total histograms compared: 3757427
  • DQMHistoTests: Total failures: 104335
  • DQMHistoTests: Total nulls: 20456
  • DQMHistoTests: Total successes: 3632614
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: -56760.091 KiB( 45 files compared)
  • DQMHistoSizes: changed ( 11634.0,... ): 1.487 KiB L1TEMU/L1TdeStage2uGMT
  • DQMHistoSizes: changed ( 23234.0,... ): -7096.313 KiB HGCAL/HGCalValidator
  • DQMHistoSizes: changed ( 312.0 ): 0.004 KiB MessageLogger/Warnings
  • Checked 193 log files, 42 edm output root files, 46 DQM output files
  • TriggerResults: no differences found

@guitargeek
Copy link
Contributor Author

Cool, it worked! What about testing also with please test for slc7_amd64_gcc11 like the previous time?

@iarspider
Copy link
Contributor

iarspider commented Feb 17, 2022

As a PR author you can start the tests yourself :)

@iarspider
Copy link
Contributor

please test for slc7_amd64_gcc11

@guitargeek
Copy link
Contributor Author

As a PR author you can start the tests yourself :)

Ah ok, thanks I didn't know!

@smuzaffar
Copy link
Contributor

please test for slc7_ppc64le_gcc11


return *this;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

@guitargeek why to remove this code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That code was apparently written before move symanics were in place. The copy constructor for auto_ptr here acts like the move constructor for the unique_ptr [1]. This means that the right record is now invalid bevause it's m_data was reset to nullptr. A copy constructor where the other object is mutated and then invalid is dangerous, we have move constructors for that now (and the move constructor is even generated by default for us, that's why code is removed but not added).

[1] https://en.cppreference.com/w/cpp/memory/auto_ptr/operator%3D

@@ -22,31 +22,6 @@ namespace coral
{
Copy link
Contributor

Choose a reason for hiding this comment

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

@guitargeek , shouldn;t we have m_data( std::move(data)) here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The consructor takes a raw pointer Payload* data that is passed to the constructor of std::unique_ptr<Payload> m_data. Raw pointers don't need to me moved. If the data passed the the Record constructor would be a smart pointer already, you would be right though.

@@ -32,7 +32,7 @@ macro_append use_cppflags '' target-vc9 ' /D_CRT_SECURE_NO_WARNINGS'
macro_append use_cppflags '' target-vc9 ' /D_SCL_SECURE_NO_WARNINGS'

# Test -std=c++0x for gcc 4.5.1 as in CMS (see task #18131)
# Disable "auto_ptr is deprecated" warning for gcc 4.5.
# Disable "unique_ptr is deprecated" warning for gcc 4.5.
Copy link
Contributor

Choose a reason for hiding this comment

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

this change was not required. The comment here is related to gcc 4.5 so I think the old comment makes better sense

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, yes thanks for catching this! I'll update.

This is to avoid getting flooded with deprecation warnings when
compiling this project.
@cmsbuild
Copy link
Contributor

Pull request #9 was updated.

@smuzaffar
Copy link
Contributor

please test

@smuzaffar
Copy link
Contributor

thanks @guitargeek , most of these changes do not effect CMSSW as we do not build any coral tests e.g. files under */tests/ and changes in CORAL_SERVER MySQLAccess Tests are also not part of cmssw. Only changes which effects cmssw are

ConnectionService/src/ConnectionService.h
ConnectionService/src/DataSource.cpp
CoralBase/CoralBase/TimeStamp.h
CoralBase/src/MessageStream.cpp
CoralBase/src/TimeStamp.cpp
CoralCommon/CoralCommon/MonitoringEvent.h
CoralCommon/src/MonitoringEvent.cpp
OracleAccess/src/Cursor.cpp
OracleAccess/src/Cursor.h
OracleAccess/src/Query.cpp
OracleAccess/src/Schema.cpp
OracleAccess/src/Sequence.cpp
OracleAccess/src/TableDescriptionProxy.cpp
PyCoral/src/ConnectionService.cpp

and these look good. Once PR tests here are successfull then we will first tests it in cmssw DEVEL IBs.

@smuzaffar
Copy link
Contributor

please test for slc7_ppc64le_gcc11

@cmsbuild
Copy link
Contributor

-1

Failed Tests: Build
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-c0f4a3/22545/summary.html
COMMIT: 27fb337
CMSSW: CMSSW_12_3_X_2022-02-20-2300/slc7_ppc64le_gcc11
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-externals/coral/9/22545/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-c0f4a3/22545/git-recent-commits.json
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-c0f4a3/22545/git-merge-result

Build

I found compilation error when building:

>> Compiling  /scratch/cmsbuild/jenkins_a/workspace/ib-run-pr-tests/CMSSW_12_3_X_2022-02-20-2300/src/RecoTracker/MkFitCore/src/Matriplex/MatriplexCommon.cc
In file included from /scratch/cmsbuild/jenkins_a/workspace/ib-run-pr-tests/CMSSW_12_3_X_2022-02-20-2300/src/RecoTracker/MkFitCore/src/Matriplex/MatriplexSym.h:4,
                 from /scratch/cmsbuild/jenkins_a/workspace/ib-run-pr-tests/CMSSW_12_3_X_2022-02-20-2300/src/RecoTracker/MkFitCore/src/Matrix.h:27,
                 from /scratch/cmsbuild/jenkins_a/workspace/ib-run-pr-tests/CMSSW_12_3_X_2022-02-20-2300/src/RecoTracker/MkFitCore/src/KalmanUtilsMPlex.h:5,
                 from /scratch/cmsbuild/jenkins_a/workspace/ib-run-pr-tests/CMSSW_12_3_X_2022-02-20-2300/src/RecoTracker/MkFitCore/src/KalmanUtilsMPlex.cc:1:
/scratch/cmsbuild/jenkins_a/workspace/ib-run-pr-tests/CMSSW_12_3_X_2022-02-20-2300/src/RecoTracker/MkFitCore/src/Matriplex/MatriplexCommon.h:13:10: fatal error: immintrin.h: No such file or directory
   13 | #include "immintrin.h"
      |          ^~~~~~~~~~~~~
compilation terminated.
In file included from /scratch/cmsbuild/jenkins_a/workspace/ib-run-pr-tests/CMSSW_12_3_X_2022-02-20-2300/src/RecoTracker/MkFitCore/src/Matriplex/MatriplexSym.h:4,
                 from /scratch/cmsbuild/jenkins_a/workspace/ib-run-pr-tests/CMSSW_12_3_X_2022-02-20-2300/src/RecoTracker/MkFitCore/src/Matrix.h:27,


@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-c0f4a3/22548/summary.html
COMMIT: 27fb337
CMSSW: CMSSW_12_3_X_2022-02-20-2300/slc7_amd64_gcc10
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-externals/coral/9/22548/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-c0f4a3/22548/git-recent-commits.json
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-c0f4a3/22548/git-merge-result

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 122 differences found in the comparisons
  • DQMHistoTests: Total files compared: 49
  • DQMHistoTests: Total histograms compared: 3965143
  • DQMHistoTests: Total failures: 64
  • DQMHistoTests: Total nulls: 1
  • DQMHistoTests: Total successes: 3965056
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.004 KiB( 48 files compared)
  • DQMHistoSizes: changed ( 312.0 ): 0.004 KiB MessageLogger/Warnings
  • Checked 204 log files, 45 edm output root files, 49 DQM output files
  • TriggerResults: no differences found

@smuzaffar
Copy link
Contributor

please test for slc7_ppc64le_gcc11

@cmsbuild
Copy link
Contributor

-1

Failed Tests: UnitTests
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-c0f4a3/22602/summary.html
COMMIT: 27fb337
CMSSW: CMSSW_12_3_X_2022-02-22-2300/slc7_ppc64le_gcc11
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-externals/coral/9/22602/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-c0f4a3/22602/git-recent-commits.json
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-c0f4a3/22602/git-merge-result

Unit Tests

I found errors in the following unit tests:

---> test DRNTest had ERRORS

@smuzaffar
Copy link
Contributor

+externals
@iarspider , this looks good. Please go ahead and merge it and open a PR for 12.3.X DEVEL IBs.

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next cms/CORAL_2_3_21py3 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)

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

4 participants