Created attachment 234726 [details] net/endlessh: fix wrong use of STRIP STRIP_CMD was meant instead of STRIP, causing the build to hang when building unstripped packages. The error also prevented the binary from being stripped as intended. Tested with Poudriere on armv7 arm64 FreeBSD 13. Please MFH this build fix if possible.
I'll note that the FreeBSD build servers seem to define things so that they do not hang but they also do not execute the file after the ${STRIP} : =======================<phase: stage >============================ ===> Staging for endlessh-1.1_1 ===> Generating temporary packing list install -d /wrkdirs/usr/ports/net/endlessh/work/stage/usr/local/bin install -m 755 endlessh /wrkdirs/usr/ports/net/endlessh/work/stage/usr/local/bin/ install -d /wrkdirs/usr/ports/net/endlessh/work/stage/usr/local/man/man1 install -m 644 endlessh.1 /wrkdirs/usr/ports/net/endlessh/work/stage/usr/local/man/man1/ install -m 0644 /usr/ports/net/endlessh/files/endlessh.newsyslog.conf /usr/ports/net/endlessh/files/endlessh.conf.sample /wrkdirs/usr/ports/net/endlessh/work/stage/usr/local/etc/ s /wrkdirs/usr/ports/net/endlessh/work/stage/usr/local/bin/endlessh make: exec(s) failed (No such file or directory) ====> Compressing man pages (compress-man) ===> Staging rc.d startup script(s) *** Error code 1 (ignored) =========================================================================== =======================<phase: package >============================ ===> Building package for endlessh-1.1_1 =========================================================================== =>> Cleaning up wrkdir ===> Cleaning for endlessh-1.1_1 build of net/endlessh | endlessh-1.1_1 ended at Thu Jun 16 21:09:56 UTC 2022 build time: 00:00:02 So it looks like, in such a context, ${STRIP} translates to: s
(In reply to Mark Millard from comment #1) More specifically, STRIP defaults to -s. The idea is to run the C compiler like this: ${CC} ${CFLAGS} ${STRIP} ... so it strips the binary if STRIP is set to -s. In make syntax, a leading dash means to ignore errors from a command. Hence, ${STRIP} ... expands to -s ... which is executed as s ... with failure ignored. Of course the command fails as there is no binary named s in the search path, so curiously two wrongs make a right here and the build just so happens to succeed.
(In reply to Robert Clausecker from comment #2) I see in Mk/bsd.port.subdir.mk : .if !defined(DEBUG_FLAGS) STRIP?= -s .endif which indicates 2 ways for the -s to not be there: A) DEBUG_FLAGS defined B) STRIP already defined (to be something else, such as empty) And that explains why I got the "it hangs up" case in what I was doing: no -s was assigned.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=0befb0f7e74637d9152aa286e4c18188cc5344ae commit 0befb0f7e74637d9152aa286e4c18188cc5344ae Author: Bernard Spil <brnrd@FreeBSD.org> AuthorDate: 2022-06-20 11:43:43 +0000 Commit: Bernard Spil <brnrd@FreeBSD.org> CommitDate: 2022-06-20 11:43:43 +0000 net/endlessh: fix wrong use of STRIP * STRIP_CMD was meant instead of STRIP, causing the build to hang when building unstripped packages. PR: 264711 Submitted by: Robert Clausecker <fuz fuz su> net/endlessh/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Thank you Robert!