fix(visionOS): make the package actually build for visionOS#80
Open
gabhelstudios-dev wants to merge 2 commits into
Open
fix(visionOS): make the package actually build for visionOS#80gabhelstudios-dev wants to merge 2 commits into
gabhelstudios-dev wants to merge 2 commits into
Conversation
The other Apple-platform guards across the package already use `#if os(iOS) || os(visionOS)` so visionOS picks up `UIKit` instead of falling through to `Cocoa`. This preview file was missed when visionOS support was added, so building any visionOS target that links LaTeXSwiftUI fails with `Unable to resolve module dependency: 'Cocoa'`.
`EquationMarker` and the `customAttribute(_:)` call site in `Component.swift` require `TextAttribute`, which is iOS 18 / macOS 15 / visionOS 2.0+. Their `@available(iOS 18.0, macOS 15.0, *)` annotations let `*` expand to the package's visionOS deployment target, which was `.v1` (1.0) — so the package fails to build for visionOS with: 'EquationMarker' is only available in visionOS 2.0 or newer visionOS 1 has been deprecated for over a year and the rest of the package's visionOS guards already assume modern visionOS. Bumping the minimum to 2.0 matches the actual API surface used.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two small fixes that were keeping LaTeXSwiftUI from building on visionOS, even though the package declares
.visionOS(.v1)inPackage.swift.1.
Previews/LaTeX_Previews+Fonts.swift— missingos(visionOS)in the iOS guardEvery other
#if os(...)guard in the package already includes visionOS (Aliases.swift,Renderer.swift,Font+Extensions.swift,Image+Extensions.swift,LaTeX.swift,SVGGeometry.swift). This preview file was missed, so visionOS fell through toimport Cocoaand the build failed with:2.
Package.swift— bump visionOS minimum to 2.0EquationMarker(and its call site inComponent.swift) conform to / useTextAttributeandcustomAttribute(_:), both of which are iOS 18 / macOS 15 / visionOS 2.0+. The existing@available(iOS 18.0, macOS 15.0, *)lets*expand to the package's visionOS deployment target, which was.v1. Result:visionOS 1 has been superseded by visionOS 2 for over a year, and the package already uses visionOS 2 era APIs (
TextAttribute), so bumping the floor to.visionOS(.v2)matches the real API surface.Alternative: add
visionOS 2.0explicitly to the two@availableannotations and keep.visionOS(.v1)inPackage.swift. Happy to switch to that form if you'd rather preserve visionOS 1 support.Test plan