Compile failures in Configuration.py: object has no attribute 'isEnum'

UNCONFIRMED
Unassigned

Status

()

Core
DOM
UNCONFIRMED
5 years ago
5 years ago

People

(Reporter: rkent, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

5 years ago
I'm getting regular compilation errors when I rerun pymake on a comm-central debug build. The errors are like:

c:\tb\central\tb-pydebug\mozilla\dom\bindings\Makefile:110:0$ PYTHONDONTWRITEBYTECODE=1 c:/tb/central/tb-pydebug/mozilla
/_virtualenv/Scripts/python.exe c:/tb/central/src/mozilla/config/pythonpath.py \
  -Ic:/tb/central/src/mozilla/other-licenses/ply -Ic:/tb/central/src/mozilla/dom/bindings/parser \
  c:/tb/central/src/mozilla/dom/bindings/BindingGen.py header \
  c:/tb/central/src/mozilla/dom/bindings/Bindings.conf TestTypedefBinding \
  TestTypedef.webidl
c:\tb\central\tb-pydebug\mozilla\dom\bindings\Makefile:110:0$ PYTHONDONTWRITEBYTECODE=1 c:/tb/central/tb-pydebug/mozilla
/_virtualenv/Scripts/python.exe c:/tb/central/src/mozilla/config/pythonpath.py \
  -Ic:/tb/central/src/mozilla/other-licenses/ply -Ic:/tb/central/src/mozilla/dom/bindings/parser \
  c:/tb/central/src/mozilla/dom/bindings/BindingGen.py header \
  c:/tb/central/src/mozilla/dom/bindings/Bindings.conf TestDictionaryBinding \
  TestDictionary.webidl
Traceback (most recent call last):
  File "c:/tb/central/src/mozilla/config/pythonpath.py", line 56, in <module>
    main(sys.argv[1:])
  File "c:/tb/central/src/mozilla/config/pythonpath.py", line 48, in main
    execfile(script, frozenglobals)
  File "c:/tb/central/src/mozilla/dom/bindings/BindingGen.py", line 69, in <module>
    main()
  File "c:/tb/central/src/mozilla/dom/bindings/BindingGen.py", line 58, in main
    config = Configuration(configFile, parserData)
  File "c:\tb\central\src\mozilla\dom\bindings\Configuration.py", line 63, in __init__
    self.enums = [e for e in parseData if e.isEnum()]
AttributeError: 'list' object has no attribute 'isEnum'

I can fix this by touching dom/bindings/parser/WebIDL.py

Although the error is occurring typically for me on a full remake of the entire tree, I get the same error when I run make.py in the directory mozilla/dom/bindings

It also works on a clobber build.
When this happens, why exactly is "e" a list? That shouldn't be the case.  What's it a list of?
(Reporter)

Comment 2

5 years ago
Here's another variation of the same problem. Once again, it is fixed if I touch WebIDL.py, then make.py on dom/bindings/ then make.py the entire tree.

c:\tb\1-central\tb-pydebug\mozilla\dom\bindings\Makefile:110:0$ PYTHONDONTWRITEBYTECODE=1 c:/tb/1-central/tb-pydebug/moz
illa/_virtualenv/Scripts/python.exe c:/tb/1-central/src/mozilla/config/pythonpath.py \
  -Ic:/tb/1-central/src/mozilla/other-licenses/ply -Ic:/tb/1-central/src/mozilla/dom/bindings/parser \
  c:/tb/1-central/src/mozilla/dom/bindings/BindingGen.py header \
  c:/tb/1-central/src/mozilla/dom/bindings/Bindings.conf TestDictionaryBinding \
  TestDictionary.webidl
c:\tb\1-central\tb-pydebug\mozilla\dom\bindings\Makefile:110:0$ PYTHONDONTWRITEBYTECODE=1 c:/tb/1-central/tb-pydebug/moz
illa/_virtualenv/Scripts/python.exe c:/tb/1-central/src/mozilla/config/pythonpath.py \
  -Ic:/tb/1-central/src/mozilla/other-licenses/ply -Ic:/tb/1-central/src/mozilla/dom/bindings/parser \
  c:/tb/1-central/src/mozilla/dom/bindings/BindingGen.py header \
  c:/tb/1-central/src/mozilla/dom/bindings/Bindings.conf TestTypedefBinding \
  TestTypedef.webidl
Traceback (most recent call last):
  File "c:/tb/1-central/src/mozilla/config/pythonpath.py", line 56, in <module>
    main(sys.argv[1:])
  File "c:/tb/1-central/src/mozilla/config/pythonpath.py", line 48, in main
    execfile(script, frozenglobals)
  File "c:/tb/1-central/src/mozilla/dom/bindings/BindingGen.py", line 69, in <module>
    main()
  File "c:/tb/1-central/src/mozilla/dom/bindings/BindingGen.py", line 54, in main
    parserData = cPickle.load(f)
TypeError: unhashable type: 'dict'
Hmm.  There was a race around this stuff with pymake at some point.  Maybe comm-central is still hitting it somehow?
(Reporter)

Comment 4

5 years ago
(In reply to Boris Zbarsky (:bz) from comment #3)
> Hmm.  There was a race around this stuff with pymake at some point.  Maybe
> comm-central is still hitting it somehow?

That sounds likely. Not sure what to do with it though. Unless other people start to hit it, I'll probably just insert a workaround in my standard compile scripts.

Should I move the bug to comm-central build component?
Let's see what Kyle has to say?
Sounds like the pickle is getting corrupted somehow.  Next time it happens see if removing ParserResults.pkl (and not touching anything else) is sufficient to fix?
(Reporter)

Comment 7

5 years ago
So here is my latest, starting from the errors in comment 2.

"removing ParserResults.pkl" allows a successful bindings directory build:

make.py -C mozilla/dom/bindings

But the standard comm-central build command:

(in src directory) make.py -f client.mk build

still fails with the same error. I was able to get it to successfully build with the following sequence:

make.py -C mozilla/dom/bindings
make.py -C mozilla/dom
make.py -C mozilla
(can't recall if I did make.py)
make.py -f client.mk build

However, I immediately did another test, with no source code changes, using make.py -f client.mk build and the build failed again, this time with the error:

c:\tb\1-central\tb-pydebug\mozilla\dom\bindings\Makefile:110:0$ PYTHONDONTWRITEBYTECODE=1 c:/tb/1-central/tb-pydebug/moz
illa/_virtualenv/Scripts/python.exe c:/tb/1-central/src/mozilla/config/pythonpath.py \
  -Ic:/tb/1-central/src/mozilla/other-licenses/ply -Ic:/tb/1-central/src/mozilla/dom/bindings/parser \
  c:/tb/1-central/src/mozilla/dom/bindings/BindingGen.py header \
  c:/tb/1-central/src/mozilla/dom/bindings/Bindings.conf TestDictionaryBinding \
  TestDictionary.webidl
Traceback (most recent call last):
  File "c:/tb/1-central/src/mozilla/config/pythonpath.py", line 56, in <module>
    main(sys.argv[1:])
  File "c:/tb/1-central/src/mozilla/config/pythonpath.py", line 48, in main
    execfile(script, frozenglobals)
  File "c:/tb/1-central/src/mozilla/dom/bindings/BindingGen.py", line 69, in <module>
    main()
  File "c:/tb/1-central/src/mozilla/dom/bindings/BindingGen.py", line 54, in main
    parserData = cPickle.load(f)
TypeError: unhashable type: 'set'
(Reporter)

Comment 8

5 years ago
Sid: I don't know if this is peculiar to comm-central or not, but bugs like this are about to make me abandon my experiment in pymake in my development environment. The time lost tracking down pymake-specific issues does not compensate for the faster build times for me.
You need to log in before you can comment on or make changes to this bug.