Skip to content

Commit 7293597

Browse files
monojenkinsakoeplinger
authored andcommitted
[corlib] Fix building nunit-lite twice (#16910)
We sometimes saw the following build error in Mono SDKs builds on Jenkins: ``` [2019-09-16T01:03:30.709Z] CSC [xammac] nunit-lite-console.exe [2019-09-16T01:03:30.709Z] error CS0009: Metadata file '/Users/builder/jenkins/workspace/archive-mono/2019-08/mac/release/mcs/class/lib/xammac/nunitlite.dll' could not be opened -- PE image doesn't contain managed metadata. ``` Taking a closer look we found out that nunit-lite was trying to be built twice for the same profile which caused a race where the file was corrupted. The reason for this is that the corlib Makefile defines two test assemblies: the normal PROFILE_corlib_test.dll and BinarySerializationOverVersionsTest.dll and integrating the BinarySerializationOverVersionsTest.dll via the `test-vts` target incorrectly overwrote the `test` target instead of using `test-local`. Backport of #16894.
1 parent 1648e88 commit 7293597

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

mcs/build/tests.make

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ $(test_nunit_dep): $(topdir)/build/deps/nunit-$(PROFILE).stamp
128128
@if test -f $@; then :; else rm -f $<; $(MAKE) $<; fi
129129

130130
$(topdir)/build/deps/nunit-$(PROFILE).stamp:
131-
cd ${topdir}/tools/nunit-lite && $(MAKE)
131+
$(MAKE) -C ${topdir}/tools/nunit-lite
132132
echo "stamp" >$@
133133

134134
tests_CLEAN_FILES += $(topdir)/build/deps/nunit-$(PROFILE).stamp
@@ -378,5 +378,3 @@ $(xtest_makefrag): $(xtest_response)
378378

379379
endif
380380

381-
382-
.PHONY: patch-nunitlite-appconfig

mcs/class/corlib/Makefile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ TEST_RESOURCES = $(TEST_RESX_RESOURCES) $(TEST_RESX_RESOURCES_SATELITE)
232232
satellite_assembly1 = $(test_lib_dir)/es-ES/$(patsubst %.dll,%.resources.dll,$(test_lib))
233233
satellite_assembly2 = $(test_lib_dir)/nn-NO/$(patsubst %.dll,%.resources.dll,$(test_lib))
234234

235-
$(test_lib_output): $(TEST_RESOURCES) $(satellite_assembly1) $(satellite_assembly2) $(test_lib_dir)
235+
$(test_lib_output): $(TEST_RESOURCES) $(satellite_assembly1) $(satellite_assembly2) | $(test_lib_dir)
236236

237237
mscorlib_for_profile = $(topdir)/class/lib/$(PROFILE)/mscorlib.dll
238238

@@ -298,11 +298,8 @@ NO_VTS_TEST = yes
298298
endif
299299

300300
ifndef NO_VTS_TEST
301-
test: test-vts
302-
run-test: run-test-vts
303-
else
304-
test:
305-
run-test:
301+
test-local: test-vts
302+
run-test-local: run-test-vts
306303
endif
307304

308305
EXTRA_DISTFILES += \

mcs/tools/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ monotouch_tv_SUBDIRS = nunit-lite
6060
monotouch_watch_SUBDIRS = nunit-lite
6161
monotouch_tools_SUBDIRS =
6262
monotouch_tools_PARALLEL_SUBDIRS = corcompare mono-api-html
63+
xammac_SUBDIRS = nunit-lite
64+
xammac_net_4_5_SUBDIRS = nunit-lite
6365
net_4_x_SUBDIRS =
6466
net_4_x_PARALLEL_SUBDIRS = $(net_4_5_dirs)
6567
wasm_tools_SUBDIRS =

0 commit comments

Comments
 (0)