Error: '@backDeployed' requires that initializer 'init(cString:)' have a body

Hi! I have a small diff on Standard Library and I am attempting to build a toolchain for testing my changes.

I checked out swift and followed the steps in GettingStarted.md to clone the dependencies. When I try and follow the steps from README.md to build the toolchain I see these errors:

error: '@backDeployed' requires that initializer 'init(cString:)' have a body
1415 |   @available(*, deprecated, renamed: "init(platformString:)")
1416 |   public init(cString: Swift.UnsafePointer<Swift.CChar>)
1417 |   @backDeployed(before: macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0)
     |    `- error: '@backDeployed' requires that initializer 'init(cString:)' have a body
1418 |   @available(*, deprecated, renamed: "init(platformString:)")
1419 |   @available(visionOS, unavailable, renamed: "init(platformString:)")

It looks like there are 18 of those errors when attempting to build the toolchain.

Any ideas what to do about that? I couldn't find any open tasks in the repo tracking a similar error on backDeployed.

Is there a better way for me to build and test local changes on Standard Library with a toolchain build?

Just in case it makes any difference I see some clues that these errors are related to building for XROS.platform and XRSimulator.platform.

I'm also building from macOS 15.5.

Actually it looks like this is also failing on CI with the same error:

It looks like build-toolchain --macos-only still works for now locally.

not sure if it's related, but a pair of PRs were put up recently to fix something involving back deployment and availability. seems like you might have found a workaround, but also could try applying the patch locally.

1 Like