Skip to content

Commit 10c579c

Browse files
iinozemtsevCommit Queue
authored andcommitted
Revert "watchOS target os"
This reverts commit 7ae1d75. Reason for revert: breaks flutter build Original change's description: > watchOS target os > > - add support for --os=watchos | --os=watchos_simulator > - do not depend on perfetto if dart_support_perfetto is false > - change the default value for dart_support_perfetto to !is_watchos > > To minimize changes and to avoid modifying third-party zlib BUILD file, is_watchos implies is_ios for now. > > TEST=manual, no watchOS SDK on bots yet. > > Cq-Include-Trybots: luci.dart.try:vm-mac-debug-arm64-try,vm-mac-release-arm64-try > Change-Id: If2130068ef546162a07a9ba53f94b11ff25fb565 > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415021 > Reviewed-by: Ryan Macnak <[email protected]> > Commit-Queue: Ivan Inozemtsev <[email protected]> Cq-Include-Trybots: luci.dart.try:vm-mac-debug-arm64-try,vm-mac-release-arm64-try No-Presubmit: true No-Tree-Checks: true No-Try: true Change-Id: I4bede9ede04ac3c533b8ff7ae2f1adbd84eb2397 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425262 Bot-Commit: Rubber Stamper <[email protected]> Reviewed-by: Alexander Thomas <[email protected]> Commit-Queue: Alexander Thomas <[email protected]> Auto-Submit: Ivan Inozemtsev <[email protected]>
1 parent 7ae1d75 commit 10c579c

File tree

13 files changed

+44
-200
lines changed

13 files changed

+44
-200
lines changed

build/config/BUILDCONFIG.gn

Lines changed: 9 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ if (current_os == "win") {
177177
is_mac = false
178178
is_nacl = false
179179
is_posix = false
180-
is_watchos = false
181180
is_win = true
182181
} else if (current_os == "mac") {
183182
is_android = false
@@ -188,7 +187,6 @@ if (current_os == "win") {
188187
is_mac = true
189188
is_nacl = false
190189
is_posix = true
191-
is_watchos = false
192190
is_win = false
193191
} else if (current_os == "android") {
194192
is_android = true
@@ -199,7 +197,6 @@ if (current_os == "win") {
199197
is_mac = false
200198
is_nacl = false
201199
is_posix = true
202-
is_watchos = false
203200
is_win = false
204201
} else if (current_os == "linux") {
205202
is_android = false
@@ -210,7 +207,6 @@ if (current_os == "win") {
210207
is_mac = false
211208
is_nacl = false
212209
is_posix = true
213-
is_watchos = false
214210
is_win = false
215211
} else if (current_os == "fuchsia") {
216212
is_android = false
@@ -221,7 +217,6 @@ if (current_os == "win") {
221217
is_mac = false
222218
is_nacl = false
223219
is_posix = true
224-
is_watchos = false
225220
is_win = false
226221
} else if (current_os == "ios") {
227222
is_android = false
@@ -232,23 +227,6 @@ if (current_os == "win") {
232227
is_mac = false
233228
is_nacl = false
234229
is_posix = true
235-
is_watchos = false
236-
is_win = false
237-
} else if (current_os == "watchos") {
238-
is_android = false
239-
is_chromeos = false
240-
is_fuchsia = false
241-
242-
# watchOS and iOS are similar enough, so almost all codepaths in
243-
# BUILD files are the same for watchOS and iOS. Additionally,
244-
# BUILD.gn zlib file doesn't support `is_watchos`, but works fine
245-
# with `is_ios`.
246-
is_ios = true
247-
is_linux = false
248-
is_mac = false
249-
is_nacl = false
250-
is_posix = true
251-
is_watchos = true
252230
is_win = false
253231
}
254232

@@ -467,19 +445,17 @@ if (is_win) {
467445
host_toolchain = "//build/toolchain/mac:clang_$host_cpu"
468446
set_default_toolchain("//build/toolchain/mac:clang_$current_cpu")
469447
} else if (is_ios) {
470-
import("//build/config/ios/ios_sdk.gni") # For use_simulator
448+
import("//build/config/ios/ios_sdk.gni") # For use_ios_simulator
471449
host_toolchain = "//build/toolchain/mac:clang_$host_cpu"
472-
toolchain_target = "clang"
473-
if (is_watchos) {
474-
toolchain_target = "watchos_$toolchain_target"
450+
if (use_ios_simulator) {
451+
if (target_cpu == "arm64") {
452+
set_default_toolchain("//build/toolchain/mac:ios_clang_arm64_sim")
453+
} else {
454+
set_default_toolchain("//build/toolchain/mac:ios_clang_x64_sim")
455+
}
475456
} else {
476-
toolchain_target = "ios_$toolchain_target"
477-
}
478-
toolchain_target = "${toolchain_target}_$target_cpu"
479-
if (use_simulator) {
480-
toolchain_target = "${toolchain_target}_sim"
457+
set_default_toolchain("//build/toolchain/mac:ios_clang_arm64")
481458
}
482-
set_default_toolchain("//build/toolchain/mac:$toolchain_target")
483459
} else if (is_fuchsia) {
484460
assert(host_cpu == "x64")
485461
if (host_os == "linux") {
@@ -578,8 +554,7 @@ if (!is_shared_library) {
578554

579555
output_prefix = "lib"
580556
if (!defined(output_extension)) {
581-
if (current_os == "mac" || current_os == "ios" ||
582-
current_os == "watchos") {
557+
if (current_os == "mac" || current_os == "ios") {
583558
output_extension = "dylib"
584559
} else if (current_os == "win") {
585560
output_extension = "dll"

build/config/ios/ios_sdk.gni

Lines changed: 19 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -6,41 +6,28 @@ import("//build/toolchain/rbe.gni")
66

77
declare_args() {
88
# SDK path to use. When empty this will use the default SDK based on the
9-
# value of use_simulator.
9+
# value of use_ios_simulator.
1010
ios_sdk_path = ""
1111

1212
# Set to true when targeting a simulator build on iOS. False means that the
1313
# target is for running on the device. The default value is to use the
1414
# Simulator except when targeting GYP's Xcode builds (for compat with the
1515
# existing GYP build).
16-
use_simulator = false
16+
use_ios_simulator = false
1717

1818
# Minimum supported version of the iOS SDK.
1919
ios_sdk_min = "12.0"
2020

21-
# Minimum supported version of the watchOS SDK.
22-
watchos_sdk_min = "11.0"
23-
2421
# The path to the iOS device SDK.
2522
ios_device_sdk_path = ""
2623

2724
# The path to the iOS simulator SDK.
2825
ios_simulator_sdk_path = ""
2926

30-
# The path to the watchOS device SDK.
31-
watchos_device_sdk_path = ""
32-
33-
# The path to the watchOS simulator SDK.
34-
watchos_simulator_sdk_path = ""
35-
3627
ios_enable_relative_sdk_path = use_rbe
3728
}
3829

3930
if (ios_sdk_path == "") {
40-
if (is_watchos) {
41-
ios_sdk_min = watchos_sdk_min
42-
}
43-
4431
_find_sdk_args = [
4532
"--print_sdk_path",
4633
ios_sdk_min,
@@ -55,44 +42,25 @@ if (ios_sdk_path == "") {
5542
]
5643
}
5744

58-
platform = "iphone"
59-
if (is_watchos) {
60-
platform = "watch"
61-
}
62-
if (use_simulator) {
63-
platform = "${platform}_simulator"
45+
if (use_ios_simulator && ios_simulator_sdk_path == "") {
46+
_find_sdk_args += [ "--platform=iphone_simulator" ]
47+
_find_sdk_result =
48+
exec_script("//build/mac/find_sdk.py", _find_sdk_args, "list lines")
49+
ios_simulator_sdk_path = _find_sdk_result[0]
6450
}
6551

66-
_find_sdk_args += [ "--platform=$platform" ]
67-
_find_sdk_result =
68-
exec_script("//build/mac/find_sdk.py", _find_sdk_args, "list lines")
69-
platform_sdk_path = _find_sdk_result[0]
52+
if (!use_ios_simulator && ios_device_sdk_path == "") {
53+
_find_sdk_args += [ "--platform=iphone" ]
54+
_find_sdk_result =
55+
exec_script("//build/mac/find_sdk.py", _find_sdk_args, "list lines")
56+
ios_device_sdk_path = _find_sdk_result[0]
57+
}
7058

71-
if (use_simulator && is_watchos) {
72-
# watchos_simulator
73-
if (watchos_simulator_sdk_path != "") {
74-
platform_sdk_path = watchos_simulator_sdk_path
75-
}
76-
ios_sdk_path = platform_sdk_path
77-
ios_sdk_min = watchos_sdk_min
78-
} else if (!use_simulator && is_watchos) {
79-
# watchos
80-
if (watchos_device_sdk_path != "") {
81-
platform_sdk_path = watchos_device_sdk_path
82-
}
83-
ios_sdk_path = platform_sdk_path
84-
ios_sdk_min = watchos_sdk_min
85-
} else if (use_simulator && !is_watchos) {
86-
# ios_simulator
87-
if (ios_simulator_sdk_path != "") {
88-
platform_sdk_path = ios_simulator_sdk_path
89-
}
90-
ios_sdk_path = platform_sdk_path
91-
} else if (!use_simulator && !is_watchos) {
92-
# ios
93-
if (ios_device_sdk_path != "") {
94-
platform_sdk_path = ios_device_sdk_path
95-
}
96-
ios_sdk_path = platform_sdk_path
59+
if (use_ios_simulator) {
60+
assert(ios_simulator_sdk_path != "")
61+
ios_sdk_path = ios_simulator_sdk_path
62+
} else {
63+
assert(ios_device_sdk_path != "")
64+
ios_sdk_path = ios_device_sdk_path
9765
}
9866
}

build/toolchain/mac/BUILD.gn

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -78,55 +78,6 @@ mac_toolchain_suite("ios_clang_x64_sim") {
7878
"-isysroot $ios_sdk_path -mios-simulator-version-min=$ios_sdk_min"
7979
}
8080

81-
if (is_watchos) {
82-
# Toolchain used for watchOS device targets.
83-
mac_toolchain_suite("watchos_clang_arm64") {
84-
toolchain_cpu = "arm64"
85-
toolchain_os = "watchos"
86-
prefix = rebased_clang_dir
87-
cc = "${compiler_prefix}${prefix}/clang"
88-
cxx = "${compiler_prefix}${prefix}/clang++"
89-
if (use_rbe) {
90-
cc = "${cc} --target=arm64-apple-darwin"
91-
cxx = "${cxx} --target=arm64-apple-darwin"
92-
}
93-
asm = "${assembler_prefix}${prefix}/clang"
94-
ar = "${prefix}/llvm-ar"
95-
ld = "${link_prefix}${prefix}/clang++"
96-
strip = "${prefix}/llvm-strip"
97-
nm = "${prefix}/llvm-nm"
98-
is_clang = true
99-
if (ios_enable_relative_sdk_path) {
100-
ios_sdk_path = rebase_path(ios_sdk_path, root_build_dir)
101-
}
102-
sysroot_flags = "-isysroot $ios_sdk_path -mwatchos-version-min=$ios_sdk_min"
103-
}
104-
105-
# Toolchain used for watchOS simulator targets (arm64).
106-
mac_toolchain_suite("watchos_clang_arm64_sim") {
107-
toolchain_cpu = "arm64"
108-
toolchain_os = "watchos"
109-
prefix = rebased_clang_dir
110-
cc = "${compiler_prefix}${prefix}/clang"
111-
cxx = "${compiler_prefix}${prefix}/clang++"
112-
if (use_rbe) {
113-
cc = "${cc} --target=arm64-apple-darwin"
114-
cxx = "${cxx} --target=arm64-apple-darwin"
115-
}
116-
asm = "${assembler_prefix}${prefix}/clang"
117-
ar = "${prefix}/llvm-ar"
118-
ld = "${link_prefix}${prefix}/clang++"
119-
strip = "${prefix}/llvm-strip"
120-
nm = "${prefix}/llvm-nm"
121-
is_clang = true
122-
if (ios_enable_relative_sdk_path) {
123-
ios_sdk_path = rebase_path(ios_sdk_path, root_build_dir)
124-
}
125-
sysroot_flags =
126-
"-isysroot $ios_sdk_path -mwatchos-simulator-version-min=$ios_sdk_min"
127-
}
128-
}
129-
13081
mac_toolchain_suite("clang_x64") {
13182
toolchain_cpu = "x64"
13283
toolchain_os = "mac"

runtime/BUILD.gn

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,6 @@ config("dart_os_config") {
104104
} else if (target_os == "ios") {
105105
defines += [ "DART_TARGET_OS_MACOS" ]
106106
defines += [ "DART_TARGET_OS_MACOS_IOS" ]
107-
} else if (target_os == "watchos") {
108-
defines += [ "DART_TARGET_OS_MACOS" ]
109-
110-
# This doesn't look entirely correct, but so far it looks
111-
# sufficient and allows to add watchOS support with less changes.
112-
# If we need to differentiate iOS and watchOS targets later, we'll
113-
# change this.
114-
defines += [ "DART_TARGET_OS_MACOS_IOS" ]
115107
} else if (target_os == "linux") {
116108
defines += [ "DART_TARGET_OS_LINUX" ]
117109
} else if (target_os == "mac") {
@@ -325,10 +317,7 @@ source_set("dart_api") {
325317

326318
library_for_all_configs("libdart") {
327319
target_type = dart_component_kind
328-
extra_nonproduct_deps = []
329-
if (dart_support_perfetto) {
330-
extra_nonproduct_deps += [ "vm:libprotozero" ]
331-
}
320+
extra_nonproduct_deps = [ "vm:libprotozero" ]
332321
extra_deps = [
333322
":generate_version_cc_file",
334323
"../third_party/double-conversion/src:libdouble_conversion",

runtime/bin/process_macos.cc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -903,11 +903,6 @@ int Process::Exec(Namespace* namespc,
903903
const char* working_directory,
904904
char* errmsg,
905905
intptr_t errmsg_len) {
906-
#if defined(DART_HOST_OS_WATCH)
907-
// execvp is not available on watchOS.
908-
Utils::StrError(ENOSYS, errmsg, errmsg_len);
909-
return -1;
910-
#else
911906
if (working_directory != nullptr &&
912907
TEMP_FAILURE_RETRY(chdir(working_directory)) == -1) {
913908
Utils::StrError(errno, errmsg, errmsg_len);
@@ -917,7 +912,6 @@ int Process::Exec(Namespace* namespc,
917912
execvp(const_cast<const char*>(path), const_cast<char* const*>(arguments));
918913
Utils::StrError(errno, errmsg, errmsg_len);
919914
return -1;
920-
#endif
921915
}
922916

923917
static int SignalMap(intptr_t id) {

runtime/platform/globals.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,6 @@
122122
#if TARGET_OS_IPHONE
123123
#define DART_HOST_OS_IOS 1
124124
#endif
125-
#if TARGET_OS_WATCH
126-
#define DART_HOST_OS_WATCH 1
127-
#endif
128125

129126
#elif defined(_WIN32)
130127

runtime/runtime_args.gni

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ declare_args() {
7272
# Whether the sampling heap profiler should be included in product mode.
7373
dart_include_sampling_heap_profiler = false
7474

75-
# Whether features that depend on Perfetto should be built. We need
76-
# to define this to allow excluding code that depends on Perfetto
77-
# from being built on platforms which have a problem linking in the
78-
# Perfetto library, e.g. watchOS.
79-
dart_support_perfetto = !is_watchos
75+
# Whether features that depend on Perfetto should be built. We temporarily
76+
# need to define this to allow excluding code that depends on Perfetto from
77+
# being built on platforms which have a problem linking in the Perfetto
78+
# library.
79+
dart_support_perfetto = true
8080

8181
# Whether to support dynamic loading and interpretation of Dart bytecode.
8282
dart_dynamic_modules = false

runtime/tools/bin_to_assembly.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def Main():
5151
return -1
5252

5353
with open(options.output, "w") as output_file:
54-
if options.target_os in ["mac", "ios", "watchos"]:
54+
if options.target_os in ["mac", "ios"]:
5555
if options.executable:
5656
output_file.write(".text\n")
5757
else:
@@ -106,7 +106,7 @@ def Main():
106106
if incbin:
107107
output_file.write(".incbin \"%s\"\n" % options.input)
108108

109-
if options.target_os not in ["mac", "ios", "watchos", "win", "win_gnu"]:
109+
if options.target_os not in ["mac", "ios", "win", "win_gnu"]:
110110
output_file.write(".size {0}, .-{0}\n".format(options.symbol_name))
111111

112112
if options.size_symbol_name:
@@ -128,7 +128,7 @@ def Main():
128128
else:
129129
output_file.write("dword %d\n" % size)
130130
else:
131-
if options.target_os in ["mac", "ios", "watchos"]:
131+
if options.target_os in ["mac", "ios"]:
132132
output_file.write(
133133
".global _%s\n" % options.size_symbol_name)
134134
output_file.write("_%s:\n" % options.size_symbol_name)

0 commit comments

Comments
 (0)