Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't build because warning "'temporaryDirectory' is only available in macOS 10.12 or newer" #1158

Closed
dazy1030 opened this issue Mar 16, 2022 · 7 comments
Labels
fixed in develop bug/feature resolved in the develop branch

Comments

@dazy1030
Copy link

dazy1030 commented Mar 16, 2022

about

  • Can't build because warning 'temporaryDirectory' is only available in macOS 10.12 or newer at line 556 of CommandLine.swift.
  • It may have something to do with 573ae3f.
  • If version 0.49.4 is specified in a similar environment, the build succeeds.

environment

  • SwiftFormat 0.49.6
  • macOS 12.3
  • Xcode13.3
  • iOS App project (target iOS 15.0 or newer)
  • use SPM.(I have introduced this guideline.)
// swift-tools-version:5.6
import PackageDescription

let package = Package(
    name: "BuildTools",
    platforms: [.macOS(.v10_12)],
    dependencies: [
        .package(url: "https://github.com/nicklockwood/SwiftFormat", from: "0.49.0"),
    ],
    targets: [.target(name: "BuildTools", path: "")]
)
@nicklockwood
Copy link
Owner

@dazy1030 fixed in 0.49.7

@bilalb
Copy link

bilalb commented Sep 5, 2022

Hi,

I almost have the same issue on both 0.49.7 & 0.49.18:

'temporaryDirectory' is only available in iOS 10.0 or newer

I have tried to clean the project, remove derived data and reset package caches but nothing helped.
Do you have any suggestion to fix that?
Please let me know if I can provide any further information.

Thank you in advance

Environment

  • macOS 12.5.1
  • Xcode 13.4.1
  • iOS App project (target iOS 14.3 or newer)
  • use SPM

@radekwilczak
Copy link

radekwilczak commented Sep 16, 2022

I have same issue as @bilalb. Checked with 0.49.7 & 0.49.18
On 0.49.4 I have this issue: #424
I've added SwiftFormat through Package Dependencies on iOS Project in Xcode 13.4.1.
My idea was to use SwiftFormat as Swift Package plugin (https://developer.apple.com/videos/play/wwdc2022/110359/)
@nicklockwood any ideas? ;)

@nicklockwood
Copy link
Owner

I'm not exactly clear how you can correct it, but it seems like the way you've integrated SwiftFormat means it's trying to build it for iOS, which isn't right.

Even if you are planning to format an iOS project, the SwiftFormat plugin should be built for macOS, in which case the iOS version you are targeting shouldn't matter?

@bilalb
Copy link

bilalb commented Sep 16, 2022

I've just realised SwiftFormat should not be added to the project's package dependencies 😅
So I've removed it and now everything works as expected 🎉

Thanks your feedback and keep up the great work!

@radekwilczak
Copy link

@bilalb If not added as project's package dependencie - then how to add it through SPM?

@bilalb
Copy link

bilalb commented Sep 16, 2022

It should not be added via SPM, as described in Xcode build phase > Using Swift Package Manager

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed in develop bug/feature resolved in the develop branch
Projects
None yet
Development

No branches or pull requests

4 participants