Open Bug 1532169 Opened 5 years ago Updated 2 years ago

build error if distcc used: UnicodeEncodeError: 'ascii' codec can't encode characters in position 147-149: ordinal not in range(128)

Categories

(Firefox Build System :: General, defect)

65 Branch
defect

Tracking

(Not tracked)

UNCONFIRMED

People

(Reporter: whissi, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0

Steps to reproduce:

Try compiling firefox with distcc. Within first 5 minutes, build output will crash with the following error:

1:08.05 gmake[5]: Leaving directory '/var/tmp/portage/www-client/firefox-65.0.2/work/firefox-65.0.2/ff/modules/fdlibm/src'
1:08.13 gmake[5]: Entering directory '/var/tmp/portage/www-client/firefox-65.0.2/work/firefox-65.0.2/ff/third_party/prio'
1:08.14 third_party/prio
1:08.14 /usr/lib/distcc/bin/x86_64-pc-linux-gnu-gcc -std=gnu99 -o montmulf.i_o -c -DNDEBUG=1 -DTRIMMED=1 -DPRIO_BUILD_LIBRARY -DSTATIC_EXPORTABLE_JS_API -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -I/var/tmp/portage/www-client/firefox-65.0.2/work/firefox-65.0.2/third_party/prio -I/var/tmp/portage/www-client/firefox-65.0.2/work/firefox-65.0.2/ff/third_party/prio -I/var/tmp/portage/www-client/firefox-65.0.2/work/firefox-65.0.2/security/nss/lib/freebl/mpi -I/var/tmp/portage/www-client/firefox-65.0.2/work/firefox-65.0.2/third_party/msgpack/include -I/var/tmp/portage/www-client/firefox-65.0.2/work/firefox-65.0.2/third_party/prio/include -I/var/tmp/portage/www-client/firefox-65.0.2/work/firefox-65.0.2/ff/dist/include -I/usr/include/nspr -I/usr/include/nss -I/var/tmp/portage/www-client/firefox-65.0.2/work/firefox-65.0.2/ff/dist/include/nss -I/usr/include/pixman-1 -fPIC -include /var/tmp/portage/www-client/firefox-65.0.2/work/firefox-65.0.2/ff/mozilla-config.h -DMOZILLA_CLIENT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -pipe -march=ivybridge -mtune=ivybridge -mno-xsaveopt -frecord-gcc-switches -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-strict-aliasing -ffunction-sections -fdata-sections -fno-math-errno -pthread -pipe -O3 -fomit-frame-pointer -funwind-tables -Wall -Wempty-body -Wignored-qualifiers -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wduplicated-cond -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=coverage-mismatch -Wno-error=free-nonheap-object -Wno-error=multistatement-macros -Wno-error=class-memaccess -Wformat -Wformat-security -Wformat-overflow=2 -fprofile-generate -DMOZ_PROFILE_INSTRUMENTATION -MD -MP -MF .deps/montmulf.i_o.pp -fdiagnostics-color /var/tmp/portage/www-client/firefox-65.0.2/work/firefox-65.0.2/security/nss/lib/freebl/mpi/montmulf.c
Exception in thread ProcessReader:
Traceback (most recent call last):
File "/usr/lib64/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/lib64/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "/var/tmp/portage/www-client/firefox-65.0.2/work/firefox-65.0.2/testing/mozbase/mozprocess/mozprocess/processhandler.py", line 1035, in _read
callback(line.rstrip())
File "/var/tmp/portage/www-client/firefox-65.0.2/work/firefox-65.0.2/testing/mozbase/mozprocess/mozprocess/processhandler.py", line 951, in call
e(*args, **kwargs)
File "/var/tmp/portage/www-client/firefox-65.0.2/work/firefox-65.0.2/python/mach/mach/mixin/process.py", line 87, in handleLine
line_handler(line)
File "/var/tmp/portage/www-client/firefox-65.0.2/work/firefox-65.0.2/python/mozbuild/mozbuild/controller/building.py", line 691, in on_line
self.log(logging.INFO, 'build_output', {'line': message}, '{line}')
File "/var/tmp/portage/www-client/firefox-65.0.2/work/firefox-65.0.2/python/mach/mach/mixin/logging.py", line 54, in log
extra={'action': action, 'params': params})
File "/usr/lib64/python2.7/logging/init.py", line 1238, in log
self._log(level, msg, args, **kwargs)
File "/usr/lib64/python2.7/logging/init.py", line 1293, in _log
self.handle(record)
File "/usr/lib64/python2.7/logging/init.py", line 1303, in handle
self.callHandlers(record)
File "/usr/lib64/python2.7/logging/init.py", line 1343, in callHandlers
hdlr.handle(record)
File "/usr/lib64/python2.7/logging/init.py", line 766, in handle
self.emit(record)
File "/var/tmp/portage/www-client/firefox-65.0.2/work/firefox-65.0.2/python/mozbuild/mozbuild/controller/building.py", line 574, in emit
self.fh.write(msg)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 147-149: ordinal not in range(128)

Downstream-Bug: https://bugs.gentoo.org/666948

Using the following quick patch seems to workaround the problem:

diff --git a/python/mozbuild/mozbuild/controller/building.py b/python/mozbuild/mozbuild/controller/building.py
index 32e3535..34a1c9b 100644
--- a/python/mozbuild/mozbuild/controller/building.py
+++ b/python/mozbuild/mozbuild/controller/building.py
@@ -571,7 +571,7 @@ class TerminalLoggingHandler(logging.Handler):
if self.footer:
self.footer.clear()

  •        self.fh.write(msg)
    
  •        self.fh.write(msg.encode("utf-8"))
           self.fh.write('\n')
    
           if self.footer:
    
Component: Untriaged → General
Product: Firefox → Firefox Build System
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.