On Thu, Oct 13, 2016 at 04:42:52PM +0800, hykw...@sina.com wrote:
> > Hi. 
> >
> >I tried to build the firefox 48.0.2 under BLFS 7.10 (System V version) but 
> >the building process reported a Python Error message:
> >
> > UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 36: 
> > ordinal not in range(128)
> >
> > The environment variable "LANG " was set to en_US.utf8 and the "LC_CTYPE" 
> > was "en_US.utf8".
> >
> > Does anyone have an idea to fix it?

Normally, I would suggest that you use the current release of firefox
(49) because *every* new release fixes vulnerabilities, but I don't
think the build system has changed much since FF48 so moving to FF49
will not change the build problem.

I still have no idea why your first build reported the unicode
error, although it seems there have been a lot of similar problems
in Python-2.7 over the years.  My scripted builds use
 export LC_ALL=C
but I have made several manual builds with LC_ALL=en_GB.UTF-8 and
not seen anything like your error.

I suppose that using clean source and setting LC_ALL might fix it.
I know that there are a lot of references to xx_YY.utf8 values, but
xx_YY.UTF-8 always looks safer - my build log from glibc shows

en_US.UTF-8... done

More comments at the end.
> After some tests, I found two methods to "remove" that Python error:
> 1. After the command "make -f client.mk" is fail, just execute it again. I.e.
> make -f client.mk
> make -f client.mk
> 2. Modify configure.py to set the current default string encoding from 
> "ascii" to "utf-8" :
> sed -i '/import sys/ a\
> \
> reload(sys) \
> sys.setdefaultencoding("utf-8")' configure.py
> make -f client.mk
> The reference of the function "sys.setdefaultencoding()" : 
> https://docs.python.org/2.7/library/sys.html#sys.setdefaultencoding
> However, I found that the use of "sys.setdefaultencoding()" has always been 
> discouraged. (Reference: 
> http://stackoverflow.com/questions/3828723/why-should-we-not-use-sys-setdefaultencodingutf-8-in-a-py-script
>  )
> Anyhow, if we modify the default string encoding, the output of the building 
> process becomes:
> mkdir -p '/sources/firefox-48.0.2/firefox-build-dir/'
> python2.7 /sources/firefox-48.0.2/config/pythonpath.py -I 
> /sources/firefox-48.0.2/testing/mozbase/mozfile \
>     /sources/firefox-48.0.2/python/mozbuild/mozbuild/controller/clobber.py 
> /sources/firefox-48.0.2 /sources/firefox-48.0.2/firefox-build-dir
> Clobber not needed.
> > /sources/firefox-48.0.2/firefox-build-dir/.mozconfig.mk
> make -f /sources/firefox-48.0.2/client.mk realbuild CREATE_MOZCONFIG_JSON=
> make[1]: Entering directory '/sources/firefox-48.0.2'
> Adding client.mk options from /sources/firefox-48.0.2/mozconfig:
>     MOZ_OBJDIR=/sources/firefox-48.0.2/firefox-build-dir
>     OBJDIR=/sources/firefox-48.0.2/firefox-build-dir
>     FOUND_MOZCONFIG=/sources/firefox-48.0.2/mozconfig
> make[2]: Entering directory '/sources/firefox-48.0.2'
> cp /sources/firefox-48.0.2/mozconfig 
> /sources/firefox-48.0.2/firefox-build-dir/.mozconfig
> cd /sources/firefox-48.0.2/firefox-build-dir
> /sources/firefox-48.0.2/configure
> Creating Python environment
> New python executable in 
> /sources/firefox-48.0.2/firefox-build-dir/_virtualenv/bin/python2.7
> Also creating executable in 
> /sources/firefox-48.0.2/firefox-build-dir/_virtualenv/bin/python
> Installing setuptools, pip, wheel...done.
> running build_ext
> building 'psutil._psutil_linux' extension
> creating build/temp.linux-i686-2.7
> creating build/temp.linux-i686-2.7/psutil
> gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall 
> -Wstrict-prototypes -fPIC -DPSUTIL_VERSION=311 -I/usr/include/python2.7 -c 
> psutil/_psutil_linux.c -o build/temp.linux-i686-2.7/psutil/_psutil_linux.o
> psutil/_psutil_linux.c: In function ‘init_psutil_linux’:
> psutil/_psutil_linux.c:652:54: warning: overflow in implicit constant 
> conversion [-Woverflow]
>      PyModule_AddIntConstant(module, "RLIM_INFINITY", RLIM_INFINITY);
>                                                       ^~~~~~~~~~~~~
> creating build/lib.linux-i686-2.7
> creating build/lib.linux-i686-2.7/psutil
> gcc -pthread -shared build/temp.linux-i686-2.7/psutil/_psutil_linux.o 
> -L/usr/lib -lpython2.7 -o build/lib.linux-i686-2.7/psutil/_psutil_linux.so
> building 'psutil._psutil_posix' extension
> gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall 
> -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c psutil/_psutil_posix.c 
> -o build/temp.linux-i686-2.7/psutil/_psutil_posix.o
> gcc -pthread -shared build/temp.linux-i686-2.7/psutil/_psutil_posix.o 
> -L/usr/lib -lpython2.7 -o build/lib.linux-i686-2.7/psutil/_psutil_posix.so
> copying build/lib.linux-i686-2.7/psutil/_psutil_linux.so -> psutil
> copying build/lib.linux-i686-2.7/psutil/_psutil_posix.so -> psutil
> Reexecuting in the virtualenv
> As you see, GCC 6.x will use something likes "^~~~" to indicate the errors 
> and the current building script cannot handle it.

You appear to be doing something different, but I don't know what -
except that I only build on x86_64.  Looking at google, people have
had that warning message  with '^' on i686, and it did not stop the
build, e.g.

although that (old) build failed because it did not find a suitable
version of sqlite3.

Your log looks VERY different from mine - between "Adding client.mk
options" with its list of directories, and the next "entering
directory" I have very different output -

make[1]: Entering directory '/scratch/working/firefox-48.0.2'
Adding client.mk options from
Generating /scratch/working/firefox-48.0.2/configure
sed '1,/^divert/d' /scratch/working/firefox-48.0.2/configure.in >
chmod +x /scratch/working/firefox-48.0.2/configure
Generating /scratch/working/firefox-48.0.2/js/src/configure
sed '1,/^divert/d'
/scratch/working/firefox-48.0.2/js/src/configure.in >
chmod +x /scratch/working/firefox-48.0.2/js/src/configure
make[2]: Entering directory '/scratch/working/firefox-48.0.2'

BUT - you made some changes, and you say that the build failed
later, but all you show is a warning and then the "reexecuting in
the virtual environment" message.  My log for FF48 follows that with
a list of the added configure options, and then it shows configure
output (probably from configure.py) in js/src.

`I shall take my mountains', said Lu-Tze. `The climate will be good
for them.'     -- Small Gods
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to