Skip to content

Swift doesn’t recognize Clang’s header on Windows #60534

Open
swiftlang/swift-installer-scripts
#198
@stevapple

Description

@stevapple

Describe the bug
Clang provides some C headers as polyfills (or shims) and the Swift toolchain vendors it in /usr/lib/clang/{clang_version}/include. However, the Swift compiler doesn’t recognize these headers, so a module produced by the bundled Clang may not be consumed by Swift.

Steps To Reproduce
Steps to reproduce the behavior:

  1. Clone https://github.com/apple/swift-atomics;
  2. Change directory to swift-atomics;
  3. Run swift build.

Expected behavior
Since the _AtomicsShims target is successfully compiled, it should be consumable for Atomics.

Screenshots
A9ECDABB-E29B-4822-9347-A4909F6FF54D

Environment

  • OS: Windows Server 2019 Datacenter (1809)
  • Swift version: 5.6.2
  • Visual Studio: Community 2019, 16.11.18

Additional context
Although this can be worked around from the SwiftPM side, I believe resolving it with swiftc is a better choice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions