cmake version 3.25.1
mac OS 12.6.1
on an M1
Hi all. I'm brand new to the Swift compiler and am running into some issues with building. I have successfully built a few times, and have compiled a helloworld.swift with the built compiler. But I am running into some issues with cmake that is preventing me from building both through the build-script and through ninja.
Using the build-script, a number of CMake errors like this appear near what seems like the end of the build process. I've provided the first error below, with some succesful output above it, to give it context in the build process.
-- Swift Benchmark Suite:
-- SWIFT_BENCHMARK_BUILT_STANDALONE = FALSE
-- SWIFT_BENCHMARK_USE_OS_LIBRARIES = OFF
-- SWIFT_EXEC = /Users/mwylder/Developer/swift-project/build/Xcode-DebugAssert/swift-macosx-arm64/Debug/bin/swiftc
-- SWIFT_LIBRARY_PATH = /Users/mwylder/Developer/swift-project/build/Xcode-DebugAssert/swift-macosx-arm64/Debug/lib/swift
-- SWIFT_RPATH_BASE = @executable_path/../lib/swift
-- CLANG_EXEC = /Applications/Xcode-14.1.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-- SWIFT_BENCHMARK_EXTRA_FLAGS =
-- SWIFT_OPTIMIZATION_LEVELS = Onone;O;Osize
-- ONLY_PLATFORMS = macosx;iphoneos;appletvos;watchos;linux
-- PAGE_ALIGNMENT_OPTION = -Xllvm;-align-module-to-page-size
-- found platforms: macosx;iphoneos;appletvos;watchos
-- found sdks:
-- /Applications/Xcode-14.1.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk
-- /Applications/Xcode-14.1.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.1.sdk
-- /Applications/Xcode-14.1.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS16.1.sdk
-- /Applications/Xcode-14.1.0.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS9.1.sdk
CMake Warning at docs/CMakeLists.txt:23 (message):
Unable to find sphinx-build program. Not building docs
-- Configuring done
-- Generating done
CMake Error in lib/ASTGen/CMakeLists.txt:
Imported target "SwiftSyntax::SwiftBasicFormat" includes non-existent path
"/Users/mwylder/Developer/swift-project/build/Xcode-DebugAssert/earlyswiftsyntax-macosx-arm64/lib/swift/host"
in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:
* The path was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and references files it does not
provide.
Ninja also errors out - it seems to want to use a different version of cmake than the one currently installed.
ninja: Entering directory `../build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64'
[0/1] Re-running CMake...
/bin/sh: /opt/homebrew/Cellar/cmake/3.23.2/bin/cmake: No such file or directory
FAILED: build.ninja
/opt/homebrew/Cellar/cmake/3.23.2/bin/cmake --regenerate-during-build -S/Users/mwylder/Developer/swift-project/swift -B/Users/mwylder/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64
ninja: error: rebuilding 'build.ninja': subcommand failed
Some of this seems to be related to my environment setup. I upgraded cmake after encountering this issue. I may also not understand when to use the build-script vs ninja -- the error message for build-script mentions that an "uninstall procedure" may not have completed successfully.
Thanks in advance. Hope to start contributing to the language soon