diff options
author | Ludovic Henry <luhenry@microsoft.com> | 2018-10-10 20:35:45 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-10 20:35:45 +0300 |
commit | 46b723d6b015e5b9a10b03e7c4b4c8259177589b (patch) | |
tree | 7d2995d215379cd0d953b4a39652912e258b48c0 | |
parent | ab3c897d6851ccf75e840d8b767aafa0d0a32d53 (diff) |
[2018-06] [sdks] Create archive targets for pre-building on CI (#10936)
* [sdks] Remove redundant --enable-cxx
* [sdks] Shorten `-m32`/`-m64` parameters detection for runtimes
* [sdks] Build BCL profiles without configure flags
* [sdks] Create archive targets for pre-building on CI
* [sdks] Add BclTemplate to build BCL profiles
This is to avoid building all the profiles in a single `sdks/out/bcl` directory which will be shared between android, ios and wasm.
* [sdks] Use archive-{android,ios,wasm} on CI
* [sdks] Run archive-llvm-llvm{,win}{32,64} on CI
* [sdks] Add download/pack capabilities for LLVM
* [sdks] Ensure LLVM is cloned before trying to download
* [sdks] Simplify call to BclTemplate
* Put xunit tests in mcs/class/lib/PROFILE/tests too
So they are next to their NUnit counterparts.
Move xunit remote executor app to tests dir too and compile it when
compiling the test assembly instead of doing it before running the test.
We need to use an absolute path for the xunit remote executor and it
needs to be in Windows format on Windows since we pass it as an env var
to the xunit tests.
* [sdks] Build LLVM with make in parallel
* [mcs] Make directory dependency as order-only
We would otherwise always rebuild the target since the directory is updated whenever something is added to the directory. This is a common Makefile technique.
* [sdks] Build tests for BCL targets
* [build] Switch to netstandard based xunit
m--------- | external/xunit-binaries | 0 | ||||
-rw-r--r-- | mcs/build/config-default.make | 6 | ||||
-rw-r--r-- | mcs/build/tests.make | 47 | ||||
-rw-r--r-- | mcs/class/Mono.Profiler.Log/Makefile | 11 | ||||
-rw-r--r-- | mcs/class/Mono.Profiler.Log/Test/ProfilerTestRun.cs | 9 | ||||
-rw-r--r-- | mcs/class/System.ComponentModel.Composition.4.5/monodroid_System.ComponentModel.Composition_xtest.dll.exclude.sources | 11 | ||||
-rw-r--r-- | mcs/class/System/monodroid_System_xtest.dll.exclude.sources | 15 | ||||
-rw-r--r-- | runtime/Makefile.am | 34 | ||||
-rwxr-xr-x | scripts/ci/run-jenkins.sh | 34 | ||||
-rw-r--r-- | sdks/builds/Makefile | 45 | ||||
-rw-r--r-- | sdks/builds/android.mk | 28 | ||||
-rw-r--r-- | sdks/builds/bcl.mk | 80 | ||||
-rw-r--r-- | sdks/builds/desktop.mk | 11 | ||||
-rw-r--r-- | sdks/builds/ios.mk | 41 | ||||
-rw-r--r-- | sdks/builds/llvm.mk | 97 | ||||
-rw-r--r-- | sdks/builds/runtime.mk | 13 | ||||
-rw-r--r-- | sdks/builds/wasm.mk | 4 | ||||
-rw-r--r-- | sdks/desktop/Makefile | 4 | ||||
-rw-r--r-- | sdks/paths.mk | 2 | ||||
-rw-r--r-- | sdks/wasm/Makefile | 4 |
20 files changed, 293 insertions, 203 deletions
diff --git a/external/xunit-binaries b/external/xunit-binaries -Subproject 9df2dda5298b0544ffb2dc28ed2467982d71c93 +Subproject 445fe217a7585257cb7675767bec7514b3b58af diff --git a/mcs/build/config-default.make b/mcs/build/config-default.make index f9d2f21212a..0c05bd4c050 100644 --- a/mcs/build/config-default.make +++ b/mcs/build/config-default.make @@ -32,10 +32,10 @@ mono_libdir = $(exec_prefix)/lib sysconfdir = $(prefix)/etc #RUNTIME = mono RUNTIME = false -MONO_PATH_TOP = $(topdir)/class/lib/$(PROFILE_DIRECTORY)/ +MONO_PATH_TOP = $(topdir)/class/lib/$(PROFILE_DIRECTORY) MONO_PATH_TESTS = $(MONO_PATH_TOP)/tests -TEST_MONO_PATH = $(MONO_PATH_TOP)$(PLATFORM_PATH_SEPARATOR)$(MONO_PATH_TESTS) -TEST_RUNTIME = MONO_PATH="$(TEST_MONO_PATH)$(PLATFORM_PATH_SEPARATOR).$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) --debug +TEST_MONO_PATH = $(MONO_PATH_TOP)$(PLATFORM_PATH_SEPARATOR)$(MONO_PATH_TESTS)$(PLATFORM_PATH_SEPARATOR). +TEST_RUNTIME = MONO_PATH="$(TEST_MONO_PATH)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) --debug # In case you want to add MCS_FLAGS, this lets you not have to # keep track of the default value diff --git a/mcs/build/tests.make b/mcs/build/tests.make index ada45b1a6c6..bcb09e2f9b4 100644 --- a/mcs/build/tests.make +++ b/mcs/build/tests.make @@ -19,13 +19,22 @@ TEST_RUNTIME_WRAPPERS_PATH = $(shell dirname $(RUNTIME))/_tmpinst/bin ## Unit test support ifndef NO_TEST +test_lib_dir = $(topdir)/class/lib/$(PROFILE)/tests + test_nunit_lib = nunitlite.dll -xunit_core := xunit.core xunit.execution.desktop xunit.abstractions xunit.assert Xunit.NetCore.Extensions +xunit_core := xunit.core xunit.execution.dotnet xunit.abstractions xunit.assert Xunit.NetCore.Extensions xunit_deps := System.Runtime xunit_src := $(patsubst %,$(topdir)/../external/xunit-binaries/%,BenchmarkAttribute.cs BenchmarkDiscover.cs) $(topdir)/../mcs/class/test-helpers/PlatformDetection.cs ifeq ($(USE_XTEST_REMOTE_EXECUTOR), YES) -XTEST_REMOTE_EXECUTOR = $(topdir)/class/lib/$(PROFILE)/RemoteExecutorConsoleApp.exe +XTEST_REMOTE_EXECUTOR = $(test_lib_dir)/RemoteExecutorConsoleApp.exe + +ifeq ($(BUILD_PLATFORM), win32) +XTEST_REMOTE_EXECUTOR_ABSPATH = $(shell cygpath -w $(abspath $(XTEST_REMOTE_EXECUTOR))) +else +XTEST_REMOTE_EXECUTOR_ABSPATH = $(abspath $(XTEST_REMOTE_EXECUTOR)) +endif + xunit_src += $(topdir)/../mcs/class/test-helpers/AdminHelper.cs \ $(topdir)/../external/corefx/src/CoreFx.Private.TestUtilities/src/System/IO/FileCleanupTestBase.cs \ $(topdir)/../external/corefx/src/CoreFx.Private.TestUtilities/src/System/Diagnostics/RemoteExecutorTestBase.cs \ @@ -62,6 +71,7 @@ test_sourcefile = $(ASSEMBLY:$(ASSEMBLY_EXT)=_test.dll.sources) endif test_lib = $(PROFILE)_$(ASSEMBLY:$(ASSEMBLY_EXT)=_test.dll) +test_lib_output = $(test_lib_dir)/$(test_lib) test_sourcefile_excludes = $(test_lib).exclude.sources @@ -73,12 +83,13 @@ ifndef NO_BUILD test_flags += -r:$(the_assembly) test_assembly_dep = $(the_assembly) endif -tests_CLEAN_FILES += $(ASSEMBLY:$(ASSEMBLY_EXT)=_test*.dll) $(ASSEMBLY:$(ASSEMBLY_EXT)=_test*.pdb) $(test_response) $(test_makefrag) +tests_CLEAN_FILES += $(test_lib_output) $(test_lib_output:$(ASSEMBLY_EXT)=.pdb) $(test_response) $(test_makefrag) xtest_sourcefile = $(PROFILE)_$(ASSEMBLY:$(ASSEMBLY_EXT)=_xtest.dll.sources) xtest_sourcefile_excludes = $(PROFILE)_$(ASSEMBLY:$(ASSEMBLY_EXT)=_xtest.dll.exclude.sources) xunit_test_lib = $(PROFILE)_$(ASSEMBLY:$(ASSEMBLY_EXT)=_xunit-test.dll) +xtest_lib_output = $(test_lib_dir)/$(xunit_test_lib) xtest_response = $(depsdir)/$(xunit_test_lib).response xtest_makefrag = $(depsdir)/$(xunit_test_lib).makefrag @@ -86,7 +97,7 @@ xtest_flags = -r:$(the_assembly) $(xunit_libs_ref) $(XTEST_MCS_FLAGS) $(XTEST_LI ifeq ($(wildcard $(xtest_sourcefile)),) xtest_sourcefile = $(ASSEMBLY:$(ASSEMBLY_EXT)=_xtest.dll.sources) -tests_CLEAN_FILES += $(xunit_test_lib) $(xtest_response) $(xtest_makefrag) +tests_CLEAN_FILES += $(xtest_lib_output) $(xtest_response) $(xtest_makefrag) endif ifndef HAVE_CS_TESTS @@ -113,10 +124,6 @@ endif test_assemblies := -test_lib_dir = $(topdir)/class/lib/$(PROFILE)/tests - -test_lib_output = $(topdir)/class/lib/$(PROFILE)/tests/$(test_lib) - ifdef HAVE_CS_TESTS test_assemblies += $(test_lib_output) @@ -242,7 +249,7 @@ ifdef HAVE_CS_TESTS $(test_lib_dir): mkdir -p $@ -$(test_lib_output): $(test_assembly_dep) $(test_response) $(test_nunit_dep) $(test_lib_dir) +$(test_lib_output): $(test_assembly_dep) $(test_response) $(test_nunit_dep) | $(test_lib_dir) $(TEST_COMPILE) $(LIBRARY_FLAGS) -target:library -out:$@ $(test_flags) $(LOCAL_TEST_COMPILER_ONDOTNET_FLAGS) @$(test_response) test_response_preprocessed = $(test_response)_preprocessed @@ -272,7 +279,8 @@ ifdef HAVE_CS_XTESTS XTEST_HARNESS_PATH := $(topdir)/../external/xunit-binaries XTEST_HARNESS = $(XTEST_HARNESS_PATH)/xunit.console.exe -XTEST_HARNESS_FLAGS := -noappdomain -noshadow -parallel none -nunit TestResult-$(PROFILE)-xunit.xml +XTEST_RESULT_FILE := TestResult-$(PROFILE)-xunit.xml +XTEST_HARNESS_FLAGS := -noappdomain -noshadow -parallel none -nunit $(XTEST_RESULT_FILE) XTEST_TRAIT := -notrait category=failing -notrait category=nonmonotests -notrait Benchmark=true -notrait category=outerloop # The logic is double inverted so this actually excludes tests not intented for current platform # best to search for `property name="category"` in the xml output to see what's going on @@ -294,22 +302,23 @@ XTEST_COVERAGE_FLAGS = -O=-aot --profile=coverage:output=$(topdir)/class/lib/$(P endif check: run-xunit-test-local -xunit-test-local: $(xunit_test_lib) +xunit-test-local: $(xtest_lib_output) run-xunit-test-local: run-xunit-test-lib -# cp -rf is a HACK for xunit runner to require xunit.execution.desktop.dll file in local folder on .net only -run-xunit-test-lib: xunit-test-local $(XTEST_REMOTE_EXECUTOR) - @cp -rf $(XTEST_HARNESS_PATH)/xunit.execution.desktop.dll xunit.execution.desktop.dll +# cp -rf is a HACK for xunit runner to require xunit.execution.dOTNET.dll file in local folder on .net only +run-xunit-test-lib: xunit-test-local + @cp -rf $(XTEST_HARNESS_PATH)/xunit.execution.dotnet.dll $(test_lib_dir)/xunit.execution.dotnet.dll ok=:; \ - PATH="$(TEST_RUNTIME_WRAPPERS_PATH):$(PATH)" REMOTE_EXECUTOR=$(XTEST_REMOTE_EXECUTOR) $(TEST_RUNTIME) $(TEST_RUNTIME_FLAGS) $(XTEST_COVERAGE_FLAGS) $(AOT_RUN_FLAGS) $(XTEST_HARNESS) $(xunit_test_lib) $(XTEST_HARNESS_FLAGS) $(XTEST_TRAIT) $(XTEST_TRAIT_PLATFORM) || ok=false; \ + PATH="$(TEST_RUNTIME_WRAPPERS_PATH):$(PATH)" REMOTE_EXECUTOR="$(XTEST_REMOTE_EXECUTOR_ABSPATH)" $(TEST_RUNTIME) $(TEST_RUNTIME_FLAGS) $(XTEST_COVERAGE_FLAGS) $(AOT_RUN_FLAGS) $(XTEST_HARNESS) $(xtest_lib_output) $(XTEST_HARNESS_FLAGS) $(XTEST_TRAIT) $(XTEST_TRAIT_PLATFORM) || ok=false; \ + if [ -n "$$MONO_BABYSITTER_NUNIT_XML_LIST_FILE" ]; then echo "$(abspath $(XTEST_RESULT_FILE))" >> "$$MONO_BABYSITTER_NUNIT_XML_LIST_FILE"; fi; \ $$ok - @rm -f xunit.execution.desktop.dll + @rm -f $(test_lib_dir)/xunit.execution.dotnet.dll # Some xunit tests want to be executed in a separate process (see RemoteExecutorTestBase) -$(XTEST_REMOTE_EXECUTOR): $(topdir)/../external/corefx/src/Common/tests/System/Diagnostics/RemoteExecutorConsoleApp/RemoteExecutorConsoleApp.cs +$(XTEST_REMOTE_EXECUTOR): $(topdir)/../external/corefx/src/Common/tests/System/Diagnostics/RemoteExecutorConsoleApp/RemoteExecutorConsoleApp.cs | $(test_lib_dir) $(TEST_COMPILE) -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll $< -out:$@ -$(xunit_test_lib): $(the_assembly) $(xtest_response) $(xunit_libs_dep) $(xunit_src) +$(xtest_lib_output): $(the_assembly) $(xtest_response) $(xunit_libs_dep) $(xunit_src) $(XTEST_REMOTE_EXECUTOR) | $(test_lib_dir) $(TEST_COMPILE) $(LIBRARY_FLAGS) $(XTEST_LIB_FLAGS) -target:library -out:$@ $(xtest_flags) @$(xtest_response) $(xunit_src) xtest_response_preprocessed = $(xtest_response)_preprocessed @@ -321,7 +330,7 @@ $(xtest_response): $(xtest_sourcefile) $(wildcard $(xtest_sourcefile_excludes)) $(xtest_makefrag): $(xtest_response) @echo Creating $@ ... - @sed 's,^,$(xunit_test_lib): ,' $< >$@ + @sed 's,^,$(xtest_lib_output): ,' $< >$@ -include $(xtest_makefrag) diff --git a/mcs/class/Mono.Profiler.Log/Makefile b/mcs/class/Mono.Profiler.Log/Makefile index 15aefd3f216..3791df0d6a5 100644 --- a/mcs/class/Mono.Profiler.Log/Makefile +++ b/mcs/class/Mono.Profiler.Log/Makefile @@ -11,17 +11,18 @@ LIB_MCS_FLAGS = /unsafe /publicsign /nowarn:0618 XTEST_LIB_REFS = System System.Core Facades/System.Threading.Tasks -xunit-test-local: log-profiler-test.exe +xunit-test-local: $(topdir)/class/lib/$(PROFILE_DIRECTORY)/tests/log-profiler-test.exe -log-profiler-test.exe: Test/log-profiler-test.cs +$(topdir)/class/lib/$(PROFILE_DIRECTORY)/tests/log-profiler-test.exe: Test/log-profiler-test.cs + mkdir -p $(dir $@) $(CSCOMPILE) $(PLATFORM_DEBUG_FLAGS) /unsafe $(if $(MCS_MODE),,/warnaserror) /r:$(build_libdir)/mscorlib.dll /r:$(build_lib) /out:$@ $< EXTRA_DISTFILES = \ Test/log-profiler-test.cs CLEAN_FILES = \ - log-profiler-test.exe \ - log-profiler-test.exe.mdb \ - log-profiler-test.pdb + $(topdir)/class/lib/$(PROFILE_DIRECTORY)/tests/log-profiler-test.exe \ + $(topdir)/class/lib/$(PROFILE_DIRECTORY)/tests/log-profiler-test.exe.mdb \ + $(topdir)/class/lib/$(PROFILE_DIRECTORY)/tests/log-profiler-test.pdb include ../../build/library.make diff --git a/mcs/class/Mono.Profiler.Log/Test/ProfilerTestRun.cs b/mcs/class/Mono.Profiler.Log/Test/ProfilerTestRun.cs index 3de425c4cc3..5e1155d60b9 100644 --- a/mcs/class/Mono.Profiler.Log/Test/ProfilerTestRun.cs +++ b/mcs/class/Mono.Profiler.Log/Test/ProfilerTestRun.cs @@ -37,8 +37,13 @@ namespace MonoTests.Mono.Profiler.Log { static volatile int _id; + static string _testAssemblyPath; + static Process _currentProcess; + public ProfilerTestRun (string name, string options) { + _testAssemblyPath = Path.Combine (Path.GetDirectoryName (System.Reflection.Assembly.GetExecutingAssembly ().Location), "log-profiler-test.exe"); + _currentProcess = Process.GetCurrentProcess(); Name = name; Options = options; _output = $"test-{_id++}.mlpd"; @@ -57,8 +62,8 @@ namespace MonoTests.Mono.Profiler.Log { using (var proc = new Process ()) { proc.StartInfo = new ProcessStartInfo { UseShellExecute = false, - FileName = Path.GetFullPath (Path.Combine ("..", "..", "..", "runtime", "mono-wrapper")), - Arguments = $"--debug --profile=log:nodefaults,output={_output},{Options} log-profiler-test.exe {Name}", + FileName = _currentProcess.MainModule.FileName, + Arguments = $"--debug --profile=log:nodefaults,output=\"{_output}\",{Options} {_testAssemblyPath} {Name}", }; proc.Start (); diff --git a/mcs/class/System.ComponentModel.Composition.4.5/monodroid_System.ComponentModel.Composition_xtest.dll.exclude.sources b/mcs/class/System.ComponentModel.Composition.4.5/monodroid_System.ComponentModel.Composition_xtest.dll.exclude.sources new file mode 100644 index 00000000000..2948c43db12 --- /dev/null +++ b/mcs/class/System.ComponentModel.Composition.4.5/monodroid_System.ComponentModel.Composition_xtest.dll.exclude.sources @@ -0,0 +1,11 @@ + +../../../external/corefx/src/System.ComponentModel.Composition/tests/*.cs +../../../external/corefx/src/System.ComponentModel.Composition/tests/System/*.cs +../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/*.cs +../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/AttributedModel/*.cs +../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Diagnostics/*.cs +../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Factories/*.cs +../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Primitives/*.cs +../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ReflectionModel/*.cs +../../../external/corefx/src/System.ComponentModel.Composition/tests/System/Integration/*.cs +../../../external/corefx/src/System.ComponentModel.Composition/tests/System/UnitTesting/*.cs diff --git a/mcs/class/System/monodroid_System_xtest.dll.exclude.sources b/mcs/class/System/monodroid_System_xtest.dll.exclude.sources new file mode 100644 index 00000000000..009b279c6b2 --- /dev/null +++ b/mcs/class/System/monodroid_System_xtest.dll.exclude.sources @@ -0,0 +1,15 @@ + +../../../external/corefx/src/System.CodeDom/tests/CodeCollections/*.cs +../../../external/corefx/src/System.CodeDom/tests/CodeExpressions/*.cs +../../../external/corefx/src/System.CodeDom/tests/CodeObjects/*.cs +../../../external/corefx/src/System.CodeDom/tests/CodeStatements/*.cs +../../../external/corefx/src/System.CodeDom/tests/CodeTypeMembers/*.cs +../../../external/corefx/src/System.CodeDom/tests/Compiler/*.cs +../../../external/corefx/src/System.CodeDom/tests/Other/*.cs +../../../external/corefx/src/System.CodeDom/tests/Microsoft/CSharp/*.cs +../../../external/corefx/src/System.CodeDom/tests/Microsoft/VisualBasic/*.cs +../../../external/corefx/src/System.CodeDom/tests/*.cs + +../../../external/corefx/src/System.Net.Security/tests/UnitTests/Fakes/*.cs + +../../../external/corefx/src/System.Text.RegularExpressions/tests/*.cs diff --git a/runtime/Makefile.am b/runtime/Makefile.am index 633bc041357..c9351859da6 100644 --- a/runtime/Makefile.am +++ b/runtime/Makefile.am @@ -1,3 +1,4 @@ + tmpinst = _tmpinst noinst_SCRIPTS = mono-wrapper monodis-wrapper @@ -81,34 +82,49 @@ endif test_profiles = $(filter-out binary_reference_assemblies monodroid_tools,$(build_profiles)) -if BUILD_MCS - MAKE_FLAGS=$(if $(V),,--no-print-directory -s) # The write check is to foil 'make distcheck' -all-local: $(SUPPORT_FILES) $(TEST_SUPPORT_FILES) +all-mcs: $(SUPPORT_FILES) $(TEST_SUPPORT_FILES) if test -w $(mcs_topdir); then :; else chmod -R +w $(mcs_topdir); fi cd $(mcs_topdir) && $(MAKE) $(MAKE_FLAGS) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' CC='$(CC)' all-profiles -# override automake -install: install-exec install-data +install-mcs: install-mcs-exec install-mcs-data # override automake -install-exec: $(SUPPORT_FILES) $(TEST_SUPPORT_FILES) +install-mcs-exec: $(SUPPORT_FILES) $(TEST_SUPPORT_FILES) cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' RUNTIME_HAS_CONSISTENT_GACDIR=yes prefix=$(prefix) install-profiles # override automake -install-data: +install-mcs-data: @: # override automake -uninstall: +uninstall-mcs: cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' RUNTIME_HAS_CONSISTENT_GACDIR=yes prefix=$(prefix) uninstall-profiles -clean-local: +clean-mcs: cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(build_profiles)' clean-profiles -rm -fr $(etctmp) $(tmpinst) +if BUILD_MCS + +all-local: all-mcs + +# override automake +install: install-mcs + +# override automake +install-exec: install-mcs-exec + +# override automake +install-data: install-mcs-data + +# override automake +uninstall: uninstall-mcs + +clean-local: clean-mcs + endif BUILD_MCS TEST_SUPPORT_FILES = $(tmpinst)/bin/mono $(tmpinst)/bin/ilasm $(tmpinst)/bin/csc $(tmpinst)/bin/mcs $(tmpinst)/bin/al diff --git a/scripts/ci/run-jenkins.sh b/scripts/ci/run-jenkins.sh index f4da7c77815..049e87782a5 100755 --- a/scripts/ci/run-jenkins.sh +++ b/scripts/ci/run-jenkins.sh @@ -83,17 +83,20 @@ then wget -qO- https://download.mono-project.com/test/new-certs.tgz| tar zx -C ~/.config/.mono/ fi +if [[ ${CI_TAGS} == *'sdks-llvm'* ]]; then + ${TESTCMD} --label=archive --timeout=120m --fatal make -j ${CI_CPU_COUNT} -C sdks/builds archive-llvm36-llvm32 archive-llvm-llvm{,win}{32,64} NINJA= + exit 0 +fi + if [[ ${CI_TAGS} == *'product-sdks-ios'* ]]; then echo "DISABLE_ANDROID=1" > sdks/Make.config echo "DISABLE_WASM=1" >> sdks/Make.config + echo "DISABLE_DESKTOP=1" >> sdks/Make.config export device_test_suites="Mono.Runtime.Tests System.Core" - ${TESTCMD} --label=build-sim-runtimes --timeout=60m --fatal make -j4 -C sdks/builds package-ios-{sim64,sim32,simtv,simwatch} - ${TESTCMD} --label=build-dev-runtimes --timeout=60m --fatal make -j4 -C sdks/builds package-ios-{target64,target32,targettv,targetwatch} - ${TESTCMD} --label=build-cross-compilers --timeout=60m --fatal make -j4 -C sdks/builds package-ios-{cross64,cross32,crosswatch} + ${TESTCMD} --label=archive --timeout=180m --fatal make -j12 -C sdks/builds archive-ios NINJA= - ${TESTCMD} --label=bcl --timeout=60m --fatal make -j4 -C sdks/builds package-bcl ${TESTCMD} --label=build-tests --timeout=10m --fatal make -C sdks/ios compile-tests ${TESTCMD} --label=run-sim --timeout=20m make -C sdks/ios run-ios-sim-all ${TESTCMD} --label=build-ios-dev --timeout=60m make -C sdks/ios build-ios-dev-all @@ -112,22 +115,19 @@ if [[ ${CI_TAGS} == *'product-sdks-ios'* ]]; if [[ ${CI_TAGS} == *'run-device-tests'* ]]; then for suite in ${device_test_suites}; do ${TESTCMD} --label=run-ios-dev-interp-mixed-${suite} --timeout=10m make -C sdks/ios run-ios-dev-${suite}; done fi - ${TESTCMD} --label=package --timeout=60m tar cvzf mono-product-sdk-$GIT_COMMIT.tar.gz -C sdks/out/ bcl ios-llvm64 ios-llvm32 ios-cross32-release ios-cross64-release exit 0 fi if [[ ${CI_TAGS} == *'product-sdks-android'* ]]; then - echo "IGNORE_PROVISION_ANDROID=1" > sdks/Make.config - echo "IGNORE_PROVISION_MXE=1" >> sdks/Make.config - echo "IGNORE_PROVISION_LLVM=1" >> sdks/Make.config + echo "DISABLE_IOS=1" > sdks/Make.config + echo "DISABLE_WASM=1" >> sdks/Make.config + echo "DISABLE_DESKTOP=1" >> sdks/Make.config echo "DISABLE_CCACHE=1" >> sdks/Make.config - ${TESTCMD} --label=provision-android --timeout=120m --fatal make -j4 -C sdks/builds provision-android - if [[ ${CI_TAGS} == *'provision-mxe'* ]]; then - ${TESTCMD} --label=provision-mxe --timeout=240m --fatal make -j4 -C sdks/builds provision-mxe - fi - ${TESTCMD} --label=llvm --timeout=240m --fatal make -j4 -C sdks/builds provision-llvm-llvm{,win}{32,64} - ${TESTCMD} --label=runtimes --timeout=120m --fatal make -j4 -C sdks/builds package-android-{armeabi,armeabi-v7a,arm64-v8a,x86,x86_64} package-android-host-{Darwin,mxe-Win64} package-android-cross-{arm,arm64,x86,x86_64}{,-win} + + ${TESTCMD} --label=provision-android --timeout=120m --fatal make -j12 -C sdks/builds provision-android + ${TESTCMD} --label=provision-mxe --timeout=240m --fatal make -j12 -C sdks/builds provision-mxe + ${TESTCMD} --label=archive --timeout=180m --fatal make -j12 -C sdks/builds archive-android NINJA= IGNORE_PROVISION_ANDROID=1 IGNORE_PROVISION_MXE=1 exit 0 fi @@ -135,8 +135,10 @@ if [[ ${CI_TAGS} == *'webassembly'* ]]; then echo "DISABLE_ANDROID=1" > sdks/Make.config echo "DISABLE_IOS=1" >> sdks/Make.config - ${TESTCMD} --label=runtimes --timeout=60m --fatal make -j4 -C sdks/builds package-wasm-interp - ${TESTCMD} --label=bcl --timeout=60m --fatal make -j4 -C sdks/builds package-bcl + echo "DISABLE_DESKTOP=1" >> sdks/Make.config + + ${TESTCMD} --label=archive --timeout=180m --fatal make -j4 -C sdks/builds archive-wasm NINJA= + ${TESTCMD} --label=wasm-build --timeout=60m --fatal make -j4 -C sdks/wasm build ${TESTCMD} --label=ch-mini-test --timeout=60m make -C sdks/wasm run-ch-mini ${TESTCMD} --label=v8-mini-test --timeout=60m make -C sdks/wasm run-v8-mini diff --git a/sdks/builds/Makefile b/sdks/builds/Makefile index 6c847bb5a37..b8df0aa6678 100644 --- a/sdks/builds/Makefile +++ b/sdks/builds/Makefile @@ -11,6 +11,7 @@ CCACHE:=$(if $(DISABLE_CCACHE),,$(shell which ccache)) NINJA:=$(shell which ninja) UNAME=$(shell uname) + ifneq ($(UNAME),Darwin) # iOS requires Xcode to be available, and Xcode is only available on macOS DISABLE_IOS=1 @@ -37,7 +38,20 @@ $(TOP)/configure: $(TOP)/configure.ac $(TOP)/autogen.sh TARGETS= +ifndef DISABLE_ANDROID +android_TARGETS= +endif + +ifndef DISABLE_IOS +ios_TARGETS= +endif + +ifndef DISABLE_WASM +wasm_TARGETS= +endif + include runtime.mk +include bcl.mk ## MXE targets ifndef DISABLE_ANDROID @@ -50,11 +64,6 @@ ifeq ($(and $(DISABLE_ANDROID),$(DISABLE_IOS)),) include llvm.mk endif -## BCL targets -ifndef DISABLE_BCL -include bcl.mk -endif - ## Android targets ifndef DISABLE_ANDROID include android.mk @@ -76,6 +85,32 @@ ifndef DISABLE_WASM include wasm.mk endif +## Archive targets + +## +# Parameters: +# $(1): target (android, ios, wasm) +define ArchiveTemplate +_$(1)_HASH = $$(shell git -C $$(TOP) rev-parse HEAD) +_$(1)_PACKAGE = $(1)-$$(CONFIGURATION)-$$(_$(1)_HASH)-$$(UNAME).tar.gz + +.PHONY: archive-$(1) +archive-$(1): $$(foreach target,$$(filter $(1)-%,$$(patsubst %-$$(CONFIGURATION),%,$$($(1)_TARGETS))),package-$$(target)) + tar -cvzf $$(TOP)/$$(_$(1)_PACKAGE) -C $$(TOP)/sdks/out $$(sort $$(foreach target,$$($(1)_TARGETS),$$(or $$(wildcard $$(target)-$$(CONFIGURATION)),$$(target)))) +endef + +ifndef DISABLE_ANDROID +$(eval $(call ArchiveTemplate,android)) +endif + +ifndef DISABLE_IOS +$(eval $(call ArchiveTemplate,ios)) +endif + +ifndef DISABLE_WASM +$(eval $(call ArchiveTemplate,wasm)) +endif + ## Generic targets .PHONY: $(foreach target,$(TARGETS),toolchain-$(target)) $(foreach target,$(TARGETS),toolchain-$(target)): toolchain-%: .stamp-%-toolchain diff --git a/sdks/builds/android.mk b/sdks/builds/android.mk index 34b55a4ee59..a207d2f5040 100644 --- a/sdks/builds/android.mk +++ b/sdks/builds/android.mk @@ -29,9 +29,6 @@ provision-android-$(3)-$(1): $$(ANDROID_TOOLCHAIN_DIR)/$(3)$$(if $(2),/$(2))/.st .PHONY: provision-android provision-android: provision-android-$(3)-$(1) -.PHONY: provision -provision: provision-android-$(3)-$(1) - endef AndroidNDKProvisioningTemplate=$(call AndroidProvisioningTemplate,$(1),,ndk,$(ANDROID_URI)) @@ -161,6 +158,8 @@ _android-$(1)_CONFIGURE_FLAGS= \ $$(eval $$(call RuntimeTemplate,android-$(1),$(4))) +android_TARGETS += android-$(1)-$$(CONFIGURATION) + endef ## android-armeabi @@ -206,17 +205,19 @@ _android-$(1)_LD=ld _android-$(1)_RANLIB=ranlib _android-$(1)_STRIP=strip +_android-$(1)_CFLAGS= \ + $$(if $$(filter $$(UNAME),Darwin),-mmacosx-version-min=10.9) + _android-$(1)_CONFIGURE_FLAGS= \ --disable-boehm \ --disable-iconv \ --disable-mono-debugger \ --disable-nls \ + --disable-mcs-build \ --enable-dynamic-btls \ --enable-maintainer-mode \ --enable-monodroid \ --with-mcs-docs=no \ - --with-monodroid \ - --with-profile4_x=no \ --without-ikvm-native .stamp-android-$(1)-toolchain: @@ -224,11 +225,11 @@ _android-$(1)_CONFIGURE_FLAGS= \ $$(eval $$(call RuntimeTemplate,android-$(1))) +android_TARGETS += android-$(1)-$$(CONFIGURATION) + endef -android-host-Darwin_CFLAGS=-mmacosx-version-min=10.9 -$(eval $(call AndroidHostTemplate,host-Darwin)) -$(eval $(call AndroidHostTemplate,host-Linux)) +$(eval $(call AndroidHostTemplate,host-$(UNAME))) ## # Parameters @@ -274,12 +275,12 @@ _android-$(1)_CONFIGURE_FLAGS= \ $$(eval $$(call RuntimeTemplate,android-$(1),$(2)-w64-mingw32$$(if $$(filter $(UNAME),Darwin),.static))) +android_TARGETS += android-$(1)-$$(CONFIGURATION) + endef -ifneq ($(MXE_PREFIX),) $(eval $(call AndroidHostMxeTemplate,host-mxe-Win32,i686)) $(eval $(call AndroidHostMxeTemplate,host-mxe-Win64,x86_64)) -endif ## # Parameters @@ -322,6 +323,8 @@ _android-$(1)_CONFIGURE_FLAGS= \ $$(eval $$(call CrossRuntimeTemplate,android-$(1),$$(if $$(filter $$(UNAME),Darwin),$(2)-apple-darwin10,$$(if $$(filter $$(UNAME),Linux),$(2)-linux-gnu,$$(error "Unknown UNAME='$$(UNAME)'"))),$(3)-linux-android,$(4),$(5),$(6))) +android_TARGETS += android-$(1)-$$(CONFIGURATION) $(5) + endef $(eval $(call AndroidCrossTemplate,cross-arm,i686,armv7,android-armeabi-v7a,llvm-llvm32,armv7-none-linux-androideabi)) @@ -382,9 +385,14 @@ _android-$(1)_CONFIGURE_FLAGS= \ $$(eval $$(call CrossRuntimeTemplate,android-$(1),$(2)-w64-mingw32$$(if $$(filter $(UNAME),Darwin),.static),$(3)-linux-android,$(4),$(5),$(6))) +android_TARGETS += android-$(1)-$$(CONFIGURATION) $(5) + endef $(eval $(call AndroidCrossMXETemplate,cross-arm-win,i686,armv7,android-armeabi-v7a,llvm-llvmwin32,armv7-none-linux-androideabi)) $(eval $(call AndroidCrossMXETemplate,cross-arm64-win,x86_64,aarch64-v8a,android-arm64-v8a,llvm-llvmwin64,aarch64-v8a-linux-android)) $(eval $(call AndroidCrossMXETemplate,cross-x86-win,i686,i686,android-x86,llvm-llvmwin32,i686-none-linux-android)) $(eval $(call AndroidCrossMXETemplate,cross-x86_64-win,x86_64,x86_64,android-x86_64,llvm-llvmwin64,x86_64-none-linux-android)) + +$(eval $(call BclTemplate,android-bcl,monodroid monodroid_tools,monodroid)) +android_TARGETS += android-bcl diff --git a/sdks/builds/bcl.mk b/sdks/builds/bcl.mk index 445b96a0583..e18e3f58ac2 100644 --- a/sdks/builds/bcl.mk +++ b/sdks/builds/bcl.mk @@ -1,41 +1,59 @@ -.stamp-bcl-toolchain: - touch $@ - -bcl-ios_CONFIGURE_FLAGS = \ - --with-monotouch=yes \ - --with-monotouch_tv=yes \ - --with-xammac=yes \ - --with-monotouch_watch=yes - -bcl_CONFIGURE_FLAGS = \ - $(if $(DISABLE_DESKTOP),--with-profile4_x=no,--with-profile4_x=yes) \ - $(if $(DISABLE_ANDROID),,--with-monodroid=yes) \ - $(if $(DISABLE_IOS),,$(bcl-ios_CONFIGURE_FLAGS)) \ - $(if $(DISABLE_WASM),,--with-wasm=yes) \ - --with-mcs-docs=no \ - --disable-nls \ - --disable-btls-lib \ - --disable-support-build \ - --disable-boehm +_bcl_CONFIGURE_FLAGS = \ + --disable-boehm \ + --disable-btls-lib \ + --disable-nls \ + --disable-support-build \ + --with-mcs-docs=no .stamp-bcl-configure: $(TOP)/configure mkdir -p $(TOP)/sdks/builds/bcl - cd $(TOP)/sdks/builds/bcl && $(TOP)/configure $(bcl_CONFIGURE_FLAGS) + ./wrap-configure.sh $(TOP)/sdks/builds/bcl $(abspath $<) $(_bcl_CONFIGURE_FLAGS) touch $@ -$(TOP)/sdks/out/bcl/monodroid $(TOP)/sdks/out/bcl/monotouch $(TOP)/sdks/out/bcl/wasm $(TOP)/sdks/out/bcl/net_4_x: - mkdir -p $@ - -.PHONY: package-bcl -package-bcl: | $(TOP)/sdks/out/bcl/net_4_x $(TOP)/sdks/out/bcl/monodroid $(TOP)/sdks/out/bcl/monotouch $(TOP)/sdks/out/bcl/wasm - if [ -d $(TOP)/mcs/class/lib/monodroid ]; then cp -R $(TOP)/mcs/class/lib/monodroid/* $(TOP)/sdks/out/bcl/monodroid; fi - if [ -d $(TOP)/mcs/class/lib/monotouch ]; then cp -R $(TOP)/mcs/class/lib/monotouch/* $(TOP)/sdks/out/bcl/monotouch; fi - if [ -d $(TOP)/mcs/class/lib/wasm ]; then cp -R $(TOP)/mcs/class/lib/wasm/* $(TOP)/sdks/out/bcl/wasm; fi - if [ -d $(TOP)/mcs/class/lib/net_4_x ]; then cp -R $(TOP)/mcs/class/lib/net_4_x/* $(TOP)/sdks/out/bcl/net_4_x; fi +.PHONY: build-bcl +build-bcl: .stamp-bcl-configure + $(MAKE) -C bcl -C mono + $(MAKE) -C bcl -C runtime all-mcs build_profiles="build" .PHONY: clean-bcl clean-bcl: - rm -rf .stamp-bcl-toolchain .stamp-bcl-configure $(TOP)/sdks/builds/bcl $(TOP)/sdks/out/bcl + rm -rf .stamp-bcl-configure $(TOP)/sdks/builds/bcl + +## +# Parameters +# $(1): target +# $(2): build profiles +# $(3): test profiles +define BclTemplate + +.stamp-$(1)-toolchain: + touch $$@ + +.stamp-$(1)-configure: .stamp-bcl-configure + touch $$@ + +.PHONY: setup-custom-$(1) +setup-custom-$(1): + mkdir -p $$(TOP)/sdks/out/$(1) $$(foreach profile,$(2),$$(TOP)/sdks/out/$(1)/$$(profile)) + +.PHONY: build-$(1) +build-$(1): build-bcl + +.PHONY: build-custom-$(1) +build-custom-$(1): + $$(MAKE) -C bcl -C runtime all-mcs build_profiles="$(2)" + $$(if $(3),$$(MAKE) -C bcl -C runtime test xunit-test test_profiles="$(3)") + +.PHONY: package-$(1) +package-$(1): + $$(foreach profile,$(2), \ + cp -R $$(TOP)/mcs/class/lib/$$(profile)/* $$(TOP)/sdks/out/$(1)/$$(profile);) + +.PHONY: clean-$(1) +clean-$(1): clean-bcl + rm -rf $$(TOP)/sdks/out/$(1) $$(foreach profile,$(2),$$(TOP)/sdks/out/$(1)/$$(profile)) + +TARGETS += $(1) -TARGETS += bcl +endef diff --git a/sdks/builds/desktop.mk b/sdks/builds/desktop.mk index 72a3581f8b6..1ea72a58094 100644 --- a/sdks/builds/desktop.mk +++ b/sdks/builds/desktop.mk @@ -28,3 +28,14 @@ $$(eval $$(call RuntimeTemplate,desktop-$(1),$(2))) endef $(eval $(call DesktopTemplate,x86_64,x86_64-apple-darwin17.2.0)) + +## +# Parameters +# $(1): build profiles +define DesktopBclTemplate + +$$(eval $$(call BclTemplate,desktop,$(1),)) + +endef + +$(eval $(call DesktopBclTemplate,net_4_x)) diff --git a/sdks/builds/ios.mk b/sdks/builds/ios.mk index 673766de52e..4a1cabadfb9 100644 --- a/sdks/builds/ios.mk +++ b/sdks/builds/ios.mk @@ -12,16 +12,6 @@ PLATFORM_BIN=$(XCODE_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/bin -ios_CPPFLAGS=-DMONOTOUCH=1 - -ios_LDFLAGS= - -COMMON_LDFLAGS=-Wl,-no_weak_imports - -BITCODE_CFLAGS=-fexceptions -BITCODE_LDFLAGS=-framework CoreFoundation -lobjc -lc++ -BITCODE_CONFIGURE_FLAGS=--enable-llvm-runtime --with-bitcode=yes - ## # Device builds # @@ -78,7 +68,7 @@ _ios-$(1)_CXXFLAGS= \ $$(ios-$(1)_BITCODE_MARKER) _ios-$(1)_CPPFLAGS= \ - $$(ios_CPPFLAGS) \ + -DMONOTOUCH=1 \ $$(ios-$(1)_SYSROOT) \ -arch $(3) \ -DSMALL_CONFIG -DDISABLE_POLICY_EVIDENCE=1 -D_XOPEN_SOURCE -DHOST_IOS -DHAVE_LARGE_FILE_SUPPORT=1 \ @@ -114,6 +104,8 @@ _ios-$(1)_CONFIGURE_FLAGS = \ $$(eval $$(call RuntimeTemplate,ios-$(1),$(2)-apple-darwin10)) +ios_TARGETS += ios-$(1)-$$(CONFIGURATION) + endef ios_sysroot = -isysroot $(XCODE_DIR)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS$(IOS_VERSION).sdk -miphoneos-version-min=$(IOS_VERSION_MIN) @@ -121,8 +113,8 @@ tvos_sysroot = -isysroot $(XCODE_DIR)/Platforms/AppleTVOS.platform/Developer/SDK watchos_sysroot = -isysroot $(XCODE_DIR)/Platforms/WatchOS.platform/Developer/SDKs/WatchOS$(WATCH_VERSION).sdk -mwatchos-version-min=$(WATCHOS_VERSION_MIN) # explicitly disable dtrace, since it requires inline assembly, which is disabled on AppleTV (and mono's configure.ac doesn't know that (yet at least)) -ios-targettv_CONFIGURE_FLAGS = --enable-dtrace=no $(BITCODE_CONFIGURE_FLAGS) -ios-targetwatch_CONFIGURE_FLAGS = --enable-cooperative-suspend $(BITCODE_CONFIGURE_FLAGS) +ios-targettv_CONFIGURE_FLAGS = --enable-dtrace=no --enable-llvm-runtime --with-bitcode=yes +ios-targetwatch_CONFIGURE_FLAGS = --enable-cooperative-suspend --enable-llvm-runtime --with-bitcode=yes ios-target32_SYSROOT = $(ios_sysroot) ios-target32s_SYSROOT = $(ios_sysroot) @@ -141,8 +133,8 @@ ios-targettv_CXXFLAGS = -fembed-bitcode -fno-gnu-inline-asm ios-targetwatch_CFLAGS = -fembed-bitcode -fno-gnu-inline-asm ios-targetwatch_CXXFLAGS = -fembed-bitcode -fno-gnu-inline-asm -ios-targettv_LDFLAGS = -Wl,-bitcode_bundle $(BITCODE_LDFLAGS) -ios-targetwatch_LDFLAGS = -Wl,-bitcode_bundle $(BITCODE_LDFLAGS) +ios-targettv_LDFLAGS = -Wl,-bitcode_bundle -framework CoreFoundation -lobjc -lc++ +ios-targetwatch_LDFLAGS = -Wl,-bitcode_bundle -framework CoreFoundation -lobjc -lc++ ios-targettv_AC_VARS = \ ac_cv_func_system=no \ @@ -203,7 +195,7 @@ _ios-$(1)_CFLAGS= \ -Wl,-application_extension _ios-$(1)_CPPFLAGS= \ - $$(ios_CPPFLAGS) \ + -DMONOTOUCH=1 \ $$(ios-$(1)_SYSROOT) \ -arch $(2) \ -Wl,-application_extension @@ -213,9 +205,6 @@ _ios-$(1)_CXXFLAGS= \ -arch $(2) \ -Wl,-application_extension -_ios-$(1)_LDFLAGS= \ - $$(ios_LDFLAGS) - _ios-$(1)_CONFIGURE_FLAGS= \ --disable-boehm \ --disable-btls \ @@ -237,6 +226,8 @@ _ios-$(1)_CONFIGURE_FLAGS= \ $$(eval $$(call RuntimeTemplate,ios-$(1),$(2)-apple-darwin10)) +ios_TARGETS += ios-$(1)-$$(CONFIGURATION) + endef ios_sim_sysroot = -isysroot $(XCODE_DIR)/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator$(IOS_VERSION).sdk -mios-simulator-version-min=$(IOS_VERSION_MIN) @@ -318,7 +309,6 @@ _ios-$(1)_CPPFLAGS= \ -DMONOTOUCH=1 _ios-$(1)_LDFLAGS= \ - $$(ios_LDFLAGS) \ -stdlib=libc++ _ios-$(1)_CONFIGURE_FLAGS= \ @@ -334,9 +324,20 @@ _ios-$(1)_CONFIGURE_FLAGS= \ $$(eval $$(call CrossRuntimeTemplate,ios-$(1),$(2)-apple-darwin10,$(3)-darwin,$(4),$(5),$(6))) +ios_TARGETS += ios-$(1)-$$(CONFIGURATION) $(5) + endef $(eval $(call iOSCrossTemplate,cross32,i386,arm,ios-target32,llvm36-llvm32,arm-apple-darwin10)) $(eval $(call iOSCrossTemplate,cross64,x86_64,aarch64,ios-target64,llvm-llvm64,aarch64-apple-darwin10)) ios-crosswatch_CONFIGURE_FLAGS=--enable-cooperative-suspend $(eval $(call iOSCrossTemplate,crosswatch,i386,armv7k-unknown,ios-targetwatch,llvm36-llvm32,armv7k-apple-darwin)) + +$(eval $(call BclTemplate,ios-bcl,monotouch monotouch_tv monotouch_runtime monotouch_tv_runtime)) +ios_TARGETS += ios-bcl + +$(eval $(call BclTemplate,ios-watchbcl,monotouch_watch monotouch_watch_runtime)) +ios_TARGETS += ios-watchbcl + +# Both BCL builds can't be run concurrently +build-ios-watchbcl: build-ios-bcl diff --git a/sdks/builds/llvm.mk b/sdks/builds/llvm.mk index 7ae50337bc0..bd54780a0cf 100644 --- a/sdks/builds/llvm.mk +++ b/sdks/builds/llvm.mk @@ -26,81 +26,42 @@ llvm_CMAKE_FLAGS = \ ## # Parameters -# $(1): target -# $(2): jenkins lane -# $(3): revision hash -define LLVMDownloadTemplate -# The rule suceed even if we fail to download. This makes the caller have to check for the precense of the output file, -# but you should use the `provision-llvm-*` in any case. -.stamp-$(1)-download: -ifeq ($(UNAME),Darwin) -ifeq ($(DISABLE_DOWNLOAD_LLVM),) - mkdir -p $$(TOP)/sdks/builds/toolchains/$(1)-download - -wget --no-verbose -O - http://xamjenkinsartifact.blob.core.windows.net/$(2)/llvm-osx64-$(3).tar.gz | tar -xC $$(TOP)/sdks/builds/toolchains/$(1)-download -f - - touch $$@ -endif -endif -endef - -$(eval $(call LLVMDownloadTemplate,llvm,$(LLVM_JENKINS_LANE),$(LLVM_HASH))) -$(eval $(call LLVMDownloadTemplate,llvm36,$(LLVM36_JENKINS_LANE),$(LLVM36_HASH))) - -## -# Parameters # $(1): version # $(2): target -# $(3): bitness -# $(4): configure script +# $(3): configure script define LLVMProvisionTemplate -ifeq ($(UNAME),Darwin) -.stamp-$(1)-$(2)-unpack: - cp -r $$(TOP)/sdks/builds/toolchains/$(1)-download/usr$(3)/* $$(TOP)/sdks/out/$(1)-$(2) - touch $$@ - -.PHONY: unpack-$(1)-$(2) -unpack-$(1)-$(2): .stamp-$(1)-$(2)-unpack - -.PHONY: provision-$(1)-$(2) -provision-$(1)-$(2): .stamp-$(1)-download | setup-$(1)-$(2) $(4) - $$(MAKE) $$(if $$(wildcard $$(TOP)/sdks/builds/toolchains/$(1)-download/usr$(3)),unpack,package)-$(1)-$(2) +_$(1)-$(2)_HASH = $$(shell git -C $$(dir $(3)) rev-parse HEAD) +_$(1)-$(2)_PACKAGE = $(1)-$(2)-$$(_$(1)-$(2)_HASH)-$$(UNAME).tar.gz +_$(1)-$(2)_URL = "http://xamjenkinsartifact.blob.core.windows.net/mono-sdks/$$(_$(1)-$(2)_PACKAGE)" -.PHONY: clean-$(1)-$(2) -clean-$(1)-$(2):: - rm -rf .stamp-$(1)-download .stamp-$(1)-$(2)-unpack $$(TOP)/sdks/builds/toolchains/$(1)-download $$(TOP)/sdks/out/$(1)-$(2) -else -.PHONY: provision-$(1)-$(2) -provision-$(1)-$(2): package-$(1)-$(2) -endif - -.PHONY: provision -provision: provision-$(1)-$(2) -endef +$$(TOP)/sdks/out/$(1)-$(2)/.stamp-download: + curl --location --silent --show-error $$(_$(1)-$(2)_URL) | tar -xvzf - -C $$(dir $$@) + touch $$@ -$(eval $(call LLVMProvisionTemplate,llvm,llvm32,32,$(LLVM_SRC)/CMakeLists.txt)) -$(eval $(call LLVMProvisionTemplate,llvm,llvm64,64,$(LLVM_SRC)/CMakeLists.txt)) -$(eval $(call LLVMProvisionTemplate,llvm36,llvm32,32,$(LLVM36_SRC)/configure)) +.PHONY: download-$(1)-$(2) +download-$(1)-$(2): $(3) | setup-$(1)-$(2) + -$$(MAKE) $$(TOP)/sdks/out/$(1)-$(2)/.stamp-download -## -# Parameters -# $(1): version -# $(2): target -# $(3): bitness -# $(4): configure script -define LLVMMXEProvisionTemplate .PHONY: provision-$(1)-$(2) -provision-$(1)-$(2): | package-$(1)-$(2) $(4) +provision-$(1)-$(2): $(3) | download-$(1)-$(2) + $$(if $$(wildcard $$(TOP)/sdks/out/$(1)-$(2)/.stamp-download),,$$(MAKE) package-$(1)-$(2)) -.PHONY: provision -provision: provision-$(1)-$(2) +.PHONY: archive-$(1)-$(2) +archive-$(1)-$(2): package-$(1)-$(2) + tar -cvzf $$(TOP)/$$(_$(1)-$(2)_PACKAGE) -C $$(TOP)/sdks/out/$(1)-$(2) . endef -$(eval $(call LLVMMXEProvisionTemplate,llvm,llvmwin32,32,$(LLVM_SRC)/CMakeLists.txt)) -$(eval $(call LLVMMXEProvisionTemplate,llvm,llvmwin64,64,$(LLVM_SRC)/CMakeLists.txt)) +$(eval $(call LLVMProvisionTemplate,llvm,llvm32,$(LLVM_SRC)/CMakeLists.txt)) +$(eval $(call LLVMProvisionTemplate,llvm,llvm64,$(LLVM_SRC)/CMakeLists.txt)) +$(eval $(call LLVMProvisionTemplate,llvm,llvmwin32,$(LLVM_SRC)/CMakeLists.txt)) +$(eval $(call LLVMProvisionTemplate,llvm,llvmwin64,$(LLVM_SRC)/CMakeLists.txt)) +ifeq ($(UNAME),Darwin) +$(eval $(call LLVMProvisionTemplate,llvm36,llvm32,$(LLVM36_SRC)/configure)) +endif ## # Parameters # $(1): target -# $(2): arch define LLVMTemplate _llvm-$(1)_CMAKE_FLAGS = \ @@ -119,11 +80,11 @@ setup-llvm-$(1): .PHONY: build-llvm-$(1) build-llvm-$(1): .stamp-llvm-$(1)-configure - cmake --build $$(TOP)/sdks/builds/llvm-$(1) + $$(or $$(NINJA),$$(MAKE)) -C $$(TOP)/sdks/builds/llvm-$(1) .PHONY: package-llvm-$(1) package-llvm-$(1): setup-llvm-$(1) build-llvm-$(1) - cmake --build $$(TOP)/sdks/builds/llvm-$(1) --target install + $$(or $$(NINJA),$$(MAKE)) -C $$(TOP)/sdks/builds/llvm-$(1) install .PHONY: clean-llvm-$(1) clean-llvm-$(1):: @@ -132,8 +93,8 @@ clean-llvm-$(1):: endef llvm-llvm32_CMAKE_FLAGS=-DLLVM_BUILD_32_BITS=On -$(eval $(call LLVMTemplate,llvm32,i386)) -$(eval $(call LLVMTemplate,llvm64,x86_64)) +$(eval $(call LLVMTemplate,llvm32)) +$(eval $(call LLVMTemplate,llvm64)) ## # Parameters @@ -188,7 +149,9 @@ clean-llvm36-$(1):: endef +ifeq ($(UNAME),Darwin) $(eval $(call LLVM36Template,llvm32,i386)) +endif ## # Parameters @@ -223,10 +186,10 @@ setup-llvm-$(1): .PHONY: build-llvm-$(1) build-llvm-$(1): .stamp-llvm-$(1)-configure - $$(_llvm-$(1)_CMAKE) --build $$(TOP)/sdks/builds/llvm-$(1) + $$(or $$(NINJA),$$(MAKE)) -C $$(TOP)/sdks/builds/llvm-$(1) package-llvm-$(1): setup-llvm-$(1) build-llvm-$(1) - $$(_llvm-$(1)_CMAKE) --build $$(TOP)/sdks/builds/llvm-$(1) --target install + $$(or $$(NINJA),$$(MAKE)) -C $$(TOP)/sdks/builds/llvm-$(1) install .PHONY: clean-llvm-$(1) clean-llvm-$(1):: diff --git a/sdks/builds/runtime.mk b/sdks/builds/runtime.mk index fa63d9cf002..7dda8f6d827 100644 --- a/sdks/builds/runtime.mk +++ b/sdks/builds/runtime.mk @@ -25,15 +25,7 @@ # _$(1)_PATH define RuntimeTemplate -_runtime_$(1)_BITNESS=$$(if $$(findstring i686,$(2)),-m32) - -ifeq ($$(_runtime_$(1)_BITNESS),) -_runtime_$(1)_BITNESS=$$(if $$(findstring i386,$(2)),-m32) -endif - -ifeq ($$(_runtime_$(1)_BITNESS),) -_runtime_$(1)_BITNESS=$$(if $$(findstring x86_64,$(2)),-m64) -endif +_runtime_$(1)_BITNESS=$$(if $$(or $$(findstring i686,$(2)),$$(findstring i386,$(2))),-m32,$$(if $$(findstring x86_64,$(2)),-m64)) _runtime_$(1)_CFLAGS=$(if $(RELEASE),-O2 -g,-O0 -ggdb3 -fno-omit-frame-pointer) $$(_$(1)_CFLAGS) $$($(1)_CFLAGS) $$(_runtime_$(1)_BITNESS) _runtime_$(1)_CXXFLAGS=$(if $(RELEASE),-O2 -g,-O0 -ggdb3 -fno-omit-frame-pointer) $$(_$(1)_CXXFLAGS) $$($(1)_CXXFLAGS) $$(_runtime_$(1)_BITNESS) @@ -67,6 +59,7 @@ _runtime_$(1)_CONFIGURE_FLAGS= \ $$(if $(2),--host=$(2)) \ --cache-file=$$(TOP)/sdks/builds/$(1)-$$(CONFIGURATION).config.cache \ --prefix=$$(TOP)/sdks/out/$(1)-$$(CONFIGURATION) \ + $$(if $$(ENABLE_CXX),--enable-cxx) \ $$(_cross-runtime_$(1)_CONFIGURE_FLAGS) \ $$(_$(1)_CONFIGURE_FLAGS) \ $$($(1)_CONFIGURE_FLAGS) @@ -76,8 +69,8 @@ _runtime_$(1)_CONFIGURE_FLAGS= \ $(if $$(_$(1)_PATH),PATH="$$$$PATH:$$(_$(1)_PATH)") ./wrap-configure.sh $$(TOP)/sdks/builds/$(1)-$$(CONFIGURATION) $$(abspath $$<) $$(_runtime_$(1)_AC_VARS) $$(_runtime_$(1)_CONFIGURE_ENVIRONMENT) $$(_runtime_$(1)_CONFIGURE_FLAGS) touch $$@ -.PHONY: .stamp-$(1)-configure .stamp-$(1)-configure: .stamp-$(1)-$$(CONFIGURATION)-configure + touch $$@ .PHONY: build-custom-$(1) build-custom-$(1): diff --git a/sdks/builds/wasm.mk b/sdks/builds/wasm.mk index 38de6a70a80..3c7faab3594 100644 --- a/sdks/builds/wasm.mk +++ b/sdks/builds/wasm.mk @@ -53,5 +53,7 @@ clean-wasm-interp: clean-wasm TARGETS += wasm-interp +wasm_TARGETS += wasm-interp - +$(eval $(call BclTemplate,wasm-bcl,wasm)) +wasm_TARGETS += wasm-bcl diff --git a/sdks/desktop/Makefile b/sdks/desktop/Makefile index a741d8695eb..bd1f9fb4c5e 100644 --- a/sdks/desktop/Makefile +++ b/sdks/desktop/Makefile @@ -2,12 +2,12 @@ TOP=$(realpath $(CURDIR)/../..) include $(TOP)/sdks/paths.mk run: $(CURDIR)/net_4_x_Mono.Debugger.Soft_test.dll $(TOP)/sdks/out/desktop-x86_64/bin/mono-sgen - MONO_TESTS_IN_PROGRESS="yes" MONO_PATH="$(CURDIR)/../out/bcl/net_4_x" $(TOP)/sdks/out/desktop-x86_64/bin/mono-sgen --debug $(CURDIR)/../out/bcl/net_4_x/nunit-lite-console.exe $(CURDIR)/net_4_x_Mono.Debugger.Soft_test.dll -exclude=NotOnMac,MacNotWorking,NotWorking,CAS -format:nunit2 + MONO_TESTS_IN_PROGRESS="yes" MONO_PATH="$(CURDIR)/../out/desktop-bcl/net_4_x" $(TOP)/sdks/out/desktop-x86_64/bin/mono-sgen --debug $(CURDIR)/../out/desktop-bcl/net_4_x/nunit-lite-console.exe $(CURDIR)/net_4_x_Mono.Debugger.Soft_test.dll -exclude=NotOnMac,MacNotWorking,NotWorking,CAS -format:nunit2 .PHONY: $(CURDIR)/net_4_x_Mono.Debugger.Soft_test.dll $(CURDIR)/net_4_x_Mono.Debugger.Soft_test.dll: $(TOP)/mcs/class/lib/net_4_x/tests/net_4_x_Mono.Debugger.Soft_test.dll cp $(TOP)/mcs/class/lib/net_4_x/tests/net_4_x_Mono.Debugger.Soft_test.dll $(CURDIR)/net_4_x_Mono.Debugger.Soft_test.dll - cp $(TOP)/mcs/class/lib/net_4_x/nunit* $(CURDIR)/../out/bcl/net_4_x + cp $(TOP)/mcs/class/lib/net_4_x/nunit* $(CURDIR)/../out/desktop-bcl/net_4_x .PHONY: $(TOP)/mcs/class/lib/net_4_x/tests/net_4_x_Mono.Debugger.Soft_test.dll $(TOP)/mcs/class/lib/net_4_x/tests/net_4_x_Mono.Debugger.Soft_test.dll: diff --git a/sdks/paths.mk b/sdks/paths.mk index f0df1febc56..646264fbc89 100644 --- a/sdks/paths.mk +++ b/sdks/paths.mk @@ -7,7 +7,7 @@ ifeq ($(call CheckXcodeDir,$(XCODE_DIR)),) $(error Could not find Xcode at $(XCODE_DIR)) endif -endif # DISABLE_IOS +endif ifndef DISABLE_ANDROID diff --git a/sdks/wasm/Makefile b/sdks/wasm/Makefile index 14ce013eabf..642dec7b93c 100644 --- a/sdks/wasm/Makefile +++ b/sdks/wasm/Makefile @@ -13,7 +13,7 @@ DRIVER_CONF=debug EMCC=source $(TOP)/sdks/builds/toolchains/emsdk/emsdk_env.sh && emcc -WASM_BCL_DIR=$(TOP)/sdks/out/bcl/wasm +WASM_BCL_DIR=$(TOP)/sdks/out/wasm-bcl/wasm MANAGED_DEPLOY_DIR=$(TOP)/sdks/wasm/managed MINI_PATH=$(TOP)/mono/mini CSC= MONO_PATH=$(TOP)/mcs/class/lib/build $(TOP)/sdks/builds/bcl/runtime/mono-wrapper $(CSC_LOCATION) @@ -171,7 +171,7 @@ package: build rm -rf tmp mkdir tmp mkdir tmp/bcl - cp -r $(TOP)/sdks/out/bcl/wasm/* tmp/bcl/ + cp -r $(TOP)/sdks/out/wasm-bcl/wasm/* tmp/bcl/ cp driver.c tmp/ cp $(TOP)/sdks/out/wasm-interp/lib/libmonosgen-2.0.a tmp/ cp library_mono.js tmp/ |