Skip to content

Fix the app target's compiler warnings - #118

Merged
robbietilton merged 1 commit into
robbietilton:mainfrom
dcarrero:upstream/fix-warnings
Sep 24, 2026
Merged

robbietilton merged 1 commit into
robbietilton:mainfrom
dcarrero:upstream/fix-warnings

Conversation

@dcarrero

Copy link
Copy Markdown
Contributor

The app target built with 17 compiler warnings. This clears all of them, without changing behavior.

Most came from the target's default MainActor isolation: extensions of nonisolated types are main-actor isolated again unless they say otherwise, so pixel and export code that runs on workers was calling into the main actor.

  • nonisolated on the CameraRawSettings extensions (calibration, curve/color, detail/optics), ProjectLayerRecord.effectiveOpacity, ImageLayer.size, UTType.photoshopImage/.photoshopLargeImage and EditorSession.textAttributes
  • MetalLayerEffects is now nonisolated and Sendable: export calls it from a worker, and it only holds a device, a command queue and pipeline states, which are all Sendable and thread-safe
  • The floating panel's frame observer runs through MainActor.assumeIsolated (it is registered on .main), as EditorCanvas already does for its autoscroll timer
  • AdjustPixels.c: the lateral chromatic aberration offsets are int, matching clamped_index
  • CameraRawGeometryCalibration: a var that is never mutated is now let

Tested with Xcode 27.0 on macOS 27 (Apple silicon), in a clean build: no warnings in the app target. The unit tests pass (parallel suite and FloatingPanelTests). Two things are unchanged and not part of this PR:

  • TiledLayerTests.swift:242/244 warn that try #require(…) has nothing to throw. I left it alone because removing try may not build with the Xcode 26.6 that CI uses.
  • SliderSnapTests.clickingTheTrackSnapsTheKnobAndStillEditsTheValue fails on macOS 27 without these changes too: it finds no slider in the hosting view.

With the target's default MainActor isolation, extensions of nonisolated types were
main-actor isolated again, so pixel and export code that runs on workers called into
the main actor. Mark those extensions and helpers nonisolated, make MetalLayerEffects
Sendable (it only holds Metal objects, which are thread-safe), run the floating
panel's frame observer through MainActor.assumeIsolated, and fix a long-to-int
narrowing in AdjustPixels.c and a var that is never mutated.
@robbietilton
robbietilton merged commit 075a71b into robbietilton:main Sep 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants