Closed Bug 1285860 Opened 3 years ago Closed 3 years ago

`mach build` fails if there is a local installation of mozbuild


(Firefox Build System :: General, defect)

Not set


(firefox50 fixed)

Tracking Status
firefox50 --- fixed


(Reporter: amiyaguchi, Assigned: gps)



(1 file)

`./mach build` will fail in an unexpected manner if the user has a local installation of mozbuild. This occurs on OSX during the initial build if mozbuild is installed in the system python packages.

This can be reproduced through the following steps.

1) Obtain a clean tree free of the build virtualenv, `./mach clobber`
2) Install mozbuild to the system packages, `pip install mozbuild`
3) Start the build, `./mach build`

It should throw up something like the following:

> 0:02.05 cd /Users/amiyaguchi/mozilla-central/obj-x86_64-apple-darwin15.4.0/x86_64
> 0:02.05 /Users/amiyaguchi/mozilla-central/configure
> 0:02.08 Traceback (most recent call last):
> 0:02.08   File "/Users/amiyaguchi/mozilla-central/", line 16, in <module>
> 0:02.08     from mozbuild.configure import ConfigureSandbox
> 0:02.08 ImportError: cannot import name ConfigureSandbox
> 0:02.08 *** Fix above errors and then restart with               "/Applications/ -f build"
> 0:02.08 make[3]: *** [configure] Error 1
> 0:02.08 make[2]: *** [/Users/amiyaguchi/mozilla-central/obj-x86_64-apple-darwin15.4.0/x86_64/Makefile] Error 2
> 0:02.08 make[1]: *** [realbuild] Error 2
> 0:02.08 make: *** [build] Error 2
> 0:02.12 0 compiler warnings present.

I expect the build system create the appropriate virtualenv and install a fresh copy of mozbuild to it. Instead, it attempts to reference my local copy. A workaround is to uninstall mozbuild during the initial build. Once the virtualenv has been created for the repository, this issue no longer manifests itself.
I found the bug. Will submit patch momentarily.
Assignee: nobody → gps
We want local source directory paths to take precedence over system
paths so system installed packages don't get used.

Review commit:
See other reviews:
Attachment #8769786 - Flags: review?(mh+mozilla)
Comment on attachment 8769786 [details]
Bug 1285860 - Add python/mozbuild at beginning of sys.path;
Attachment #8769786 - Flags: review?(mh+mozilla) → review+
Pushed by
Add python/mozbuild at beginning of sys.path; r=glandium
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.