{"action":"created","issue":{"url":"https://api.github.com/repos/apple/swift/issues/4972","repository_url":"https://api.github.com/repos/apple/swift","labels_url":"https://api.github.com/repos/apple/swift/issues/4972/labels{/name}","comments_url":"https://api.github.com/repos/apple/swift/issues/4972/comments","events_url":"https://api.github.com/repos/apple/swift/issues/4972/events","html_url":"https://github.com/apple/swift/pull/4972","id":178958417,"number":4972,"title":"[Android] Enable building static stdlib on macOS","user":{"login":"modocache","id":552921,"avatar_url":"https://avatars.githubusercontent.com/u/552921?v=3","gravatar_id":"","url":"https://api.github.com/users/modocache","html_url":"https://github.com/modocache","followers_url":"https://api.github.com/users/modocache/followers","following_url":"https://api.github.com/users/modocache/following{/other_user}","gists_url":"https://api.github.com/users/modocache/gists{/gist_id}","starred_url":"https://api.github.com/users/modocache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/modocache/subscriptions","organizations_url":"https://api.github.com/users/modocache/orgs","repos_url":"https://api.github.com/users/modocache/repos","events_url":"https://api.github.com/users/modocache/events{/privacy}","received_events_url":"https://api.github.com/users/modocache/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"gottesmm","id":499423,"avatar_url":"https://avatars.githubusercontent.com/u/499423?v=3","gravatar_id":"","url":"https://api.github.com/users/gottesmm","html_url":"https://github.com/gottesmm","followers_url":"https://api.github.com/users/gottesmm/followers","following_url":"https://api.github.com/users/gottesmm/following{/other_user}","gists_url":"https://api.github.com/users/gottesmm/gists{/gist_id}","starred_url":"https://api.github.com/users/gottesmm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gottesmm/subscriptions","organizations_url":"https://api.github.com/users/gottesmm/orgs","repos_url":"https://api.github.com/users/gottesmm/repos","events_url":"https://api.github.com/users/gottesmm/events{/privacy}","received_events_url":"https://api.github.com/users/gottesmm/received_events","type":"User","site_admin":false},"assignees":[{"login":"gottesmm","id":499423,"avatar_url":"https://avatars.githubusercontent.com/u/499423?v=3","gravatar_id":"","url":"https://api.github.com/users/gottesmm","html_url":"https://github.com/gottesmm","followers_url":"https://api.github.com/users/gottesmm/followers","following_url":"https://api.github.com/users/gottesmm/following{/other_user}","gists_url":"https://api.github.com/users/gottesmm/gists{/gist_id}","starred_url":"https://api.github.com/users/gottesmm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gottesmm/subscriptions","organizations_url":"https://api.github.com/users/gottesmm/orgs","repos_url":"https://api.github.com/users/gottesmm/repos","events_url":"https://api.github.com/users/gottesmm/events{/privacy}","received_events_url":"https://api.github.com/users/gottesmm/received_events","type":"User","site_admin":false},{"login":"llvm-beanz","id":15788759,"avatar_url":"https://avatars.githubusercontent.com/u/15788759?v=3","gravatar_id":"","url":"https://api.github.com/users/llvm-beanz","html_url":"https://github.com/llvm-beanz","followers_url":"https://api.github.com/users/llvm-beanz/followers","following_url":"https://api.github.com/users/llvm-beanz/following{/other_user}","gists_url":"https://api.github.com/users/llvm-beanz/gists{/gist_id}","starred_url":"https://api.github.com/users/llvm-beanz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/llvm-beanz/subscriptions","organizations_url":"https://api.github.com/users/llvm-beanz/orgs","repos_url":"https://api.github.com/users/llvm-beanz/repos","events_url":"https://api.github.com/users/llvm-beanz/events{/privacy}","received_events_url":"https://api.github.com/users/llvm-beanz/received_events","type":"User","site_admin":false}],"milestone":null,"comments":21,"created_at":"2016-09-23T19:43:52Z","updated_at":"2016-10-15T04:56:35Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apple/swift/pulls/4972","html_url":"https://github.com/apple/swift/pull/4972","diff_url":"https://github.com/apple/swift/pull/4972.diff","patch_url":"https://github.com/apple/swift/pull/4972.patch"},"body":"<!-- What's in this pull request? -->\r\nThe Swift runtime can be built for Android on Linux host machines using the instructions in `docs/Android.md`. This commit allows it to be built on macOS host machines as well.\r\n\r\nThis work is inspired by @compnerd's work in enabling Windows builds from macOS hosts. It assumes host tools are already built for macOS. It also does not support building the stdlib and SDK overlays yet. I intend to support these in a future commit.\r\n\r\nFor now, the Android runtime may be built by using the following bash script, which simply calls CMake:\r\n\r\n```sh\r\n\r\nset -e\r\nset -x\r\n\r\nHOME_DIR=\"/Users/bgesiak\"\r\n\r\nAPPLE_DIR=\"${HOME_DIR}/GitHub/apple\"\r\nBUILD_DIR=\"${APPLE_DIR}/build/Ninja-Release\"\r\nCMARK_SRC_DIR=\"${APPLE_DIR}/cmark\"\r\nCMARK_BUILD_DIR=\"${BUILD_DIR}/cmark-macosx-x86_64\"\r\nLLVM_SRC_DIR=\"${APPLE_DIR}/llvm\"\r\nLLVM_BUILD_DIR=\"${BUILD_DIR}/llvm-macosx-x86_64\"\r\nSWIFT_BUILD_DIR=\"${BUILD_DIR}/swift-macosx-x86_64\"\r\n\r\nANDROID_NDK_DIR=\"${HOME_DIR}/android-ndk-r12b\"\r\nLIBICU_SRC_DIR=\"${APPLE_DIR}/libiconv-libicu-android\"\r\nLIBICU_BUILD_DIR=\"${LIBICU_SRC_DIR}/armeabi-v7a\"\r\n\r\nSWIFT_ANDROID_BUILD_DIR=\"${APPLE_DIR}/build/SwiftAndroid\"\r\n\r\nmkdir -p \"${SWIFT_ANDROID_BUILD_DIR}\"\r\n\r\ncmake \\\r\n  -G \"Ninja\" \\\r\n  \\\r\n  -DCMAKE_C_COMPILER:PATH=\"${LLVM_BUILD_DIR}/bin/clang\" \\\r\n  -DCMAKE_CXX_COMPILER:PATH=\"${LLVM_BUILD_DIR}/bin/clang++\" \\\r\n  \\\r\n  -DSWIFT_PATH_TO_CMARK_SOURCE:PATH=\"${CMARK_SRC_DIR}\" \\\r\n  -DSWIFT_PATH_TO_CMARK_BUILD:PATH=\"${CMARK_BUILD_DIR}\" \\\r\n  -DSWIFT_CMARK_LIBRARY_DIR:PATH=\"${CMARK_BUILD_DIR}/src\" \\\r\n  -DSWIFT_PATH_TO_LLVM_SOURCE:PATH=\"${LLVM_SRC_DIR}\" \\\r\n  -DSWIFT_PATH_TO_LLVM_BUILD:PATH=\"${LLVM_BUILD_DIR}\" \\\r\n  -DSWIFT_PATH_TO_CLANG_SOURCE:PATH=\"${LLVM_SRC_DIR}/tools/clang\" \\\r\n  -DSWIFT_PATH_TO_CLANG_BUILD:PATH=\"${LLVM_BUILD_DIR}\" \\\r\n  -DSWIFT_NATIVE_LLVM_TOOLS_PATH:STRING=\"${LLVM_BUILD_DIR}/bin\" \\\r\n  -DSWIFT_NATIVE_SWIFT_TOOLS_PATH:STRING=\"${SWIFT_BUILD_DIR}/bin\" \\\r\n  \\\r\n  -DSWIFT_ANALYZE_CODE_COVERAGE:STRING=FALSE \\\r\n  -DSWIFT_SERIALIZE_STDLIB_UNITTEST:BOOL=FALSE \\\r\n  -DSWIFT_STDLIB_SIL_DEBUGGING:BOOL=FALSE \\\r\n  -DSWIFT_CHECK_INCREMENTAL_COMPILATION:BOOL=FALSE \\\r\n  -DSWIFT_STDLIB_ENABLE_RESILIENCE:BOOL=FALSE \\\r\n  -DSWIFT_STDLIB_SIL_SERIALIZE_ALL:BOOL=TRUE \\\r\n  -DSWIFT_BUILD_PERF_TESTSUITE:BOOL=FALSE \\\r\n  -DSWIFT_BUILD_EXAMPLES:BOOL=FALSE \\\r\n  -DSWIFT_INCLUDE_TESTS:BOOL=FALSE \\\r\n  -DSWIFT_EMBED_BITCODE_SECTION:BOOL=FALSE \\\r\n  -DSWIFT_TOOLS_ENABLE_LTO:STRING= \\\r\n  -DSWIFT_AST_VERIFIER:BOOL=TRUE \\\r\n  -DSWIFT_SIL_VERIFY_ALL:BOOL=FALSE \\\r\n  -DSWIFT_RUNTIME_ENABLE_LEAK_CHECKER:BOOL=FALSE \\\r\n  \\\r\n  -DCMAKE_BUILD_TYPE:STRING=Release \\\r\n  -DLLVM_ENABLE_ASSERTIONS:BOOL=TRUE \\\r\n  -DSWIFT_STDLIB_BUILD_TYPE:STRING=Release \\\r\n  -DSWIFT_STDLIB_ASSERTIONS:BOOL=TRUE \\\r\n  -DSWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER:BOOL=TRUE \\\r\n  -DSWIFT_HOST_VARIANT=macosx \\\r\n  -DSWIFT_HOST_VARIANT_SDK=OSX \\\r\n  -DSWIFT_HOST_VARIANT_ARCH=x86_64 \\\r\n  -DSWIFT_BUILD_TOOLS:BOOL=FALSE \\\r\n  -DSWIFT_INCLUDE_TOOLS:BOOL=FALSE \\\r\n  -DSWIFT_BUILD_REMOTE_MIRROR:BOOL=FALSE \\\r\n  -DSWIFT_BUILD_DYNAMIC_STDLIB:BOOL=FALSE \\\r\n  -DSWIFT_BUILD_STATIC_STDLIB:BOOL=TRUE \\\r\n  -DSWIFT_BUILD_DYNAMIC_SDK_OVERLAY:BOOL=FALSE \\\r\n  -DSWIFT_BUILD_STATIC_SDK_OVERLAY:BOOL=FALSE \\\r\n  -DSWIFT_EXEC:STRING=\"${SWIFT_BUILD_DIR}/bin/swiftc\" \\\r\n  \\\r\n  -DSWIFT_ENABLE_GOLD_LINKER:BOOL=TRUE \\\r\n  -DSWIFT_SDKS:STRING=ANDROID \\\r\n  -DSWIFT_ANDROID_NDK_PATH:STRING=\"${ANDROID_NDK_DIR}\" \\\r\n  -DSWIFT_ANDROID_NDK_GCC_VERSION:STRING=4.9 \\\r\n  -DSWIFT_ANDROID_SDK_PATH:STRING=\"${ANDROID_NDK_DIR}/platforms/android-21/arch-arm\" \\\r\n  -DSWIFT_ANDROID_ICU_UC:STRING=\"${LIBICU_BUILD_DIR}\" \\\r\n  -DSWIFT_ANDROID_ICU_UC_INCLUDE:STRING=\"${LIBICU_BUILD_DIR}/icu/source/common\" \\\r\n  -DSWIFT_ANDROID_ICU_I18N:STRING=\"${LIBICU_BUILD_DIR}\" \\\r\n  -DSWIFT_ANDROID_ICU_I18N_INCLUDE:STRING=\"${LIBICU_BUILD_DIR}/icu/source/i18n\" \\\r\n  \\\r\n  \"${APPLE_DIR}/swift\"\r\n\r\ncmake --build \"${APPLE_DIR}/swift\" -- -j8 swift-stdlib-android-armv7\r\n```\r\n\r\n<!-- If this pull request resolves any bugs in the Swift bug tracker, provide a link: -->\r\nAddresses part of [SR-1362](https://bugs.swift.org/browse/SR-1362), with stdlib and SDK overlay support coming in a future pull request."},"comment":{"url":"https://api.github.com/repos/apple/swift/issues/comments/253963037","html_url":"https://github.com/apple/swift/pull/4972#issuecomment-253963037","issue_url":"https://api.github.com/repos/apple/swift/issues/4972","id":253963037,"user":{"login":"modocache","id":552921,"avatar_url":"https://avatars.githubusercontent.com/u/552921?v=3","gravatar_id":"","url":"https://api.github.com/users/modocache","html_url":"https://github.com/modocache","followers_url":"https://api.github.com/users/modocache/followers","following_url":"https://api.github.com/users/modocache/following{/other_user}","gists_url":"https://api.github.com/users/modocache/gists{/gist_id}","starred_url":"https://api.github.com/users/modocache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/modocache/subscriptions","organizations_url":"https://api.github.com/users/modocache/orgs","repos_url":"https://api.github.com/users/modocache/repos","events_url":"https://api.github.com/users/modocache/events{/privacy}","received_events_url":"https://api.github.com/users/modocache/received_events","type":"User","site_admin":false},"created_at":"2016-10-15T04:56:35Z","updated_at":"2016-10-15T04:56:35Z","body":"The DebugInfo test failure appears unrelated."}}
{"actor":{"display_login":"modocache"}}