This works just fine in file-5.42 (f.e., in FreeBSD 12.3-RELEASE): (echo /lib/libc.so.7; sleep 3600) | file -bnf - The commands prints result immediately, as expected. Same command in 12.4-PRERELEASE which has file-5.43 does not print result immediately. This breaks portupgrade, for example.
Created attachment 237479 [details] rollback of original commit that introduced the problem This patch solved the problem rolling back original commit https://github.com/file/file/commit/f56746661bec2570e0797d499fa7573cb037c78b
The problem reported upstream: https://bugs.astron.com/view.php?id=397
Adding re@ to CC: due to upcoming 12.4-RELEASE.
(In reply to Eugene Grosbein from comment #1) Sorry, I pointed to wrong original commit. Correction: https://github.com/file/file/commit/19bf47777d0002ee884467e45e6ace702e40a4c1
Upstream developer is reluctant to fix this regression: https://bugs.astron.com/view.php?id=397#c3850 A decision needs to made, how should we deal with a problem? For example, we can follow upstream importing latest commit that introduced new option -I: https://github.com/file/file/commit/ae5c1ff8df0d6e00cbf5e31875d777edbb88d60a Then use EXTRA_PATCHES for portupgrade etc. to add -I for invocation of file(1) conditionally, depending on OSVERSION. I do not like this solution so much. Alternatively, we could use temporary apply the patch attached to this PR that rolls back commit that broke things, as we have not much time for 12.4-RELEASE to wait for this issue to settle.
Created attachment 237669 [details] upstream regression fix Upstream developer finally issued regression fix in compatible way: https://github.com/file/file/commit/425f9897f0ed791a6c216c24375bd9b3a42330a2 Here is ready-to-commit patch adapted for our tree.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=07dfb236c81483c2f08a3976f6d44ce307f4ceaf commit 07dfb236c81483c2f08a3976f6d44ce307f4ceaf Merge: 866beaa0aa95 5d5531f83be2 Author: Xin LI <delphij@FreeBSD.org> AuthorDate: 2022-10-27 07:12:53 +0000 Commit: Xin LI <delphij@FreeBSD.org> CommitDate: 2022-10-27 07:12:53 +0000 MFV: Restore the ability to process files from stdin immediately. PR: bin/267221 MFC after: 3 days contrib/file/doc/file.man | 4 ++-- contrib/file/src/file.c | 36 ++++++++++++++++++++++-------------- contrib/file/src/file_opts.h | 2 +- 3 files changed, 25 insertions(+), 17 deletions(-)
-I flag has been removed and previous behavior seems to have been restored: https://bugs.astron.com/view.php?id=397#c3852 Can anyone confirm this?
(In reply to Fernando Apesteguía from comment #8) I can. And you can see the commit noted above https://github.com/file/file/commit/425f9897f0ed791a6c216c24375bd9b3a42330a2 Or check out the patch attached to this PR, it is same change. It applies to our tree and then "file" works as before breakage.
(In reply to Eugene Grosbein from comment #9) Thanks, I didn't realize it was the same change. I'll try to get some of the reporters in bug #266362 and bug #266386 to confirm that works for them and close those PRs. Thanks.
(In reply to Fernando Apesteguía from comment #10) No need to rush. We can wait until after MFC.
A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=14b1657ef3f3a4bf6ddb4df94e17697ecdbccd13 commit 14b1657ef3f3a4bf6ddb4df94e17697ecdbccd13 Author: Xin LI <delphij@FreeBSD.org> AuthorDate: 2022-10-27 07:12:53 +0000 Commit: Xin LI <delphij@FreeBSD.org> CommitDate: 2022-10-30 04:41:20 +0000 MFV: Restore the ability to process files from stdin immediately. PR: bin/267221 MFC after: 3 days (cherry picked from commit 07dfb236c81483c2f08a3976f6d44ce307f4ceaf) contrib/file/doc/file.man | 4 ++-- contrib/file/src/file.c | 36 ++++++++++++++++++++++-------------- contrib/file/src/file_opts.h | 2 +- 3 files changed, 25 insertions(+), 17 deletions(-)
A commit in branch stable/12 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=97a6bb4a3f4712ec2d9443f79b6a6e8668ef2b38 commit 97a6bb4a3f4712ec2d9443f79b6a6e8668ef2b38 Author: Xin LI <delphij@FreeBSD.org> AuthorDate: 2022-10-27 07:12:53 +0000 Commit: Xin LI <delphij@FreeBSD.org> CommitDate: 2022-10-30 04:42:45 +0000 MFV: Restore the ability to process files from stdin immediately. PR: bin/267221 (cherry picked from commit 07dfb236c81483c2f08a3976f6d44ce307f4ceaf) contrib/file/doc/file.man | 4 ++-- contrib/file/src/file.c | 36 ++++++++++++++++++++++-------------- contrib/file/src/file_opts.h | 2 +- 3 files changed, 25 insertions(+), 17 deletions(-)
I'd like to see the fix included in 12.4-RELEASE. Please merge it to releng/12.4.
A commit in branch releng/12.4 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=28f11883e8d4007f27f6d39f4a95a703bc572da4 commit 28f11883e8d4007f27f6d39f4a95a703bc572da4 Author: Xin LI <delphij@FreeBSD.org> AuthorDate: 2022-10-27 07:12:53 +0000 Commit: Xin LI <delphij@FreeBSD.org> CommitDate: 2022-10-30 19:43:13 +0000 MFV: Restore the ability to process files from stdin immediately. PR: bin/267221 Approved by: re (gjb) (cherry picked from commit 07dfb236c81483c2f08a3976f6d44ce307f4ceaf) (cherry picked from commit 97a6bb4a3f4712ec2d9443f79b6a6e8668ef2b38) contrib/file/doc/file.man | 4 ++-- contrib/file/src/file.c | 36 ++++++++++++++++++++++-------------- contrib/file/src/file_opts.h | 2 +- 3 files changed, 25 insertions(+), 17 deletions(-)