I couldn't get anywhere because the build kept failing. Now, over a year later and upgrading to Sonoma on my M1 MacBook Air, the build still fails at some point. If this is the right group (I've forgotten), I'll post the stdout from my last try, but after the first fail (so it still fails, but the output isn't as large).
From the suggestions at the right to the post input, I posted about my previous failures to the sub-group too.
This is an appropriate place to post, though as John notes in your previous thread it seems you were able to get the compiler building, you were just encountering some test failures.
But so many changes have happened (on both sides) since then. It looks like it's currently a compiler issue:
daryle@Daryle-MacBookAir-3 swift % utils/build-script --skip-build-benchmarks \
--skip-ios --skip-watchos --skip-tvos --swift-darwin-supported-archs "$(uname -m)" \
--sccache --release-debuginfo --swift-disable-dead-stripping --xctest
[utils/build-script] NOTE: Using toolchain default
+ /usr/libexec/PlistBuddy -c 'Print :SupportedTargets:macosx:Archs' /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/SDKSettings.plist
Ensuring the sccache server is running...
+ /opt/homebrew/bin/sccache --show-stats
+ mkdir -p /Users/daryle/projects/swift-project/build/Ninja-RelWithDebInfoAssert
--- Building earlyswiftdriver ---
+ /Users/daryle/projects/swift-project/swift-driver/Utilities/build-script-helper.py build --package-path /Users/daryle/projects/swift-project/swift-driver --build-path /Users/daryle/projects/swift-project/build/Ninja-RelWithDebInfoAssert/earlyswiftdriver-macosx-arm64 --configuration release --toolchain /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr --ninja-bin /opt/homebrew/bin/ninja --cmake-bin /opt/homebrew/bin/cmake --local_compiler_build
Building Swift Driver dependency: llbuild
CMake Warning (dev) at CMakeLists.txt:97 (find_package):
Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
are removed. Run "cmake --help-policy CMP0148" for policy details. Use
the cmake_policy command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
Building Swift Driver dependency: Swift System
Building Swift Driver dependency: TSC
Building Swift Driver dependency: Argument Parser
Building Swift Driver dependency: Yams
Building Swift Driver for target: arm64-apple-macosx10.15
--- Building cmark ---
+ mkdir -p /Users/daryle/projects/swift-project/build/Ninja-RelWithDebInfoAssert/cmark-macosx-arm64
+ env /opt/homebrew/bin/cmake --build /Users/daryle/projects/swift-project/build/Ninja-RelWithDebInfoAssert/cmark-macosx-arm64 --config RelWithDebInfo -- -j8 all
[0/1][ 0%][0.003s] Re-running CMake...
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
CMake Warning (dev) at test/CMakeLists.txt:9 (find_package):
Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
are removed. Run "cmake --help-policy CMP0148" for policy details. Use
the cmake_policy command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /Users/daryle/projects/swift-project/build/Ninja-RelWithDebInfoAssert/cmark-macosx-arm64
[1/47][ 2%][0.614s] Building C object src/CMakeFiles/libcmark.dir/cmark.c.o
/Users/daryle/projects/swift-project/cmark/src/cmark.c:9:18: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
int cmark_version() { return CMARK_VERSION; }
^
void
/Users/daryle/projects/swift-project/cmark/src/cmark.c:11:33: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
const char *cmark_version_string() { return CMARK_VERSION_STRING; }
^
void
2 warnings generated.
[3/47][ 6%][0.633s] Building C object src/CMakeFiles/cmark.dir/main.c.o
/Users/daryle/projects/swift-project/cmark/src/main.c:31:17: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
void print_usage() {
^
void
1 warning generated.
[18/47][ 38%][1.022s] Building C objec...akeFiles/libcmark_static.dir/cmark.c.o
/Users/daryle/projects/swift-project/cmark/src/cmark.c:9:18: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
int cmark_version() { return CMARK_VERSION; }
^
void
/Users/daryle/projects/swift-project/cmark/src/cmark.c:11:33: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
const char *cmark_version_string() { return CMARK_VERSION_STRING; }
^
void
2 warnings generated.
[37/47][ 78%][1.571s] Building C objec...st/CMakeFiles/api_test.dir/harness.c.o
In file included from /Users/daryle/projects/swift-project/cmark/api_test/harness.c:6:
/Users/daryle/projects/swift-project/cmark/api_test/harness.h:15:41: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
test_batch_runner *test_batch_runner_new();
^
void
/Users/daryle/projects/swift-project/cmark/api_test/harness.c:8:41: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
test_batch_runner *test_batch_runner_new() {
^
void
2 warnings generated.
[40/47][ 85%][1.631s] Building C objec..._test/CMakeFiles/api_test.dir/main.c.o
In file included from /Users/daryle/projects/swift-project/cmark/api_test/main.c:9:
/Users/daryle/projects/swift-project/cmark/api_test/harness.h:15:41: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
test_batch_runner *test_batch_runner_new();
^
void
/Users/daryle/projects/swift-project/cmark/api_test/main.c:1039:9: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
int main() {
^
void
2 warnings generated.
[47/47][100%][1.866s] Linking C executable src/cmark
--- Building llvm ---
+ env /opt/homebrew/bin/cmake --build /Users/daryle/projects/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64 --config RelWithDebInfo -- -j8 all
[0/3][ 0%][0.488s] Performing build step for 'compiler-rt'
[6/2269][ 0%][0.167s] Building CXX ob.../sanitizer_platform_limits_posix.cpp.o
FAILED: lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.osx.dir/sanitizer_platform_limits_posix.cpp.o
/Users/daryle/projects/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/./bin/clang++ -DHAVE_RPC_XDR_H=1 -I/Users/daryle/projects/swift-project/llvm-project/compiler-rt/lib/sanitizer_common/.. -Wall -std=c++14 -Wno-unused-parameter -O2 -g -DNDEBUG -arch arm64 -arch x86_64 -arch x86_64h -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk -stdlib=libc++ -mmacosx-version-min=10.10 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk -fPIC -fno-builtin -fno-exceptions -funwind-tables -fno-stack-protector -fno-sanitize=safe-stack -fvisibility=hidden -fno-lto -Werror=thread-safety -Werror=thread-safety-reference -Werror=thread-safety-beta -O3 -g -Wno-gnu -Wno-variadic-macros -Wno-c99-extensions -nostdinc++ -fno-rtti -Wframe-larger-than=570 -Wglobal-constructors -MD -MT lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.osx.dir/sanitizer_platform_limits_posix.cpp.o -MF lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.osx.dir/sanitizer_platform_limits_posix.cpp.o.d -o lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.osx.dir/sanitizer_platform_limits_posix.cpp.o -c /Users/daryle/projects/swift-project/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
/Users/daryle/projects/swift-project/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:1234:1: error: unknown type name '__sanitizer_XDR'; did you mean '__sanitizer_tm'?
CHECK_TYPE_SIZE(XDR);
^
/Users/daryle/projects/swift-project/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h:1425:25: note: expanded from macro 'CHECK_TYPE_SIZE'
COMPILER_CHECK(sizeof(__sanitizer_##TYPE) == sizeof(TYPE))
^
<scratch space>:20:1: note: expanded from here
__sanitizer_XDR
^
/Users/daryle/projects/swift-project/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h:399:8: note: '__sanitizer_tm' declared here
struct __sanitizer_tm {
^
/Users/daryle/projects/swift-project/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:1234:17: error: use of undeclared identifier 'XDR'
CHECK_TYPE_SIZE(XDR);
^
/Users/daryle/projects/swift-project/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:1235:1: error: use of undeclared identifier '__sanitizer_XDR'; did you mean '__sanitizer'?
CHECK_SIZE_AND_OFFSET(XDR, x_op);
^
/Users/daryle/projects/swift-project/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h:1428:27: note: expanded from macro 'CHECK_SIZE_AND_OFFSET'
COMPILER_CHECK(sizeof(((__sanitizer_##CLASS *)NULL)->MEMBER) == \
^
<scratch space>:21:1: note: expanded from here
__sanitizer_XDR
^
/Users/daryle/projects/swift-project/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:176:11: note: '__sanitizer' declared here
namespace __sanitizer {
^
/Users/daryle/projects/swift-project/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:1235:1: error: unexpected namespace name '__sanitizer': expected expression
CHECK_SIZE_AND_OFFSET(XDR, x_op);
^
/Users/daryle/projects/swift-project/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h:1428:27: note: expanded from macro 'CHECK_SIZE_AND_OFFSET'
COMPILER_CHECK(sizeof(((__sanitizer_##CLASS *)NULL)->MEMBER) == \
^
<scratch space>:21:1: note: expanded from here
__sanitizer_XDR
^
/Users/daryle/projects/swift-project/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:1235:1: error: expected expression
/Users/daryle/projects/swift-project/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h:1428:48: note: expanded from macro 'CHECK_SIZE_AND_OFFSET'
COMPILER_CHECK(sizeof(((__sanitizer_##CLASS *)NULL)->MEMBER) == \
^
/Users/daryle/projects/swift-project/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:1235:23: error: use of undeclared identifier 'XDR'
CHECK_SIZE_AND_OFFSET(XDR, x_op);
^
/Users/daryle/projects/swift-project/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:1235:1: error: expected expression
CHECK_SIZE_AND_OFFSET(XDR, x_op);
^
/Users/daryle/projects/swift-project/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h:1429:34: note: expanded from macro 'CHECK_SIZE_AND_OFFSET'
sizeof(((CLASS *)NULL)->MEMBER)); \
^
/Users/daryle/projects/swift-project/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:1235:1: error: unknown type name '__sanitizer_XDR'; did you mean '__sanitizer_tm'?
/Users/daryle/projects/swift-project/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h:1430:27: note: expanded from macro 'CHECK_SIZE_AND_OFFSET'
COMPILER_CHECK(offsetof(__sanitizer_##CLASS, MEMBER) == \
^
<scratch space>:22:1: note: expanded from here
__sanitizer_XDR
^
/Users/daryle/projects/swift-project/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h:399:8: note: '__sanitizer_tm' declared here
struct __sanitizer_tm {
^
/Users/daryle/projects/swift-project/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:1235:1: error: no member named 'x_op' in '__sanitizer_tm'
CHECK_SIZE_AND_OFFSET(XDR, x_op);
^ ~~~~
/Users/daryle/projects/swift-project/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h:1430:18: note: expanded from macro 'CHECK_SIZE_AND_OFFSET'
COMPILER_CHECK(offsetof(__sanitizer_##CLASS, MEMBER) == \
^ ~~~~~~
/Users/daryle/projects/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/clang/15.0.0/include/stddef.h:104:24: note: expanded from macro 'offsetof'
#define offsetof(t, d) __builtin_offsetof(t, d)
^ ~
/Users/daryle/projects/swift-project/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:332:44: note: expanded from macro 'COMPILER_CHECK'
#define COMPILER_CHECK(pred) static_assert(pred, "")
^~~~
/Users/daryle/projects/swift-project/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:1235:23: error: unknown type name 'XDR'
CHECK_SIZE_AND_OFFSET(XDR, x_op);
^
/Users/daryle/projects/swift-project/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:1236:1: error: use of undeclared identifier '__sanitizer_XDR'; did you mean '__sanitizer'?
CHECK_SIZE_AND_OFFSET(XDR, x_ops);
^
/Users/daryle/projects/swift-project/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h:1428:27: note: expanded from macro 'CHECK_SIZE_AND_OFFSET'
COMPILER_CHECK(sizeof(((__sanitizer_##CLASS *)NULL)->MEMBER) == \
^
<scratch space>:23:1: note: expanded from here
__sanitizer_XDR
^
/Users/daryle/projects/swift-project/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:176:11: note: '__sanitizer' declared here
namespace __sanitizer {
^
/Users/daryle/projects/swift-project/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:1236:1: error: unexpected namespace name '__sanitizer': expected expression
CHECK_SIZE_AND_OFFSET(XDR, x_ops);
^
/Users/daryle/projects/swift-project/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h:1428:27: note: expanded from macro 'CHECK_SIZE_AND_OFFSET'
COMPILER_CHECK(sizeof(((__sanitizer_##CLASS *)NULL)->MEMBER) == \
^
<scratch space>:23:1: note: expanded from here
__sanitizer_XDR
^
/Users/daryle/projects/swift-project/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:1236:1: error: expected expression
/Users/daryle/projects/swift-project/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h:1428:48: note: expanded from macro 'CHECK_SIZE_AND_OFFSET'
COMPILER_CHECK(sizeof(((__sanitizer_##CLASS *)NULL)->MEMBER) == \
^
/Users/daryle/projects/swift-project/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:1236:23: error: use of undeclared identifier 'XDR'
CHECK_SIZE_AND_OFFSET(XDR, x_ops);
^
/Users/daryle/projects/swift-project/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:1236:1: error: expected expression
CHECK_SIZE_AND_OFFSET(XDR, x_ops);
^
/Users/daryle/projects/swift-project/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h:1429:34: note: expanded from macro 'CHECK_SIZE_AND_OFFSET'
sizeof(((CLASS *)NULL)->MEMBER)); \
^
/Users/daryle/projects/swift-project/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:1236:1: error: unknown type name '__sanitizer_XDR'; did you mean '__sanitizer_tm'?
/Users/daryle/projects/swift-project/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h:1430:27: note: expanded from macro 'CHECK_SIZE_AND_OFFSET'
COMPILER_CHECK(offsetof(__sanitizer_##CLASS, MEMBER) == \
^
<scratch space>:24:1: note: expanded from here
__sanitizer_XDR
^
/Users/daryle/projects/swift-project/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h:399:8: note: '__sanitizer_tm' declared here
struct __sanitizer_tm {
^
/Users/daryle/projects/swift-project/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:1236:1: error: no member named 'x_ops' in '__sanitizer_tm'
CHECK_SIZE_AND_OFFSET(XDR, x_ops);
^ ~~~~~
/Users/daryle/projects/swift-project/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h:1430:18: note: expanded from macro 'CHECK_SIZE_AND_OFFSET'
COMPILER_CHECK(offsetof(__sanitizer_##CLASS, MEMBER) == \
^ ~~~~~~
/Users/daryle/projects/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/clang/15.0.0/include/stddef.h:104:24: note: expanded from macro 'offsetof'
#define offsetof(t, d) __builtin_offsetof(t, d)
^ ~
/Users/daryle/projects/swift-project/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:332:44: note: expanded from macro 'COMPILER_CHECK'
#define COMPILER_CHECK(pred) static_assert(pred, "")
^~~~
/Users/daryle/projects/swift-project/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:1236:23: error: unknown type name 'XDR'
CHECK_SIZE_AND_OFFSET(XDR, x_ops);
^
/Users/daryle/projects/swift-project/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:1237:1: error: use of undeclared identifier '__sanitizer_XDR'; did you mean '__sanitizer'?
CHECK_SIZE_AND_OFFSET(XDR, x_public);
^
/Users/daryle/projects/swift-project/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h:1428:27: note: expanded from macro 'CHECK_SIZE_AND_OFFSET'
COMPILER_CHECK(sizeof(((__sanitizer_##CLASS *)NULL)->MEMBER) == \
^
<scratch space>:25:1: note: expanded from here
__sanitizer_XDR
^
/Users/daryle/projects/swift-project/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:176:11: note: '__sanitizer' declared here
namespace __sanitizer {
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
[15/2269][ 0%][0.879s] Building CXX o...tion.osx.dir/sanitizer_allocator.cpp.o
ninja: build stopped: subcommand failed.
FAILED: tools/clang/runtime/compiler-rt-stamps/compiler-rt-build /Users/daryle/projects/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/tools/clang/runtime/compiler-rt-stamps/compiler-rt-build
cd /Users/daryle/projects/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/tools/clang/runtime/compiler-rt-bins && /opt/homebrew/Cellar/cmake/3.27.7/bin/cmake --build .
ninja: build stopped: subcommand failed.
ERROR: command terminated with a non-zero exit status 1, aborting
daryle@Daryle-MacBookAir-3 swift %
Is this with a fresh clone of all the repos? If not, have you run utils/update-checkout (and/or re-cloned everything) to make sure things are all up-to-date from a year ago?
As far as I know that shouldn’t be necessary if update-checkout succeeded for all repos, but it can’t hurt to start from a clean slate. I’ve successfully built on Sonoma with Xcode 15 from top-of-tree just today.
Took over 2 years to notice that the optional "--xctest " build argument is Linux-only. Compiled just fine with the default Sonoma/Xcode-15 setup. Still have to try proper tests and the Xcode project version.
I would recommend you to update to the latest main branch of the swift compiler, run the update-checkout, and then run build-script. These instructions can be found on GettingStarted.md
cd swift
git checkout main
git pull origin main
utils/update-checkout --clone ...
utils/build-script ...
Let us know where you fail and we would be able to help you
Tests on main don't always pass in all configurations, as the main branch reflects current work in progress, and PR testing runs on PR branches but not on the main branch itself.
Even when with a given PR 100% of all tests pass, by the time it's merged a different combination of merges may lead to a test regression, and by that time the combination of commits from all projects participating in a build and test run (compiler, LLVM, core libraries, the driver, the syntax library etc) has changed. Besides, to merge a PR on main you only need smoke tests to pass, not the whole test suite. Integration tests usually run only for full toolchain builds.
If you want a higher chance of all of the tests passing, I recommend trying the release/* branches, which move more slowly, especially the already released 5.8 branch. There's still ongoing work on 5.9 patch releases though.
Overall, if you're looking to contribute there's no need to make 100% of all the tests pass locally on your machine. Just make sure that tests don't regress after making your changes, and you'll most likely get much better test coverage on CI when you submit a PR.