Created attachment 764366 [details, diff] fix-configure-bashisms.patch lcms's configure.ac contains a Bashism (use of == operator with test built-in). Thus, configure emits an error when /bin/sh is not Bash. This doesn't cause the build to fail outright, but it may be causing misdetection of features. if test "$with_fastfloat" == "yes" /var/tmp/portage/media-libs/lcms-2.13-r1/work/lcms2-2.13/configure: 17181: test: no: unexpected operator There is also just a plain bug: LIB_PLUGINS = '' /var/tmp/portage/media-libs/lcms-2.13-r1/work/lcms2-2.13/configure: 16630: LIB_PLUGINS: not found The attached patch removes the Bashism and fixes the bug and allows media-libs/lcms-2.13-r1 to configure without error when /bin/sh is Dash.
Thanks. I apologise if I'm misremembering you, but I have a vague memory of you saying you had a bashrc hook to find bits like this. It's easy to sometimes miss silent failure from bashisms. Would you consider sharing it with me, if that was you, so I can avoid missing more of these in future? I do try keep an eye out. Also, would you mind submitting this patch upstream?
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=01d345a2a91f782d33a2d1217fdf63617e962413 commit 01d345a2a91f782d33a2d1217fdf63617e962413 Author: Sam James <sam@gentoo.org> AuthorDate: 2022-02-06 11:21:16 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-02-06 11:22:16 +0000 media-libs/lcms: add 2.13.1 Bug: https://bugs.gentoo.org/832520 Closes: https://bugs.gentoo.org/832733 Thanks-to: Matt Whitlock <gentoo@mattwhitlock.name> (bashism fix) Signed-off-by: Sam James <sam@gentoo.org> media-libs/lcms/Manifest | 1 + .../files/lcms-2.13.1-fix-configure-bashisms.patch | 22 +++++++++ media-libs/lcms/lcms-2.13.1.ebuild | 57 ++++++++++++++++++++++ 3 files changed, 80 insertions(+)
(In reply to Sam James from comment #1) > I apologise if I'm misremembering you, but I have a vague memory of you > saying you had a bashrc hook to find bits like this. It's easy to sometimes > miss silent failure from bashisms. Would you consider sharing it with me, if > that was you, so I can avoid missing more of these in future? I do try keep > an eye out. You remember correctly. Here it is: if fgrep -q \ -e ': unexpected operator' \ -e 'configure: line' \ "${T}/build.log" then eerror 'Package exhibits symptoms of assuming /bin/sh is Bash!' eerror 'Maybe setting CONFIG_SHELL=/bin/bash will work around it.' die fi Arrange for that code snippet to run in the post_src_configure() hook. > Also, would you mind submitting this patch upstream? I tickled the author who introduced the Bashism. https://github.com/mm2/Little-CMS/commit/d2f2e9e6f3fada2b887ce1ccbdba36d8eb5a05be#r66476517 We'll see if that's enough to get it corrected.