Skip to content

Commit 36f9ff6

Browse files
Use host toolchain for all mac and ios targets (project-chip#32283)
* Use host toolchain for all mac and ios targets. * Fix ASAN options for clang build * Collect .ips files from the system directory as well
1 parent 19fcc57 commit 36f9ff6

File tree

5 files changed

+11
-58
lines changed

5 files changed

+11
-58
lines changed

.github/workflows/darwin.yaml

+4-7
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,10 @@ jobs:
119119
run: |
120120
xcodebuild -target "MatterTvCastingBridge" -sdk iphoneos
121121
working-directory: examples/tv-casting-app/darwin/MatterTvCastingBridge
122-
- name: Uploading .ips files in Xcode derived data to debug the failure
123-
uses: actions/upload-artifact@v4
124-
if: ${{ failure() && !env.ACT }}
125-
with:
126-
name: darwin-framework-derived-data
127-
path: ~/Library/Developer/Xcode/DerivedData/**/*.ips
128-
retention-days: 5
122+
- name: Collect crash logs
123+
run: |
124+
mkdir -p /tmp/darwin/framework-tests
125+
find ~/Library/Developer/Xcode/DerivedData /Library/Logs/DiagnosticReports -name '*.ips' -print0 | xargs -0 -J % cp % /tmp/darwin/framework-tests
129126
- name: Uploading log files
130127
uses: actions/upload-artifact@v4
131128
if: ${{ failure() && !env.ACT }}

build/config/BUILDCONFIG.gn

+4-7
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ if (_chip_defaults.custom_toolchain != "") {
7676
} else {
7777
_target_compiler = "gcc"
7878
}
79-
8079
_default_toolchain = "${_build_overrides.build_root}/toolchain/linux:linux_${target_cpu}_${_target_compiler}"
81-
} else if (target_os == host_os &&
82-
(target_cpu == host_cpu ||
83-
(target_cpu == "arm64e" && host_cpu == "arm64"))) {
80+
} else if (host_os == "mac" && (target_os == "mac" || target_os == "ios")) {
81+
# On Mac the host toolchain supports building for all mac and ios targets
82+
_default_toolchain = host_toolchain
83+
} else if (target_os == host_os && target_cpu == host_cpu) {
8484
_default_toolchain = host_toolchain
8585
} else if (target_os == "freertos") {
8686
if (_chip_defaults.is_clang) {
@@ -113,9 +113,6 @@ if (_chip_defaults.custom_toolchain != "") {
113113
} else {
114114
assert(false, "Unsupported target_cpu: ${current_cpu}")
115115
}
116-
} else if (target_os == "ios") {
117-
_default_toolchain =
118-
"${_build_overrides.build_root}/toolchain/ios:ios_${target_cpu}"
119116
} else if (target_os == "tizen") {
120117
_default_toolchain =
121118
"${_build_overrides.build_root}/toolchain/tizen:tizen_${target_cpu}"

build/config/compiler/BUILD.gn

+2-2
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ config("cosmetic_default") {
343343
}
344344

345345
config("runtime_default") {
346-
if (is_clang) {
346+
if (is_clang) { # Using Pigweed clang instead of Darwin host clang
347347
configs = [
348348
"$dir_pw_toolchain/host_clang:no_system_libcpp",
349349
"$dir_pw_toolchain/host_clang:xcode_sysroot",
@@ -402,7 +402,7 @@ config("sanitize_address") {
402402
]
403403
ldflags = cflags
404404

405-
if (target_os == "mac" || target_os == "ios") {
405+
if ((target_os == "mac" || target_os == "ios") && !is_clang) {
406406
defines += [ "_LIBCPP_HAS_NO_ASAN" ]
407407
}
408408
}

build/toolchain/ios/BUILD.gn

-42
This file was deleted.

examples/darwin-framework-tool/BUILD.gn

+1
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ action("build-darwin-framework") {
139139
config("config") {
140140
include_dirs = [
141141
".",
142+
"include",
142143
"${chip_root}/examples/common",
143144
"${chip_root}/examples/darwin-framework-tool/commands/common",
144145
"${chip_root}/zzz_generated/darwin-framework-tool",

0 commit comments

Comments
 (0)