Closed Bug 1827273 Opened 2 years ago Closed 2 years ago

Status messages for the in-progress tasks overwrite only a portion of the text

Categories

(Firefox Build System :: MozillaBuild, defect)

x86_64
Windows 11
defect

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: ayeddi, Unassigned)

Details

Attachments

(1 file)

Attached video MozBuild-example-1.mp4

STR:

  1. Open a MozillaBuild shell and run a moz-phab patch D123456 or similar
  2. Observe the behavior of status messages/log entries

Expected:

  1. Each line of the status messages is clearly readable during the process and in the log after.

Actual:

  1. Status messages are updated by overwriting each other, but only a potion of the line is being changed, leaving "an echo" of the previous letters in the line before and after the current string.
  2. The log retains some unexpected symbols before and after the entry, as shown in the (edited for clarity) examples below:

Example 1 (from the video):

Gecko Test@DESKTOP-MPGSA94 /c/mozilla-source/mozilla-unified
$ moz-phab patch D123456
←[K←[33mRevision [...] stack?.←[0m (YES/No/Always)? n
←[KPatching [...]
[...]
←[K

Example 2:

Gecko Test@DESKTOP-MPGSA94 /c/mozilla-source/mozilla-unified
$ moz-phab patch D172947 --apply-to central
[...]
  warnings.warn(
←[K←[31mFileNotFoundError: [...].exe'←[0m
←[31mRun [...] output←[0m

Full logs

Example 1:

Gecko Test@DESKTOP-MPGSA94 /c/mozilla-source/mozilla-unified
$ moz-phab patch D123456
←[K←[33mRevision D123456 has child commits.  Would you like to patch the full stack?.←[0m (YES/No/Always)? n
←[KPatching revision: D123456
Checking out 4b6fe8e386ff.. /. -\
Cancelled
←[K

Example 2:

Gecko Test@DESKTOP-MPGSA94 /c/mozilla-source/mozilla-unified
$ moz-phab patch D172947 --apply-to central && ./mach clobber && ./mach build && ./mach run
C:\mozilla-build\python3\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
←[K←[31mFileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\\mozilla-build\\python3\\Scripts\\moz-phab.exe\\moz-phab.exe' -> 'C:\\mozilla-build\\python3\\Scripts\\moz-phab.exe\\moz-phab-temp.exe'←[0m
←[31mRun moz-phab again with '--trace' to show debugging output←[0m

It looks like the ANSI Escape Sequences aren't being interpreted correctly. Can you check if you have HKEY_CURRENT_USER\Console\VirtualTerminalLevel=1 set in your registry? (https://wiki.mozilla.org/MozillaBuild#Technical_Details)

Are you using anything else to wrap the shell? Your MozillaBuild shell does not look like mine does on Windows 10.

Flags: needinfo?(ayeddi)

If you just want the problem to go away, you should be able to set NO_ANSI=1 in your environment and the ANSI Escape Sequences will go away, (but you won't see colored output). We should be able to resolve this by digging in to it, though (and get you working colored output).

Product: mozilla.org → Firefox Build System

(In reply to Alex Hochheiden [:ahochheiden] from comment #1)

It looks like the ANSI Escape Sequences aren't being interpreted correctly. Can you check if you have HKEY_CURRENT_USER\Console\VirtualTerminalLevel=1 set in your registry? (https://wiki.mozilla.org/MozillaBuild#Technical_Details)

Are you using anything else to wrap the shell? Your MozillaBuild shell does not look like mine does on Windows 10.

Alex, thank you for the reminder - the subkey was not set in my registry, I added it manually but the behavior did not change for me. I do not have any other wraps, the shell was installed from the Building Firefox on Windows source docs and I just followed the docs step by step. Do you think filing a docs bug to mention that the subkey needs to be checked would be helpful?

Also, my Windows is 11 Pro (build 10.0.22621) - I'm curious now why would Bugzilla fill it in as Win 10? I'm updating the bug info now.

Flags: needinfo?(ayeddi)
OS: Windows 10 → Windows 11

(In reply to Anna Yeddi [:ayeddi] ❌ On leave till May 7 ❌ from comment #3)

(In reply to Alex Hochheiden [:ahochheiden] from comment #1)

It looks like the ANSI Escape Sequences aren't being interpreted correctly. Can you check if you have HKEY_CURRENT_USER\Console\VirtualTerminalLevel=1 set in your registry? (https://wiki.mozilla.org/MozillaBuild#Technical_Details)

Are you using anything else to wrap the shell? Your MozillaBuild shell does not look like mine does on Windows 10.

Alex, thank you for the reminder - the subkey was not set in my registry, I added it manually but the behavior did not change for me. I do not have any other wraps, the shell was installed from the Building Firefox on Windows source docs and I just followed the docs step by step. Do you think filing a docs bug to mention that the subkey needs to be checked would be helpful?

The MozillaBuild installer for 4.0.2 sets the registry value itself, so it shouldn't need to be mentioned in the setup docs, I'm just using it as a troubleshooting step. That fact that it wasn't there, and that setting it didn't change anything is odd. What version of MozillaBuild are you running? There should be a VERSION file in the directory you installed it in.

Also, can you check if you have a MozillaBuild environment variable set maybe pointing to an older version?

Also, my Windows is 11 Pro (build 10.0.22621) - I'm curious now why would Bugzilla fill it in as Win 10? I'm updating the bug info now.

I'm not sure. I think Bugzilla just might not be able to differentiate between Windows 10 and 11? (Your build number does start with 10, but that's the Windows 11 up-to-date build number).

I also can't reproduce your issue on my Windows 11 Pro machine (build 22621.1555). I was going through the CMD settings and trying different "Default Profile"s, but that didn't stop the ANSI escape sequences from being interpreted.

Maybe try re-installing MozillaBuild version 4.0.2 and see if that helps. Let's remove the registry key prior to doing that as well and seeing if the installation re-adds it as expected.

Flags: needinfo?(ayeddi)

(In reply to Alex Hochheiden [:ahochheiden] from comment #4)

Maybe try re-installing MozillaBuild version 4.0.2 and see if that helps. Let's remove the registry key prior to doing that as well and seeing if the installation re-adds it as expected.

Hi Alex, apologies for the delay in replying. After returning from the leave I ran all possible updates and re-installed the MozillaBuild v.4.0.2 as you recommended and the moz-phab and other commands are working as magic now, updating the symbols as expected. I'll close the bug as WFM.

Thank you for your patience and through guidance!

Status: NEW → RESOLVED
Closed: 2 years ago
Flags: needinfo?(ayeddi)
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: