Closed Bug 1800171 Opened 2 years ago Closed 2 years ago

non-ASCII characters of hg outputs are not displayed correctly with MozillaBuild 4.0.2

Categories

(Firefox Build System :: MozillaBuild, defect)

x86_64
Windows 11
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: masayuki, Assigned: ahochheiden)

References

(Regression)

Details

(Keywords: intl, regression)

Attachments

(1 file)

In MozillaBuild 4.0.2 (I use the terminal in vscode), hg outputs gets broken if it contains Japanese characters like:

$ hg --version
Mercurial - 蛻・淵讒区・邂。逅・ヤ繝シ繝ォ(繝舌・繧ク繝ァ繝ウ 6.2.3)
(隧ウ邏ー縺ッ https://mercurial-scm.org 繧貞盾辣ァ)

Copyright (C) 2005-2022 Olivia Mackall and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

However, I got result of hg log -r central correctly:

$ hg log -r central
リビジョン:   742345:963d3b67f524
fxtree:      central
ユーザ:       Tim Giles <tgiles@mozilla.com>
日付:         Thu Nov 10 14:43:54 2022 +0000
要約:         Bug 1797509 - Add help text for determining harness specific arguments. r=ahal

I don't know why these command gets different result.

I got same result in "Windows Terminal".

IIRC, before MozillaBuild 4.0.2, Mercurial was not localized on Windows.

Summary: non-ASCII characters of hg outputs are not displayed correctly → non-ASCII characters of hg outputs are not displayed correctly with MozillaBuild 4.0.2
Duplicate of this bug: 1800554

Does the problem go away on MozillaBuild 4.0.1?
What happens if you downgrade your version of Mercurial in MozillaBuild 4.0.2? (python3 -m pip install mercurial==6.1)
Can you also try changing the registry value at HKCU\Console\VirtualTerminalLevel (delete it, or set it to 0)?

Glandium and I are seeing different results, so I'm just trying to get more info on the behavior you're seeing.

Flags: needinfo?(masayuki)

Thank you for the investigation. Oddly, I cannot reproduce this today (before testing what you said, I checked current behavior). I rebooted my system yesterday, it could've "fixed" this issue.

Sorry for the bug spams.

-> WFM

Status: NEW → RESOLVED
Closed: 2 years ago
Flags: needinfo?(masayuki)
Resolution: --- → WORKSFORME

Is it displaying English or correct Japanese now?

Flags: needinfo?(masayuki)

I still reproduces for me today:

$ hg --version
Mercurial - 蛻・淵讒区・邂。逅・ヤ繝シ繝ォ(繝舌・繧ク繝ァ繝ウ 6.2.3)
(隧ウ邏ー縺ッ https://mercurial-scm.org 繧貞盾辣ァ)

Copyright (C) 2005-2022 Olivia Mackall and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

(In reply to Mike Hommey [:glandium] from comment #6)

Is it displaying English or correct Japanese now?

Correct Japanese text now.

Flags: needinfo?(masayuki)

did you switch your console to the utf-8 codepage?

I'm reopening, BTW, because I can still reproduce, and so does Brian. As a workaround, you can remove hg.exe in $mozilla-build/python3/Scripts, but please note that has other downsides. Another workaround is to remove the locales from $mozilla-build/python3/lib/site-packages/mercurial/locale

Status: RESOLVED → REOPENED
Flags: needinfo?(masayuki)
Resolution: WORKSFORME → ---

No, I did nothing special at least for settings of python, mercurial, etc which are used for developing m-c.

Flags: needinfo?(masayuki)

Oh, restarting vscode causes this bug back...

Can you try deleting the locale folder at $mozilla-build/python3/lib/site-packages/mercurial/locale and seeing if that resolves it? It looks like pip didn't provide the locale folder for mercurial before 6.2.3. It does look like there's a bad interaction between MSYS2 and the locales, but that might have always been there, and I'm not too keen on digging into what the cause is at this time (that definitely sound like a rabbit hole). If removing the locale folder 'fixes' the problem, we're essentially just going back to what previous versions of MozillaBuild provided. Which means we can just remove the locale during packageit.py when creating the MozillaBuild installer, and that should prevent this problem in future releases.

Ideally we do find and fix the root cause eventually, but I think for now that's the pragmatic solution to this.

Flags: needinfo?(masayuki)

Right. Renaming locale makes the output written in English. I think that it's no problem to make Mercurial work only with English because English ability is required in the further process like review in Phabricator.

Flags: needinfo?(masayuki)
Assignee: nobody → ahochheiden
Attachment #9304540 - Attachment description: Bug 1800171 - Remove 'locale' directory after pip install of `mercurial` to workaround and `MSYS2` issue r?#build → Bug 1800171 - Remove 'locale' directory after pip install of `mercurial` to workaround an `MSYS2` issue r?#build

Pushed by ahochheiden@mozilla.com:
https://hg.mozilla.org/mozilla-build/rev/6ccb9ec541fb
Remove 'locale' directory after pip install of mercurial to workaround an MSYS2 issue r=firefox-build-system-reviewers,glandium

Status: REOPENED → RESOLVED
Closed: 2 years ago2 years ago
Resolution: --- → FIXED
Product: mozilla.org → Firefox Build System

When will this fix be released? I hit this bug when I bought a new machine. Renaming locale worked around the problem.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: