Closed
Bug 515792
Opened 14 years ago
Closed 14 years ago
build system runs identical 'hg identify' command too many times
Categories
(Firefox Build System :: General, defect)
Firefox Build System
General
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla1.9.3a1
People
(Reporter: dbaron, Assigned: Gijs)
References
Details
(Keywords: perf)
Attachments
(1 file, 2 obsolete files)
3.63 KB,
patch
|
ted
:
review+
|
Details | Diff | Splinter Review |
'hg identify' can be quite slow: * because it does a full-tree diff * for other reasons, unclear to me, when a tree has a large number of heads and we call it a significant number of times. (I have a tree with a large number of heads in which it can take a significant part of a minute.) We call an identical hg identify command from three different makefiles: http://mxr.mozilla.org/mozilla-central/search?string=hg%20identi for every phase of the build (export, libs, etc.(?)). We should probably just call it once, either in configure (and put the output in a variable that gets AC_SUBSTed into autoconf.mk), or in the export phase of config/Makefile.in or something similar (and put the output in a file that can be cat-ed elsewhere).
Comment 1•14 years ago
|
||
I think we could also change the command slightly so it doesn't try to figure out if you have local changes. Something like: hg identify -ir. ('.' is "the parent changeset of the working directory")
Reporter | ||
Comment 2•14 years ago
|
||
You can also get that from: hg parent --template="{node|short}\n"
Comment #2 makes this sound like the easiest build-speed win available!
Comment 4•14 years ago
|
||
10 minute build times, here we come!
Assignee | ||
Comment 5•14 years ago
|
||
Something like this?
Assignee: nobody → gijskruitbosch+bugs
Status: NEW → ASSIGNED
Attachment #409345 -
Flags: review?(ted.mielczarek)
Comment 6•14 years ago
|
||
You could also AC_DEFINE it and then remove the manual addition to DEFINES in the two makefiles, I think.
Comment 7•14 years ago
|
||
Is running configure each time we update the tree really going to speed things up?
Assignee | ||
Comment 8•14 years ago
|
||
So the previous patch wouldn't have worked, I don't think (I mean, it built, but MOZ_SOURCE_STAMP was actually empty). This, on the other hand, does work (tested with about:buildconfig, which uses the variable). It adds MOZ_SOURCE_STAMP as an export in the toplevel makefile, and then in the sub-makefiles only assigns to that variable if it's not already defined. This ensures that the value is up-to-date even if make is only ran in subdirectories (thanks, Axel!).
Attachment #409345 -
Attachment is obsolete: true
Attachment #410760 -
Flags: review?(ted.mielczarek)
Attachment #409345 -
Flags: review?(ted.mielczarek)
Comment 9•14 years ago
|
||
Comment on attachment 410760 [details] [diff] [review] Patch +MOZ_SOURCE_STAMP = $(shell cd $(srcdir) && hg parent --template="{node|short}\n" 2>/dev/null) Is this going to have the same problem that bug 517417 fixed, in that hg will look for a repo above the current directory?
Comment 10•14 years ago
|
||
Arne: could you test if the command in this patch (quoted in my previous comment) exhibits the same problem as bug 517417? I don't want to regress that for you.
Comment 11•14 years ago
|
||
Ted: Thank you for asking! It doesn't exibit the same problem, but it would lead to false information for your buildsystem (since it still finds the higher up hg repo). To make sure that the command bails out when it isn't in the top level directory of the repo, you can use hg parent --repository . --template="{node|short}\n" But the cleanest way would probably be to use MOZ_SOURCE_STAMP ?= $(shell hg --repository $(topsrcdir) parent --template="{node|short}\n" 2>/dev/null) This checks explicitely if $(topsrcdir) is a hg repository *root* and if yes it returns its parent. A shorthand would be "hg -R" instead of "hg --repository".
Comment 12•14 years ago
|
||
I think we might not have been using -R because we are trying to support some ancient version of hg (0.9.4?) that comes with Scratchbox, which our mobile developers use.
Comment 13•14 years ago
|
||
Could you test if -R works for them? For me hg 0.9.4 uses -R - I just tested it with 0.9, too.
Assignee | ||
Comment 14•14 years ago
|
||
(In reply to comment #13) > Could you test if -R works for them? > > For me hg 0.9.4 uses -R - I just tested it with 0.9, too. This works for me in scratchbox, too: [sbox-CHINOOK-ARMEL-2007: ~/devmoz/mozilla-central] > hg -R . parent --template="{node|short}\n" 2>/dev/null 001e14d17a30 Updated the patch using this approach instead.
Attachment #410760 -
Attachment is obsolete: true
Attachment #413296 -
Flags: review?(ted.mielczarek)
Attachment #410760 -
Flags: review?(ted.mielczarek)
Comment 15•14 years ago
|
||
Ok, I wasn't sure, I just remembered that that code went through several revisions, and we did have problems with the old hg in scratchbox. Thanks for testing!
Comment 16•14 years ago
|
||
Thank you for taking care!
Comment 17•14 years ago
|
||
Comment on attachment 413296 [details] [diff] [review] Patch using -R flag Looks good, thanks!
Attachment #413296 -
Flags: review?(ted.mielczarek) → review+
Assignee | ||
Comment 18•14 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/fec4a5e4b36e
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Comment 19•14 years ago
|
||
Fwiw, should { /toolkit/crashreporter/tools/symbolstore.py * line 276 -- rev = os.popen('hg identify -i "%s"' % srcdir, "r").readlines()[0].rstrip() } be updated too?
Updated•14 years ago
|
Flags: wanted1.9.2?
Target Milestone: --- → mozilla1.9.3a1
Updated•14 years ago
|
Comment 20•14 years ago
|
||
No, not worth it.
Comment 21•14 years ago
|
||
And I don't see any reason we'd take this on 1.9.2.
Flags: wanted1.9.2? → wanted1.9.2-
Updated•5 years ago
|
Product: Core → Firefox Build System
You need to log in
before you can comment on or make changes to this bug.
Description
•