Closed Bug 1411169 Opened 7 years ago Closed 7 years ago

make pkg step busted : TypeError: 'str' object does not support item assignment

Categories

(SeaMonkey :: Build Config, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
seamonkey2.55

People

(Reporter: ewong, Assigned: ewong)

Details

Attachments

(1 file)

current make_pkg step bustage:

cat /builds/slave/c-cen-t-lnx/build/suite/locales/en-US/updater/updater.ini | \
  sed -e 's/^InfoText=/Info=/' -e 's/^TitleText=/Title=/' | \
  sed -e 's/%MOZ_APP_DISPLAYNAME%/SeaMonkey/' > \
  ../../dist/xpi-stage/locale-en-US/updater.ini
../../config/nsinstall -t -m 644 /builds/slave/c-cen-t-lnx/build/suite/locales/en-US/crashreporter/crashreporter-override.ini ../../dist/xpi-stage/locale-en-US
make[4]: Leaving directory `/builds/slave/c-cen-t-lnx/build/objdir/suite/locales'
Making langpack /builds/slave/c-cen-t-lnx/build/objdir/dist/linux-i686/xpi/seamonkey-2.55a1.en-US.langpack.xpi
../../config/nsinstall -D ../../dist/linux-i686/xpi/
/builds/slave/c-cen-t-lnx/build/objdir/_virtualenv/bin/python -m mozbuild.action.langpack_manifest --locales en-US --min-app-ver 2.55a1 --max-app-ver 2.55a1 --app-name "SeaMonkey" --l10n-basedir "/builds/.mozbuild/l10n-central" --defines /builds/slave/c-cen-t-lnx/build/mozilla/toolkit/locales/en-US/defines.inc /builds/slave/c-cen-t-lnx/build/suite/locales/en-US/defines.inc  --input ../../dist/xpi-stage/locale-en-US
Traceback (most recent call last):
  File "/tools/python27/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/tools/python27/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/builds/slave/c-cen-t-lnx/build/mozilla/python/mozbuild/mozbuild/action/langpack_manifest.py", line 445, in <module>
    main(sys.argv[1:])
  File "/builds/slave/c-cen-t-lnx/build/mozilla/python/mozbuild/mozbuild/action/langpack_manifest.py", line 439, in main
    chrome_entries
  File "/builds/slave/c-cen-t-lnx/build/mozilla/python/mozbuild/mozbuild/action/langpack_manifest.py", line 391, in create_webmanifest
    cr[entry['alias']][platform] = entry['path']
TypeError: 'str' object does not support item assignment
make[3]: *** [langpack-en-US] Error 1
make[3]: Leaving directory `/builds/slave/c-cen-t-lnx/build/objdir/suite/locales'
make[2]: *** [libs] Error 2
make[2]: Leaving directory `/builds/slave/c-cen-t-lnx/build/objdir/suite/installer'
make[1]: *** [default] Error 2
make[1]: Leaving directory `/builds/slave/c-cen-t-lnx/build/objdir/suite/installer'
make: *** [package] Error 2
DEBUG: shell: unmounting all filesystems
Summary: make pkg step busted → make pkg step busted : TypeError: 'str' object does not support item assignment
The error stems from the following file: https://hg.mozilla.org/comm-central/file/tip/suite/locales/jar.mn

particularly the following lines:

% locale communicator-platform @AB_CD@ %locale/@AB_CD@/communicator-platform/gtk/
% locale communicator-platform @AB_CD@ %locale/@AB_CD@/communicator-platform/mac/ os=Darwin
% locale communicator-platform @AB_CD@ %locale/@AB_CD@/communicator-platform/win/ os=WINNT

The following lines in langpack_manifest.py:

390            if platforms:
391                if entry['alias'] not in cr:
392                    cr[entry['alias']] = {}
393                for platform in platforms:
394                    cr[entry['alias']][platform] = entry['path']
395            else:
396                assert entry['alias'] not in cr
397                cr[entry['alias']] = entry['path']

Since platforms for the first line isn't defined, it assigns cr[entry['alias']] to the string entry['path'].
entry['alias'] being communicator-platform.  entry['path'] = communicator-platform/gtk/

When it goes to the 2nd line, it sees a platform and checks if the entry['alias'] is not in cr.
if it isn't, it makes cr[entry['alias']] into a dictionary.  However, since "communicator-platform"
already exists, it skips that and goes to assigning cr[entry['alias']][platform] = entry['path']
BUT cr[entry['alias']] is a string "communicator-platform" and thus, it fails.

Solutions:
1) add os=LikeUnix to all gtk/ lines in all jar.mn files
    - this should avoid anything in the else statement
    - it was assumed that not specifying the os, it defaults to Linux.
      we need to explicitly state this now.

2) a) in line 397, have cr[entry['alias']] = {'linux': entry['path']}
      (assuming it should even defaulted to linux.)
   or b) add a check after line 392 to see if cr[entry['alias']] is not 
         a dictionary.  If it isn't, make it a dictionary by something
         like:
                       if not isinstance(cr[entry['alias']], dict):
                           tmp = cr[entry['alias']]
                           cr[entry['alias']] = {'linux': tmp}

   [ however, this means modifying m-c code... so will need to ping kmag ]

:kmag, given the above..  what would you prefer?
Flags: needinfo?(kmaglione+bmo)
Attachment #8921365 - Flags: review?(rsx11m.pub)
Assignee: nobody → ewong
Status: NEW → ASSIGNED
Comment on attachment 8921365 [details] [diff] [review]
proposed c-c patch

Looks reasonable (at least as a workaround, pending further action from discussion with kmag) and is similarly used in other contexts.
Attachment #8921365 - Flags: review?(rsx11m.pub) → review+
I'd prefer that we define a platform for all entries if we're going to define one for any.
Flags: needinfo?(kmaglione+bmo)
Pushed by ewong@pw-wspx.org:
https://hg.mozilla.org/comm-central/rev/902ffcc65c27
Add os=LikeUnix to gtk/ entries in jar.mn r=rsx11m
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → seamonkey2.55
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: