Skip to content
This repository has been archived by the owner on Aug 14, 2022. It is now read-only.

Update to use Swift 5.5 #129

Closed
vgorloff opened this issue Sep 23, 2021 · 12 comments
Closed

Update to use Swift 5.5 #129

vgorloff opened this issue Sep 23, 2021 · 12 comments

Comments

@vgorloff
Copy link
Owner

No description provided.

@MihaelIsaev
Copy link

Yes please 🙏🚀

@vgorloff
Copy link
Owner Author

First compile error:

CMake Error at CMakeLists.txt:54 (find_package):
  Could not find a package configuration file provided by "SwiftCrypto" with
  any of the following names:

    SwiftCryptoConfig.cmake
    swiftcrypto-config.cmake

  Add the installation prefix of "SwiftCrypto" to CMAKE_PREFIX_PATH or set
  "SwiftCrypto_DIR" to a directory containing one of the above files.  If
  "SwiftCrypto" provides a separate development package or SDK, be sure it
  has been installed.

Seems the new dependency needed for Swift 5.5 - the "swift-crypto": "1.1.5"

@vgorloff
Copy link
Owner Author

Another issue:

CMake Error at /usr/local/Cellar/cmake/3.21.2/share/cmake/Modules/ExternalProject.cmake:2866 (message):
  No download info given for 'libdispatch-android-armv7' and its source
  directory:

   /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/Build/darwin-host/swift/libdispatch-android-armv7-prefix/src/libdispatch-android-armv7

  is not an existing non-empty directory.  Please specify one of:

   * SOURCE_DIR with an existing non-empty directory
   * DOWNLOAD_COMMAND
   * URL
   * GIT_REPOSITORY
   * SVN_REPOSITORY
   * HG_REPOSITORY
   * CVS_REPOSITORY and CVS_MODULE
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.21.2/share/cmake/Modules/ExternalProject.cmake:3700 (_ep_add_download_command)
  cmake/modules/Libdispatch.cmake:76 (ExternalProject_Add)
  CMakeLists.txt:983 (include)


CMake Error at /usr/local/Cellar/cmake/3.21.2/share/cmake/Modules/ExternalProject.cmake:2866 (message):
  No download info given for 'libdispatch-android-aarch64' and its source
  directory:

   /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/Build/darwin-host/swift/libdispatch-android-aarch64-prefix/src/libdispatch-android-aarch64

  is not an existing non-empty directory.  Please specify one of:

   * SOURCE_DIR with an existing non-empty directory
   * DOWNLOAD_COMMAND
   * URL
   * GIT_REPOSITORY
   * SVN_REPOSITORY
   * HG_REPOSITORY
   * CVS_REPOSITORY and CVS_MODULE
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.21.2/share/cmake/Modules/ExternalProject.cmake:3700 (_ep_add_download_command)
  cmake/modules/Libdispatch.cmake:76 (ExternalProject_Add)
  CMakeLists.txt:983 (include)


CMake Error at /usr/local/Cellar/cmake/3.21.2/share/cmake/Modules/ExternalProject.cmake:2866 (message):
  No download info given for 'libdispatch-android-i686' and its source
  directory:

   /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/Build/darwin-host/swift/libdispatch-android-i686-prefix/src/libdispatch-android-i686

  is not an existing non-empty directory.  Please specify one of:

   * SOURCE_DIR with an existing non-empty directory
   * DOWNLOAD_COMMAND
   * URL
   * GIT_REPOSITORY
   * SVN_REPOSITORY
   * HG_REPOSITORY
   * CVS_REPOSITORY and CVS_MODULE
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.21.2/share/cmake/Modules/ExternalProject.cmake:3700 (_ep_add_download_command)
  cmake/modules/Libdispatch.cmake:76 (ExternalProject_Add)
  CMakeLists.txt:983 (include)


CMake Error at /usr/local/Cellar/cmake/3.21.2/share/cmake/Modules/ExternalProject.cmake:2866 (message):
  No download info given for 'libdispatch-android-x86_64' and its source
  directory:

   /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/Build/darwin-host/swift/libdispatch-android-x86_64-prefix/src/libdispatch-android-x86_64

  is not an existing non-empty directory.  Please specify one of:

   * SOURCE_DIR with an existing non-empty directory
   * DOWNLOAD_COMMAND
   * URL
   * GIT_REPOSITORY
   * SVN_REPOSITORY
   * HG_REPOSITORY
   * CVS_REPOSITORY and CVS_MODULE
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.21.2/share/cmake/Modules/ExternalProject.cmake:3700 (_ep_add_download_command)
  cmake/modules/Libdispatch.cmake:76 (ExternalProject_Add)
  CMakeLists.txt:983 (include)

Swift trying to use libdispatch. But we are usually building it on next step.

@vgorloff
Copy link
Owner Author

vgorloff commented Oct 1, 2021

Previous error fixed by cmake flag -D SWIFT_ENABLE_DISPATCH=false

@vgorloff
Copy link
Owner Author

vgorloff commented Oct 1, 2021

Next error:

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
"swift-stdlib" Configure [armv7a] is started.
mkdir -p "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/Build/darwin-armv7a/swift-stdlib"
cd /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/Build/darwin-armv7a/swift-stdlib && cmake -G Ninja \
   -D ANDROID_ABI=armeabi-v7a \
   -D ANDROID_PLATFORM=android-21 \
   -D CMAKE_TOOLCHAIN_FILE=/Volumes/Shared/Data/Android/sdk/ndk/21.4.7075529/build/cmake/android.toolchain.cmake \
   -D CMAKE_C_FLAGS=" -L/Volumes/Shared/Data/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/arm-linux-androideabi/21" \
   -D CMAKE_CXX_FLAGS=" -L/Volumes/Shared/Data/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/arm-linux-androideabi/21" \
   -D LLVM_DIR=/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/Build/darwin-host/llvm-project/lib/cmake/llvm \
   -D SWIFT_HOST_VARIANT_SDK=ANDROID \
   -D SWIFT_HOST_VARIANT_ARCH=armv7 \
   -D SWIFT_SDKS="ANDROID" \
   -D SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS="-sdk;/Volumes/Shared/Data/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot" \
   -D SWIFT_BUILD_DYNAMIC_SDK_OVERLAY=TRUE \
   -D SWIFT_BUILD_STATIC_SDK_OVERLAY=FALSE \
   -D SWIFT_INCLUDE_TOOLS=NO \
   -D SWIFT_INCLUDE_TESTS=NO \
   -D SWIFT_INCLUDE_DOCS=NO \
   -D SWIFT_BUILD_SYNTAXPARSERLIB=NO \
   -D SWIFT_BUILD_SOURCEKIT=NO \
   -D SWIFT_ANDROID_API_LEVEL=21 \
   -D SWIFT_ANDROID_NDK_PATH=/Volumes/Shared/Data/Android/sdk/ndk/21.4.7075529 \
   -D SWIFT_ANDROID_NDK_GCC_VERSION=4.9 \
   -D SWIFT_ENABLE_LLD_LINKER=FALSE \
   -D SWIFT_ENABLE_GOLD_LINKER=TRUE \
   -D SWIFT_ANDROID_armv7_ICU_UC=/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/Install/darwin-armv7a/icu/lib/libicuucswift.so \
   -D SWIFT_ANDROID_armv7_ICU_UC_INCLUDE=/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/Sources/icu/icu4c/source/common \
   -D SWIFT_ANDROID_armv7_ICU_I18N=/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/Install/darwin-armv7a/icu/lib/libicui18nswift.so \
   -D SWIFT_ANDROID_armv7_ICU_I18N_INCLUDE=/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/Sources/icu/icu4c/source/i18n \
   -D SWIFT_ANDROID_armv7_ICU_DATA=/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/Install/darwin-armv7a/icu/lib/libicudataswift.so \
   -D CMAKE_BUILD_TYPE=Release \
   -D SWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER=YES \
   -D SWIFT_NATIVE_SWIFT_TOOLS_PATH=/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/Build/darwin-host/swift/bin \
   -D SWIFT_ANDROID_armv7_ICU_STATICLIB=TRUE \
   -D CMAKE_INSTALL_PREFIX=/ \
   /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/Sources/swift
CMake Deprecation Warning at CMakeLists.txt:7 (cmake_policy):
  The OLD behavior for policy CMP0068 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


-- CMake (/usr/local/Cellar/cmake/3.21.2/bin/cmake) Version: 3.21.2
-- CMake Make Program (/usr/local/bin/ninja) Version: 1.10.2
-- C Compiler (/Volumes/Shared/Data/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang) Version: 9.0
-- C++ Compiler (/Volumes/Shared/Data/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++) Version: 9.0
--
-- Found ZLIB: /Volumes/Shared/Data/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/arm-linux-androideabi/libz.a (found version "1.2.7")
-- Could NOT find LibXml2 (missing: LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
CMake Warning at /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/Sources/llvm-project/llvm/cmake/modules/HandleLLVMOptions.cmake:261 (message):
  -fPIC is not supported.
Call Stack (most recent call first):
  /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/Sources/llvm-project/llvm/cmake/modules/HandleLLVMOptions.cmake:297 (add_flag_or_print_warning)
  cmake/modules/SwiftSharedCMakeConfig.cmake:106 (include)
  cmake/modules/SwiftSharedCMakeConfig.cmake:211 (swift_common_standalone_build_config_llvm)
  CMakeLists.txt:516 (swift_common_standalone_build_config)


-- Performing Test CXX_SUPPORTS_SUGGEST_OVERRIDE_FLAG
-- Performing Test CXX_SUPPORTS_SUGGEST_OVERRIDE_FLAG - Failed
-- Android SDK:
--   Object File Format: ELF
--   Swift Standard Library Path: android
--   Architectures: armv7
--   armv7 triple: armv7-unknown-linux-androideabi
--   Module triple: armv7-unknown-linux-android
--  NDK:
--  Sysroot: /data/data/com.termux/files
--   armv7 libc header path: /Volumes/Shared/Data/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include
--   armv7 libc architecture specific header path: /Volumes/Shared/Data/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include
--   armv7 ICU i18n INCLUDE: /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/Sources/icu/icu4c/source/i18n
--   armv7 ICU i18n LIB: /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/Install/darwin-armv7a/icu/lib/libicui18nswift.so
--   armv7 ICU unicode INCLUDE: /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/Sources/icu/icu4c/source/common
--   armv7 ICU unicode LIB: /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/Install/darwin-armv7a/icu/lib/libicuucswift.so
--
-- Not building host Swift tools
--
-- Building Swift standard library and overlays for SDKs: ANDROID
--   Build type:       Release
--   Assertions:       OFF
--
-- Building Swift runtime with:
--   Leak Detection Checker Entrypoints: OFF
--
-- Differentiable Programming Support: OFF
-- Concurrency Support: OFF
--
CMake Error at /usr/local/Cellar/cmake/3.21.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find LibXml2 (missing: LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.21.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  /usr/local/Cellar/cmake/3.21.2/share/cmake/Modules/FindLibXml2.cmake:108 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:947 (find_package)


-- Configuring incomplete, errors occurred!
See also "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/Build/darwin-armv7a/swift-stdlib/CMakeFiles/CMakeOutput.log".
See also "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/Build/darwin-armv7a/swift-stdlib/CMakeFiles/CMakeError.log".

@vgorloff
Copy link
Owner Author

vgorloff commented Oct 1, 2021

Previous issue fixed by adding -D LLVM_ENABLE_LIBXML2=FALSE to LLVM builder.

@vgorloff
Copy link
Owner Author

vgorloff commented Oct 1, 2021

Next error:

CMake Error at /usr/local/Cellar/cmake/3.21.2/share/cmake/Modules/ExternalProject.cmake:2866 (message):
  No download info given for 'libdispatch-android-armv7' and its source
  directory:

   /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/Build/darwin-armv7a/swift-stdlib/libdispatch-android-armv7-prefix/src/libdispatch-android-armv7

  is not an existing non-empty directory.  Please specify one of:

   * SOURCE_DIR with an existing non-empty directory
   * DOWNLOAD_COMMAND
   * URL
   * GIT_REPOSITORY
   * SVN_REPOSITORY
   * HG_REPOSITORY
   * CVS_REPOSITORY and CVS_MODULE
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.21.2/share/cmake/Modules/ExternalProject.cmake:3700 (_ep_add_download_command)
  cmake/modules/Libdispatch.cmake:76 (ExternalProject_Add)
  CMakeLists.txt:983 (include)

@vgorloff
Copy link
Owner Author

vgorloff commented Oct 1, 2021

Fixed by -D SWIFT_ENABLE_DISPATCH=false.

@vgorloff
Copy link
Owner Author

vgorloff commented Oct 1, 2021

Next error:

mkdir -p "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/Build/darwin-armv7a/swift-stdlib"
cd /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/Build/darwin-armv7a/swift-stdlib && ninja -j5
ninja: error: 'stdlib/private/StdlibUnittest/swift_Concurrency-swiftmodule-android-armv7', needed by 'lib/swift/android/StdlibUnittest.swiftmodule/armv7-unknown-linux-android.swiftmodule', missing and no known rule to make it

@vgorloff
Copy link
Owner Author

vgorloff commented Oct 1, 2021

Fixed by -D SWIFT_BUILD_DYNAMIC_SDK_OVERLAY=FALSE

@vgorloff
Copy link
Owner Author

vgorloff commented Oct 1, 2021

Next error:

/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/Sources/swift-corelibs-foundation/Sources/Foundation/NSSwiftRuntime.swift:18:19: error: no such module 'Glibc'
@_exported import Glibc
                  ^
<unknown>:0: note: did you forget to set an SDK using -sdk or SDKROOT?
<unknown>:0: note: use "xcrun swiftc" to select the default macOS SDK installed with Xcode
ninja: build stopped: subcommand failed.

It is due -D SWIFT_BUILD_DYNAMIC_SDK_OVERLAY=FALSE.

vgorloff added a commit that referenced this issue Oct 2, 2021
@vgorloff
Copy link
Owner Author

vgorloff commented Oct 2, 2021

Fixed in #132

@vgorloff vgorloff closed this as completed Oct 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants