ld: unsupported tapi file type '!tapi-tbd' in YAML file
…
I think it is weird that I run macOS 12.5, but f2py
refers to
src.macosx-10.9-x86_64-3.9
Right. I’m not able to help with your specific problem — there’s way too much third-party tooling in play here and my focus is on Apple’s platforms and tools — but I can at least explain the error.
To start, let’s talk about .tbd
files. Actually, let me just point you at this post, which explains the backstory. In short, a .tbd
file is a YAML file that acts as a stub library.
These .tbd
files debuted with the macOS 10.11 SDK. Since then they’ve gone through a number of different versions:
-
The macOS 10.11 SDK has no version information. For example, libSystem.tbd
[1] starts like this:
---
… lots of content …
-
The macOS 10.12 and 10.13 SDKs use version 2:
--- !tapi-tbd-v2
… lots of content …
-
The macOS 10.14 and 10.15 SDKs use version 3:
--- !tapi-tbd-v3
… lots of content …
-
The macOS 11, 12, and 13 beta SDKs use version 4:
--- !tapi-tbd
tbd-version: 4
… lots of content …
This error indicates that you’re passing a .tbd
file of version N to a linker that only understands version M, where M < N. This typically comes about because of a mismatch between the tools and the SDK. On Apple’s platforms the tools and SDK are effectively revlocked: You must use the SDK that came with the tools you’re using. For example, Xcode 13.4.1 includes the macOS 12.3 SDK and so its command-line tools are only guaranteed to work with that SDK.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] libSystem.tbd
is actually a symlink that points to libSystem.B.tbd
.