Swift Playdate Examples Build Error on M3 MacBook Air

I just got a MacBook Air M3 to separate from using my work MacBook Pro M3 to play with code and game design. On my MBP, I haven't had any issues with compiling the examples following the documentation, but on the MBA I'm getting an error when attempting to make a release build. From what I can see, it seems like it's pulling the incorrect Toolchain with the xcrun command and is expecting the macOS SDK from Xcode and then fails to choose to run Embedded Swift.

Command output:

$ TOOLCHAINS="org.swift.59202403201a" swift build -c release

warning: could not determine XCTest paths: terminated(1): /usr/bin/xcrun --sdk macosx --show-sdk-platform-path output:
    xcrun: error: unable to lookup item 'PlatformPath' from command line tools installation
    xcrun: error: unable to lookup item 'PlatformPath' in SDK '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk'

Building for production...
<unknown>:0: error: module 'Swift' cannot be imported in embedded Swift mode
<unknown>:0: error: module '_StringProcessing' cannot be imported in embedded Swift mode
<unknown>:0: error: module '_Concurrency' cannot be imported in embedded Swift mode
/Users/vincemascoli/Documents/GitHub/swift-playdate-examples/Sources/Playdate/Display.swift:4:1: error: Access level on imports require '-enable-experimental-feature AccessLevelOnImport'
public import CPlaydate
^~~~~~~
/Users/vincemascoli/Documents/GitHub/swift-playdate-examples/Sources/Playdate/Display.swift:4:15: error: ambiguous implicit access level for import of 'CPlaydate'; it is imported as 'public' elsewhere
public import CPlaydate
              ^
       public
/Users/vincemascoli/Documents/GitHub/swift-playdate-examples/Sources/Playdate/Graphics.swift:1:1: note: imported 'public' here
public import CPlaydate
^
/Users/vincemascoli/Documents/GitHub/swift-playdate-examples/Sources/Playdate/Graphics.swift:1:1: error: Access level on imports require '-enable-experimental-feature AccessLevelOnImport'
public import CPlaydate
^~~~~~~
/Users/vincemascoli/Documents/GitHub/swift-playdate-examples/Sources/Playdate/Display.swift:4:15: error: ambiguous implicit access level for import of 'CPlaydate'; it is imported as 'public' elsewhere
public import CPlaydate
              ^
       public
/Users/vincemascoli/Documents/GitHub/swift-playdate-examples/Sources/Playdate/Playdate.swift:4:1: note: imported 'public' here
public import CPlaydate
^
/Users/vincemascoli/Documents/GitHub/swift-playdate-examples/Sources/Playdate/Graphics.swift:1:15: error: ambiguous implicit access level for import of 'CPlaydate'; it is imported as 'public' elsewhere
public import CPlaydate
              ^
       public
/Users/vincemascoli/Documents/GitHub/swift-playdate-examples/Sources/Playdate/Playdate.swift:4:1: note: imported 'public' here
public import CPlaydate
^
/Users/vincemascoli/Documents/GitHub/swift-playdate-examples/Sources/Playdate/Playdate.swift:4:1: error: Access level on imports require '-enable-experimental-feature AccessLevelOnImport'
public import CPlaydate
^~~~~~~
/Users/vincemascoli/Documents/GitHub/swift-playdate-examples/Sources/Playdate/Playdate.swift:7:8: error: Please use a Swift 6.0 compiler or later
#error("Please use a Swift 6.0 compiler or later")
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/vincemascoli/Documents/GitHub/swift-playdate-examples/Sources/Playdate/Playdate.swift:4:8: remark: '@preconcurrency' attribute on module 'CPlaydate' is unused
public import CPlaydate
       ^
/Users/vincemascoli/Documents/GitHub/swift-playdate-examples/Sources/Playdate/Display.swift:4:15: error: ambiguous implicit access level for import of 'CPlaydate'; it is imported as 'public' elsewhere
public import CPlaydate
              ^
       public
/Users/vincemascoli/Documents/GitHub/swift-playdate-examples/Sources/Playdate/Sprite.swift:1:1: note: imported 'public' here
public import CPlaydate
^
/Users/vincemascoli/Documents/GitHub/swift-playdate-examples/Sources/Playdate/Graphics.swift:1:15: error: ambiguous implicit access level for import of 'CPlaydate'; it is imported as 'public' elsewhere
public import CPlaydate
              ^
       public
/Users/vincemascoli/Documents/GitHub/swift-playdate-examples/Sources/Playdate/Sprite.swift:1:1: note: imported 'public' here
public import CPlaydate
^
/Users/vincemascoli/Documents/GitHub/swift-playdate-examples/Sources/Playdate/Playdate.swift:4:15: error: ambiguous implicit access level for import of 'CPlaydate'; it is imported as 'public' elsewhere
public import CPlaydate
              ^
       public
/Users/vincemascoli/Documents/GitHub/swift-playdate-examples/Sources/Playdate/Sprite.swift:1:1: note: imported 'public' here
public import CPlaydate
^
/Users/vincemascoli/Documents/GitHub/swift-playdate-examples/Sources/Playdate/Sprite.swift:1:1: error: Access level on imports require '-enable-experimental-feature AccessLevelOnImport'
public import CPlaydate
^~~~~~~
/Users/vincemascoli/Documents/GitHub/swift-playdate-examples/Sources/Playdate/Display.swift:4:15: error: ambiguous implicit access level for import of 'CPlaydate'; it is imported as 'public' elsewhere
public import CPlaydate
              ^
       public
/Users/vincemascoli/Documents/GitHub/swift-playdate-examples/Sources/Playdate/System.swift:1:1: note: imported 'public' here
public import CPlaydate
^
/Users/vincemascoli/Documents/GitHub/swift-playdate-examples/Sources/Playdate/Graphics.swift:1:15: error: ambiguous implicit access level for import of 'CPlaydate'; it is imported as 'public' elsewhere
public import CPlaydate
              ^
       public
/Users/vincemascoli/Documents/GitHub/swift-playdate-examples/Sources/Playdate/System.swift:1:1: note: imported 'public' here
public import CPlaydate
^
/Users/vincemascoli/Documents/GitHub/swift-playdate-examples/Sources/Playdate/Playdate.swift:4:15: error: ambiguous implicit access level for import of 'CPlaydate'; it is imported as 'public' elsewhere
public import CPlaydate
              ^
       public
/Users/vincemascoli/Documents/GitHub/swift-playdate-examples/Sources/Playdate/System.swift:1:1: note: imported 'public' here
public import CPlaydate
^
/Users/vincemascoli/Documents/GitHub/swift-playdate-examples/Sources/Playdate/Sprite.swift:1:15: error: ambiguous implicit access level for import of 'CPlaydate'; it is imported as 'public' elsewhere
public import CPlaydate
              ^
       public
/Users/vincemascoli/Documents/GitHub/swift-playdate-examples/Sources/Playdate/System.swift:1:1: note: imported 'public' here
public import CPlaydate
^
/Users/vincemascoli/Documents/GitHub/swift-playdate-examples/Sources/Playdate/System.swift:1:1: error: Access level on imports require '-enable-experimental-feature AccessLevelOnImport'
public import CPlaydate
^~~~~~~
<unknown>:0: error: error opening '/Users/vincemascoli/Documents/GitHub/swift-playdate-examples/Examples/Life/.build/arm64-apple-macosx/release/Playdate.build/Playdate.d' for output: /Users/vincemascoli/Documents/GitHub/swift-playdate-examples/Examples/Life/.build/arm64-apple-macosx/release/Playdate.build/Playdate.d: Operation not permitted

It also seems like this might be some weird TCC issue since it's telling me the operation isn't permitted when it's running from my userspace, but sudo also gives the same output.

If anyone has seen a similar error, let me know if there's a quick fix. I'll reach out to the Swift repo maintainer to see if they have suggestions for it as well, but I figured I'd start here before opening anything official.

1 Like