Cannot run most mach commands when mercurial runs against Python 3.11: .hgignore: invalid pattern (relre): (?i)(^|/)TAGS$
Categories
(Firefox Build System :: Mach Core, defect)
Tracking
(Not tracked)
People
(Reporter: jlorenzo, Unassigned)
References
(Blocks 1 open bug)
Details
I'm filing this bug just for the sake of documenting what happens. The real fix is likely on the Mercurial side. I just filed a bug on their bugzilla instance[1].
macOS users on Brew now get mercurial installed on Python 3.11[2]. So anyone who runs brew upgrade
will face this bug no matter what Python version they use to run mach
. I recommend reinstalling an earlier version:
cd "$(brew --prefix)/Library/Taps/homebrew/homebrew-core/Formula"
git checkout 37e85eab944e8d72e1048bc4c9ca38ff0ae00e2e -- mercurial.rb
brew reinstall mercurial
There's a line in our .hgignore
[3] that now breaks Mercurial. I don't think this line should be fixed on our end. For more info, see the hg bug.
[1] https://bz.mercurial-scm.org/show_bug.cgi?id=6759
[2] https://github.com/Homebrew/homebrew-core/commit/f0a032259231526eb1cf1f2c2828562c6e284daf
[3] https://hg.mozilla.org/mozilla-central/file/f130aa968d7eac720e17f4ddef0fec9b57a11d08/.hgignore#l6
Comment 1•1 year ago
|
||
Fixed with a workaround by :Glandium in bug 1800776.
Comment 2•1 year ago
•
|
||
Also, I think this is a somewhat expected change with Python 3.11
: Regex inline flags "not at the start of a regular expression" were deprecated in Python 3.6 and I think removed in Python 3.11.
Though, it seems that our regex in .hgignore
that got caught by this does seem to be at the start of the regular expression, so maybe it's a bug on the Python side in regards to the 'removal' in Python 3.11
?
Reporter | ||
Comment 3•1 year ago
•
|
||
Thanks for finding this dupe, :ahochheiden! It's actually a bug in mercurial. They do a few things with the regexes (like adding .*
at the beginning, and merging all lines in .hgignore
in one big regex). I left more details in the this ticket[1]. I tested their most recent fix[2] and it worked fine on my end.
[1] https://bz.mercurial-scm.org/show_bug.cgi?id=6759
[2] https://foss.heptapod.net/mercurial/mercurial-devel/-/merge_requests/306
Comment 4•1 year ago
|
||
(In reply to Johan Lorenzo [:jlorenzo] from comment #3)
They do a few things with the regexes (like adding
.*
at the beginning, and merging all lines in.hgignore
in one big regex.
Ah okay, that makes sense actually!
I'm sure we'll have to fix plenty of more regular expressions for Python 3.11
compatibility, so keeping concatenation in mind is probably a good idea.
Thanks!
Description
•