浏览代码

python3: do not use hg when available

During the execution of its configure script, Python 3 tries to find an
available "hg" installation, and if available, will try to use it to get
information from the version control system. To do this, it tries to
communicate over the network, potentially over ports that are blocked,
causing the build to halt. This was reported by a user as part of bug
7802.

To solve this, we simply make the Python script use /bin/false as the
"hg" program.

Fixes bug #7802 for the python3 package.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Thomas Petazzoni 9 年之前
父节点
当前提交
4f76d86d99
共有 1 个文件被更改,包括 8 次插入2 次删除
  1. 8 2
      package/python3/python3.mk

+ 8 - 2
package/python3/python3.mk

@@ -41,8 +41,11 @@ HOST_PYTHON3_CONF_OPTS += 	\
 # Make sure that LD_LIBRARY_PATH overrides -rpath.
 # Make sure that LD_LIBRARY_PATH overrides -rpath.
 # This is needed because libpython may be installed at the same time that
 # This is needed because libpython may be installed at the same time that
 # python is called.
 # python is called.
+# Make python believe we don't have 'hg', so that it doesn't try to
+# communicate over the network during the build.
 HOST_PYTHON3_CONF_ENV += \
 HOST_PYTHON3_CONF_ENV += \
-	LDFLAGS="$(HOST_LDFLAGS) -Wl,--enable-new-dtags"
+	LDFLAGS="$(HOST_LDFLAGS) -Wl,--enable-new-dtags" \
+	ac_cv_prog_HAS_HG=/bin/false
 
 
 PYTHON3_DEPENDENCIES = host-python3 libffi
 PYTHON3_DEPENDENCIES = host-python3 libffi
 
 
@@ -110,11 +113,14 @@ else
 PYTHON3_CONF_OPTS += --disable-ossaudiodev
 PYTHON3_CONF_OPTS += --disable-ossaudiodev
 endif
 endif
 
 
+# Make python believe we don't have 'hg', so that it doesn't try to
+# communicate over the network during the build.
 PYTHON3_CONF_ENV += \
 PYTHON3_CONF_ENV += \
 	ac_cv_have_long_long_format=yes \
 	ac_cv_have_long_long_format=yes \
 	ac_cv_file__dev_ptmx=yes \
 	ac_cv_file__dev_ptmx=yes \
 	ac_cv_file__dev_ptc=yes \
 	ac_cv_file__dev_ptc=yes \
-	ac_cv_working_tzset=yes
+	ac_cv_working_tzset=yes \
+	ac_cv_prog_HAS_HG=/bin/false
 
 
 # uClibc is known to have a broken wcsftime() implementation, so tell
 # uClibc is known to have a broken wcsftime() implementation, so tell
 # Python 3 to fall back to strftime() instead.
 # Python 3 to fall back to strftime() instead.