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...)
>From cf19a4602442c908c489c52da372a74e140d6451 Mon Sep 17 00:00:00 2001
From: Simon McVittie <[email protected]>
Date: Thu, 21 Sep 2017 10:13:45 +0100
Subject: [PATCH] Export SHELL and PYTHON for all stages of the build process
(Closes: #nnnnnn)
---
debian/changelog | 7 +++++++
debian/rules | 6 +++++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/debian/changelog b/debian/changelog
index cc81af8a..189c5bec 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+mozjs52 (52.3.1-5) UNRELEASED; urgency=medium
+
+ * Export SHELL and PYTHON for all stages of the build process
+ (Closes: #nnnnnn)
+
+ -- Simon McVittie <[email protected]> Thu, 21 Sep 2017 10:10:10 +0100
+
mozjs52 (52.3.1-4) unstable; urgency=medium
[ Jeremy Bicha ]
diff --git a/debian/rules b/debian/rules
index b62ced55..f903238e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -7,6 +7,10 @@
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
+# mozjs' build process does not seem to be compatible with other shells
+# like zsh
+export SHELL = /bin/sh
+export PYTHON = python
SRCDIR = $(CURDIR)/js/src
@@ -35,7 +39,7 @@ override_dh_clean:
# scripts, so we call configure ourselves.
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=570375
override_dh_auto_configure:
- cd $(SRCDIR) && SHELL=/bin/sh && PYTHON=python && $(SHELL) configure \
+ cd $(SRCDIR) && $(SHELL) configure \
--host=$(DEB_HOST_GNU_TYPE) \
--target=$(DEB_BUILD_GNU_TYPE) \
--prefix=/usr \
--
2.14.1