l10n.py doesn't show "Missing file" errors in some cases as it hits a python error first

RESOLVED FIXED in Firefox 52

Status

defect
RESOLVED FIXED
3 years ago
a year ago

People

(Reporter: aleth, Assigned: aleth)

Tracking

unspecified
mozilla52

Firefox Tracking Flags

(firefox52 fixed)

Details

Attachments

(1 attachment, 1 obsolete attachment)

Assignee

Description

3 years ago
Example: https://ftp.mozilla.org/pub/thunderbird/nightly/2016/10/2016-10-18-15-07-14-comm-central-l10n/comm-central-linux64-l10n-nightly-el-bm72-build1-build1923.txt.gz
Traceback (most recent call last):
  File "/builds/slave/tb-c-cen-l64-l10n-ntly-0000000/build/comm-central/mozilla/toolkit/mozapps/installer/l10n-repack.py", line 60, in <module>
    main()
  File "/builds/slave/tb-c-cen-l64-l10n-ntly-0000000/build/comm-central/mozilla/toolkit/mozapps/installer/l10n-repack.py", line 56, in main
    non_resources=args.non_resource, non_chrome=NON_CHROME)
  File "/builds/slave/tb-c-cen-l64-l10n-ntly-0000000/build/comm-central/mozilla/python/mozbuild/mozpack/packager/l10n.py", line 250, in repack
    _repack(app_finder, l10n_finder, copier, formatter, non_chrome)
  File "/builds/slave/tb-c-cen-l64-l10n-ntly-0000000/build/comm-central/mozilla/python/mozbuild/mozpack/packager/l10n.py", line 171, in _repack
    os.path.join(l10n_finder.base, path))
AttributeError: 'ComposedFinder' object has no attribute 'base'
make[1]: *** [repackage-zip] Error 1

Setting an empty base on ComposeFinder leads to actual missing files being reported in the log (from http://searchfox.org/mozilla-central/source/python/mozbuild/mozpack/packager/l10n.py#170).
Assignee

Updated

3 years ago
See Also: → 1311115
Assignee

Comment 1

3 years ago
It's possible this is a very specific problem, so maybe a simple fix like this this would be best?
Attachment #8802259 - Flags: review?(mh+mozilla)
Assignee

Updated

3 years ago
Assignee: nobody → aleth
Status: NEW → ASSIGNED
Comment on attachment 8802259 [details] [diff] [review]
Ensure missing file errors get reported despite missing base path in l10n.py

Review of attachment 8802259 [details] [diff] [review]:
-----------------------------------------------------------------

::: python/mozbuild/mozpack/packager/l10n.py
@@ +167,5 @@
>              files = [f for p, f in l10n_finder.find(path)]
>              if not len(files):
>                  if base not in non_chrome:
> +                    finderBase = ""
> +                    if base in l10n_finder:

This is not the right test to ensure that l10n_finder.base exists. The right test would be hasattr(l10n_finder, 'base')
Attachment #8802259 - Flags: review?(mh+mozilla)
Assignee

Comment 3

3 years ago
Ooops, thanks! The bug this was intended to help with has since been fixed, but it probably doesn't hurt to have this.
Attachment #8804242 - Flags: review?(mh+mozilla)
Assignee

Updated

3 years ago
Attachment #8802259 - Attachment is obsolete: true
Attachment #8804242 - Flags: review?(mh+mozilla) → review+
Assignee

Comment 4

3 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/e47ad07f2d527ca78a01f022c177df8437b03b6a
Bug 1311122 - Ensure missing file errors get reported despite missing base path in l10n.py. r=glandium

Comment 5

3 years ago
Pushed by aleth@instantbird.org:
https://hg.mozilla.org/integration/mozilla-inbound/rev/e47ad07f2d52
Ensure missing file errors get reported despite missing base path in l10n.py. r=glandium

Comment 6

3 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/e47ad07f2d52
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52

Updated

a year ago
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.