From: Masahiro Yamada Date: Tue, 30 Sep 2014 17:58:21 +0900 Subject: [U-Boot] [RFC PATCH] genboardscfg.py: use Python2 from default path In-Reply-To: <1412065042-572-1-git-send-email-wd@denx.de> References: <1412065042-572-1-git-send-email-wd@denx.de> Message-ID: <20140930175820.4A3C.AA925319@jp.panasonic.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Wolfgang, On Tue, 30 Sep 2014 10:17:22 +0200 Wolfgang Denk wrote: > Instead of searching for Python2 in $PATH, use the one installed by > the system (i. e. /usr/bin/python2). This prevents failures like > this: > > -> ./MAKEALL m53evk > Traceback (most recent call last): > File "tools/genboardscfg.py", line 19, in > import fnmatch > ImportError: No module named fnmatch > Failed to generate boards.cfg > > This happens for example with all but the most recent versions of > Yocto based tool chains (inclusing all currently existing versions of > the ELDK), which provide a python2 binary in SYSROOT/usr/bin/python2, > but do not include the "fnmatch" module. I'd like to regard the root cause of the problem as ELDK missing fnmatch module. I have no idea if fnmatch module is so special. > By using the system installed Python interpreter, the user is able to > install any missing modules himself, without need to patch and rebuild > the whole tool chain. I think '/usr/bin/env python' is a general strategy to support various platforms where Python might not be installed in /usr/bin directory. (Buildman and Patman have already adopted this way.) If necessary, I do not mind this change (as I only use Linux). Though FreeBSD people (Jeroen) might be unhappy because the standard installation path of Python is '/usr/local/bin/python' on FreeBSD. (OK. They can have a symbolic link /usr/bin/python2 => /usr/local/bin/python2) Best Regards Masahiro Yamada