You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(Linux) Build failure against 2024-09-25 nightly toolchain -- error: cannot inherit from class 'Thread' (compiled with Swift 6.1) because it has overridable members that could not be loaded in Swift 5.10
#615
Open
clackary opened this issue
Oct 14, 2024
· 1 comment
root@7481e59c0960:/project/opentelemetry-swift# /home/dev-toolchain/swift-DEVELOPMENT-SNAPSHOT-2024-09-25-a-ubuntu22.04-aarch64/usr/bin/swift build
...
/project/opentelemetry-swift/Sources/OpenTelemetrySdk/Logs/Processors/BatchLogRecordProcessor.swift:41:15: error: cannot inherit from class 'Thread' (compiled with Swift 6.1) because it has overridable members that could not be loaded in Swift 5.10
39 | }
40 |
41 | private class BatchWorker : Thread {
| `- error: cannot inherit from class 'Thread' (compiled with Swift 6.1) because it has overridable members that could not be loaded in Swift 5.10
42 | let logRecordExporter : LogRecordExporter
43 | let scheduleDelay : TimeInterval
From what I've seen in the other cases, it looks like would be feasible to workaround the issue by making a Thread property within BatchWorker, and then wrapping the start and cancel calls with matching BatchWorker funcs.
But the problem here is the override on Thread.main(). I don't think there's a way to do this without inheriting from Thread.
Configuration:
OS: Linux Ubuntu 22.04
Toolchain: swift-DEVELOPMENT-SNAPSHOT-2024-09-25-a-ubuntu22.04-aarch64
The text was updated successfully, but these errors were encountered:
Hey @clackary! You're right that it was introduced in that nightly build; and looking at the issue you created in swift-corelibs-foundation, it seems it's not expected (and thankfully, because it'd be quite problematic 😂). From what I see, they've opened a PR that theoretically solves the problem with both NSLock and Thread.
Maybe once that PR gets merged, it would be good to test and see if the problem disappears in the BatchWorker class
This one is another instance of a swiftlang compiler bug I've been running into for a while: swiftlang/swift-corelibs-foundation#5108
From what I've seen in the other cases, it looks like would be feasible to workaround the issue by making a Thread property within BatchWorker, and then wrapping the
start
andcancel
calls with matching BatchWorker funcs.But the problem here is the override on
Thread.main()
. I don't think there's a way to do this without inheriting from Thread.Configuration:
OS: Linux Ubuntu 22.04
Toolchain: swift-DEVELOPMENT-SNAPSHOT-2024-09-25-a-ubuntu22.04-aarch64
The text was updated successfully, but these errors were encountered: