Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(100)

Issue 425953002: IDL parser: fix rebuilding of (stale) cached lexer tables (Closed)

Created:
6 years, 4 months ago by Jens Widell
Modified:
6 years, 4 months ago
CC:
blink-reviews, blink-reviews-bindings_chromium.org, arv+blink, abarth-chromium
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Project:
blink
Visibility:
Public.

Description

IDL parser: fix rebuilding of (stale) cached lexer tables The PLY lexer caches its table as a Python module (lextab.py). The cache is loaded by attempting to import the module, which succeeds if there's a lextab.py{,c,o} anywhere in the Python path. If the import succeeds, the cache is assumed by PLY to be up-to-date, so to update the cache, we need to remove those files before calling PLY to initialize the lexer. This patch makes blink_idl_lexer.main() do just that. It also extends blink_idl_parser.main() to call the former, since the GYP (and GN) build systems only actually call the latter script. BUG=397909 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=179129

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+25 lines, -3 lines) Patch
M Source/bindings/scripts/blink_idl_lexer.py View 4 chunks +22 lines, -2 lines 1 comment Download
M Source/bindings/scripts/blink_idl_parser.py View 2 chunks +3 lines, -1 line 0 comments Download

Messages

Total messages: 7 (0 generated)
Jens Widell
PTAL Similar to https://codereview.chromium.org/332683004, but handles the other half of the IDL parser (i.e. the ...
6 years, 4 months ago (2014-07-29 09:42:59 UTC) #1
haraken
LGTM
6 years, 4 months ago (2014-07-29 10:03:51 UTC) #2
Jens Widell
The CQ bit was checked by jl@opera.com
6 years, 4 months ago (2014-07-29 10:54:04 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jl@opera.com/425953002/1
6 years, 4 months ago (2014-07-29 10:55:10 UTC) #4
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: win_blink_rel on tryserver.blink ...
6 years, 4 months ago (2014-07-29 11:36:08 UTC) #5
commit-bot: I haz the power
Change committed as 179129
6 years, 4 months ago (2014-07-29 12:17:48 UTC) #6
Nils Barth (inactive)
6 years, 4 months ago (2014-07-29 16:00:25 UTC) #7
Message was sent while issue was closed.
Quick style note.

https://codereview.chromium.org/425953002/diff/1/Source/bindings/scripts/blin...
File Source/bindings/scripts/blink_idl_lexer.py (right):

https://codereview.chromium.org/425953002/diff/1/Source/bindings/scripts/blin...
Source/bindings/scripts/blink_idl_lexer.py:111: unlink(tablefile)
FWIW, cleaner would be a loop through suffixes, which avoids needing a helper
function:

tablefile_root = os.path.join(outputdir, 'lextab')
for ext in ('.py', '.pyc', '.pyo'):
    try:
        os.unlink(tablefile_root + ext)
    except OSError:
        pass

...and to be really formal, we'd want
LEXTAB = 'lextab'
...and to use that both places.
...but that's a *bit* picky.

Powered by Google App Engine
This is Rietveld 408576698