Skip to content

Detect mismatched toolchain and macOS SDK #427

@cmcgee1024

Description

@cmcgee1024

Lately, the macOS CI was failing for swiftly with mysterious compiler errors.

It was caused by the builders being upgrade to a newer macOS (Tahoe), and a new macOS SDK. Swift toolchains for macOS can’t work with newer macOS SDK version. The fix was to bump the swift version that we use for building and testing swiftly, but the compile errors didn’t make this very clear.

Since system dependency management is being considered for Linux, this might be another aspect of that. Swiftly can detect misalignments in the following way on macOS:

  • Use xcrun --show-sdk-path to find the current macOS SDK path
  • From that path find a stable .swiftinterface file, such as System/Library/Frameworks/Foundation.framework/Versions/C/Modules/Foundation.swiftmodule/arm64e-apple-ios-macabi.swiftinterface
  • Check the first few lines in the file for a header that has swift-compiler-version
  • Determine if any installed toolchains, especially the one that is in-use is older than this version

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions