Closed Bug 1742480 Opened 2 years ago Closed 2 years ago

push-to-try: watchman command error: RootResolveError

Categories

(Firefox Build System :: Mach Core, defect)

defect

Tracking

(firefox97 fixed)

RESOLVED FIXED
97 Branch
Tracking Status
firefox97 --- fixed

People

(Reporter: barret, Assigned: barret)

Details

Attachments

(1 file)

When running ./mach try, I get the following error from watchman several times:

warning: Watchman unavailable: watchman command error: RootResolveError: unable to resolve root c:\users\barret\workspace\src\hg.mozilla.org\mozilla-central: "c:\users\barret\workspace\src\hg.mozilla.org\mozilla-central" resolved to "C:/Users/Barret/Workspace/src/hg.mozilla.org/mozilla-central" but we were unable to examine "c:\users\barret\workspace\src\hg.mozilla.org\mozilla-central" using strict case sensitive rules. Please check each component of the path and make sure that that path exactly matches the correct case of the files on your filesystem.

This wasn't happening 3 mo ago (not a useful timeframe, I know :)), but it happened after I came back and before I upgraded to the latest mozilla-build

I've done some investigation and one of the errors stems from Mach's FinderHook

This sets the relative path for imports to a normcase'd (i.e., lowercase path) so later on when we get to push.py as part of ./mach try, __file__ is lowercased up until the mozilla-central repo root, and so the resulting hg repo path will be all lowercase, resulting in the path mismatch error.

This doesn't resolve all the errors, but it removes at least one error message (of 6+)

Upon further investigation, the mach.pth file in the virtualenv has all lowercase paths starting from topsrcdir. This line calling normcase() causes the bug. Removing the call to normcase() fixes the issue for me.

(In reply to Barret Rennie [:barret] (they/them) from comment #2)

Upon further investigation, the mach.pth file in the virtualenv has all lowercase paths starting from topsrcdir. This line calling normcase() causes the bug. Removing the call to normcase() fixes the issue for me.

Nice work. Sounds like something that would be fixed by bug 1740564 eventually. Looking at the annotate that function was added in November, so within your 3-month window. :)

The author of that function is Mitch, so moving NI to him.

Flags: needinfo?(mhentges)
Assignee: nobody → mhentges
Status: NEW → ASSIGNED
Component: Mercurial: hg.mozilla.org → Mach Core
Flags: needinfo?(mhentges)
Product: Developer Services → Firefox Build System

I'm going to dogfood this patch for the foreseeable future and see if anything breaks.

Assignee: mhentges → brennie

If watchman is invoked (as part of hg's fsmonitor) with a path whose case does
not match the on-disk case (e.g., for case-insensitive file systems like NTFS),
it will get angry and throw a RootResolveError (although it will still work).
When doing ./mach try, we end up invoking watchman several times which leads
to it getting very angry and throwing lots of errors.

This is all due to how we compute virtualenv paths -- by normcase()-ing them in
mach.pth -- which results in push.py having a lowercase path even if your
mozilla-central checkout has a non-lowercase on-disk path.

Calling Path.resolve() on the resulting path returns it to its on-disk
representation and no longer angers watchman.

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 97 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: