Skip to content

swiftinterface generator confuses @exclusivity(unchecked) and @_optimize(none) on Windows #76279

Open
@grynspan

Description

@grynspan

After merging swiftlang/swift-testing#655, CI started failing with a very curious error:

T:/105/swift/Testing.swiftinterface:156:2: error: '@_optimize(none)' attribute cannot be applied to stored properties
154 | }
155 | @usableFromInline
156 | @_optimize(none) nonisolated(unsafe) internal var failureBreakpointValue: Swift.Int
    |  `- error: '@_optimize(none)' attribute cannot be applied to stored properties
157 | @usableFromInline
158 | @inline(never) internal func failureBreakpoint()

T:/105/swift/Testing.swiftinterface:4:1: error: failed to verify module interface of 'Testing' due to the errors above; the textual interface may be broken by project issues or a compiler bug
  2 | // swift-compiler-version: Swift version 6.1-dev (LLVM bb83b24e1f07337, Swift c3368800501a32d)
  3 | // swift-module-flags: -target x86_64-unknown-windows-msvc -disable-objc-interop -enable-library-evolution -module-link-name Testing -swift-version 6 -O -enable-experimental-feature AccessLevelOnImport -enable-upcoming-feature ExistentialAny -enable-upcoming-feature InternalImportsByDefault -module-name Testing
  4 | public import Swift
    | `- error: failed to verify module interface of 'Testing' due to the errors above; the textual interface may be broken by project issues or a compiler bug

  5 | public import _Concurrency

  6 | public import _StringProcessing

<unknown>:0: error: verify-module-interface command failed with exit code 1 (use -v to see invocation)

This makes no sense because failureBreakpointValue does not have @_optimize(none) on it, it has @exclusivity(unchecked). This issue appears to only affect Windows builds so far.

CI compiler info:

  2 | // swift-compiler-version: Swift version 6.1-dev (LLVM fb5d83939c06f77, Swift a3589c0f0595cad)
  3 | // swift-module-flags: -target x86_64-unknown-windows-msvc -disable-objc-interop -enable-library-evolution -module-link-name Testing -swift-version 6 -O -enable-experimental-feature AccessLevelOnImport -enable-upcoming-feature ExistentialAny -enable-upcoming-feature InternalImportsByDefault -module-name Testing

Metadata

Metadata

Assignees

Labels

WindowsPlatform: WindowsbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.serializationArea → compiler: Serialization & deserializationtextual interfaces

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions