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
20 changes: 14 additions & 6 deletions Make.config
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
include $(TOP)/mk/subdirs.mk

# Detect if we're building on Linux
# Detect if we're building on Linux (which means there's no Xcode)
UNAME_S:=$(shell uname -s)
ifeq ($(UNAME_S),Linux)
IS_LINUX=1
NO_XCODE=1
endif

# Common cURL command:
Expand Down Expand Up @@ -209,9 +209,18 @@ MACCATALYST_NUGET_VERSION_FULL=$(MACCATALYST_NUGET_VERSION_NO_METADATA)$(NUGET_B
# Xcode version should have both a major and a minor version (even if the minor version is 0)
XCODE_VERSION=26.5
XCODE_URL=https://bosstoragemirror.blob.core.windows.net/internal-files/xcodes/Xcode_26.5.xip
ifndef IS_LINUX
ifndef NO_XCODE
XCODE_DEVELOPER_ROOT=/Applications/Xcode_26.5.0.app/Contents/Developer
XCODE_PRODUCT_BUILD_VERSION:=$(shell /usr/libexec/PlistBuddy -c 'Print :ProductBuildVersion' $(XCODE_DEVELOPER_ROOT)/../version.plist 2>/dev/null || echo " $(shell tput setaf 1 2>/dev/null)The required Xcode ($(XCODE_VERSION)) is not installed in $(basename $(basename $(XCODE_DEVELOPER_ROOT)))$(shell tput sgr0 2>/dev/null)" >&2)
ifneq (OK,$(shell test -d $(abspath $(XCODE_DEVELOPER_ROOT)) && echo OK))
NO_XCODE=1
$(warning The required Xcode ($(XCODE_VERSION)) is not installed in $(XCODE_DEVELOPER_ROOT) - this directory does not exist. Any parts of the build that require Xcode will be disabled.)
else
XCODE_PRODUCT_BUILD_VERSION:=$(shell /usr/libexec/PlistBuddy -c 'Print :ProductBuildVersion' $(XCODE_DEVELOPER_ROOT)/../version.plist 2>/dev/null)
ifeq (,$(XCODE_PRODUCT_BUILD_VERSION))
NO_XCODE=1
$(warning The required Xcode ($(XCODE_VERSION)) is not installed in $(XCODE_DEVELOPER_ROOT) - directory exists, but no version found. Any parts of the build that require Xcode will be disabled.)
endif
endif

# We define stable Xcode as the Xcode app being named like "Xcode_#.#[.#].app"
# and any other naming is deemed to be a beta. This is the safer approach: any
Expand All @@ -232,8 +241,7 @@ endif
export DEVELOPER_DIR=$(XCODE_DEVELOPER_ROOT)
export MD_APPLE_SDK_ROOT=$(abspath $(XCODE_DEVELOPER_ROOT)/../..)
else
# On Linux, set placeholder Xcode values but honor XCODE_CHANNEL so we configure bots correctly
XCODE_PRODUCT_BUILD_VERSION=
# Without Xcode, set placeholder Xcode values but honor XCODE_CHANNEL so we configure bots correctly
ifeq ($(XCODE_CHANNEL),Beta)
XCODE_IS_STABLE=false
XCODE_IS_PREVIEW=true
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ SUBDIRS=builds
include $(TOP)/Make.config
include $(TOP)/mk/versions.mk

# On Linux, skip directories that require native compilation or macOS platform
ifndef IS_LINUX
# Without Xcode, skip directories that require native compilation or macOS platform
ifndef NO_XCODE
SUBDIRS += runtime
endif

Expand All @@ -16,7 +16,7 @@ endif

SUBDIRS += tools

ifndef IS_LINUX
ifndef NO_XCODE
SUBDIRS += dotnet
endif

Expand Down
7 changes: 7 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ Usage: configure [options]
--custom-dotnet=[dotnet/runtime] Use a locally built version of dotnet/runtime. Pass the path to an already build checkout of dotnet/runtime. See docs/CORECLR.md for detailed instructions about how to build dotnet/runtime from source.

--ignore-unknown-params alters the default behavior to not return an non-zero exit code when an unknown parameter is provided.

--no-xcode Only do things that don't require Xcode. This won't produce anything useful, but might come in handy once in a blue moon when testing something that doesn't require Xcode somewhere Xcode can't be installed (Linux, older macOS devices, etc.)
EOL
}

Expand Down Expand Up @@ -149,6 +151,11 @@ while test "x$1" != x; do
IGNORE_UNKNOWN_PARAMS=true
shift
;;
--no-xcode)
echo "Ignoring Xcode requirement"
echo "NO_XCODE=1" >> "$CONFIGURED_FILE"
shift
;;
--help|-h)
show_help
exit 0
Expand Down
4 changes: 2 additions & 2 deletions msbuild/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ DOTNET_IOS_WINDOWS_FILES += Messaging/Xamarin.Messaging.Build/obj/$(CONFIG)/Buil

.dotnet-windows: .build-stamp .copy-windows-files

ifndef IS_LINUX
ifndef NO_XCODE
all-local:: .dotnet-windows
dotnet:: .dotnet-windows
endif
Expand All @@ -130,7 +130,7 @@ endif

# we must install locally during 'make all', because the F# build depends on the msbuild targets/assemblies.
all-local:: $(MSBUILD_PRODUCTS)
ifndef IS_LINUX
ifndef NO_XCODE
all-local:: .stamp-test-xml
endif

Expand Down
6 changes: 3 additions & 3 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -346,17 +346,17 @@ $(DOTNET_DESTDIR)/$($(2)_NUGET_REF_NAME)/ref/$(DOTNET_TFM)/Microsoft.$(1).dll: $
$(DOTNET_DESTDIR)/$($(2)_NUGET_REF_NAME)/ref/$(DOTNET_TFM)/Microsoft.$(1).xml: $($(2)_DOTNET_BUILD_DIR)/doc/Microsoft.$(1).xml | $(DOTNET_DESTDIR)/$($(2)_NUGET_REF_NAME)/ref/$(DOTNET_TFM)
$$(Q) $(CP) $$< $$@

ifndef IS_LINUX
ifndef NO_XCODE
$($(2)_DOTNET_BUILD_DIR)/doc/Microsoft.$(1).xml: $($(2)_DOTNET_BUILD_DIR)/ref/Microsoft.$(1).xml $($(2)_DOTNET_BUILD_DIR)/ref/Microsoft.$(1).dll build/.build-adr-stamp | $($(2)_DOTNET_BUILD_DIR)/doc
$$(Q_GEN) $(TOP)/packages/appledocreader.$(ADR_RUNTIME_IDENTIFIER)/$(ADR_NUGET_VERSION)/tools/any/$(ADR_RUNTIME_IDENTIFIER)/AppleDocReader inject docs --assembly="$(abspath $($(2)_DOTNET_BUILD_DIR)/ref/Microsoft.$(1).dll)" --input="$(abspath $($(2)_DOTNET_BUILD_DIR)/ref/Microsoft.$(1).xml)" --output="$(abspath $$@)" --xcode="$(DEVELOPER_DIR)/../.." --runtimeDll="$(DOTNET_BCL_DIR)/System.Runtime.dll" -f
else
# On Linux, skip AppleDocReader (macOS-only tool) and just copy the XML
# Without Xcode, skip AppleDocReader and just copy the XML
$($(2)_DOTNET_BUILD_DIR)/doc/Microsoft.$(1).xml: $($(2)_DOTNET_BUILD_DIR)/ref/Microsoft.$(1).xml | $($(2)_DOTNET_BUILD_DIR)/doc
$(Q) $(CP) $$< $$@
endif
endef

ifndef IS_LINUX
ifndef NO_XCODE
build/.build-adr-stamp:
$(MAKE) -C $(TOP)/tools/adr
$(Q) touch $@
Expand Down
24 changes: 18 additions & 6 deletions system-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cd $(dirname $0)

# Detect if we're running on Linux
if [[ "$(uname -s)" == "Linux" ]]; then
IS_LINUX=1
NO_XCODE=1
# On Linux, ignore all macOS-specific dependencies
IGNORE_OSX=1
IGNORE_XCODE=1
Expand All @@ -20,7 +20,7 @@ if [[ "$(uname -s)" == "Linux" ]]; then
IGNORE_YAMLLINT=1
IGNORE_PYTHON3=1
else
IS_LINUX=
NO_XCODE=
fi

FAIL=
Expand All @@ -31,6 +31,18 @@ VERBOSE=
OPTIONAL_SIMULATORS=1
OPTIONAL_OLD_SIMULATORS=1

if test -f configure.inc; then
source configure.inc

if test -n "$NO_XCODE"; then
IGNORE_OSX=1
IGNORE_XCODE=1
IGNORE_SIMULATORS=1
Comment thread
rolfbjarne marked this conversation as resolved.
Resolved
IGNORE_OLD_SIMULATORS=1
IGNORE_XCODE_COMPONENTS=1
fi
fi

# parse command-line arguments
while ! test -z $1; do
case $1 in
Expand Down Expand Up @@ -848,8 +860,8 @@ function check_osx_version () {
}

function check_checkout_dir () {
# Skip on Linux - this check is macOS-specific
if test -n "$IS_LINUX"; then
# Skip without Xcode - this check is macOS-specific
if test -n "$NO_XCODE"; then
return
fi

Expand Down Expand Up @@ -964,8 +976,8 @@ function check_old_simulators ()

echo "Checking system..."

if test -n "$IS_LINUX"; then
ok "Running on ${COLOR_BLUE}Linux${COLOR_CLEAR} - skipping macOS-specific checks"
if test -n "$NO_XCODE"; then
ok "No Xcode available - skipping Xcode-specific checks"
ok "Only .NET download and managed code builds will be available"
fi

Expand Down
4 changes: 2 additions & 2 deletions tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ TOP = ..

include $(TOP)/Make.config

# Skip test-libraries on Linux (requires native compilation with Xcode/clang)
# Skip test-libraries without Xcode (requires native compilation with Xcode/clang)
ifndef ONLY_SHARPIE
ifndef IS_LINUX
ifndef NO_XCODE
SUBDIRS=test-libraries
endif
endif
Expand Down
2 changes: 1 addition & 1 deletion tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ TOP=..

include $(TOP)/Make.config

ifndef IS_LINUX
ifndef NO_XCODE
SUBDIRS += sharpie
endif

Expand Down
2 changes: 1 addition & 1 deletion tools/mtouch/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ endef

$(foreach platform,$(DOTNET_PLATFORMS_MTOUCH),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),$(eval $(call InstallRegistrar,$(platform),$(rid)))))

ifndef IS_LINUX
ifndef NO_XCODE
dotnet: $(TARGETS_DOTNET)
install-local:: $(TARGETS_DOTNET)
all-local:: $(TARGETS_DOTNET)
Expand Down
Loading