Replies: 2 comments 6 replies
-
|
Hi @marcprux, I'm just not sure there is much we can do here. We are taking all the precautions necessary to make sure this code does not compile on platforms that don't support it. Have you tried reporting this to Apple? Since this isn't an issue with the library I am going to convert it to a discussion. Please feel free to continue the conversation over there! |
Beta Was this translation helpful? Give feedback.
-
|
It turns out this doesn't have anything to do with the cross-compilation SDK: building anything with the macOS OSS toolchain (rather than Xcode's) will cause the build error, with or without a custom SDK. I.e.: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Trying to cross-compile to the static Linux SDK from macOS fails with the error:
This is pretty kooky, because
WithPerceptionTracking.swiftgates those lines within both#if canImport(SwiftUI)as well as#if canImport(MapKit), neither of which are available in the static Linux SDK.swift-perception/Sources/PerceptionCore/SwiftUI/WithPerceptionTracking.swift
Lines 223 to 232 in 7d3509c
Even weirder, if I comment out that section, the project builds fine, even though there is a similar construct with Charts that doesn't seem to cause any issues:
swift-perception/Sources/PerceptionCore/SwiftUI/WithPerceptionTracking.swift
Lines 214 to 220 in 7d3509c
I suspect this must somehow be a bug in the Swift toolchain, but I can't narrow it down to a small reproducible example, so I figured I would report it here so you are aware of it.
FTR, this also affects the Android SDK, so any package that depends on
swift-perceptioncannot currently be built for Android due to this issue.Checklist
@Observablemacro or another tool from theObservationframework, please file it directly with Apple.mainbranch of this package.Expected behavior
No response
Actual behavior
No response
Steps to reproduce
No response
Perception version information
7d3509c
Destination operating system
No response
Xcode version information
Command line SwiftPM
Swift Compiler version information
% ~/Library/Developer/Toolchains/swift-6.1-RELEASE.xctoolchain/usr/bin/swift --version Apple Swift version 6.1 (swift-6.1-RELEASE) Target: arm64-apple-macosx15.0Beta Was this translation helpful? Give feedback.
All reactions