Closed Bug 848447 Opened 7 years ago Closed 7 years ago

os.path.sep issues in xpcshell mach commands

Categories

(Testing :: XPCShell Harness, defect)

All
Windows 8
defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED
mozilla22

People

(Reporter: mbrubeck, Assigned: mbrubeck)

References

Details

Attachments

(1 file)

Attached patch patchSplinter Review
I noticed some issues in the path handling in XPCShellRunner.

For example, it does not handle paths on windows that end in "/" because it uses code that checks for a trailing os.path.sep (which is "\" on Windows).  The code to get a relative path also fails sometimes because self.topsrcdir may use different path separators than the test_file argument.

This code also has problems when run in a directory other than $topsrcdir (for example, when using bug 840588 to run mach in a different directory), because the os.path.isfile and os.path.isdir checks assume that $PWD == $topsrcdir.

This patch uses the new mozpack.path module to ensure that comparisons are all done using "/" as the path separator, and it makes the code explicitly handle paths relative to $topsrcdir.
Attachment #721782 - Flags: review?(ted)
Comment on attachment 721782 [details] [diff] [review]
patch

Review of attachment 721782 [details] [diff] [review]:
-----------------------------------------------------------------

I really haven't reviewed any mach code yet. I probably should, but you're better off with gps for now.
Attachment #721782 - Flags: review?(ted) → review?(gps)
Blocks: 840690
Comment on attachment 721782 [details] [diff] [review]
patch

Review of attachment 721782 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good to me.
Attachment #721782 - Flags: review?(gps) → review+
https://hg.mozilla.org/mozilla-central/rev/f37c3553015e
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
You need to log in before you can comment on or make changes to this bug.