Skip to content

Fix Android build error with @preconcurrency import Android#393

Merged
ktoso merged 5 commits intoapple:mainfrom
MaxDesiatov:patch-4
Dec 3, 2025
Merged

Fix Android build error with @preconcurrency import Android#393
ktoso merged 5 commits intoapple:mainfrom
MaxDesiatov:patch-4

Conversation

@MaxDesiatov
Copy link
Copy Markdown
Member

Motivation:

swift-log currently can't be built on Android due to this error:

/home/runner/work/WasmKit/WasmKit/.build/checkouts/swift-log/Sources/Logging/Logging.swift:1380:36: error: reference to var 'stdout' is not concurrency-safe because it involves shared mutable state
1378 |         let systemStdout = Glibc.stdout!
1379 |         #elseif canImport(Android)
1380 |         let systemStdout = Android.stdout
     |                                    `- error: reference to var 'stdout' is not concurrency-safe because it involves shared mutable state

Modifications:

Marked import Android with @preconcurrency attribute.

Result:

The package builds for Android now.

@MaxDesiatov MaxDesiatov requested a review from czechboy0 December 3, 2025 15:28
@MaxDesiatov
Copy link
Copy Markdown
Member Author

MaxDesiatov commented Dec 3, 2025

Android build failed due to interrupted download, needs a failed CI jobs restart

Copy link
Copy Markdown
Member

@ktoso ktoso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@ktoso ktoso added the 🔨 semver/patch No public API change. label Dec 3, 2025
@ktoso ktoso merged commit f3a82f1 into apple:main Dec 3, 2025
114 of 116 checks passed
@MaxDesiatov MaxDesiatov deleted the patch-4 branch December 4, 2025 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 semver/patch No public API change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants