Bug#876354: mozjs52: FTBFS with SHELL=/bin/zsh: Could not detect environment shell!

Simon McVittie smcv at debian.org
Thu Sep 21 09:18:09 UTC 2017


Source: mozjs52
Version: 52.3.1-4
Severity: important
Tags: patch

Steps to reproduce: Build mozjs52 on zelenka and minkus (s390x and mips
porterboxes) from an account like mine with SHELL=/bin/zsh

Expected result: Build succeeds, but tests fail due to #873778

Actual result:

> Creating config.status
> Traceback (most recent call last):
>   File "./../../configure.py", line 107, in <module>
>     sys.exit(main(sys.argv))
>   File "./../../configure.py", line 31, in main
>     return config_status(config)
>   File "./../../configure.py", line 92, in config_status
>     from mozbuild.config_status import config_status
>   File "/home/smcv/mozjs52-52.3.1/build/mach_bootstrap.py", line 370, in __call__
>     module = self._original_import(name, globals, locals, fromlist, level)
>   File "/home/smcv/mozjs52-52.3.1/python/mozbuild/mozbuild/config_status.py", line 21, in <module>
>     from mozbuild.base import MachCommandConditions
>   File "/home/smcv/mozjs52-52.3.1/build/mach_bootstrap.py", line 370, in __call__
>     module = self._original_import(name, globals, locals, fromlist, level)
>   File "/home/smcv/mozjs52-52.3.1/python/mozbuild/mozbuild/base.py", line 17, in <module>
>     from mach.mixin.process import ProcessExecutionMixin
>   File "/home/smcv/mozjs52-52.3.1/build/mach_bootstrap.py", line 370, in __call__
>     module = self._original_import(name, globals, locals, fromlist, level)
>   File "/home/smcv/mozjs52-52.3.1/python/mach/mach/mixin/process.py", line 29, in <module>
>     raise Exception('Could not detect environment shell!')
> Exception: Could not detect environment shell!
> debian/rules:38: recipe for target 'override_dh_auto_configure' failed

debian/rules sets SHELL and PYTHON before invoking ./configure, but
the syntax is wrong: it is just setting "shell parameters" (variables),
not environment variables, so they won't be exported into configure's
environment unless they were already exported. Also, it looks as
though SHELL may need to be exported during make, not just configure.
It seems safest to export them globally, as in the attached patch.

Upstream for this package seem to have missed some subtleties of how
$SHELL normally works. As the GNU Make documentation puts it:

> Unlike most variables, the variable 'SHELL' is never set from the
> environment.  This is because the 'SHELL' environment variable is used
> to specify your personal choice of shell program for interactive use.
> It would be very bad for personal choices like this to affect the
> functioning of makefiles.

Regards,
    smcv
    (still no closer to understanding the test failures...)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Export-SHELL-and-PYTHON-for-all-stages-of-the-build-.patch
Type: text/x-diff
Size: 1668 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-gnome-maintainers/attachments/20170921/242427e1/attachment.patch>


More information about the pkg-gnome-maintainers mailing list