summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2018-06-14 13:06:32 -0400
committerAndrew Morrow <acm@mongodb.com>2018-06-14 17:54:18 -0400
commit9e1dd9db4bf614c785f51b23f73facc45fd75302 (patch)
treef41c9f727f82d6d2cfaec06ab643883292bf2eb8
parentd54be2fa9beef38399f4771a50e0bd8d3bf70d08 (diff)
downloadmongo-9e1dd9db4bf614c785f51b23f73facc45fd75302.tar.gz
SERVER-35600 Add support for targeting watchos
-rw-r--r--SConstruct3
-rw-r--r--etc/evergreen.yml77
-rw-r--r--etc/scons/xcode_ios_sim.vars5
-rw-r--r--etc/scons/xcode_tvos_sim.vars5
-rw-r--r--etc/scons/xcode_watchos.vars14
-rw-r--r--etc/scons/xcode_watchos_sim.vars14
-rw-r--r--site_scons/mongo/platform.py2
-rw-r--r--src/mongo/platform/stack_locator_watchOS-sim.cpp29
-rw-r--r--src/mongo/platform/stack_locator_watchOS.cpp29
-rw-r--r--src/mongo/unittest/death_test.cpp4
-rw-r--r--src/mongo/util/concurrency/thread_name.cpp2
-rw-r--r--src/mongo/util/processinfo_watchOS-sim.cpp29
-rw-r--r--src/mongo/util/processinfo_watchOS.cpp29
13 files changed, 230 insertions, 12 deletions
diff --git a/SConstruct b/SConstruct
index c26cdfd1429..9bbe81aca80 100644
--- a/SConstruct
+++ b/SConstruct
@@ -1100,6 +1100,9 @@ os_macros = {
"iOS-sim": "defined(__APPLE__) && TARGET_OS_IOS && TARGET_OS_SIMULATOR",
"tvOS": "defined(__APPLE__) && TARGET_OS_TV && !TARGET_OS_SIMULATOR",
"tvOS-sim": "defined(__APPLE__) && TARGET_OS_TV && TARGET_OS_SIMULATOR",
+ "watchOS": "defined(__APPLE__) && TARGET_OS_WATCH && !TARGET_OS_SIMULATOR",
+ "watchOS-sim": "defined(__APPLE__) && TARGET_OS_WATCH && TARGET_OS_SIMULATOR",
+
# NOTE: Once we have XCode 8 required, we can rely on the value of TARGET_OS_OSX. In case
# we are on an older XCode, use TARGET_OS_MAC and TARGET_OS_IPHONE. We don't need to correct
# the above declarations since we will never target them with anything other than XCode 8.
diff --git a/etc/evergreen.yml b/etc/evergreen.yml
index 31acc222626..818c5eae640 100644
--- a/etc/evergreen.yml
+++ b/etc/evergreen.yml
@@ -9369,7 +9369,7 @@ buildvariants:
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY
-DCMAKE_C_FLAGS="-arch x86_64 -isysroot $(xcrun --sdk macosx --show-sdk-path) -mmacosx-version-min=10.10"
- -DCMAKE_LINKER_FLAGS="-isysroot $(xcrun --sdk macosx --show-sdk-path) -mmacosx-version-min=10.10"
+ -DCMAKE_LINKER_FLAGS="-arch x86_64 -isysroot $(xcrun --sdk macosx --show-sdk-path) -mmacosx-version-min=10.10"
-DCMAKE_INSTALL_NAME_DIR=@rpath
disable_unit_tests: true
enable_embedded_tests: native
@@ -9398,7 +9398,7 @@ buildvariants:
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY
-DCMAKE_C_FLAGS="-arch arm64 -isysroot $(xcrun --sdk iphoneos --show-sdk-path) -miphoneos-version-min=10.2"
- -DCMAKE_LINKER_FLAGS="-isysroot $(xcrun --sdk iphoneos --show-sdk-path) -miphoneos-version-min=10.2"
+ -DCMAKE_LINKER_FLAGS="-arch arm64 -isysroot $(xcrun --sdk iphoneos --show-sdk-path) -miphoneos-version-min=10.2"
-DCMAKE_INSTALL_NAME_DIR=@rpath
compile_env: DEVELOPER_DIR=/Applications/Xcode9.2.app
disable_unit_tests: true
@@ -9460,7 +9460,7 @@ buildvariants:
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY
-DCMAKE_C_FLAGS="-arch arm64 -isysroot $(xcrun --sdk appletvos --show-sdk-path) -mtvos-version-min=10.2"
- -DCMAKE_LINKER_FLAGS="-isysroot $(xcrun --sdk appletvos --show-sdk-path) -mtvos-version-min=10.2"
+ -DCMAKE_LINKER_FLAGS="-arch arm64 -isysroot $(xcrun --sdk appletvos --show-sdk-path) -mtvos-version-min=10.2"
-DCMAKE_INSTALL_NAME_DIR=@rpath
disable_unit_tests: true
tasks:
@@ -9489,7 +9489,7 @@ buildvariants:
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY
-DCMAKE_C_FLAGS="-arch x86_64 -isysroot $(xcrun --sdk appletvsimulator --show-sdk-path) -mtvos-version-min=10.2"
- -DCMAKE_LINKER_FLAGS="-isysroot $(xcrun --sdk appletvsimulator --show-sdk-path) -mtvos-version-min=10.2"
+ -DCMAKE_LINKER_FLAGS="-arch x86_64 -isysroot $(xcrun --sdk appletvsimulator --show-sdk-path) -mtvos-version-min=10.2"
-DCMAKE_INSTALL_NAME_DIR=@rpath
disable_unit_tests: true
enable_embedded_tests: ios_tvos_simulator
@@ -9498,6 +9498,75 @@ buildvariants:
tasks:
- name: compile_mobile
+- name: embedded-sdk-watchos-4.3
+ display_name: "Embedded SDK - watchOS 4.3"
+ run_on:
+ - macos-1012
+ batchtime: 1440 # 1 day
+ expansions:
+ build_cdriver: true
+ cmake_path: /Applications/cmake-3.11.0-Darwin-x86_64/CMake.app/Contents/bin/cmake
+ test_flags: --excludeWithAnyTags=requires_mmapv1,uses_transactions
+ compile_env: DEVELOPER_DIR=/Applications/XCode9.2.app
+ compile_flags: >-
+ -j$(sysctl -n hw.logicalcpu)
+ --dbg=off
+ --opt=size
+ --enable-free-mon=off
+ --variables-files=etc/scons/xcode_watchos.vars
+ --use-system-mongo-c=on
+ LIBPATH="\$BUILD_ROOT/mongo-embedded-sdk-\$MONGO_VERSION/lib"
+ cdriver_cmake_flags: >-
+ -DTHREADS_PTHREAD_ARG=2
+ -DCMAKE_SYSTEM_NAME=Darwin
+ -DCMAKE_FIND_ROOT_PATH="$(xcrun --sdk watchos --show-sdk-path);$WORKDIR/src/build/mongo-embedded-sdk-$VERSION-tmp"
+ -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY
+ -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY
+ -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER
+ -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY
+ -DCMAKE_C_FLAGS="-arch armv7k -isysroot $(xcrun --sdk watchos --show-sdk-path) -mwatchos-version-min=4.3"
+ -DCMAKE_LINKER_FLAGS="-arch armv7k -isysroot $(xcrun --sdk watchos --show-sdk-path) -mwatchos-version-min=4.3"
+ -DCMAKE_INSTALL_NAME_DIR=@rpath
+ disable_unit_tests: true
+ tasks:
+ - name: compile_mobile
+
+- name: embedded-sdk-watchsimulator-4.3
+ display_name: "Embedded SDK - watchOS Simulator 4.3"
+ run_on:
+ - macos-1012
+ batchtime: 1440 # 1 day
+ expansions:
+ build_cdriver: true
+ cmake_path: /Applications/cmake-3.11.0-Darwin-x86_64/CMake.app/Contents/bin/cmake
+ test_flags: --excludeWithAnyTags=requires_mmapv1,uses_transactions
+ compile_env: DEVELOPER_DIR=/Applications/XCode9.2.app
+ compile_flags: >-
+ -j$(sysctl -n hw.logicalcpu)
+ --dbg=off
+ --opt=size
+ --enable-free-mon=off
+ --variables-files=etc/scons/xcode_watchos_sim.vars
+ --use-system-mongo-c=on
+ LIBPATH="\$BUILD_ROOT/mongo-embedded-sdk-\$MONGO_VERSION/lib"
+ cdriver_cmake_flags: >-
+ -DTHREADS_PTHREAD_ARG=2
+ -DCMAKE_SYSTEM_NAME=Darwin
+ -DCMAKE_FIND_ROOT_PATH="$(xcrun --sdk watchsimulator --show-sdk-path);$WORKDIR/src/build/mongo-embedded-sdk-$VERSION-tmp"
+ -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY
+ -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY
+ -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER
+ -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY
+ -DCMAKE_C_FLAGS="-arch i386 -isysroot $(xcrun --sdk watchsimulator --show-sdk-path) -mwatchos-version-min=4.3"
+ -DCMAKE_LINKER_FLAGS="-arch i386 -isysroot $(xcrun --sdk watchsimulator --show-sdk-path) -mwatchos-version-min=4.3"
+ -DCMAKE_INSTALL_NAME_DIR=@rpath
+ disable_unit_tests: true
+ enable_embedded_tests: ios_watchos_simulator
+ ios_sim_device: Apple-Watch-Series-3-42mm
+ ios_sim_runtime: watchOS-4-3
+ tasks:
+ - name: compile_mobile
+
- name: embedded-sdk-ubuntu-1604-x86_64
display_name: "Embedded SDK - Ubuntu 16.04 x86_64"
run_on:
diff --git a/etc/scons/xcode_ios_sim.vars b/etc/scons/xcode_ios_sim.vars
index bcc46547069..cbf6aaaf8aa 100644
--- a/etc/scons/xcode_ios_sim.vars
+++ b/etc/scons/xcode_ios_sim.vars
@@ -7,7 +7,8 @@ CXX = subprocess.check_output(['xcrun', '-f', '--sdk', 'iphonesimulator', 'clang
sdk_path = subprocess.check_output(['xcrun', '--sdk', 'iphonesimulator', '--show-sdk-path']).strip()
-CCFLAGS = "-isysroot {} -miphoneos-version-min=10.2".format(sdk_path)
-LINKFLAGS = "-Wl,-syslibroot,{} -miphoneos-version-min=10.2".format(sdk_path)
+CCFLAGS = "-isysroot {} -miphoneos-version-min=10.2 -arch x86_64".format(sdk_path)
+LINKFLAGS = "-Wl,-syslibroot,{} -miphoneos-version-min=10.2 -arch x86_64".format(sdk_path)
TARGET_OS = "iOS-sim"
+TARGET_ARCH = "x86_64"
diff --git a/etc/scons/xcode_tvos_sim.vars b/etc/scons/xcode_tvos_sim.vars
index eaccb5ca18c..6f680cfaa8b 100644
--- a/etc/scons/xcode_tvos_sim.vars
+++ b/etc/scons/xcode_tvos_sim.vars
@@ -7,7 +7,8 @@ CXX = subprocess.check_output(['xcrun', '-f', '--sdk', 'appletvsimulator', 'clan
sdk_path = subprocess.check_output(['xcrun', '--sdk', 'appletvsimulator', '--show-sdk-path']).strip()
-CCFLAGS = "-isysroot {} -mtvos-version-min=10.2".format(sdk_path)
-LINKFLAGS = "-Wl,-syslibroot,{} -mtvos-version-min=10.2".format(sdk_path)
+CCFLAGS = "-isysroot {} -mtvos-version-min=10.2 -arch x86_64".format(sdk_path)
+LINKFLAGS = "-Wl,-syslibroot,{} -mtvos-version-min=10.2 -arch x86_64".format(sdk_path)
TARGET_OS = "tvOS-sim"
+TARGET_ARCH = "x86_64"
diff --git a/etc/scons/xcode_watchos.vars b/etc/scons/xcode_watchos.vars
new file mode 100644
index 00000000000..b431e3f05f8
--- /dev/null
+++ b/etc/scons/xcode_watchos.vars
@@ -0,0 +1,14 @@
+# Configures the build to use XCode targeting iOS
+
+import subprocess
+
+CC = subprocess.check_output(['xcrun', '-f', '--sdk', 'watchos', 'clang']).strip()
+CXX = subprocess.check_output(['xcrun', '-f', '--sdk', 'watchos', 'clang++']).strip()
+
+sdk_path = subprocess.check_output(['xcrun', '--sdk', 'watchos', '--show-sdk-path']).strip()
+
+CCFLAGS = "-isysroot {} -mwatchos-version-min=4.3 -arch armv7k -fembed-bitcode".format(sdk_path)
+LINKFLAGS = "-Wl,-syslibroot,{} -mwatchos-version-min=4.3 -arch armv7k".format(sdk_path)
+
+TARGET_OS = "watchOS"
+TARGET_ARCH = "arm"
diff --git a/etc/scons/xcode_watchos_sim.vars b/etc/scons/xcode_watchos_sim.vars
new file mode 100644
index 00000000000..a9f5dea7856
--- /dev/null
+++ b/etc/scons/xcode_watchos_sim.vars
@@ -0,0 +1,14 @@
+# Configures the build to use XCode targeting iOS simulator
+
+import subprocess
+
+CC = subprocess.check_output(['xcrun', '-f', '--sdk', 'watchsimulator', 'clang']).strip()
+CXX = subprocess.check_output(['xcrun', '-f', '--sdk', 'watchsimulator', 'clang++']).strip()
+
+sdk_path = subprocess.check_output(['xcrun', '--sdk', 'watchsimulator', '--show-sdk-path']).strip()
+
+CCFLAGS = "-isysroot {} -mwatchos-version-min=4.3 -arch i386".format(sdk_path)
+LINKFLAGS = "-Wl,-syslibroot,{} -mwatchos-version-min=4.3 -arch i386".format(sdk_path)
+
+TARGET_OS = "watchOS-sim"
+TARGET_ARCH = "i386"
diff --git a/site_scons/mongo/platform.py b/site_scons/mongo/platform.py
index 03b26f5bc0d..9e86da95c8c 100644
--- a/site_scons/mongo/platform.py
+++ b/site_scons/mongo/platform.py
@@ -38,7 +38,7 @@ def env_get_os_name_wrapper(self):
return self['TARGET_OS']
def is_os_raw(target_os, os_list_to_check):
- darwin_os_list = [ 'macOS', 'tvOS', 'tvOS-sim', 'iOS', 'iOS-sim' ]
+ darwin_os_list = [ 'macOS', 'tvOS', 'tvOS-sim', 'iOS', 'iOS-sim', 'watchOS', 'watchOS-sim' ]
linux_os_list = [ 'android', 'linux' ]
posix_os_list = [ 'openbsd', 'freebsd', 'solaris' ] + darwin_os_list + linux_os_list
diff --git a/src/mongo/platform/stack_locator_watchOS-sim.cpp b/src/mongo/platform/stack_locator_watchOS-sim.cpp
new file mode 100644
index 00000000000..bce4347951e
--- /dev/null
+++ b/src/mongo/platform/stack_locator_watchOS-sim.cpp
@@ -0,0 +1,29 @@
+/**
+ * Copyright (C) 2017 MongoDB Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * As a special exception, the copyright holders give permission to link the
+ * code of portions of this program with the OpenSSL library under certain
+ * conditions as described in each individual source file and distribute
+ * linked combinations including the program with the OpenSSL library. You
+ * must comply with the GNU Affero General Public License in all respects for
+ * all of the code used other than as permitted herein. If you modify file(s)
+ * with this exception, you may extend this exception to your version of the
+ * file(s), but you are not obligated to do so. If you do not wish to do so,
+ * delete this exception statement from your version. If you delete this
+ * exception statement from all source files in the program, then also delete
+ * it in the license file.
+ */
+
+#include "mongo/platform/stack_locator_osx.cpp"
diff --git a/src/mongo/platform/stack_locator_watchOS.cpp b/src/mongo/platform/stack_locator_watchOS.cpp
new file mode 100644
index 00000000000..bce4347951e
--- /dev/null
+++ b/src/mongo/platform/stack_locator_watchOS.cpp
@@ -0,0 +1,29 @@
+/**
+ * Copyright (C) 2017 MongoDB Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * As a special exception, the copyright holders give permission to link the
+ * code of portions of this program with the OpenSSL library under certain
+ * conditions as described in each individual source file and distribute
+ * linked combinations including the program with the OpenSSL library. You
+ * must comply with the GNU Affero General Public License in all respects for
+ * all of the code used other than as permitted herein. If you modify file(s)
+ * with this exception, you may extend this exception to your version of the
+ * file(s), but you are not obligated to do so. If you do not wish to do so,
+ * delete this exception statement from your version. If you delete this
+ * exception statement from all source files in the program, then also delete
+ * it in the license file.
+ */
+
+#include "mongo/platform/stack_locator_osx.cpp"
diff --git a/src/mongo/unittest/death_test.cpp b/src/mongo/unittest/death_test.cpp
index 73bb1c91c1e..e9def2e6e75 100644
--- a/src/mongo/unittest/death_test.cpp
+++ b/src/mongo/unittest/death_test.cpp
@@ -67,8 +67,8 @@ void DeathTestImpl::_doTest() {
#if defined(_WIN32)
log() << "Skipping death test on Windows";
return;
-#elif defined(__APPLE__) && TARGET_OS_TV
- log() << "Skipping death test on tvOS";
+#elif defined(__APPLE__) && (TARGET_OS_TV || TARGET_OS_WATCH)
+ log() << "Skipping death test on tvOS/watchOS";
return;
#else
int pipes[2];
diff --git a/src/mongo/util/concurrency/thread_name.cpp b/src/mongo/util/concurrency/thread_name.cpp
index 500d51bf08d..57358b0d5c1 100644
--- a/src/mongo/util/concurrency/thread_name.cpp
+++ b/src/mongo/util/concurrency/thread_name.cpp
@@ -36,7 +36,7 @@
#endif
#if defined(__APPLE__)
#include <TargetConditionals.h>
-#if !TARGET_OS_TV && !TARGET_OS_IOS
+#if !TARGET_OS_TV && !TARGET_OS_IOS && !TARGET_OS_WATCH
#include <sys/proc_info.h>
#else
#include <mach/thread_info.h>
diff --git a/src/mongo/util/processinfo_watchOS-sim.cpp b/src/mongo/util/processinfo_watchOS-sim.cpp
new file mode 100644
index 00000000000..bfba9c7ec97
--- /dev/null
+++ b/src/mongo/util/processinfo_watchOS-sim.cpp
@@ -0,0 +1,29 @@
+/**
+ * Copyright (C) 2017 MongoDB Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * As a special exception, the copyright holders give permission to link the
+ * code of portions of this program with the OpenSSL library under certain
+ * conditions as described in each individual source file and distribute
+ * linked combinations including the program with the OpenSSL library. You
+ * must comply with the GNU Affero General Public License in all respects
+ * for all of the code used other than as permitted herein. If you modify
+ * file(s) with this exception, you may extend this exception to your
+ * version of the file(s), but you are not obligated to do so. If you do not
+ * wish to do so, delete this exception statement from your version. If you
+ * delete this exception statement from all source files in the program,
+ * then also delete it in the license file.
+ */
+
+#include "mongo/util/processinfo_osx.cpp"
diff --git a/src/mongo/util/processinfo_watchOS.cpp b/src/mongo/util/processinfo_watchOS.cpp
new file mode 100644
index 00000000000..bfba9c7ec97
--- /dev/null
+++ b/src/mongo/util/processinfo_watchOS.cpp
@@ -0,0 +1,29 @@
+/**
+ * Copyright (C) 2017 MongoDB Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * As a special exception, the copyright holders give permission to link the
+ * code of portions of this program with the OpenSSL library under certain
+ * conditions as described in each individual source file and distribute
+ * linked combinations including the program with the OpenSSL library. You
+ * must comply with the GNU Affero General Public License in all respects
+ * for all of the code used other than as permitted herein. If you modify
+ * file(s) with this exception, you may extend this exception to your
+ * version of the file(s), but you are not obligated to do so. If you do not
+ * wish to do so, delete this exception statement from your version. If you
+ * delete this exception statement from all source files in the program,
+ * then also delete it in the license file.
+ */
+
+#include "mongo/util/processinfo_osx.cpp"