Closed Bug 935741 Opened 11 years ago Closed 11 years ago

Bootstrap: Mercurial version detection broken when Mercurial is in italian language

Categories

(Firefox Build System :: General, defect)

27 Branch
x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla28

People

(Reporter: desantis.maurizio, Assigned: desantis.maurizio)

Details

(Whiteboard: [bugday-20131106])

Attachments

(1 file, 1 obsolete file)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:27.0) Gecko/20100101 Firefox/27.0 (Beta/Release) Build ID: 20131024054843 Steps to reproduce: Ubuntu 13.10 - italian language Mercurial installed with italian locale (hg --version outputs: Mercurial SCM Distribuito (versione 2.7.2) ) python python/mozboot/bin/bootstrap.py Actual results: Display: ERROR: Unable to identify Mercurial version. We attempted to upgrade Mercurial to a modern version (2.5 or newer). However, you appear to have version None still. It's possible your package manager doesn't support a modern version of Mercurial. It's also possible Mercurial is not being installed in the search path for this shell. Try creating a new shell and run this bootstrapper again. If it continues to fail, consider installing Mercurial by following the instructions at http://mercurial.selenic.com/. Expected results: Display: Your version of Mercurial (2.7.2) is sufficiently modern.
Attached patch Fix (obsolete) — Splinter Review
Assignee: nobody → desantis.maurizio
Status: UNCONFIRMED → ASSIGNED
Component: Untriaged → Build Config
Ever confirmed: true
Product: Firefox → Core
Whiteboard: [bugday-20131106]
Comment on attachment 828290 [details] [diff] [review] Fix Review of attachment 828290 [details] [diff] [review]: ----------------------------------------------------------------- One-offing Italian is not a sufficient fix. What about German, Russian, French, ... If we're going to do this, we should do it right. I'm not sure how Mercurial does it's localization, but we should attempt to set an environment variable to force English or something. Alternatively, we could change the version detection string to look for \d+\.\d+\.\d+ or something.
Attachment #828290 - Flags: review-
(In reply to Gregory Szorc [:gps] from comment #2) > One-offing Italian is not a sufficient fix. What about German, Russian, > French, ... I agree, sorry for the poor quality of my patch, I did it without thinking about implications > I'm not sure how Mercurial does it's localization, but we should attempt > to set an environment variable to force English or something. I tried to use LANG=C hg --version and I still have "versione" instead of "version" > Alternatively, we could change the version > detection string to look for \d+\.\d+\.\d+ or something. Probably this is the best way, maybe restricting the regex scan to the first line of the output, in order to avoid false positives in an hypotetic future change of the hg --version output
I did some source code diving. `HGPLAIN=1 hg --version` should work (at least with sufficiently modern versions of Mercurial). The docs say "the output should be stable, reproducible and suitable for use in scripts or applications." This sounds like exactly what we want!
It works! HGPLAIN=1 hg --version outputs: Mercurial Distributed SCM (version 2.7.2) I'll upload a new patch
Fix using HGPLAIN
Attachment #828290 - Attachment is obsolete: true
Attachment #829661 - Flags: review+
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: