Closed Bug 1645779 Opened 5 years ago Closed 5 years ago

intl/icu_sources_data.py broken after switching "mach python" to python3

Categories

(Core :: JavaScript: Internationalization API, defect)

Other
Linux
defect

Tracking

()

RESOLVED FIXED
mozilla79
Tracking Status
firefox-esr68 --- unaffected
firefox77 --- unaffected
firefox78 --- unaffected
firefox79 --- fixed

People

(Reporter: dan, Assigned: rstewart)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

After changes from bug 1621960 the intl/icu_sources_data.py script fails to run with

Updating ICU sources lists...
Traceback (most recent call last):
  File "intl/icu_sources_data.py", line 291, in <module>
    main()
  File "intl/icu_sources_data.py", line 284, in main
    update_sources(topsrcdir)
  File "intl/icu_sources_data.py", line 181, in update_sources
    for s in get_sources_from_makefile(makefile)]
  File "intl/icu_sources_data.py", line 139, in get_sources_from_makefile
    import pymake.parser
  File "/home/sharkcz/projects/firefox/build/mach_bootstrap.py", line 476, in __call__
    module = self._original_import(name, globals, locals, fromlist, level)
  File "/home/sharkcz/projects/firefox/build/pymake/pymake/parser.py", line 37, in <module>
    import data, functions, util, parserdata
  File "/home/sharkcz/projects/firefox/build/mach_bootstrap.py", line 476, in __call__
    module = self._original_import(name, globals, locals, fromlist, level)
ModuleNotFoundError: No module named 'data'

We need to run the script on big endian platforms to generate the right data file (see bug 1264836 and bug 1642184).

Regressions: 1621960

You can run python2 mach python intl/icu_sources_data.py in the meantime.

Component: Internationalization → JavaScript: Internationalization API

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

You can run python2 mach python intl/icu_sources_data.py in the meantime.

Thanks, it helps.

FYI, we have documentation on updating ICU now. We discussed in bug 1642505 whether to document the use of icu_sources_data.py and largely decided to keep it simple -- invoking that subscript directly (and therefore having to think about Python 2 versus Python 3) is largely a power-user obscure feature.

It's best if you follow the steps in that file when doing updates/rebuilds of this stuff, because that document -- now that it exists -- is the source of truth on how to do things. And I for one intend to lean heavily on it so that I can forget everything I had to relearn in order to write it. :-)

Side note, each time I run icu_sources_data.py, I have to hack away the GNU-ism of --output-sync, 'cause on a mac, it seems to want to find bsd make instead of gnu make.

I'm happy to take a patch to fix that in some sensible fashion. :-) (I think someone complained about this in another bug as well, maybe even it was you, but I don't know the platform distinctions well enough to write a patch that preserves the current behavior as far as that's possible.)

Depends on: 1646112

I think there's a quick fix, testing now, with any luck I'll have a patch shortly.

This removes a dependency on pymake, which is Python 2-only, and thoroughly unnecessary since we just use it to find assignments of the form OBJECTS = .... We can replicate this logic by just isolating lines that begin with that literal string, and everything else can stay the same. This is definitionally more brittle than actually using a parser, but it works fine for now, and the original implementation wasn't significantly better (it didn't handle any form of dynamism, anything more complicated than a single unconditional assignment with a space-separated list of literal strings representing outputs, etc.)

Assignee: nobody → rstewart
Blocks: 1646190

My quick test shows that the change from comment 7 works fine (Fedora 32 on s390x, without any Python2).

Pushed by rstewart@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d6b0857e2fa1 Make icu_sources_data.py Python 3-compliant r=jwalden,anba
Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla79

This should be marked Regressed By bug 1621960. It's backwards.

link updated

Regressed by: 1621960
No longer regressions: 1621960
Has Regression Range: --- → yes

Set release status flags based on info from the regressing bug 1621960

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

Attachment

General

Creator:
Created:
Updated:
Size: