Opened 14 months ago

Closed 14 months ago

Last modified 14 months ago

#21917 closed enhancement (fixed)

7zip-25.00 build fail

Reported by: zeckma Owned by: Douglas R. Reno
Priority: normal Milestone: 12.4
Component: BOOK Version: git
Severity: medium Keywords:
Cc:

Description

A user on the LFS Discord brought this issue to me.

Currently, 7zip uses Werror. Something else is that the for loop we employ does not catch errors, but can be circumvented by doing bash -e or set -e for the for loop specifically.

The end result is:

../../UI/Common/ArchiveExtractCallback.cpp:68:11: error: macro ‘REPLACE_SLASHES_from_Linux_to_Sys’ is not used [-Werror=unused-macros]
   68 |   #define REPLACE_SLASHES_from_Linux_to_Sys(s)
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make: *** [../../7zip_gcc.mak:884: b/g/ArchiveExtractCallback.o] Error 1
make: *** Waiting for unfinished jobs....

However, the process will then read the next make file as if the error didn't happen. The error still occurs and we should fix this. The macro from what I heard actually appears in other files, so we can't just remove the macro. But turning Werror off should be sufficient.

Change History (11)

comment:1 by zeckma, 14 months ago

Gentoo does: sed 's/-Werror //g' -i CPP/7zip/7zip_gcc.mak. This should work for us. We should still properly handle errors in the for loop so that errors are caught and dealt with.

comment:2 by Douglas R. Reno, 14 months ago

Owner: changed from blfs-book to Douglas R. Reno
Status: new → assigned

comment:3 by zeckma, 14 months ago

Using set -e will be a bad idea as it would exit the current Bash instance on error and no extra instance was created beforehand. So bash -e would be best, like what we do for pages that have clumped packages, like Xorg Libraries.

comment:4 by Xi Ruoyao, 14 months ago

Fixed at r12.3-1141-g7b997cc16b and r12.3-1142-gedb82cdeed.

The fix is wrapping the loop in (...) and and || exit for the make command in the loop, like the loop in the installation instruction.

comment:5 by Xi Ruoyao, 14 months ago

Resolution: → fixed
Status: assigned → closed

comment:6 by Xi Ruoyao, 14 months ago

FTR we cannot simply use || break here because it'll cause the loop to terminate with a zero status code.

comment:7 by Douglas R. Reno, 14 months ago

Fixed a validation error at 812bd6d73f2af3336670fe3bbbf1f84042496d33

comment:8 by zeckma, 14 months ago

Resolution: fixed
Status: closed → reopened

The issue was not fixed. CFLAGS_WARN_ALL=-Wall still leads to a build failure. The loop catches errors however.

The issue is that the make file contains this:

ifneq ($(CC), xlc)
CFLAGS_WARN_WALL = -Werror -Wall -Wextra
endif

So CFLAGS_WARN_WALL will get overwritten. This is why Gentoo edits the make file directly.

comment:9 by zeckma, 14 months ago

Resolution: → fixed
Status: reopened → closed

comment:10 by Xi Ruoyao, 14 months ago

Hmm... Per my .zsh_history I tried CFLAGS_WARN_ALL="" first which didn't work, then tried CFLAGS_WARN_WALL="" which caused a lot of spurious warnings, and finally tried CFLAGS_WARN_WALL=-Wall which worked. Not sure why I made it wrong editing the book :(.

in reply to:  10 comment:11 by zeckma, 14 months ago

Replying to Xi Ruoyao:

Hmm... Per my .zsh_history I tried CFLAGS_WARN_ALL="" first which didn't work, then tried CFLAGS_WARN_WALL="" which caused a lot of spurious warnings, and finally tried CFLAGS_WARN_WALL=-Wall which worked. Not sure why I made it wrong editing the book :(.

Now I see what happened, the book says CFLAGS_WARN_ALL=-Wall instead of CFLAGS_WARN_WALL=-Wall. I do think a sed is better regardless since everything else remains, just -Werror is now out of the process, and it isn't per make file, it's more of a master make file from what I can tell that gets called at some point by cmpl_gcc.mak.

Note: See TracTickets for help on using tickets.