Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Compilation Error: SendingRisksDataRace in FontBrowserViewModel #56

Description

@chuhillaus

When attempting to build the project using swift run RootFontApp, the compiler throws multiple #SendingRisksDataRace errors in FontBrowserViewModel.swift at line 335.

Environment :

OS: macOS Sequoia 15.7.4

Hardware: MacBook Air (M1, 2020), 16GB RAM

Xcode/Swift Version: swift-driver version: 1.127.15 Apple Swift version 6.2.4 (swiftlang-6.2.4.1.4 clang-1700.6.4.2)

Steps to Reproduce :

Clone/Download the latest source code.

Open Terminal and navigate to the project folder.

Run swift run RootFontApp.

Error Log :
swift run RootFontApp
Building for debugging...
/Users/hill/Downloads/rootfont-0.3.0-alpha/Sources/RootFontApp/ViewModels/FontBrowserViewModel.swift:335:21: error: sending 'self' risks causing data races #SendingRisksDataRace
333 |
334 | await MainActor.run {
335 | self?.applyLoadResult(fonts: loadedFonts, failed: loadFailed)
| |- error: sending 'self' risks causing data races #SendingRisksDataRace
| `- note: task-isolated 'self' is captured by a main actor-isolated closure. main actor-isolated uses in closure may race against later nonisolated uses
336 | }
337 | }

/Users/hill/Downloads/rootfont-0.3.0-alpha/Sources/RootFontApp/ViewModels/FontBrowserViewModel.swift:335:21: error: sending 'self' risks causing data races #SendingRisksDataRace
333 |
334 | await MainActor.run {
335 | self?.applyLoadResult(fonts: loadedFonts, failed: loadFailed)
| |- error: sending 'self' risks causing data races #SendingRisksDataRace
| `- note: task-isolated 'self' is captured by a main actor-isolated closure. main actor-isolated uses in closure may race against later nonisolated uses
336 | }
337 | }

/Users/hill/Downloads/rootfont-0.3.0-alpha/Sources/RootFontApp/ViewModels/FontBrowserViewModel.swift:335:21: error: sending 'self' risks causing data races #SendingRisksDataRace
333 |
334 | await MainActor.run {
335 | self?.applyLoadResult(fonts: loadedFonts, failed: loadFailed)
| |- error: sending 'self' risks causing data races #SendingRisksDataRace
| `- note: task-isolated 'self' is captured by a main actor-isolated closure. main actor-isolated uses in closure may race against later nonisolated uses
336 | }
337 | }

/Users/hill/Downloads/rootfont-0.3.0-alpha/Sources/RootFontApp/ViewModels/FontBrowserViewModel.swift:335:21: error: sending 'self' risks causing data races #SendingRisksDataRace
333 |
334 | await MainActor.run {
335 | self?.applyLoadResult(fonts: loadedFonts, failed: loadFailed)
| |- error: sending 'self' risks causing data races #SendingRisksDataRace
| `- note: task-isolated 'self' is captured by a main actor-isolated closure. main actor-isolated uses in closure may race against later nonisolated uses
336 | }
337 | }

/Users/hill/Downloads/rootfont-0.3.0-alpha/Sources/RootFontApp/ViewModels/FontBrowserViewModel.swift:335:21: error: sending 'self' risks causing data races #SendingRisksDataRace
333 |
334 | await MainActor.run {
335 | self?.applyLoadResult(fonts: loadedFonts, failed: loadFailed)
| |- error: sending 'self' risks causing data races #SendingRisksDataRace
| `- note: task-isolated 'self' is captured by a main actor-isolated closure. main actor-isolated uses in closure may race against later nonisolated uses
336 | }
337 | }

/Users/hill/Downloads/rootfont-0.3.0-alpha/Sources/RootFontApp/ViewModels/FontBrowserViewModel.swift:335:21: error: sending 'self' risks causing data races #SendingRisksDataRace
333 |
334 | await MainActor.run {
335 | self?.applyLoadResult(fonts: loadedFonts, failed: loadFailed)
| |- error: sending 'self' risks causing data races #SendingRisksDataRace
| `- note: task-isolated 'self' is captured by a main actor-isolated closure. main actor-isolated uses in closure may race against later nonisolated uses
336 | }
337 | }

[56/59] Compiling RootFontApp resource_bundle_accessor.swift

Additional Context :

Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions