Closed Bug 1584075 Opened 5 years ago Closed 4 years ago

ImportError: No module named which

Categories

(Firefox Build System :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: farre, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: in-triage)

[farre@carakan work-1]$ ./mach build
Config object not found by mach.
0:00.36 Clobber not needed.
0:00.36 Adding make options from /home/farre/.mozconfigs/android-release
AUTOCLOBBER=1
MOZ_OBJDIR=/home/farre/src/gecko/work-1/obj-android-release
OBJDIR=/home/farre/src/gecko/work-1/obj-android-release
FOUND_MOZCONFIG=/home/farre/.mozconfigs/android-release
export FOUND_MOZCONFIG
0:00.37 /usr/bin/gmake -f client.mk -s configure
0:00.38 cd /home/farre/src/gecko/work-1/obj-android-release
0:00.38 /home/farre/src/gecko/work-1/configure
0:00.50 Reexecuting in the virtualenv
0:00.62 Adding configure options from /home/farre/.mozconfigs/android-release
0:00.62 --enable-application=mobile/android
0:00.62 --disable-sandbox
0:00.62 --target=x86_64
0:00.62 checking for vcs source checkout... git
0:00.66 checking for a shell... Traceback (most recent call last):
0:00.66 File "/home/farre/src/gecko/work-1/configure.py", line 164, in <module>
0:00.66 sys.exit(main(sys.argv))
0:00.66 File "/home/farre/src/gecko/work-1/configure.py", line 40, in main
0:00.66 sandbox.run(os.path.join(os.path.dirname(file), 'moz.configure'))
0:00.66 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/configure/init.py", line 446, in run
0:00.66 self.include_file(path)
0:00.66 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/configure/init.py", line 437, in include_file
0:00.66 exec_(code, self)
0:00.66 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/util.py", line 55, in exec_
0:00.66 exec(object, globals, locals)
0:00.66 File "/home/farre/src/gecko/work-1/moz.configure", line 137, in <module>
0:00.66 when='--enable-compile-environment')
0:00.66 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/configure/init.py", line 763, in include_impl
0:00.66 self.include_file(what)
0:00.66 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/configure/init.py", line 437, in include_file
0:00.66 exec_(code, self)
0:00.66 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/util.py", line 55, in exec_
0:00.66 exec(object, globals, locals)
0:00.66 File "/home/farre/src/gecko/work-1/build/moz.configure/toolchain.configure", line 103, in <module>
0:00.66 include('android-ndk.configure', when=compiling_android)
0:00.67 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/configure/init.py", line 763, in include_impl
0:00.67 self.include_file(what)
0:00.67 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/configure/init.py", line 437, in include_file
0:00.67 exec_(code, self)
0:00.67 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/util.py", line 55, in exec_
0:00.67 exec(object, globals, locals)
0:00.67 File "/home/farre/src/gecko/work-1/build/moz.configure/android-ndk.configure", line 10, in <module>
0:00.67 @imports(_from='mozboot.android', _import='NDK_VERSION')
0:00.67 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/configure/init.py", line 746, in decorator
0:00.67 depends = DependsFunction(self, func, dependencies, when=when)
0:00.67 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/configure/init.py", line 132, in init
0:00.67 sandbox._value_for(self)
0:00.67 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/configure/init.py", line 543, in _value_for
0:00.67 return self._value_for_depends(obj)
0:00.67 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/util.py", line 963, in method_call
0:00.67 cache[args] = self.func(instance, *args)
0:00.67 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/configure/init.py", line 552, in _value_for_depends
0:00.67 value = obj.result()
0:00.67 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/util.py", line 963, in method_call
0:00.67 cache[args] = self.func(instance, *args)
0:00.67 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/configure/init.py", line 153, in result
0:00.67 if self.when and not self.sandbox._value_for(self.when):
0:00.67 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/configure/init.py", line 543, in _value_for
0:00.67 return self._value_for_depends(obj)
0:00.67 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/util.py", line 963, in method_call
0:00.67 cache[args] = self.func(instance, *args)
0:00.67 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/configure/init.py", line 552, in _value_for_depends
0:00.67 value = obj.result()
0:00.67 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/util.py", line 963, in method_call
0:00.67 cache[args] = self.func(instance, *args)
0:00.68 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/configure/init.py", line 233, in result
0:00.68 return self._func(resolved_args)
0:00.68 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/configure/init.py", line 232, in <genexpr>
0:00.68 for d in self.dependencies)
0:00.68 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/configure/init.py", line 543, in _value_for
0:00.68 return self._value_for_depends(obj)
0:00.68 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/util.py", line 963, in method_call
0:00.68 cache[args] = self.func(instance, *args)
0:00.68 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/configure/init.py", line 552, in _value_for_depends
0:00.68 value = obj.result()
0:00.68 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/util.py", line 963, in method_call
0:00.68 cache[args] = self.func(instance, *args)
0:00.68 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/configure/init.py", line 157, in result
0:00.68 for d in self.dependencies]
0:00.68 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/configure/init.py", line 543, in _value_for
0:00.68 return self._value_for_depends(obj)
0:00.68 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/util.py", line 963, in method_call
0:00.68 cache[args] = self.func(instance, *args)
0:00.68 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/configure/init.py", line 552, in _value_for_depends
0:00.68 value = obj.result()
0:00.68 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/util.py", line 963, in method_call
0:00.68 cache[args] = self.func(instance, *args)
0:00.68 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/configure/init.py", line 233, in result
0:00.68 return self._func(resolved_args)
0:00.68 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/configure/init.py", line 179, in or_impl
0:00.68 for i in iterable:
0:00.68 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/configure/init.py", line 232, in <genexpr>
0:00.68 for d in self.dependencies)
0:00.68 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/configure/init.py", line 543, in _value_for
0:00.68 return self._value_for_depends(obj)
0:00.68 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/util.py", line 963, in method_call
0:00.68 cache[args] = self.func(instance, *args)
0:00.68 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/configure/init.py", line 552, in _value_for_depends
0:00.68 value = obj.result()
0:00.68 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/util.py", line 963, in method_call
0:00.68 cache[args] = self.func(instance, *args)
0:00.68 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/configure/init.py", line 157, in result
0:00.68 for d in self.dependencies]
0:00.68 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/configure/init.py", line 543, in _value_for
0:00.68 return self._value_for_depends(obj)
0:00.68 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/util.py", line 963, in method_call
0:00.68 cache[args] = self.func(instance, *args)
0:00.68 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/configure/init.py", line 552, in _value_for_depends
0:00.68 value = obj.result()
0:00.68 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/util.py", line 963, in method_call
0:00.68 cache[args] = self.func(instance, *args)
0:00.68 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/configure/init.py", line 157, in result
0:00.68 for d in self.dependencies]
0:00.68 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/configure/init.py", line 543, in _value_for
0:00.68 return self._value_for_depends(obj)
0:00.69 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/util.py", line 963, in method_call
0:00.69 cache[args] = self.func(instance, *args)
0:00.69 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/configure/init.py", line 552, in _value_for_depends
0:00.69 value = obj.result()
0:00.69 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/util.py", line 963, in method_call
0:00.69 cache[args] = self.func(instance, *args)
0:00.69 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/configure/init.py", line 233, in result
0:00.69 return self._func(resolved_args)
0:00.69 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/configure/init.py", line 179, in or_impl
0:00.69 for i in iterable:
0:00.69 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/configure/init.py", line 232, in <genexpr>
0:00.69 for d in self.dependencies)
0:00.69 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/configure/init.py", line 543, in _value_for
0:00.69 return self._value_for_depends(obj)
0:00.69 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/util.py", line 963, in method_call
0:00.69 cache[args] = self.func(instance, *args)
0:00.69 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/configure/init.py", line 552, in _value_for_depends
0:00.69 value = obj.result()
0:00.69 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/util.py", line 963, in method_call
0:00.69 cache[args] = self.func(instance, *args)
0:00.69 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/configure/init.py", line 158, in result
0:00.69 return self._func(*resolved_args)
0:00.69 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/configure/init.py", line 1144, in wrapped
0:00.69 return new_func(*args, **kwargs)
0:00.69 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/configure/init.py", line 805, in wrapper
0:00.69 ret = template(*args, **kwargs)
0:00.69 File "/home/farre/src/gecko/work-1/build/moz.configure/checks.configure", line 58, in wrapped
0:00.69 ret = func(*args, **kwargs)
0:00.69 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/configure/init.py", line 1144, in wrapped
0:00.69 return new_func(*args, **kwargs)
0:00.69 File "/home/farre/src/gecko/work-1/build/moz.configure/init.configure", line 369, in shell
0:00.69 return find_program(shell)
0:00.69 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/configure/init.py", line 1143, in wrapped
0:00.69 self._apply_imports(func, glob)
0:00.69 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/configure/init.py", line 871, in _apply_imports
0:00.69 glob[what] = self._get_one_import('%s%s' % (from, what))
0:00.69 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/configure/init.py", line 946, in get_one_import
0:00.69 exec
(import_line, {}, glob)
0:00.69 File "/home/farre/src/gecko/work-1/python/mozbuild/mozbuild/util.py", line 55, in exec

0:00.69 exec(object, globals, locals)
0:00.69 File "<string>", line 1, in <module>
0:00.69 ImportError: No module named which
0:00.69 *** Fix above errors and then restart with
0:00.69 "./mach build"
0:00.69 gmake: *** [client.mk:115: configure] Error 1

Does this go away after running './mach clobber python'? We've had issues in the past where .pyc files aren't updated correctly.

Sorry, forgot to needinfo...

Flags: needinfo?(afarre)

Yep, went away after ./mach clobber.

Flags: needinfo?(afarre)

I am hit by this.

tritter@ff-t moz/mozilla-unified » ./mach build
 Config object not found by mach.
 0:01.19 Clobber not needed.
 0:01.19 Adding make options from /Users/tritter/Documents/moz/mozilla-unified/.mozconfig
    MOZ_OBJDIR=/Users/tritter/Documents/moz/mozilla-unified/obj-x86_64-apple-darwin18.5.0.opt
    OBJDIR=/Users/tritter/Documents/moz/mozilla-unified/obj-x86_64-apple-darwin18.5.0.opt
    FOUND_MOZCONFIG=/Users/tritter/Documents/moz/mozilla-unified/.mozconfig
    export FOUND_MOZCONFIG
 0:01.21 /usr/bin/make -f client.mk -s configure
 0:01.23 cd /Users/tritter/Documents/moz/mozilla-unified/obj-x86_64-apple-darwin18.5.0.opt
 0:01.23 /Users/tritter/Documents/moz/mozilla-unified/configure
 0:01.50 Traceback (most recent call last):
 0:01.50   File "/Users/tritter/Documents/moz/mozilla-unified/configure.py", line 170, in <module>
 0:01.50     sys.exit(main(sys.argv))
 0:01.50   File "/Users/tritter/Documents/moz/mozilla-unified/configure.py", line 46, in main
 0:01.50     sandbox.run(os.path.join(os.path.dirname(__file__), 'moz.configure'))
 0:01.50   File "/Users/tritter/Documents/moz/mozilla-unified/python/mozbuild/mozbuild/configure/__init__.py", line 444, in run
 0:01.50     self.include_file(path)
 0:01.50   File "/Users/tritter/Documents/moz/mozilla-unified/python/mozbuild/mozbuild/configure/__init__.py", line 435, in include_file
 0:01.50     exec_(code, self)
 0:01.50   File "/Users/tritter/Documents/moz/mozilla-unified/python/mozbuild/mozbuild/util.py", line 52, in exec_
 0:01.50     exec(object, globals, locals)
 0:01.50   File "/Users/tritter/Documents/moz/mozilla-unified/moz.configure", line 7, in <module>
 0:01.50     include('build/moz.configure/init.configure')
 0:01.50   File "/Users/tritter/Documents/moz/mozilla-unified/python/mozbuild/mozbuild/configure/__init__.py", line 767, in include_impl
 0:01.50     self.include_file(what)
 0:01.50   File "/Users/tritter/Documents/moz/mozilla-unified/python/mozbuild/mozbuild/configure/__init__.py", line 435, in include_file
 0:01.52     exec_(code, self)
 0:01.52   File "/Users/tritter/Documents/moz/mozilla-unified/python/mozbuild/mozbuild/util.py", line 52, in exec_
 0:01.52     exec(object, globals, locals)
 0:01.52   File "/Users/tritter/Documents/moz/mozilla-unified/build/moz.configure/init.configure", line 254, in <module>
 0:01.52     @imports(_from='six', _import='ensure_text')
 0:01.52   File "/Users/tritter/Documents/moz/mozilla-unified/python/mozbuild/mozbuild/configure/__init__.py", line 750, in decorator
 0:01.52     depends = DependsFunction(self, func, dependencies, when=when)
 0:01.52   File "/Users/tritter/Documents/moz/mozilla-unified/python/mozbuild/mozbuild/configure/__init__.py", line 129, in __init__
 0:01.52     sandbox._value_for(self)
 0:01.52   File "/Users/tritter/Documents/moz/mozilla-unified/python/mozbuild/mozbuild/configure/__init__.py", line 541, in _value_for
 0:01.52     return self._value_for_depends(obj)
 0:01.52   File "/Users/tritter/Documents/moz/mozilla-unified/python/mozbuild/mozbuild/util.py", line 1017, in method_call
 0:01.52     cache[args] = self.func(instance, *args)
 0:01.52   File "/Users/tritter/Documents/moz/mozilla-unified/python/mozbuild/mozbuild/configure/__init__.py", line 550, in _value_for_depends
 0:01.52     value = obj.result()
 0:01.52   File "/Users/tritter/Documents/moz/mozilla-unified/python/mozbuild/mozbuild/util.py", line 1017, in method_call
 0:01.52     cache[args] = self.func(instance, *args)
 0:01.52   File "/Users/tritter/Documents/moz/mozilla-unified/python/mozbuild/mozbuild/configure/__init__.py", line 155, in result
 0:01.52     return self._func(*resolved_args)
 0:01.52   File "/Users/tritter/Documents/moz/mozilla-unified/python/mozbuild/mozbuild/configure/__init__.py", line 1155, in wrapped
 0:01.52     return new_func(*args, **kwargs)
 0:01.52   File "/Users/tritter/Documents/moz/mozilla-unified/build/moz.configure/init.configure", line 324, in virtualenv_python2
 0:01.52     python, version = find_python2_executable()
 0:01.52   File "/Users/tritter/Documents/moz/mozilla-unified/python/mozbuild/mozbuild/pythonutil.py", line 51, in ret
 0:01.52     from mozfile import which
 0:01.53 ImportError: cannot import name which
 0:01.53 *** Fix above errors and then restart with               "./mach build"
 0:01.53 make: *** [configure] Error 1

However this occurs even after I run

$ rm -rf obj-*
$ find . -name "*.pyc" -delete
$ ./mach clobber && ./mach clobber python

That's a different thing (see bug 1610774).

Closing per comment 3.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.