Skip to content

p7zip: fix build on gcc 11#28376

Merged
alalazo merged 1 commit intospack:developfrom
tobbez:p7zip-gcc11
Feb 1, 2022
Merged

p7zip: fix build on gcc 11#28376
alalazo merged 1 commit intospack:developfrom
tobbez:p7zip-gcc11

Conversation

@tobbez
Copy link
Copy Markdown
Contributor

@tobbez tobbez commented Jan 12, 2022

Fixes the following build failure when building with gcc 11:

     478    ../../../../CPP/7zip/Archive/Wim/WimHandler.cpp: In member function 'virtual LONG NArchive::NWim::CHandler::GetArchiveProperty(PROPID, PROPVARIANT*)':
  >> 479    ../../../../CPP/7zip/Archive/Wim/WimHandler.cpp:308:11: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
     480      308 |           numMethods++;
     481          |           ^~~~~~~~~~
  >> 482    ../../../../CPP/7zip/Archive/Wim/WimHandler.cpp:318:9: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
     483      318 |         numMethods++;
     484          |         ^~~~~~~~~~

@vmiheer
Copy link
Copy Markdown
Contributor

vmiheer commented Jan 13, 2022

Sounds good. But we should be adding support for newer version (of 7zip) which would remove the requirement for such patches.
Note we wanted to update earlier but downloading source code of new version of 7zip needed 7zip and so it needed kind-of infrastructure changes.
The latest 7zip release seem to have .xz file, worth checking.

vmiheer
vmiheer previously approved these changes Jan 13, 2022
@tobbez
Copy link
Copy Markdown
Contributor Author

tobbez commented Jan 24, 2022

Is there anything I need to do here? The CI failure looks completely unrelated to the changes in this PR.

Long term I agree that the correct solution is to package (a modern version of) 7zip instead of (the no longer maintained) p7zip, but that essentially means packaging a new software (while p7zip is based on 7zip, they are not the same).

@vmiheer
Copy link
Copy Markdown
Contributor

vmiheer commented Jan 25, 2022

I don't think anything is needed from you. I guess someone with merging privilege will eventually merge this :).
Thank you for your contribution 🙌

version('16.02', sha256='5eb20ac0e2944f6cb9c2d51dd6c4518941c185347d4089ea89087ffdd6e2341f')

patch('gcc10.patch', when='%gcc@10:', sha256='96914025b9f431fdd75ae69768162d57751413634622f9df1a4bc4960e7e8fe1')
patch('gcc11.patch', when='%gcc@11:', sha256='39dd15f2dfc86eeee8c3a13ffde65c2ca919433cfe97ea126fbdc016afc587d1')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

On a second thought, can you please add a brief comment above this directive to explain what the patch does and link to its provenance or a bug report if it exists?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added a comment and rebased on top of develop.

There is no more provenance than is present in the commit. I discovered the issue when p7zip failed to build under GCC 11, and wrote the patch to fix it.

There is also no bug report, since the upstream project is no longer maintained (last release was in 2016).

Fixes the following build failure when building with gcc 11:

         478    ../../../../CPP/7zip/Archive/Wim/WimHandler.cpp: In member function 'virtual LONG NArchive::NWim::CHandler::GetArchiveProperty(PROPID, PROPVARIANT*)':
      >> 479    ../../../../CPP/7zip/Archive/Wim/WimHandler.cpp:308:11: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
         480      308 |           numMethods++;
         481          |           ^~~~~~~~~~
      >> 482    ../../../../CPP/7zip/Archive/Wim/WimHandler.cpp:318:9: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
         483      318 |         numMethods++;
         484          |         ^~~~~~~~~~
@alalazo alalazo merged commit 218b1c1 into spack:develop Feb 1, 2022
RikkiButler20 pushed a commit to RikkiButler20/spack that referenced this pull request Feb 1, 2022
Fixes the following build failure when building with gcc 11:

         478    ../../../../CPP/7zip/Archive/Wim/WimHandler.cpp: In member function 'virtual LONG NArchive::NWim::CHandler::GetArchiveProperty(PROPID, PROPVARIANT*)':
      >> 479    ../../../../CPP/7zip/Archive/Wim/WimHandler.cpp:308:11: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
         480      308 |           numMethods++;
         481          |           ^~~~~~~~~~
      >> 482    ../../../../CPP/7zip/Archive/Wim/WimHandler.cpp:318:9: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
         483      318 |         numMethods++;
         484          |         ^~~~~~~~~~
RikkiButler20 pushed a commit to RikkiButler20/spack that referenced this pull request Feb 8, 2022
Fixes the following build failure when building with gcc 11:

         478    ../../../../CPP/7zip/Archive/Wim/WimHandler.cpp: In member function 'virtual LONG NArchive::NWim::CHandler::GetArchiveProperty(PROPID, PROPVARIANT*)':
      >> 479    ../../../../CPP/7zip/Archive/Wim/WimHandler.cpp:308:11: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
         480      308 |           numMethods++;
         481          |           ^~~~~~~~~~
      >> 482    ../../../../CPP/7zip/Archive/Wim/WimHandler.cpp:318:9: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
         483      318 |         numMethods++;
         484          |         ^~~~~~~~~~
EthanS94 pushed a commit to EthanS94/spack that referenced this pull request Feb 17, 2022
Fixes the following build failure when building with gcc 11:

         478    ../../../../CPP/7zip/Archive/Wim/WimHandler.cpp: In member function 'virtual LONG NArchive::NWim::CHandler::GetArchiveProperty(PROPID, PROPVARIANT*)':
      >> 479    ../../../../CPP/7zip/Archive/Wim/WimHandler.cpp:308:11: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
         480      308 |           numMethods++;
         481          |           ^~~~~~~~~~
      >> 482    ../../../../CPP/7zip/Archive/Wim/WimHandler.cpp:318:9: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
         483      318 |         numMethods++;
         484          |         ^~~~~~~~~~
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.

3 participants