diff --git a/Make.config b/Make.config index d18677dd0f16..ee35a9a02d36 100644 --- a/Make.config +++ b/Make.config @@ -37,7 +37,7 @@ NUGET_VERSION_COMMIT_DISTANCE_START=$(DOTNET_MAJOR_VERSION)000 NUGET_VERSION_STABLE_COMMIT_DISTANCE_START=$(DOTNET_MAJOR_VERSION)000 -include $(TOP)/Make.config.inc -$(TOP)/Make.config.inc: $(TOP)/Make.config $(TOP)/mk/mono.mk +$(TOP)/Make.config.inc: $(TOP)/Make.config $(Q) cd $(TOP) && \ ALL_DOTNET_PLATFORMS="$(ALL_DOTNET_PLATFORMS)" \ NUGET_VERSION_COMMIT_DISTANCE_START=$(NUGET_VERSION_COMMIT_DISTANCE_START) \ @@ -243,15 +243,6 @@ export DOTNET_CLI_WORKLOAD_UPDATE_NOTIFY_DISABLE=true # We don't need to be told we're using preview packages (we pretty much always are). export SuppressNETCoreSdkPreviewMessage=true -# Mono version embedded in XI/XM (NEEDED_MONO_VERSION/BRANCH) are specified in mk/mono.mk -include $(TOP)/mk/mono.mk -MONO_HASH := $(NEEDED_MONO_VERSION) - -# Minimum Mono version for building XI/XM -MIN_MONO_VERSION=6.12.0.179 -MAX_MONO_VERSION=6.12.99 -MIN_MONO_URL=https://download.mono-project.com/archive/6.12.0/macos-10-universal/MonoFramework-MDK-6.12.0.179.macos10.xamarin.universal.pkg - # Minimum OSX versions for building XI/XM MIN_OSX_BUILD_VERSION=15.3 @@ -305,15 +296,7 @@ RANLIB=$(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranli # paths to the modules we depend on, as variables, so people can put # things in other places if they absolutely must. -MONO_PATH=$(TOP)/external/mono XAMARIN_MACDEV_PATH=$(TOP)/external/Xamarin.MacDev -API_TOOLS_PATH=$(TOP)/external/api-tools - -MONO_PREFIX ?= /Library/Frameworks/Mono.framework/Versions/Current -SYSTEM_MONO=$(MONO_PREFIX)/bin/mono -SYSTEM_MSBUILD=unset MSBuildExtensionsPath && $(MONO_PREFIX)/bin/msbuild /p:Features=strict /m - -PKG_CONFIG=$(MONO_PREFIX)/bin/pkg-config MACOS_NUGET=Microsoft.macOS MACOS_NUGET_VERSION=$(MACOS_NUGET_OS_VERSION).$(MACOS_NUGET_COMMIT_DISTANCE) @@ -334,8 +317,6 @@ JENKINS_RESULTS_DIRECTORY ?= $(abspath $(TOP)/jenkins-results) # Clone files instead of copying them on APFS file systems. Much faster. CP:=$(shell df -t apfs / >/dev/null 2>&1 && echo "cp -c" || echo "cp") -MONO_IOS_SDK_DESTDIR:=$(abspath $(TOP)/builds/downloads/mono-ios-sdk-destdir) - # This variable includes all the platforms we support, even those that might be disabled in this build. ALL_DOTNET_PLATFORMS=iOS macOS tvOS MacCatalyst diff --git a/mk/mono.mk b/mk/mono.mk deleted file mode 100644 index c674c2bb5681..000000000000 --- a/mk/mono.mk +++ /dev/null @@ -1,5 +0,0 @@ -NEEDED_MONO_VERSION := 6dd9def57ce969ca04a0ecd9ef72c0a8f069112d -NEEDED_MONO_BRANCH := 2020-02 - -MONO_DIRECTORY := mono -MONO_MODULE := https://github.com/mono/mono diff --git a/mk/rules.mk b/mk/rules.mk index fe9d9457c771..f88355085159 100644 --- a/mk/rules.mk +++ b/mk/rules.mk @@ -155,7 +155,7 @@ $(foreach rid,$(DOTNET_RUNTIME_IDENTIFIERS),$(eval $(call NativeCompilationTempl $(foreach rid,$(DOTNET_RUNTIME_IDENTIFIERS),$(eval $(call NativeCompilationTemplate,$(rid),-dotnet-nativeaot,$(RELEASE_FLAGS) -DCORECLR_RUNTIME -DDOTNET -DNATIVEAOT))) $(foreach rid,$(DOTNET_RUNTIME_IDENTIFIERS),$(eval $(call NativeCompilationTemplate,$(rid),-dotnet-nativeaot-debug,$(DEBUG_FLAGS) -DCORECLR_RUNTIME -DDOTNET -DNATIVEAOT))) -%.csproj.inc: %.csproj $(TOP)/Make.config $(TOP)/mk/mono.mk $(TOP)/tools/common/create-makefile-fragment.sh +%.csproj.inc: %.csproj $(TOP)/Make.config $(TOP)/tools/common/create-makefile-fragment.sh $(Q) $(TOP)/tools/common/create-makefile-fragment.sh $(abspath $<) $(abspath $@) DIRS = \ diff --git a/msbuild/Makefile b/msbuild/Makefile index 6700affdf174..7f9d2ebf851a 100644 --- a/msbuild/Makefile +++ b/msbuild/Makefile @@ -128,7 +128,6 @@ endif # I haven't found a way to execute ilrepack.exe on .NET (it will probably have to be built for .NET), so run it using Mono. -.build-stamp: export SYSTEM_MONO:=$(SYSTEM_MONO) .build-stamp: $(ALL_SOURCES) $(Q) $(DOTNET) build "/bl:$@.binlog" $(XBUILD_VERBOSITY) $(Q) touch $@ diff --git a/runtime/Makefile b/runtime/Makefile index d5348366632c..bc201797a95c 100644 --- a/runtime/Makefile +++ b/runtime/Makefile @@ -29,7 +29,7 @@ SHARED_HEADERS += shared.h product.h delegates.h runtime-internal.h $(SHARED_INC SHARED_FILES = $(SHARED_SOURCES) $(SHARED_HEADERS) $(SHARED_X64_SOURCES) $(SHARED_ARM64_SOURCES) -EXTRA_DEPENDENCIES = $(SHARED_HEADERS) $(TOP)/Make.config $(TOP)/mk/mono.mk +EXTRA_DEPENDENCIES = $(SHARED_HEADERS) $(TOP)/Make.config IOS_SIMULATOR_ARCHITECTURES+=x86_64 IOS_DEVICE_ARCHITECTURES+=arm64 diff --git a/src/bgen/BindingTouch.cs b/src/bgen/BindingTouch.cs index 58befc2015e0..3734381eaa73 100644 --- a/src/bgen/BindingTouch.cs +++ b/src/bgen/BindingTouch.cs @@ -165,7 +165,9 @@ public bool TryCreateOptionSet (BindingTouchConfig config, string [] args) { "attributelib=", "Sets the attribute library", v => config.Attributedll = v }, { "use-zero-copy", v=> config.UseZeroCopy = true }, { "nostdlib", "Does not reference mscorlib.dll library", l => config.OmitStandardLibrary = true }, +#if !XAMCORE_5_0 { "no-mono-path", "Launches compiler with empty MONO_PATH", l => { }, true }, +#endif { "native-exception-marshalling", "Enable the marshalling support for Objective-C exceptions", (v) => { /* no-op */} }, { "inline-selectors:", "If Selector.GetHandle is inlined and does not need to be cached (enabled by default in Xamarin.iOS, disabled in Xamarin.Mac)", v => config.InlineSelectors = string.Equals ("true", v, StringComparison.OrdinalIgnoreCase) || string.IsNullOrEmpty (v) diff --git a/system-dependencies.sh b/system-dependencies.sh index 9b1041ff47e2..26f0b38b9eb0 100755 --- a/system-dependencies.sh +++ b/system-dependencies.sh @@ -11,7 +11,6 @@ if [[ "$(uname -s)" == "Linux" ]]; then IGNORE_OSX=1 IGNORE_XCODE=1 IGNORE_XCODE_COMPONENTS=1 - IGNORE_MONO=1 IGNORE_VISUAL_STUDIO=1 IGNORE_SIMULATORS=1 IGNORE_OLD_SIMULATORS=1 @@ -62,11 +61,6 @@ while ! test -z $1; do unset IGNORE_VISUAL_STUDIO shift ;; - --provision-mono) - PROVISION_MONO=1 - unset IGNORE_MONO - shift - ;; --provision-7z) PROVISION_7Z=1 unset IGNORE_7Z @@ -110,8 +104,6 @@ while ! test -z $1; do shift ;; --provision-all) - PROVISION_MONO=1 - unset IGNORE_MONO PROVISION_VS=1 unset IGNORE_VISUAL_STUDIO PROVISION_XCODE=1 @@ -138,7 +130,6 @@ while ! test -z $1; do ;; --ignore-all) IGNORE_OSX=1 - IGNORE_MONO=1 IGNORE_VISUAL_STUDIO=1 IGNORE_XCODE=1 IGNORE_7Z=1 @@ -167,10 +158,6 @@ while ! test -z $1; do IGNORE_VISUAL_STUDIO=1 shift ;; - --ignore-mono) - IGNORE_MONO=1 - shift - ;; --ignore-autotools) # this is an old argument, just ignore it shift @@ -294,27 +281,6 @@ function is_at_least_version () { fi } -function install_mono () { - local MONO_URL=`grep MIN_MONO_URL= Make.config | sed 's/.*=//'` - local MIN_MONO_VERSION=`grep MIN_MONO_VERSION= Make.config | sed 's/.*=//'` - - if test -z $MONO_URL; then - fail "No MIN_MONO_URL set in Make.config, cannot provision" - return - fi - - mkdir -p $PROVISION_DOWNLOAD_DIR - log "Downloading Mono $MIN_MONO_VERSION from $MONO_URL to $PROVISION_DOWNLOAD_DIR..." - local MONO_NAME=`basename $MONO_URL` - local MONO_PKG=$PROVISION_DOWNLOAD_DIR/$MONO_NAME - curl -L $MONO_URL > $MONO_PKG - - log "Installing Mono $MIN_MONO_VERSION from $MONO_URL..." - $SUDO installer -pkg $MONO_PKG -target / - - rm -f $MONO_PKG -} - function delete_all_simulator_runtimes () { log "Executing 'xcrun simctl runtime delete all'..." @@ -772,63 +738,6 @@ function check_xcode_components () xcrun -k } -function check_mono () { - if ! test -z $IGNORE_MONO; then return; fi - - MONO_VERSION_FILE=/Library/Frameworks/Mono.framework/Versions/Current/VERSION - if ! /Library/Frameworks/Mono.framework/Commands/mono --version 2>/dev/null >/dev/null; then - if ! test -z $PROVISION_MONO; then - install_mono - else - fail "You must install the Mono MDK. Download URL: $MIN_MONO_URL" - return - fi - elif ! test -e $MONO_VERSION_FILE; then - if ! test -z $PROVISION_MONO; then - install_mono - else - fail "Could not find Mono's VERSION file, you must install the Mono MDK. Download URL: $MIN_MONO_URL" - return - fi - fi - - MIN_MONO_VERSION=`grep MIN_MONO_VERSION= Make.config | sed 's/.*=//'` - MAX_MONO_VERSION=`grep MAX_MONO_VERSION= Make.config | sed 's/.*=//'` - - ACTUAL_MONO_VERSION=`cat $MONO_VERSION_FILE` - if ! is_at_least_version $ACTUAL_MONO_VERSION $MIN_MONO_VERSION; then - if ! test -z $PROVISION_MONO; then - install_mono - ACTUAL_MONO_VERSION=`cat $MONO_VERSION_FILE` - else - MIN_MONO_URL=$(grep ^MIN_MONO_URL= Make.config | sed 's/.*=//') - fail "You must have at least Mono $MIN_MONO_VERSION, found $ACTUAL_MONO_VERSION. Download URL: $MIN_MONO_URL" - return - fi - elif [[ "$ACTUAL_MONO_VERSION" == "$MAX_MONO_VERSION" ]]; then - : # this is ok - elif is_at_least_version $ACTUAL_MONO_VERSION $MAX_MONO_VERSION; then - if ! test -z $PROVISION_MONO; then - install_mono - ACTUAL_MONO_VERSION=`cat $MONO_VERSION_FILE` - else - fail "Your mono version is too new, max version is $MAX_MONO_VERSION, found $ACTUAL_MONO_VERSION." - fail "You may edit Make.config and change MAX_MONO_VERSION to your actual version to continue the" - fail "build (unless you're on a release branch). Once the build completes successfully, please" - fail "commit the new MAX_MONO_VERSION value." - fail "Alternatively you can ${COLOR_MAGENTA}export IGNORE_MONO=1${COLOR_RED} to skip this check." - return - fi - fi - - if ! which mono > /dev/null 2>&1; then - fail "Mono is not in PATH. You must add '/Library/Frameworks/Mono.framework/Versions/Current/Commands' to PATH. Current PATH is: $PATH". - return - fi - - ok "Found Mono $ACTUAL_MONO_VERSION (at least $MIN_MONO_VERSION and not more than $MAX_MONO_VERSION is required)" -} - function install_shellcheck () { if ! brew --version >& /dev/null; then fail "Asked to install shellcheck, but brew is not installed." @@ -1054,7 +963,6 @@ check_homebrew check_shellcheck check_yamllint check_python3 -check_mono check_7z check_old_simulators if test -z "$IGNORE_DOTNET"; then diff --git a/tests/Makefile b/tests/Makefile index 1b9d8451c0e1..3b606359c523 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -45,7 +45,7 @@ endif package-tests: $(MAKE) mac-test-package.zip -test.config: Makefile $(TOP)/Make.config $(TOP)/mk/mono.mk $(TOP)/eng/Version.Details.xml +test.config: Makefile $(TOP)/Make.config $(TOP)/eng/Version.Details.xml @rm -f $@ @echo "JENKINS_RESULTS_DIRECTORY=$(abspath $(JENKINS_RESULTS_DIRECTORY))" >> $@ @echo "XCODE_DEVELOPER_ROOT=$(XCODE_DEVELOPER_ROOT)" >> $@ @@ -60,7 +60,6 @@ test.config: Makefile $(TOP)/Make.config $(TOP)/mk/mono.mk $(TOP)/eng/Version.De @echo "DOTNET_CSC_COMMAND='$(DOTNET_CSC)'" >> $@ @echo "DOTNET_TFM=$(DOTNET_TFM)" >> $@ @printf "$(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(platform)_NUGET_VERSION_NO_METADATA=$($(platform)_NUGET_VERSION_NO_METADATA)\\n)" | sed 's/^ //' >> $@ - @echo "SYSTEM_MONO=$(SYSTEM_MONO)" >> $@ @echo "DOTNET_DIR=$(DOTNET_DIR)" >> $@ @echo "INCLUDE_IOS=$(INCLUDE_IOS)" >> $@ @echo "INCLUDE_TVOS=$(INCLUDE_TVOS)" >> $@ @@ -78,7 +77,7 @@ test.config: Makefile $(TOP)/Make.config $(TOP)/mk/mono.mk $(TOP)/eng/Version.De @printf "$(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(platform)_NUGET_OS_VERSION=$($(platform)_NUGET_OS_VERSION)\\n)" | sed 's/^ //' >> $@ @printf "NUGET_PRERELEASE_IDENTIFIER=$(NUGET_PRERELEASE_IDENTIFIER)\n" >> $@ -test-system.config: Makefile $(TOP)/Make.config $(TOP)/mk/mono.mk $(TOP)/eng/Version.Details.xml +test-system.config: Makefile $(TOP)/Make.config $(TOP)/eng/Version.Details.xml @rm -f $@ @echo "JENKINS_RESULTS_DIRECTORY=$(abspath $(JENKINS_RESULTS_DIRECTORY))" >> $@ @echo "DOTNET=$(DOTNET)" >> $@ @@ -91,7 +90,6 @@ test-system.config: Makefile $(TOP)/Make.config $(TOP)/mk/mono.mk $(TOP)/eng/Ver @printf "$(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),DOTNET_$(rid)_ARCHITECTURES='$(DOTNET_$(rid)_ARCHITECTURES)'\\n))" | sed 's/^ //' >> $@ @echo "DOTNET_CSC_COMMAND='$(DOTNET_CSC)'" >> $@ @printf "$(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(platform)_NUGET_VERSION_NO_METADATA=$($(platform)_NUGET_VERSION_NO_METADATA)\\n)" | sed 's/^ //' >> $@ - @echo "SYSTEM_MONO=$(SYSTEM_MONO)" >> $@ @echo "DOTNET_DIR=$(DOTNET_DIR)" >> $@ @echo "INCLUDE_IOS=$(INCLUDE_IOS)" >> $@ @echo "INCLUDE_TVOS=$(INCLUDE_TVOS)" >> $@ diff --git a/tests/common/mac/ProjectTestHelpers.cs b/tests/common/mac/ProjectTestHelpers.cs index 38cbbeecf3f9..822f72d29ac7 100644 --- a/tests/common/mac/ProjectTestHelpers.cs +++ b/tests/common/mac/ProjectTestHelpers.cs @@ -169,7 +169,6 @@ public static string RunAndAssert (string exe, IList args, string stepNa { StringBuilder output = new StringBuilder (); environment ??= new Dictionary (); - environment ["MONO_PATH"] = null; environment ["DYLD_FALLBACK_LIBRARY_PATH"] = null; int compileResult = ExecutionHelper.Execute (exe, args, environmentVariables: environment, stdout: output, stderr: output); if (!shouldFail && compileResult != 0) { diff --git a/tests/dotnet/size-comparison/common.mk b/tests/dotnet/size-comparison/common.mk index bc5ce1311ea1..aa4428269b80 100644 --- a/tests/dotnet/size-comparison/common.mk +++ b/tests/dotnet/size-comparison/common.mk @@ -35,7 +35,6 @@ report: COMMON_ARGS=/p:Platform=iPhone /p:Configuration=Release $(MSBUILD_VERBOSITY) -build-oldnet: export MSBUILD_EXE_PATH=$(MONO_PREFIX)/lib/mono/msbuild/15.0/bin/MSBuild.dll build-oldnet: export TargetFrameworkFallbackSearchPaths=$(IOS_DESTDIR)/Library/Frameworks/Mono.framework/External/xbuild-frameworks build-oldnet: export MSBuildExtensionsPathFallbackPathsOverride=$(IOS_DESTDIR)/Library/Frameworks/Mono.framework/External/xbuild build-oldnet: diff --git a/tests/generator/Makefile b/tests/generator/Makefile index a1cc89efe7e1..bfb03df5df97 100644 --- a/tests/generator/Makefile +++ b/tests/generator/Makefile @@ -2,7 +2,6 @@ TOP=../.. include $(TOP)/Make.config -export MSBUILD_EXE_PATH=$(MONO_PREFIX)/lib/mono/msbuild/15.0/bin/MSBuild.dll export TargetFrameworkFallbackSearchPaths=$(IOS_DESTDIR)/Library/Frameworks/Mono.framework/External/xbuild-frameworks export MSBuildExtensionsPathFallbackPathsOverride=$(IOS_DESTDIR)/Library/Frameworks/Mono.framework/External/xbuild diff --git a/tests/package-mac-tests.sh b/tests/package-mac-tests.sh index 84bf11e5fd72..ce02bb0d67eb 100755 --- a/tests/package-mac-tests.sh +++ b/tests/package-mac-tests.sh @@ -64,7 +64,6 @@ mkdir -p "$DIR/mk" $CP -p ../mk/subdirs.mk "$DIR/mk" $CP -p ../mk/rules.mk "$DIR/mk" $CP -p ../mk/quiet.mk "$DIR/mk" -$CP -p ../mk/mono.mk "$DIR/mk" $CP -cp ../Directory.Build.props "$DIR/" mkdir -p "$DIR/scripts/run-with-timeout" $CP -cp ../scripts/Directory.Build.props "$DIR/scripts/" diff --git a/tests/test-dependencies.sh b/tests/test-dependencies.sh index 9008eeff696b..47b9926ec8f9 100755 --- a/tests/test-dependencies.sh +++ b/tests/test-dependencies.sh @@ -1,4 +1,4 @@ #!/bin/bash -ex cd "$(dirname "$0")" -./system-dependencies.sh --provision-mono --ignore-xamarin-studio --ignore-xcode --ignore-osx --ignore-dotnet --ignore-shellcheck --ignore-yamllint --ignore-old-simulators --ignore-xcode-components +./system-dependencies.sh --ignore-xamarin-studio --ignore-xcode --ignore-osx --ignore-dotnet --ignore-shellcheck --ignore-yamllint --ignore-old-simulators --ignore-xcode-components diff --git a/tools/devops/Makefile b/tools/devops/Makefile index 04f5be9c5da2..584f1c0a7d49 100644 --- a/tools/devops/Makefile +++ b/tools/devops/Makefile @@ -5,7 +5,6 @@ provision-shared.csx: provision-shared.in.csx Makefile $(TOP)/Make.config $(Q_GEN) sed \ -e 's#@XCODE_XIP_NAME@#$(notdir $(XCODE_URL))#g' \ -e 's#@XCODE_ROOT_PATH@#$(XCODE_DEVELOPER_ROOT)#g' \ - -e 's#@MONO_PACKAGE@#$(MIN_MONO_URL)#g' \ $< > $@ LocProject.json: LocProject.json.in Makefile $(TOP)/Make.config diff --git a/tools/devops/automation/templates/windows/reserve-mac.yml b/tools/devops/automation/templates/windows/reserve-mac.yml index d725d929cdae..c0e2c9ae0ae8 100644 --- a/tools/devops/automation/templates/windows/reserve-mac.yml +++ b/tools/devops/automation/templates/windows/reserve-mac.yml @@ -107,7 +107,7 @@ steps: github_token: ${{ parameters.gitHubToken }} timeoutInMinutes: 250 -- bash: $(Build.SourcesDirectory)/$(BUILD_REPOSITORY_TITLE)/system-dependencies.sh --ignore-mono --ignore-visual-studio --ignore-mono --ignore-shellcheck --ignore-yamllint --provision-simulators --ignore-xcode-components +- bash: $(Build.SourcesDirectory)/$(BUILD_REPOSITORY_TITLE)/system-dependencies.sh --ignore-visual-studio --ignore-shellcheck --ignore-yamllint --provision-simulators --ignore-xcode-components displayName: 'Provision simulators' timeoutInMinutes: 250 diff --git a/tools/devops/build-provisioning.csx b/tools/devops/build-provisioning.csx index 63db211634b8..884b2b2f94fa 100644 --- a/tools/devops/build-provisioning.csx +++ b/tools/devops/build-provisioning.csx @@ -2,6 +2,5 @@ if (!ProvisionXcode ()) return 1; -ProvisionMono (); ProvisionBrewPackages (); SetDefaultXcodeInVSMac (); diff --git a/tools/devops/provision-shared.in.csx b/tools/devops/provision-shared.in.csx index 9b16fe2089ca..ff4b4e313f04 100644 --- a/tools/devops/provision-shared.in.csx +++ b/tools/devops/provision-shared.in.csx @@ -103,9 +103,3 @@ string GetSettingValue (string settingFile, string keyName) { return Exec ("defaults", "read", settingFile, keyName).FirstOrDefault (); } - -void ProvisionMono () -{ - Item ("@MONO_PACKAGE@"); -} - diff --git a/tools/governance/governance.cs b/tools/governance/governance.cs index b151d25b2d0b..67424ffc3c3b 100644 --- a/tools/governance/governance.cs +++ b/tools/governance/governance.cs @@ -53,12 +53,6 @@ static IEnumerable GetModules () yield return new ModuleInfo (name, hash, url); } } - - Xamarin.Bundler.Driver.RunCommand ("/usr/bin/git", new string [] { "show", "HEAD:mk/mono.mk" }, new string [] { }, out StringBuilder monoOutput, true, 0); - var lines = monoOutput.ToString ().SplitLines ().ToArray (); - var version = lines [0].Split (' ').Last (); - var monoUrl = lines [3].Split (' ').Last (); - yield return new ModuleInfo ("mono", version, monoUrl); } static HashSet KnownDevDependencies = new HashSet () {