Closed Bug 899292 Opened 11 years ago Closed 11 years ago

Running mochitests from mach fails due to topobjdir being undefined

Categories

(Firefox Build System :: General, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla25

People

(Reporter: chmanchester, Assigned: gps)

References

Details

Attachments

(1 file)

Running mach mochitest-plain after building this morning's inbound results in the following: File "/Users/mozilla/m-c/testing/mochitest/mach_commands.py", line 268, in run_mochitest_plain return self.run_mochitest(test_file, 'plain', **kwargs) File "/Users/mozilla/m-c/testing/mochitest/mach_commands.py", line 299, in run_mochitest **kwargs) File "/Users/mozilla/m-c/testing/mochitest/mach_commands.py", line 93, in run_mochitest_test ('.py', 'r', imp.PY_SOURCE)) File "/Users/mozilla/m-c/obj-x86_64-apple-darwin12.4.0/_tests/testing/mochitest/runtests.py", line 26, in <module> from mochitest_options import MochitestOptions File "/Users/mozilla/m-c/obj-x86_64-apple-darwin12.4.0/_tests/testing/mochitest/mochitest_options.py", line 17, in <module> build_obj = MozbuildObject.from_environment() File "/Users/mozilla/m-c/python/mozbuild/mozbuild/base.py", line 166, in from_environment topobjdir = os.path.normpath(config['topobjdir'] or topobjdir) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.py", line 318, in normpath initial_slashes = path.startswith('/') This is due to mach_commands.py triggering initialization of a MozbuildObject on import of runtests.py. Mozbuild doesn't find a topobjdir path, so it fails. I'm not sure how to solve this properly, but I did find that wrapping a try except around this line: http://mxr.mozilla.org/mozilla-central/source/python/mozbuild/mozbuild/base.py#166 and just setting topobjdir to None results in the command succeeding to run mochitests.
Component: General → Build Config
Product: Testing → Core
Trivial patch should do it.
Attachment #782847 - Flags: review?(mh+mozilla)
Assignee: nobody → gps
Comment on attachment 782847 [details] [diff] [review] Exception constructing environment when topobjdir isn't available Please verify this fixes it.
Attachment #782847 - Flags: feedback?(cmanchester)
Attachment #782847 - Flags: review?(mh+mozilla) → review+
Comment on attachment 782847 [details] [diff] [review] Exception constructing environment when topobjdir isn't available Review of attachment 782847 [details] [diff] [review]: ----------------------------------------------------------------- ::: python/mozbuild/mozbuild/base.py @@ +164,5 @@ > raise ObjdirMismatchException(topobjdir, config['topobjdir']) > > + topobjdir = config['topobjdir'] or topobjdir > + if topobjdir: > + topobjdir = os.path.normpath(config['topobjdir']) This works with |topobjdir = os.path.normpath(topobjdir)| instead of this line.
Attachment #782847 - Flags: feedback?(cmanchester)
(In reply to Chris Manchester [:chmanchester] from comment #4) > Comment on attachment 782847 [details] [diff] [review] > Exception constructing environment when topobjdir isn't available > > Review of attachment 782847 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: python/mozbuild/mozbuild/base.py > @@ +164,5 @@ > > raise ObjdirMismatchException(topobjdir, config['topobjdir']) > > > > + topobjdir = config['topobjdir'] or topobjdir > > + if topobjdir: > > + topobjdir = os.path.normpath(config['topobjdir']) > > This works with |topobjdir = os.path.normpath(topobjdir)| instead of this > line. Confirming this worked while the original version _does not_.
Good thing I landed the fixed version.
Blocks: 865349
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: