Build-alternative-interface-framework failed while running tests

I've downloaded the source code and trying to debug locally and I got this error when running the tests.

******************** TEST 'Swift(macosx-x86_64) :: ModuleInterface/build-alternative-interface-framework.swift' FAILED ********************
Script:
--
: 'RUN: at line 2'; rm -rf "/Users/zigiiwong/new-swift/build/Ninja-RelWithDebInfoAssert/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/Output/build-alternative-interface-framework.swift.tmp/module-cache" && mkdir -p "/Users/zigiiwong/new-swift/build/Ninja-RelWithDebInfoAssert/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/Output/build-alternative-interface-framework.swift.tmp/module-cache"
: 'RUN: at line 3'; not /Users/zigiiwong/new-swift/build/Ninja-RelWithDebInfoAssert/swift-macosx-x86_64/bin/swift-frontend -target x86_64-apple-macosx10.9 -module-cache-path /Users/zigiiwong/new-swift/build/Ninja-RelWithDebInfoAssert/swift-macosx-x86_64/swift-test-results/x86_64-apple-macosx10.9/clang-module-cache -sdk '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk' -swift-version 4 -define-availability 'SwiftStdlib 5.5:macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0' -typo-correction-limit 10 -typecheck -disable-implicit-concurrency-module-import -target arm64-apple-macosx13.0 -F /Users/zigiiwong/new-swift/swift/test/ModuleInterface/Inputs /Users/zigiiwong/new-swift/swift/test/ModuleInterface/build-alternative-interface-framework.swift -module-cache-path /Users/zigiiwong/new-swift/build/Ninja-RelWithDebInfoAssert/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/Output/build-alternative-interface-framework.swift.tmp/module-cache
: 'RUN: at line 4'; /Users/zigiiwong/new-swift/build/Ninja-RelWithDebInfoAssert/swift-macosx-x86_64/bin/swift-frontend -target x86_64-apple-macosx10.9 -module-cache-path /Users/zigiiwong/new-swift/build/Ninja-RelWithDebInfoAssert/swift-macosx-x86_64/swift-test-results/x86_64-apple-macosx10.9/clang-module-cache -sdk '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk' -swift-version 4 -define-availability 'SwiftStdlib 5.5:macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0' -typo-correction-limit 10 -typecheck -disable-implicit-concurrency-module-import -target arm64-apple-macosx13.0 -F /Users/zigiiwong/new-swift/swift/test/ModuleInterface/Inputs /Users/zigiiwong/new-swift/swift/test/ModuleInterface/build-alternative-interface-framework.swift -module-cache-path /Users/zigiiwong/new-swift/build/Ninja-RelWithDebInfoAssert/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/Output/build-alternative-interface-framework.swift.tmp/module-cache -backup-module-interface-path /Users/zigiiwong/new-swift/swift/test/ModuleInterface/Inputs/alternative-interfaces
--
Exit Code: 1

Command Output (stderr):
--
:0: error: could not find module 'Swift' for target 'arm64-apple-macos'; found: x86_64-apple-macos, at: /Users/zigiiwong/new-swift/build/Ninja-RelWithDebInfoAssert/swift-macosx-x86_64/lib/swift/macosx/Swift.swiftmodule
:0: error: could not find module 'Swift' for target 'arm64-apple-macos'; found: x86_64-apple-macos, at: /Users/zigiiwong/new-swift/build/Ninja-RelWithDebInfoAssert/swift-macosx-x86_64/lib/swift/macosx/Swift.swiftmodule

The completed log file is here.

dumphash

Any help would be appreciated!

Hey @wongzigii,

I've also been seeing this for sometime, but the problem is just that this code runs arm64 specific commands that require modules built for arm64, but since we are running on x86 those modules are not there. A quick fix you can do is to add a // REQUIRES: CPU=arm64 line that will make sure that this is unsupported ad will not run on a x86 machine. I have just put up a PR with this [test] Require arm64 for test target that run target specific commands by LucianoPAlmeida · Pull Request #38464 · apple/swift · GitHub proposing this as a fix, so let's see
But meanwhile you can do this locally or just ignore it for now since is kinda expected to fail =]

1 Like
Terms of Service

Privacy Policy

Cookie Policy