===> Checking for items in STAGEDIR missing from pkg-plist Error: Orphaned: bin/ecp.QnDgKzC3 Error: Orphaned: bin/ecp.RwhbsIDr Error: Orphaned: bin/ecp.zkCfXZGw Error: Orphaned: sbin/ecp.13yuHIqY Error: Orphaned: sbin/ecp.Q31ZkEo6 Error: Orphaned: sbin/ecp.RQ651qO3 Error: Orphaned: sbin/ecp.iRqOwgUD Error: Orphaned: sbin/ecp.uuZYIUTL Error: Orphaned: sbin/ecp.xsOn7p5F I've looked everywhere trying to figure out how these empty files are being created, but coming up empty handed. Very very strange.
Created attachment 224699 [details] remove empty files
Thanks, Mark, your fix, seems, pretty trivial to apply :) I was trying to translate to `make` this shell construction: ``` find /usr/local/bin /usr/local/sbin /usr/local/libexec -type f -print0 | \ ${XARGS} -0 -I % -S 1024 -n 1 ${SH} -c "case \"\`${FILE} --brief --mime-type '%'\`\" in 'application/'*) ${ECHO_CMD} '%' && ${STRIP_CMD} '%';; esac" STRIP ``` But got lost in additional escapes... As Dmitry pointed me privately before all the problem exposes itself in FreeBSD 13 environment due clash of two issues: 1. `strip` creates temporary file before it actually starts the processing of the file and, in case it is not strippable(shell script, for example) just leave this temporary file around, without proper cleanup. 2. Before 13 it used to create that temporary file in /tmp, which was excluded from poudriere monitoring, but now the file is created in the same directory where original file is, hence leaving those orphaned temporary files around. I guess it's worth a separate PR against the bin*, really.
Here is the problem: osipovmi@deblndw011x:/var/tmp/freebsd-src (stable/13 =) $ git diff origin/stable/12..HEAD -- ./contrib/elftoolchain/elfcopy/main.c commit 96e101bec9808987537af6e529a3ef4f1da9cb83 Author: Chris Rees <crees@FreeBSD.org> Date: 2021-02-15 12:37:06 +0100 elftoolchain: stop leaving tempfiles on error Temporary files were not cleaned up, resulting in $TMPDIR or even the current directory becoming littered with ecp.* files. This happened with error and even sometimes on success! Approved by: dim MFC after: 4 weeks Accepted upstream: https://sourceforge.net/p/elftoolchain/code/3918/ Differential Revision: https://reviews.freebsd.org/D28651 (cherry picked from commit 5ac70383c8b32eeec80426e837960977971c7c2b) has neven been cherry-picked from stable/13 to stable/12, thus https://reviews.freebsd.org/D28651 does not perform any cleanup. Though the cherry-pick produces a conflict, it can be easily resolved: osipovmi@deblndw011x:/var/tmp/freebsd-src (stable/12 *+=|CHERRY-PICKING) $ git diff diff --cc contrib/elftoolchain/elfcopy/main.c index 995f031dfa69,964d3358de60..000000000000 --- a/contrib/elftoolchain/elfcopy/main.c +++ b/contrib/elftoolchain/elfcopy/main.c @@@ -702,8 -737,7 +737,12 @@@ create_file(struct elfcopy *ecp, const } if ((ecp->ein = elf_begin(ifd, ELF_C_READ, NULL)) == NULL) { ++<<<<<<< HEAD + if (fstat(ifd, &sb) == 0 && sb.st_size == 0) + errx(EXIT_FAILURE, "file format not recognized"); ++======= + cleanup_tempfile(tempfile); ++>>>>>>> 96e101bec980 (elftoolchain: stop leaving tempfiles on error) errx(EXIT_FAILURE, "elf_begin() failed: %s", elf_errmsg(-1)); }
(In reply to Michael Osipov from comment #3) https://cgit.freebsd.org/src/commit/?id=a42a905c2afc90012996a4f361d0360056db11b7
(In reply to Dimitry Andric from comment #4) Magic, thank you. I will retest!
Works on 12-STABLE!
The attached patch doesn't fix the plist errors on 12.4 because it's trying to remove the temp files before they are created. Here is a workaround for the plist errors. https://reviews.freebsd.org/D42030
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=93a83389164030ca740440499ac8486d7fb78261 commit 93a83389164030ca740440499ac8486d7fb78261 Author: Joseph Mingrone <jrm@FreeBSD.org> AuthorDate: 2023-10-01 16:16:22 +0000 Commit: Joseph Mingrone <jrm@FreeBSD.org> CommitDate: 2023-10-01 19:46:38 +0000 net/samba413: Work around 12.4 bug with orphaned temp files Because src commit 96e101bec9 never made it into 12.4, temporary files are littering the staging directory and causing plist errors. Since 12.4 will be EOL soon, just work around the issue. PR: 255626 Approved by: portmgr (rene) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D42030 net/samba413/Makefile | 3 +++ 1 file changed, 3 insertions(+)
I believe this is either fixed (or worked around on 12.4), so I'll close. Please re-open if necessary.