Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 1 addition & 20 deletions Make.config
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand All @@ -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

Expand Down
5 changes: 0 additions & 5 deletions mk/mono.mk

This file was deleted.

2 changes: 1 addition & 1 deletion mk/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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 = \
Expand Down
1 change: 0 additions & 1 deletion msbuild/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 $@
Expand Down
2 changes: 1 addition & 1 deletion runtime/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/bgen/BindingTouch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
92 changes: 0 additions & 92 deletions system-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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'..."
Expand Down Expand Up @@ -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."
Expand Down Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)" >> $@
Expand All @@ -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)" >> $@
Expand All @@ -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)" >> $@
Expand All @@ -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)" >> $@
Expand Down
1 change: 0 additions & 1 deletion tests/common/mac/ProjectTestHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ public static string RunAndAssert (string exe, IList<string> args, string stepNa
{
StringBuilder output = new StringBuilder ();
environment ??= new Dictionary<string, string> ();
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) {
Expand Down
1 change: 0 additions & 1 deletion tests/dotnet/size-comparison/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 0 additions & 1 deletion tests/generator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion tests/package-mac-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down
2 changes: 1 addition & 1 deletion tests/test-dependencies.sh
Original file line number Diff line number Diff line change
@@ -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
1 change: 0 additions & 1 deletion tools/devops/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tools/devops/automation/templates/windows/reserve-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion tools/devops/build-provisioning.csx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@

if (!ProvisionXcode ())
return 1;
ProvisionMono ();
ProvisionBrewPackages ();
SetDefaultXcodeInVSMac ();
6 changes: 0 additions & 6 deletions tools/devops/provision-shared.in.csx
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,3 @@ string GetSettingValue (string settingFile, string keyName)
{
return Exec ("defaults", "read", settingFile, keyName).FirstOrDefault ();
}

void ProvisionMono ()
{
Item ("@MONO_PACKAGE@");
}

6 changes: 0 additions & 6 deletions tools/governance/governance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ static IEnumerable<ModuleInfo> 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<string> KnownDevDependencies = new HashSet<string> () {
Expand Down
Loading