Open Bug 1757023 Opened 3 years ago Updated 3 years ago

hg-printed paths don't work nicely in MozillaBuild

Categories

(Firefox Build System :: General, defect, P5)

Desktop
Windows 11
defect

Tracking

(Not tracked)

People

(Reporter: calixte, Unassigned)

Details

I'm using the moz-shell from C:\mozilla-build\start-shell.bat.
When I rebase a patch in using hg rebase ... I can have some conflicts and and then I get a message like

# Unresolved merge conflicts:
#
#     browser\components\companion\services\workshop\build\workshop-worker-built.js
#
# To mark files as resolved:  hg resolve --mark FILE

so if I copy/paste the path to resolve it, i.e. hg resolve --mark browser\components\companion\services\workshop\build\workshop-worker-built.js, it doesn't work because of the \ in the path. It's fine if I replace them with some /.

Component: Developer Environment Integration → General

Try adding single quotes around the path.

This is caused by hg being run in native-Windows-land, where paths use backslashes (\) and drive letters (c:) if the path isn't relative.
However, MozillaBuild itself is Linux-y (because it's based on Cygwin), so forward slashes (/) are generally used and full paths start like /c/.

Finally, Linux-y environments (more specifically, bash) interpret backslashes as "escape characters", and evaluates and removes them.

There's a couple workarounds here:

  1. Putting single-quotes around the relative path should ensure that the backslashes are maintained
  2. MozillaBuild 4.0 adds the cygpath tool, which can be used to convert between Linux-y paths and Windows-native paths
  3. We already specify ui.slash=True in MozillaBuild, so I'm a little bit surprised that these paths aren't using forward slashes already. I'm guessing that this is an issue similar to this one, where some contexts weren't respecting slash config.
Summary: Hg rebase issue with some paths on Windows → hg-printed paths don't work nicely in MozillaBuild
Priority: -- → P5
Severity: -- → S4
You need to log in before you can comment on or make changes to this bug.