Closed Bug 1614926 Opened 5 years ago Closed 5 years ago

configure of firefox-74-beta fails with: ImportError: No module named shutil_which

Categories

(Firefox Build System :: General, defect)

74 Branch
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1614994

People

(Reporter: herrtimson, Unassigned)

Details

Attachments

(1 file)

15.58 KB, text/x-log
Details
Attached file build.log

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0

Steps to reproduce:

I'm trying to config firefox-74 from beta channel, but I'm confronted with an import error of shutil_which.

Actual results:

this is a quote from the fuill build log, which shows the actuall python error:

0:00.53 Clobber not needed.
0:00.53 Adding make options from /var/tmp/portage/www-client/firefox-74.0_beta1/work/firefox-74.0/.mozconfig
XARGS=/usr/bin/xargs
MOZ_OBJDIR=/var/tmp/portage/www-client/firefox-74.0_beta1/work/firefox-74.0/ff
OBJDIR=/var/tmp/portage/www-client/firefox-74.0_beta1/work/firefox-74.0/ff
FOUND_MOZCONFIG=/var/tmp/portage/www-client/firefox-74.0_beta1/work/firefox-74.0/.mozconfig
export FOUND_MOZCONFIG
0:00.54 /usr/bin/gmake -f client.mk -s configure
0:00.55 cd /var/tmp/portage/www-client/firefox-74.0_beta1/work/firefox-74.0/ff
0:00.55 /var/tmp/portage/www-client/firefox-74.0_beta1/work/firefox-74.0/configure
0:00.71 Traceback (most recent call last):
0:00.71 File "/var/tmp/portage/www-client/firefox-74.0_beta1/work/firefox-74.0/configure.py", line 170, in <module>
0:00.71 sys.exit(main(sys.argv))
0:00.71 File "/var/tmp/portage/www-client/firefox-74.0_beta1/work/firefox-74.0/configure.py", line 46, in main
0:00.71 sandbox.run(os.path.join(os.path.dirname(file), 'moz.configure'))
0:00.71 File "/var/tmp/portage/www-client/firefox-74.0_beta1/work/firefox-74.0/python/mozbuild/mozbuild/configure/init.py", line 444, in run
0:00.71 self.include_file(path)
0:00.71 File "/var/tmp/portage/www-client/firefox-74.0_beta1/work/firefox-74.0/python/mozbuild/mozbuild/configure/init.py", line 435, in include_file
0:00.71 exec_(code, self)
0:00.71 File "/var/tmp/portage/www-client/firefox-74.0_beta1/work/firefox-74.0/python/mozbuild/mozbuild/util.py", line 52, in exec_
0:00.71 exec(object, globals, locals)
0:00.71 File "/var/tmp/portage/www-client/firefox-74.0_beta1/work/firefox-74.0/moz.configure", line 7, in <module>
0:00.71 include('build/moz.configure/init.configure')
0:00.71 File "/var/tmp/portage/www-client/firefox-74.0_beta1/work/firefox-74.0/python/mozbuild/mozbuild/configure/init.py", line 767, in include_impl
0:00.71 self.include_file(what)
0:00.71 File "/var/tmp/portage/www-client/firefox-74.0_beta1/work/firefox-74.0/python/mozbuild/mozbuild/configure/init.py", line 435, in include_file
0:00.71 exec_(code, self)
0:00.71 File "/var/tmp/portage/www-client/firefox-74.0_beta1/work/firefox-74.0/python/mozbuild/mozbuild/util.py", line 52, in exec_
0:00.71 exec(object, globals, locals)
0:00.71 File "/var/tmp/portage/www-client/firefox-74.0_beta1/work/firefox-74.0/build/moz.configure/init.configure", line 254, in <module>
0:00.71 @imports(_from='six', _import='ensure_text')
0:00.71 File "/var/tmp/portage/www-client/firefox-74.0_beta1/work/firefox-74.0/python/mozbuild/mozbuild/configure/init.py", line 750, in decorator
0:00.71 depends = DependsFunction(self, func, dependencies, when=when)
0:00.71 File "/var/tmp/portage/www-client/firefox-74.0_beta1/work/firefox-74.0/python/mozbuild/mozbuild/configure/init.py", line 129, in init
0:00.71 sandbox._value_for(self)
0:00.71 File "/var/tmp/portage/www-client/firefox-74.0_beta1/work/firefox-74.0/python/mozbuild/mozbuild/configure/init.py", line 541, in _value_for
0:00.71 return self._value_for_depends(obj)
0:00.71 File "/var/tmp/portage/www-client/firefox-74.0_beta1/work/firefox-74.0/python/mozbuild/mozbuild/util.py", line 1017, in method_call
0:00.71 cache[args] = self.func(instance, *args)
0:00.71 File "/var/tmp/portage/www-client/firefox-74.0_beta1/work/firefox-74.0/python/mozbuild/mozbuild/configure/init.py", line 550, in _value_for_depends
0:00.71 value = obj.result()
0:00.71 File "/var/tmp/portage/www-client/firefox-74.0_beta1/work/firefox-74.0/python/mozbuild/mozbuild/util.py", line 1017, in method_call
0:00.71 cache[args] = self.func(instance, *args)
0:00.71 File "/var/tmp/portage/www-client/firefox-74.0_beta1/work/firefox-74.0/python/mozbuild/mozbuild/configure/init.py", line 155, in result
0:00.71 return self._func(*resolved_args)
0:00.71 File "/var/tmp/portage/www-client/firefox-74.0_beta1/work/firefox-74.0/python/mozbuild/mozbuild/configure/init.py", line 1155, in wrapped
0:00.71 return new_func(*args, **kwargs)
0:00.71 File "/var/tmp/portage/www-client/firefox-74.0_beta1/work/firefox-74.0/build/moz.configure/init.configure", line 309, in virtualenv_python2
0:00.71 found_python = find_program(python)
0:00.71 File "/var/tmp/portage/www-client/firefox-74.0_beta1/work/firefox-74.0/python/mozbuild/mozbuild/configure/init.py", line 1155, in wrapped
0:00.71 return new_func(*args, **kwargs)
0:00.71 File "/var/tmp/portage/www-client/firefox-74.0_beta1/work/firefox-74.0/build/moz.configure/util.configure", line 185, in find_program
0:00.71 path = which(os.path.basename(file), path=os.path.dirname(file), exts=exts)
0:00.71 File "/var/tmp/portage/www-client/firefox-74.0_beta1/work/firefox-74.0/testing/mozbase/mozfile/mozfile/mozfile.py", line 338, in which
0:00.71 from shutil_which import which as shutil_which
0:00.71 ImportError: No module named shutil_which
0:00.71 *** Fix above errors and then restart with
0:00.71 "./mach build"
0:00.71 gmake: *** [client.mk:115: configure] Error 1

Expected results:

Assuming those config scripts are still on python2, I went to install the backports:

  • Contents of dev-python/backports-shutil_which-3.5.1:
    /usr
    /usr/lib64
    /usr/lib64/python2.7
    /usr/lib64/python2.7/site-packages
    /usr/lib64/python2.7/site-packages/backports
    /usr/lib64/python2.7/site-packages/backports.shutil_which-3.5.1-py2.7.egg-info
    /usr/lib64/python2.7/site-packages/backports/shutil_which.py
    /usr/lib64/python2.7/site-packages/backports/shutil_which.pyc
    /usr/lib64/python2.7/site-packages/backports/shutil_which.pyo

but to no avail.

firefox prior to 74 beta isn't affected.

digging through some random web searches, I found this documentation: https://pypi.org/project/backports.shutil_which/

it might be a good idea to change line 338 of firefox-74.0/testing/mozbase/mozfile/mozfile/mozfile.py from

    from shutil_which import which as shutil_which

to
from backports.shutil_which import which as shutil_which

but I'm uncertain wether that is correct in the sense of fixing this for upcoming python2 > python3 switch.

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → General
Product: Firefox → Firefox Build System
Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE

thanks for the heads up, I got it now fixed locally, and will be fixed soon in mozilla-central.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: