Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 832733 - media-libs/lcms-2.13-r1 configure error when /bin/sh != bash
Summary: media-libs/lcms-2.13-r1 configure error when /bin/sh != bash
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Printing Team
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks: nonbash
  Show dependency tree
 
Reported: 2022-02-05 02:56 UTC by Matt Whitlock
Modified: 2022-02-11 08:56 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
fix-configure-bashisms.patch (fix-configure-bashisms.patch,1.12 KB, patch)
2022-02-05 02:56 UTC, Matt Whitlock
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Whitlock 2022-02-05 02:56:28 UTC
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.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-02-06 11:17:06 UTC
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?
Comment 2 Larry the Git Cow gentoo-dev 2022-02-06 11:22:27 UTC
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(+)
Comment 3 Matt Whitlock 2022-02-11 08:56:04 UTC
(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.