Closed
Bug 893976
Opened 12 years ago
Closed 12 years ago
Integrate update-uuids with mach
Categories
(Firefox Build System :: Mach Core, enhancement)
Firefox Build System
Mach Core
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla25
People
(Reporter: Ms2ger, Assigned: glandium)
Details
Attachments
(7 files, 1 obsolete file)
|
8.38 KB,
patch
|
Details | Diff | Splinter Review | |
|
2.05 KB,
patch
|
gps
:
review+
|
Details | Diff | Splinter Review |
|
6.01 KB,
patch
|
gps
:
review+
|
Details | Diff | Splinter Review |
|
3.05 KB,
text/x-python
|
Details | |
|
1.14 KB,
patch
|
ted
:
review+
|
Details | Diff | Splinter Review |
|
3.07 KB,
patch
|
gps
:
review+
|
Details | Diff | Splinter Review |
|
6.02 KB,
patch
|
gps
:
review+
|
Details | Diff | Splinter Review |
Yes, perl, ugh; it works, though.
Attachment #775849 -
Flags: review?(gps)
Comment 1•12 years ago
|
||
You didn't tell me it was new perl! It's been a few years, but I do know perl, so I should be able to review this. I'm treating this as somewhat low in the priority stack. Expect turnaround in a few days.
Comment 2•12 years ago
|
||
(In reply to Gregory Szorc [:gps] from comment #1)
> You didn't tell me it was new perl! It's been a few years, but I do know
> perl, so I should be able to review this. I'm treating this as somewhat low
> in the priority stack. Expect turnaround in a few days.
It's an import of http://people.mozilla.org/~sfink/data/update-uuids
So, it's not new, but it's new to the tree, and has never been reviewed. Poor gps. I didn't exactly write it with review in mind.
| Reporter | ||
Comment 3•12 years ago
|
||
Yeah, it wasn't new to me :) No hurry in getting it reviewed.
| Assignee | ||
Comment 4•12 years ago
|
||
The trend is to *remove* perl code, not add some.
| Reporter | ||
Comment 5•12 years ago
|
||
Yes. This is a pre-existing, useful tool, though. I'd be very happy to see someone rewrite it in python, but I don't know enough perl to do that myself.
Comment 6•12 years ago
|
||
I'm not wild about adding new Perl code anywhere, but adding it for a mach utility is less offensive than adding it to a functional part of the build system, which I would strongly oppose.
| Assignee | ||
Comment 7•12 years ago
|
||
Comment on attachment 775849 [details] [diff] [review]
Patch v1
I have a working prototype in python, which happens to work better in edge cases (the perl implementation is confused with different files containing the same interface, and when doing update-uuids . nsIDOMNode, it skips dom/interfaces/xul/nsIDOMXULDocument.idl, dom/interfaces/xul/nsIDOMXULElement.idl and dom/interfaces/xul/nsIDOMXULTreeElement.idl).
Attachment #775849 -
Flags: review?(gps)
| Assignee | ||
Comment 8•12 years ago
|
||
This is not immediately obvious, but as my prototype uses FileFinder, this makes FileFinder faster for it.
Attachment #778314 -
Flags: review?(gps)
| Assignee | ||
Updated•12 years ago
|
Assignee: Ms2ger → mh+mozilla
| Assignee | ||
Comment 9•12 years ago
|
||
This too makes FileFinder significantly faster.
Attachment #778318 -
Flags: review?(gps)
| Assignee | ||
Comment 10•12 years ago
|
||
This is the prototype implementation, leveraging the python xpidl parser and useful tools from the packager. The non-class part is to integrate within mach. I just didn't know where to put everything.
Flags: needinfo?(gps)
| Reporter | ||
Comment 11•12 years ago
|
||
Comment on attachment 778318 [details] [diff] [review]
Use (cached) regular expressions for mozpack.path.match
Review of attachment 778318 [details] [diff] [review]:
-----------------------------------------------------------------
::: python/mozbuild/mozpack/path.py
@@ +96,5 @@
> '''
> if not pattern:
> return True
> + if not pattern in re_cache:
> + pattern = re.escape(pattern)
Nit: 4-space
Comment 12•12 years ago
|
||
Comment on attachment 778314 [details] [diff] [review]
Allow to skip FileFinder executables detection
Review of attachment 778314 [details] [diff] [review]:
-----------------------------------------------------------------
So I guess this makes it faster because we avoid a file stat completely and just go off info from listdir? Perhaps a comment should be added to FileFinder.__init__ documenting this.
Attachment #778314 -
Flags: review?(gps) → review+
Comment 13•12 years ago
|
||
Comment on attachment 778318 [details] [diff] [review]
Use (cached) regular expressions for mozpack.path.match
Review of attachment 778318 [details] [diff] [review]:
-----------------------------------------------------------------
::: python/mozbuild/mozpack/packager/formats.py
@@ +264,4 @@
> if any(mozpack.path.match(path, p.replace('*', '**'))
> for p in self._non_resources):
> return False
> + path = mozpack.path.split(path)
This chunk seems unrelated to the rest of the patch. Did this accidentally creep in?
Attachment #778318 -
Flags: review?(gps) → review+
Comment 14•12 years ago
|
||
Comment on attachment 778318 [details] [diff] [review]
Use (cached) regular expressions for mozpack.path.match
Review of attachment 778318 [details] [diff] [review]:
-----------------------------------------------------------------
Oh, r+ conditional on 4-space indent :)
| Assignee | ||
Comment 16•12 years ago
|
||
Comment on attachment 778318 [details] [diff] [review]
Use (cached) regular expressions for mozpack.path.match
Review of attachment 778318 [details] [diff] [review]:
-----------------------------------------------------------------
::: python/mozbuild/mozpack/packager/formats.py
@@ +264,4 @@
> if any(mozpack.path.match(path, p.replace('*', '**'))
> for p in self._non_resources):
> return False
> + path = mozpack.path.split(path)
path = mozpack.path.split(mozpack.path.relpath(path, base))
became two separate steps, in between which match is now done. Because match doesn't accept the split patch any more, but the rest of the code requires split path.
| Assignee | ||
Comment 17•12 years ago
|
||
(In reply to Gregory Szorc [:gps] from comment #15)
> I'd put things somewhere under /tools.
For a mach command?
Comment 18•12 years ago
|
||
(In reply to Mike Hommey [:glandium] from comment #17)
> (In reply to Gregory Szorc [:gps] from comment #15)
> > I'd put things somewhere under /tools.
>
> For a mach command?
I don't know where else we'd put it! We already have /tools/mach_commands.py if you don't want to create a new directory.
| Assignee | ||
Comment 19•12 years ago
|
||
I think at this point it makes no sense to keep generating the xpidl_debug parser output, and bothering people with the "Generating LALR tables" message.
Attachment #781576 -
Flags: review?(ted)
| Assignee | ||
Comment 20•12 years ago
|
||
The reason for this is that when running the update-uuid code using the FileFinder, we end up importing buildconfig, which wants to be running from the virtualend and find a config.status. But we also don't actually need buildconfig for anything, so just avoid importing it globally.
Attachment #781577 -
Flags: review?(gps)
| Assignee | ||
Comment 21•12 years ago
|
||
Attachment #781578 -
Flags: review?(gps)
Updated•12 years ago
|
Attachment #781577 -
Flags: review?(gps) → review+
| Reporter | ||
Comment 22•12 years ago
|
||
Comment on attachment 781578 [details] [diff] [review]
Add a mach command to update uuids for specific interfaces and their descendants
Review of attachment 781578 [details] [diff] [review]:
-----------------------------------------------------------------
Thanks!
::: tools/mach_commands.py
@@ +66,5 @@
> + from, what its uuid is, and where in the source file the uuid is.
> + '''
> + def __init__(self, filename, production):
> + import xpidl
> + assert(isinstance(production, xpidl.Interface))
I think 'assert foo' is more idiomatic than 'assert(foo)'.
@@ +157,5 @@
> + @CommandArgument('path', nargs='?',
> + help='Base path under which uuids will be searched (optional).')
> + @CommandArgument('interfaces', nargs='+',
> + help='Changed interfaces whose UUIDs need to be updated. ' +
> + 'Their descendants are updates as well.')
updated
Updated•12 years ago
|
Attachment #781576 -
Flags: review?(ted) → review+
Comment 23•12 years ago
|
||
Comment on attachment 781578 [details] [diff] [review]
Add a mach command to update uuids for specific interfaces and their descendants
Review of attachment 781578 [details] [diff] [review]:
-----------------------------------------------------------------
I kinda wish the code lived outside mach_commands.py, but meh.
::: tools/mach_commands.py
@@ +166,5 @@
> + import mozpack.path
> + from tempfile import mkdtemp
> +
> + # If more than one interface is given, but no path, mach will give
> + # the first interface as 'path'.
I'd just avoid this whole mess by using --path.
@@ +179,5 @@
> + tmpdir = mkdtemp()
> + try:
> + parser = xpidl.IDLParser(outputdir=tmpdir)
> + registry = InterfaceRegistry()
> + for p, f in finder.find('**/*.idl'):
This will find objdir/dist/idl/*.idl, right? Do we care?
@@ +184,5 @@
> + p = mozpack.path.join(path, p)
> + try:
> + content = f.open().read()
> + idl = parser.parse(content, filename=p)
> + except:
except Exception (since we don't want to trap KeyboardInterrupt).
Attachment #781578 -
Flags: review?(gps) → review+
| Assignee | ||
Comment 24•12 years ago
|
||
Re-running it by you for the CommandArgument stuff.
Attachment #782848 -
Flags: review?(gps)
| Assignee | ||
Updated•12 years ago
|
Attachment #781578 -
Attachment is obsolete: true
Updated•12 years ago
|
Attachment #782848 -
Flags: review?(gps) → review+
| Assignee | ||
Comment 25•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/e3ff3875a6f0
https://hg.mozilla.org/integration/mozilla-inbound/rev/5eeea818324c
https://hg.mozilla.org/integration/mozilla-inbound/rev/fb60c9b4b74f
https://hg.mozilla.org/integration/mozilla-inbound/rev/03f984a3bd2a
https://hg.mozilla.org/integration/mozilla-inbound/rev/9251bba8a9b2
Comment 26•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/e3ff3875a6f0
https://hg.mozilla.org/mozilla-central/rev/5eeea818324c
https://hg.mozilla.org/mozilla-central/rev/fb60c9b4b74f
https://hg.mozilla.org/mozilla-central/rev/03f984a3bd2a
https://hg.mozilla.org/mozilla-central/rev/9251bba8a9b2
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
Updated•7 years ago
|
Product: Core → Firefox Build System
You need to log in
before you can comment on or make changes to this bug.
Description
•