Run dmd internal unittests on CIs#6767
Conversation
ab34732 to
0263062
Compare
|
works? |
0263062 to
a5a5d57
Compare
|
Thanks for your pull request, @wilzbach! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. |
Yes, it should work now. As the PR title states this allows to build all I will add a similar target for the Windows Makefiles once this has been approved. |
andralex
left a comment
There was a problem hiding this comment.
awesome! now we need unittests :)
src/posix.mak
Outdated
| $G/dmd-unittest: $(DMD_SRCS) $(ROOT_SRCS) $G/newdelete.o $G/lexer.a $(G_GLUE_OBJS) $(G_OBJS) $(STRING_IMPORT_FILES) $(HOST_DMD_PATH) | ||
| CC=$(HOST_CXX) $(HOST_DMD_RUN) -of$@ $(MODEL_FLAG) -vtls -J$G -J../res -L-lstdc++ $(DFLAGS) -unittest -main $(filter-out $(STRING_IMPORT_FILES) $(HOST_DMD_PATH),$^) | ||
|
|
||
| test: $G/dmd-unittest |
There was a problem hiding this comment.
could you please call this target 'unittest'? It has that name in druntime and phobos.
|
This change is a good direction, but misses a few details about the current system. There's a test target at the top level that invokes the deeper level directories as needed. There's also a separation between build and test. I don't think having the src level's auto-tester-build step invoking tests is correct. The auto-tester-test target ought to do that. Right now, the top level auto-tester-test target just invokes the test directories makefile. Adding a line to have it invoke the src/posix.mak unittests would fit the current scheme better. If you want to get fancy, the build steps could produce the dmd-unittest binary, but let the test steps invoke it, but that doesn't match how the other tests are treated. |
a5a5d57 to
5b58a62
Compare
5b58a62 to
718d279
Compare
|
|
||
| all: | ||
| $(QUIET)$(MAKE) -C src -f posix.mak | ||
| $(QUIET)$(MAKE) -C src -f posix.mak all |
There was a problem hiding this comment.
This makes the default Makefile target explicit (all is the default target of src/posix.mak).
There was a problem hiding this comment.
Is there a disadvantage to assume the default target builds all? After all, if it's not it means we wrote that makefile poorly.
There was a problem hiding this comment.
Explicitly for the win - it was helpful during debugging this.
3ff6b79 to
45e98e6
Compare
b0ed6d7 to
aa9b521
Compare
|
Okay so the current status is that CircleCi works nicely again, but I am having troubles with the auto-tester as no I tried to hack around this, but exposing |
aa9b521 to
f880ed8
Compare
f880ed8 to
262f44b
Compare
|
Hmm now that I reverted the hack to detect the already built D compiler and instead I was hoping that https://auto-tester.puremagic.com/show-run.ghtml?projectid=1&runid=2928984&isPull=true Any ideas on what I could have missed? Should I go with the fallback hack which detects the already built D compiler for now? |
|
You hit some of the 3 build hosts that hadn't yet updated with the changes. I took all of them out of the active fleet until they can be updated (I don't have remote access to them). Slows the fleet down, but allows the tests to successfully build this change. |
262f44b to
a2025df
Compare
a2025df to
fed25ec
Compare
Awesome. Thanks a lot! |
| $(RM) tags | ||
|
|
||
| test: | ||
| $(QUIET)$(MAKE) -C src -f posix.mak unittest |
There was a problem hiding this comment.
It looks like you don't have to modify src/posix.mak, if you simply replace here unittest with ENABLE_DEBUG=1. For reference, ENABLE_DEBUG does the following:
ifdef ENABLE_DEBUG
CXXFLAGS += -g -g3 -DDEBUG=1 -DUNITTEST
DFLAGS += -g -debug -unittestI think going with this option, instead of introducing a new target there would be simpler/better. What do you think?
There was a problem hiding this comment.
I prefer a separate target because then it's a lot easier to run the unittest target with the currently compiled dmd binary. Imho it's a common concept to use a different binary for the unittest executable and deviating from this might lead to confusion or annoyance down the road.
There was a problem hiding this comment.
Alright, you make a good point.
andralex
left a comment
There was a problem hiding this comment.
Couple optional suggestions for later.
| make -j$N -C src -f posix.mak MODEL=$MODEL HOST_DMD=../_${build_path}/host_dmd clean | ||
| make -j$N -C src -f posix.mak MODEL=$MODEL HOST_DMD=../_${build_path}/host_dmd ENABLE_COVERAGE=1 | ||
|
|
||
| cp $build_path/dmd _${build_path}/host_dmd_cov |
There was a problem hiding this comment.
Well, the idea was too avoid any issues with rebuilding DMD with other configs. At the moment there aren't any anymore for this setup, but explicitly really helped a lot during debugging here.
|
|
||
| all: | ||
| $(QUIET)$(MAKE) -C src -f posix.mak | ||
| $(QUIET)$(MAKE) -C src -f posix.mak all |
There was a problem hiding this comment.
Is there a disadvantage to assume the default target builds all? After all, if it's not it means we wrote that makefile poorly.
|
Windows debug build is currently broken because dmd does not generate the 'main' function. I bisected the cause to this commit. I've submitted a PR (#7431) to fix it by adding the main method back in but I'm not sure if that's the right solution since I don't quite understand why it was removed. |
I'm copy/pasting my response from #7431: The Line 135 in 7c888c4 |
This will probably take a bit to configure for all CI test systems - especially for the auto-tester...