Skip to content

Linux regression -- error: cannot inherit from class 'NSLock' because it has overridable members that could not be loaded #76039

Closed
@clackary

Description

@clackary

Description

On Ubuntu 22.04, the following code snippet builds successfully against 2024-07-15 nightly toolchain, but fails against 2024-07-22 toolchain. It builds successfully against both toolchains on macOS.

import Foundation

class FooLock: NSLock {}

Reproduction

import Foundation

class FooLock: NSLock {}

With this code snippet in FooLock.swift, attempting to build that single file fails -- ./path-to-toolchain/swift-DEVELOPMENT-SNAPSHOT-2024-08-21-a-ubuntu22.04-aarch64/usr/bin/swiftc -O FooLock.swift -o FooLock.

It also seems to reproduce with some other classes like NSNumber.

Expected behavior

The code snippet should build successfully on Linux/Ubuntu 22.04.

Environment

OS: Linux / Ubuntu 22.04

Latest known good tag: swift-DEVELOPMENT-SNAPSHOT-2024-07-15-a
Earliest known bad tag: swift-DEVELOPMENT-SNAPSHOT-2024-07-22-a

Additional information

This affects RxSwift (ReactiveX/RxSwift#2621), and all downstream projects. I also filed an issue over in swift-corelibs-foundation in case it's specific to non-Darwin Foundation functionality (https://github.com/apple/swift-corelibs-foundation/issues/5076).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.triage neededThis issue needs more specific labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions