Closed
Bug 370750
Opened 16 years ago
Closed 11 years ago
Add MOCHITESTS_DIR magic to config/rules.mk
Categories
(Firefox Build System :: General, defect)
Firefox Build System
General
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla16
People
(Reporter: Waldo, Assigned: froydnj)
References
(Blocks 2 open bugs)
Details
(Keywords: dev-doc-needed)
Attachments
(6 files, 4 obsolete files)
81.07 KB,
patch
|
Details | Diff | Splinter Review | |
34.42 KB,
patch
|
Details | Diff | Splinter Review | |
241.61 KB,
patch
|
glandium
:
review+
|
Details | Diff | Splinter Review |
4.35 KB,
patch
|
glandium
:
review+
|
Details | Diff | Splinter Review |
193.49 KB,
patch
|
glandium
:
review+
|
Details | Diff | Splinter Review |
4.46 KB,
text/plain
|
froydnj
:
review+
|
Details |
I think I have a penchant for masochism.
Reporter | ||
Comment 1•16 years ago
|
||
I don't like forcing inclusion of relativesrcdir, but I assume there's no other way since that's how we did it before. Also, I changed the name to MOCHITEST_DIRS, and it's a list of directories to accommodate splitting up tests into subdirectories of a single directory if desired.
Attachment #255486 -
Flags: superreview?(sayrer)
Attachment #255486 -
Flags: review?(benjamin)
Comment 2•16 years ago
|
||
I think you have the r? flags backwards
Updated•16 years ago
|
Attachment #255486 -
Flags: superreview?(sayrer)
Attachment #255486 -
Flags: review?(sayrer)
Attachment #255486 -
Flags: review?(benjamin)
Comment 3•16 years ago
|
||
Comment on attachment 255486 [details] [diff] [review] Patch bsmedberg wants no wildcards here, so it is easy to ifdef for branching and platform
Attachment #255486 -
Flags: review?(sayrer) → review-
Reporter | ||
Comment 4•16 years ago
|
||
(In reply to comment #2) > I think you have the r? flags backwards No, I didn't -- bsmedberg for the build-fu, you for the concepts. But anyway... (In reply to comment #3) > bsmedberg wants no wildcards here, so it is easy to ifdef for branching and > platform So basically you want the status quo of having to manually list every single file used in all the tests? Why? I don't see what you gain here -- you could use the same ifdefs in the Makefile.in to determine the value of MOCHITEST_DIRS and split functionality by branch/platform/etc. that way, and there's no hassle of having to edit the Makefile.in for the general case of adding a test to an already-existing set of tests.
Comment 5•16 years ago
|
||
(In reply to comment #4) > (In reply to comment #2) > > I think you have the r? flags backwards > > No, I didn't -- bsmedberg for the build-fu, you for the concepts. But > anyway... but I am not an SR, so the process weenies would have a fit. :) But anyway... > (In reply to comment #3) > > bsmedberg wants no wildcards here, so it is easy to ifdef for branching and > > platform > > So basically you want the status quo of having to manually list every single > file used in all the tests? Why? I don't care either way. The only thing Benjamin has objected to is wildcards, so when he is back I am cool with whatever he wants.
Comment 7•15 years ago
|
||
bug 395019 could make the relativesrcdir thing less yucky. We should fix this, having to write extra rules in every Makefile sucks.
Component: Testing → Build Config
QA Contact: testing → build-config
Comment 8•13 years ago
|
||
Still working on this Jeff?
Reporter | ||
Comment 9•13 years ago
|
||
Nope, I'm not likely to get to this any time soon, hasn't even entered my mind in years.
Assignee: jwalden+bmo → nobody
Updated•13 years ago
|
Assignee: nobody → dtownsend
Comment 10•13 years ago
|
||
This is what I think we should do. It adds MOCHITEST_FILES, MOCHITEST_CHROME_FILES and MOCHITEST_BROWSER_FILES variables. Set them to a list of files and they get copied to the appropriate places. No need for relativesrcdir to be set since it calculates it in a similar way proposed by bug 395019. Apparently that is broken for srcdir builds, do we still care about those? Want to get review on this part before I actually go through and convert lots of makefiles to use these.
Attachment #255486 -
Attachment is obsolete: true
Attachment #429865 -
Flags: review?(ted.mielczarek)
Comment 11•13 years ago
|
||
Comment on attachment 429865 [details] [diff] [review] patch rev 1 I've been unsuccessful in killing srcdir builds yet, so we should make this not break them, certainly. Looking at my patch from that old bug again, and testing with a local srcdir configure, I think this might work: relativesrcdir = $(subst $(abspath $(topsrcdir))/,,$(abspath $(srcdir))) Why don't you try this patch with that in autoconf.mk.in or config.mk? >diff --git a/config/rules.mk b/config/rules.mk >--- a/config/rules.mk >+++ b/config/rules.mk >@@ -191,16 +191,33 @@ check-one: > $(testxpcsrcdir)/runxpcshelltests.py \ > --symbols-path=$(DIST)/crashreporter-symbols \ > --test-path=$(SOLO_FILE) \ > $(DIST)/bin/xpcshell \ > $(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(MODULE)/$(dir)) > > endif # XPCSHELL_TESTS > >+mochirelativedir = $(subst $(topsrcdir),,$(srcdir)) >+ >+ifdef MOCHITEST_FILES >+libs:: $(MOCHITEST_FILES) >+ $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests$(mochirelativedir) >+endif the "libs:: $(MOCHITEST_FILES)" doesn't really buy us anything here, just drop the dependency and use $(MOCHITEST_FILES) instead of $^. r=me with those changes. Thanks, I've wanted this for a long time! (Oh, and remember that you need to copy your changes to js/src/config/rules.mk as well.)
Attachment #429865 -
Flags: review?(ted.mielczarek) → review+
Updated•13 years ago
|
Assignee: dtownsend → nobody
Comment 13•11 years ago
|
||
Removed some bit rot. Created rules in config/makefiles/mochitest.mk instead of rules.mk. This doesn't work because ???. I suspect I'm not fully grokking this new makefile hierarchy we have going. Should be trivial for someone to make it work, however.
Attachment #429865 -
Attachment is obsolete: true
Comment 14•11 years ago
|
||
One issue that will probably need addressing is cases like <http://mxr.mozilla.org/mozilla-central/source/dom/tests/mochitest/dom-level1-core/Makefile.in>, where we have _TEST_FILES_{A,...,G} because Windows.
Target Milestone: mozilla1.9alpha3 → ---
![]() |
Assignee | |
Comment 15•11 years ago
|
||
This patch copies the necessary files to js/src/, fixes some syntax errors, and adds VPATH back in where appropriate. m-c builds with this patch applied from a fresh tree; I didn't check to see whether build directories with and without a patch contained equivalent files. I'm willing to slog through Makefiles to make the necessary changes; anybody want to come with to lighten the load?
Attachment #635086 -
Attachment is obsolete: true
Comment 16•11 years ago
|
||
Comment on attachment 637166 [details] [diff] [review] trivial changes to make it work Review of attachment 637166 [details] [diff] [review]: ----------------------------------------------------------------- ::: config/makefiles/mochitest.mk @@ +11,5 @@ > +endif > + > +ifdef MOCHITEST_FILES > +libs:: $(MOCHITEST_FILES) > + $(INSTALL) $(foreach f,$^,"$f") $(call mochitestdir,mochitest) Unless I'm much mistaken, this should be $(call mochitestdir,test)
Comment 17•11 years ago
|
||
Excludes dom/imptests, because those are autogenerated (I'll fix them later) and dom/tests/mochitest/dom-level* as discussed. Next up, content/.
Comment 18•11 years ago
|
||
Updated•11 years ago
|
Blocks: nomakerules
![]() |
Assignee | |
Comment 19•11 years ago
|
||
Comment on attachment 637534 [details] [diff] [review] And content/ Review of attachment 637534 [details] [diff] [review]: ----------------------------------------------------------------- \o/ ::: content/xul/templates/tests/chrome/Makefile.in @@ +4,5 @@ > > +DEPTH = ../../../../.. > +topsrcdir = @top_srcdir@ > +srcdir = @srcdir@ > +VPATH = @srcdir@ While you are semi-gratuitously touching these groups of lines, could you make them use := instead? Here and elsewhere.
![]() |
Assignee | |
Comment 20•11 years ago
|
||
This patch is part 1 of a 3-part series; for ease of review, we're just renaming all the variables to the form we want them to be in later. (Seemed easier to me anyway; I know some people prefer to see all the changes at once.)
Attachment #638853 -
Flags: review?(mh+mozilla)
![]() |
Assignee | |
Comment 21•11 years ago
|
||
Part 2 just adds the makefile fragments. This is effectively an effectless change, but it should be easy to review the fragments themselves this way.
Attachment #637166 -
Attachment is obsolete: true
Attachment #638854 -
Flags: review?(mh+mozilla)
![]() |
Assignee | |
Comment 22•11 years ago
|
||
This patch is where all the magic happens. Left unconverted are rules which install into subdirectories of mochitests; if anybody has any bright ideas for how to handle those, I'm all ears. This patch obsoletes virtually all uses of relativesrcdir and friends. I'll happily do that in a followup bug; this patch series is getting rather large in size. A sanity-checking build on my linux box survives; I'll try pushing this to try. I'll also note that the entire patch series is based on day-old-ish m-c; some updates will probably be required. Assuming those updatess are not too wacky, I'll take r+ on these patches to imply r+ on whatever updates need doing to update to current trunk.
Attachment #638856 -
Flags: review?(mh+mozilla)
Comment 23•11 years ago
|
||
Comment on attachment 638853 [details] [diff] [review] part 1 - rename makefile variables Review of attachment 638853 [details] [diff] [review]: ----------------------------------------------------------------- You may want to fix the indentation in some of those.
Attachment #638853 -
Flags: review?(mh+mozilla) → review+
Comment 24•11 years ago
|
||
Comment on attachment 638854 [details] [diff] [review] part 2 - makefile fragments Review of attachment 638854 [details] [diff] [review]: ----------------------------------------------------------------- ::: config/makefiles/mochitest.mk @@ +10,5 @@ > + mochitestdir = $(DEPTH)/_tests/testing/mochitest/$1/$(subst $(topsrcdir),,$(srcdir)) > +endif > + > +define mochitest-libs-rule-template > +libs:: $$($1) Stylistically, we always use the $(1) form in makefiles. I think you can make that $($(1)), too (instead of $$($(1))) @@ +19,5 @@ > +# installing them with a single $(INSTALL) invocation would overflow > +# command-line length limits on some operating systems. > +ifdef MOCHITEST_FILES_PARTS > +ifdef MOCHITEST_FILES > +$(error You must define only one of MOCHITEST_FILES_PARTS and MOCHITEST_FILES) s/and/or/ ?
Attachment #638854 -
Flags: review?(mh+mozilla) → review+
Comment 25•11 years ago
|
||
(In reply to Nathan Froyd (:froydnj) from comment #22) > This patch obsoletes virtually all uses of relativesrcdir and friends. I'll > happily do that in a followup bug; this patch series is getting rather large > in size. Note there's a bug for replacing relativesrcdir.
Comment 26•11 years ago
|
||
(In reply to Mike Hommey [:glandium] from comment #25) > (In reply to Nathan Froyd (:froydnj) from comment #22) > > This patch obsoletes virtually all uses of relativesrcdir and friends. I'll > > happily do that in a followup bug; this patch series is getting rather large > > in size. > > Note there's a bug for replacing relativesrcdir. That's bug 395019. By the way, it would be better to use that for part 2.
Comment 27•11 years ago
|
||
Comment on attachment 638856 [details] [diff] [review] part 3 - convert libs:: rules to use the new fragments Review of attachment 638856 [details] [diff] [review]: ----------------------------------------------------------------- Might be better to land everything in one changeset. ::: content/html/document/test/Makefile.in @@ +84,3 @@ > > ifneq (mobile,$(MOZ_BUILD_APP)) > +include $(topsrcdir)/config/rules.mk Remove the ifneq :) ::: layout/base/tests/Makefile.in @@ +360,5 @@ > $(NULL) > > +include $(topsrcdir)/config/rules.mk > + > +DEFINES += -D_IMPL_NS_LAYOUT You can leave the DEFINES where it was. ::: layout/style/test/Makefile.in @@ +215,5 @@ > + $(RM) $@ > + ./host_ListCSSProperties$(HOST_BIN_SUFFIX) > $@ > + cat $(srcdir)/css_properties_like_longhand.js >> $@ > + > +GARBAGE += css_properties.js Likewise, you don't have to move this stuff. ::: toolkit/mozapps/extensions/test/browser/Makefile.in @@ +116,1 @@ > $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir)-window It might be worth looking if this is required, because it would be nice if that could also go away.
Attachment #638856 -
Flags: review?(mh+mozilla) → review+
Updated•11 years ago
|
Assignee: nobody → nfroyd
![]() |
Assignee | |
Comment 28•11 years ago
|
||
Thanks for the quick review. (In reply to Mike Hommey [:glandium] from comment #27) > ::: layout/base/tests/Makefile.in > @@ +360,5 @@ > > $(NULL) > > > > +include $(topsrcdir)/config/rules.mk > > + > > +DEFINES += -D_IMPL_NS_LAYOUT > > You can leave the DEFINES where it was. > > ::: layout/style/test/Makefile.in > @@ +215,5 @@ > > + $(RM) $@ > > + ./host_ListCSSProperties$(HOST_BIN_SUFFIX) > $@ > > + cat $(srcdir)/css_properties_like_longhand.js >> $@ > > + > > +GARBAGE += css_properties.js > > Likewise, you don't have to move this stuff. DEFINES and GARBAGE might be able to stay, but at least some of the other rules need to be moved after including rules.mk, otherwise we run into trouble with OBJ_SUFFIX. (It's a little weird that DEFINES and GARBAGE are only ever appended to, which I suppose makes it OK to place them wherever, but also makes them a bit fragile.)
Comment 29•11 years ago
|
||
(In reply to Nathan Froyd (:froydnj) from comment #28) > Thanks for the quick review. > > (In reply to Mike Hommey [:glandium] from comment #27) > > ::: layout/base/tests/Makefile.in > > @@ +360,5 @@ > > > $(NULL) > > > > > > +include $(topsrcdir)/config/rules.mk > > > + > > > +DEFINES += -D_IMPL_NS_LAYOUT > > > > You can leave the DEFINES where it was. > > > > ::: layout/style/test/Makefile.in > > @@ +215,5 @@ > > > + $(RM) $@ > > > + ./host_ListCSSProperties$(HOST_BIN_SUFFIX) > $@ > > > + cat $(srcdir)/css_properties_like_longhand.js >> $@ > > > + > > > +GARBAGE += css_properties.js > > > > Likewise, you don't have to move this stuff. > > DEFINES and GARBAGE might be able to stay, but at least some of the other > rules need to be moved after including rules.mk, otherwise we run into > trouble with OBJ_SUFFIX. That's true. > (It's a little weird that DEFINES and GARBAGE are > only ever appended to, which I suppose makes it OK to place them wherever, > but also makes them a bit fragile.) They are not used in target definitions, so they can be assigned/appended anywhere. Variables used for target definitions are a different story. [ where target definition is a "target: dependencies" line ]
![]() |
Assignee | |
Comment 30•11 years ago
|
||
So a diff -ur --unidirectional-new-file on a pristine build directory versus a patched build directory reveals that a lot of files have been moved around. The culprit seems to be that relativesrcdir was an approximate alias of srcdir. For instance, see http://dxr.lanedo.com/mozilla-central/accessible/tests/mochitest/actions/Makefile.in.html#l10 or http://dxr.lanedo.com/mozilla-central/toolkit/components/places/tests/mochitest/bug_461710/Makefile.in.html#l10 . The diffstat for the above diff command is: 901 files changed, 53152 insertions(+), 4 deletions(-) I haven't investigated the deletions yet (probably a minor bug), but does anybody else think the large amount of churn here is a concern? Comparing tests before and after this change is applied is going to be beastly, at the very least. Could a change like this also mess with orangefactor and tbpl starring? An example of a moved test is: old: _tests/testing/mochitest/a11y/accessible/actions/test_anchors.html new: _tests/testing/mochitest/a11y/accessible/tests/mochitest/actions/test_anchors.html
Comment 31•11 years ago
|
||
That would most definitely mess with tbpl starring.
Comment 32•11 years ago
|
||
Might be safer to just use relativesrcdir for the time being.
Comment 33•11 years ago
|
||
(In reply to comment #31) > That would most definitely mess with tbpl starring. This is how the TBPL suggestions work: for each failure line in the log excerpt of the page, we parse out the path name, get the file name, and then issue a bugzilla query for bugs which have "orange" in their status whiteboard and the file name in their summary. So, as long as this patch doesn't change the leaf name of files (which it doesn't as far as I can tell), TBPL will work fine with it.
![]() |
Assignee | |
Comment 34•11 years ago
|
||
(In reply to Mike Hommey [:glandium] from comment #32) > Might be safer to just use relativesrcdir for the time being. Ah, I see what the .mk files were doing attempting to use relativetestdir. Since relativesrcdir is already there, I've changed the fragments to use relativesrcdir instead. This shuffles a few files around, but the number is much fewer than what we had before, and it's small enough that if there *is* anyway fallout, it will be minor.
Attachment #639157 -
Flags: review+
![]() |
Assignee | |
Comment 35•11 years ago
|
||
(In reply to Nathan Froyd (:froydnj) from comment #34) > This shuffles a few files around To elaborate: gfx/tests is affected (3 tests), since the makefile installed the tests into $(MOCHITEST_DIR)/gfx instead of gfx/tests, and toolkit/components/perf is affected (1 test), since the makefile installed the tests into $(MOCHITEST_DIR)/$(MODULE), where $(MODULE) is jsperf.
![]() |
Assignee | |
Comment 36•11 years ago
|
||
Try looks pretty good: https://tbpl.mozilla.org/?tree=Try&rev=2f601e611da7 Pushed as one big patch per glandium's suggestion: https://hg.mozilla.org/integration/mozilla-inbound/rev/654677c62195
Status: NEW → ASSIGNED
Comment 37•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/654677c62195
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla16
Updated•11 years ago
|
Keywords: dev-doc-needed
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
•