Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[builds] Remove all legacy logic. #21307

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 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
17 changes: 1 addition & 16 deletions Make.config
Original file line number Diff line number Diff line change
Expand Up @@ -643,22 +643,7 @@ 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")

# WORKAROUND, Ideally it should be xcode-$(XCODE_PRODUCT_BUILD_VERSION) but mono does not build binaries for each xcode release
# Xcode 12.4 Build 12D4e
XCODE_IOS_ARCHIVE_VERSION=xcode-12D4e
# Xcode 12.4 Build 12D4e
XCODE_MACOS_ARCHIVE_VERSION=xcode-12D4e
MONO_IOS_FILENAME:=ios-release-Darwin-$(MONO_HASH).7z
MONO_IOS_URL:=https://download.mono-project.com/mono-sdks/$(XCODE_IOS_ARCHIVE_VERSION)/$(MONO_IOS_FILENAME)

# Setup various variables depending on whether mono is downloaded or built from source
ifeq ($(MONO_BUILD_FROM_SOURCE),)
MONO_IOS_SDK_DESTDIR:=$(abspath $(TOP)/builds/downloads/$(basename $(MONO_IOS_FILENAME)))
MONO_BUILD_MODE=download-mono
else
MONO_IOS_SDK_DESTDIR:=$(abspath $(MONO_PATH)/sdks/out)
MONO_BUILD_MODE=compile-mono
endif
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_PLATFORMS=iOS tvOS watchOS macOS
Expand Down
28 changes: 0 additions & 28 deletions builds/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,3 @@ dotnet-install.sh
BundledNETCorePlatformsPackageVersion.txt
downloads
.stamp*
.deps.*.mk
*.config.cache
install
mac32
mac64
llvm
llvm64
simulator86
simulator64
watchsimulator
tvsimulator
tools64
cross
cross64
crosstv
cross-watch
target7
target7s
target64
targettv
targetwatch
watchbcl
mono-ios-sdk-destdir
*.dylib
*.o
x86-64-slice*
*.pkg

85 changes: 12 additions & 73 deletions builds/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,68 +10,22 @@ else
DOTNET_ARCH=x64
endif

##
## Mono download vs. build
##

download: download-mono
download-mono: \
downloads/$(basename $(MONO_IOS_FILENAME)) \

downloads/$(basename $(MONO_IOS_FILENAME)): MONO_URL=$(MONO_IOS_URL)

include $(TOP)/mk/colors.mk

DOWNLOADS = \
downloads/$(MONO_IOS_FILENAME) \

# This target downloads the mono archives, there's one for Xamarin.iOS and one for Xamarin.Mac.
# If doing many clean builds, it's possible to copy the downloaded zip file to ~/Library/Caches/xamarin-macios
# to avoid having to download it every time. The zip files have to be copied manually, otherwise
# we'd end up filling up a lot of hard drives around the world.
$(DOWNLOADS):
$(Q) mkdir -p downloads
$(Q) echo "Downloading $(MONO_URL)..."
$(Q) if test -f ~/Library/Caches/xamarin-macios/$(notdir $@); then \
echo "Found a cached version of $(MONO_URL) in ~/Library/Caches/xamarin-macios/$(notdir $@)."; \
$(CP) ~/Library/Caches/xamarin-macios/$(notdir $@) [email protected]; \
else \
EC=0; \
$(CURL_RETRY) $(MONO_URL) --output [email protected] || EC=$$?; \
if [[ x$$EC == x22 ]]; then \
MSG="Could not download the archive %s because the URL doesn't exist. This can happen if bumping mono very soon after the corresponding commit was pushed to mono (i.e. the archive hasn't been built yet). If so, please wait a bit and try again."; \
printf "$(COLOR_RED)*** $$MSG$(COLOR_CLEAR)\n" "$(notdir $@)"; \
if test -n "$$FAILURE_REASON_PATH"; then printf "$$MSG\n" "[$(notdir $@)]($(MONO_URL))" >> "$$FAILURE_REASON_PATH"; fi; \
fi; \
if [[ x$$EC != x0 ]]; then exit $$EC; fi; \
if [[ "x$$MACIOS_CACHE_DOWNLOADS" != "x" ]]; then \
mkdir -p ~/Library/Caches/xamarin-macios/; \
$(CP) [email protected] ~/Library/Caches/xamarin-macios/"$(notdir $@)"; \
echo "Cached the download of $(notdir $@) in ~/Library/Caches/xamarin-macios"; \
fi; \
fi
$(Q) mv [email protected] $@
$(Q) echo "Downloaded $(MONO_URL)"

downloads/%: downloads/%.7z
$(Q) echo "Unzipping $*..."
$(Q) rm -Rf [email protected]
$(Q) 7z x $< [email protected]
$(Q) find [email protected] -exec touch {} +
$(Q) mv [email protected] $@
$(Q) echo "Unzipped $*."

downloads/%: downloads/%.nupkg
$(Q) echo "Unzipping $*..."
$(Q) rm -Rf [email protected]
$(Q) unzip -d [email protected] $<
$(Q) find [email protected] -exec touch {} +
$(Q) mv [email protected] $@
$(Q) echo "Unzipped $*."
DOTNET_FILENAME=$(DOTNET_VERSION).tar.gz
DOTNET_CACHE_FILENAME=$(HOME)/Library/Caches/xamarin-macios/$(DOTNET_FILENAME)

downloads/$(DOTNET_INSTALL_NAME): dotnet-install.sh
$(Q) echo "Downloading and installing .NET $(DOTNET_VERSION) into $@..."
$(Q) ./dotnet-install.sh --install-dir "[email protected]" --version "$(DOTNET_VERSION)" --architecture $(DOTNET_ARCH) --no-path $$DOTNET_INSTALL_EXTRA_ARGS
$(Q) if test -f $(DOTNET_CACHE_FILENAME); then \
echo "Found a cached version of .NET $(DOTNET_VERSION) in $(DOTNET_CACHE_FILENAME)."; \
mkdir -p "[email protected]"; \
tar -xzf $(DOTNET_CACHE_FILENAME) -C "[email protected]"; \
else \
./dotnet-install.sh --install-dir "[email protected]" --version "$(DOTNET_VERSION)" --architecture $(DOTNET_ARCH) --no-path --keep-zip --zip-path "downloads/$(DOTNET_FILENAME)" $$DOTNET_INSTALL_EXTRA_ARGS; \
cp -c downloads/$(DOTNET_FILENAME) $(DOTNET_CACHE_FILENAME); \
echo "Cached the download of $(DOTNET_FILENAME) in ~/Library/Caches/xamarin-macios"; \
fi
$(Q) rm -Rf "$@"
$(Q) mv "[email protected]" "$@"
$(Q) echo "Downloaded and installed .NET $(DOTNET_VERSION) into $@."
Expand Down Expand Up @@ -106,10 +60,6 @@ dotnet-install.sh: Makefile
$(Q) chmod +x [email protected]
$(Q) mv [email protected] $@

.stamp-download-mono: $(TOP)/Make.config $(TOP)/mk/mono.mk
$(MAKE) download-mono
$(Q) touch $@

ifdef CUSTOM_DOTNET
DOWNLOAD_DOTNET_VERSION=$(CUSTOM_DOTNET_VERSION)
else
Expand Down Expand Up @@ -168,17 +118,7 @@ dotnet:: $(DOTNET_DOWNLOADS)
all-local:: $(DOTNET_DOWNLOADS)

clean-local::
$(Q) rm -Rf downloads .stamp-download-mono

all-local:: .stamp-mono-ios-sdk-destdir

.stamp-mono-ios-sdk-destdir: .stamp-$(MONO_BUILD_MODE)
ln -sf $(MONO_IOS_SDK_DESTDIR) mono-ios-sdk-destdir
$(Q) touch $@

#
# .NET
#
$(Q) rm -Rf downloads

DOTNET_COMMON_DIRECTORIES += \
$(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(DOTNET_DESTDIR)/$($(platform)_NUGET_SDK_NAME)) \
Expand Down Expand Up @@ -212,4 +152,3 @@ $(DOTNET_COMMON_DIRECTORIES):
install-dotnet: $(DOTNET_COMMON_TARGETS)
install-local:: install-dotnet
all-local:: install-dotnet

58 changes: 0 additions & 58 deletions builds/Mono.framework-Info.plist

This file was deleted.

56 changes: 0 additions & 56 deletions builds/Mono.framework-tvos.Info.plist

This file was deleted.

56 changes: 0 additions & 56 deletions builds/Mono.framework-watchos.Info.plist

This file was deleted.

3 changes: 0 additions & 3 deletions builds/mac-System.config

This file was deleted.

Loading