AudioKitEX icon indicating copy to clipboard operation
AudioKitEX copied to clipboard

Potential issue with upcoming Swift 5.7/Nightly toolchain

Open nhubbard opened this issue 2 years ago • 4 comments

Describe the bug Note that this is more of a "heads up" issue; I don't know if they will actually apply once Swift 5.7 and Xcode 14 exit beta. It may necessitate a maintainer of AudioKitEX filing a Radar issue.


When building any application that has a dependency on AudioKitEX with the upcoming Swift 5.7 or nightly Swift toolchains in Xcode 14.0 beta, the build will fail when attempting to build the CAudioKitEX component with the following error in DSPBase.h:133:

Screen Shot 2022-06-07 at 12 07 20

This issue is present in both the release and main branch versions of AudioKitEX.

To Reproduce Steps to reproduce the behavior:

  1. Install Xcode 14 beta.
  2. Install either the trunk snapshot or the Swift 5.7 development snapshot.
  3. Open any project that uses AudioKitEX, such as the AudioKit Cookbook.
  4. Select either one of the prerelease toolchains from the Xcode > Toolchains menu.
  5. Attempt to build the project using any scheme and target combination.
  6. The build will fail with the error from the screenshot.

Author's note: My project doesn't use STKAudioKit, but another error was raised when I was recreating the issue with the Cookbook app. It was in Skini.cpp:142, and the error was Missing '#include <stdlib.h>'; 'atof' must be declared before it is used.

Expected behavior The build should have completed and my application/Cookbook should have launched.

Screenshots Error screenshot is in description of bug.

Details (please complete the following information):

  • Type: 2021 MacBook Pro w/ M1 Pro CPU
  • OS: macOS Monterey 12.4
  • Xcode: 14.0 beta
  • Swift: Nightly and 5.7 development toolchains
  • AudioKit Version: Latest release and main branch

Additional context I'm happy to provide any additional context, if necessary.

nhubbard avatar Jun 07 '22 16:06 nhubbard

Is fixing this as simple as adding #include <atomic> in DSPBase.h? Otherwise do you know how to fix it?

wtholliday avatar Jun 07 '22 20:06 wtholliday

So I tried that, and it only lead to more build issues and Xcode complaining that I modified a read only copy of a package dependency; I'll try to capture a screenshot.

I'm almost certain that this is just a bug in the Swift and Objective-C beta/nightly compiler suite, but I'm not much of an Objective-C programmer so I can't say that for certain.

nhubbard avatar Jun 08 '22 13:06 nhubbard

I fixed AudioKit and AudioKitEX for Swift 5.7, but the STK had a host of problems with that toolchain.

aure avatar Jun 09 '22 10:06 aure

SporthAudioKit also has some deep-looking issues

aure avatar Jun 09 '22 10:06 aure