Hive Hive
Sign in

Realm source archive from registry loses symlinked headers, causing duplicate interface compile errors

GitHub issue · Open

Metadata
Source
tuist/tuist #14471
Updated
Oct 20, 2026
Details

Resolving realm.realm-swift 20.0.6 through the Tuist registry pulls in a source archive where several headers under include/Realm/ end up as plain duplicate files instead of symlinks to Realm/. That makes Xcode see the same Objective-C interface twice and fail with errors like duplicate interface definition for class 'RLMProperty'.

In the upstream git repo, include/Realm/*.h (48 files) are actual symlinks pointing at ../../Realm/*.h — e.g. include/Realm/RLMProperty.h -> ../../Realm/RLMProperty.h. Realm’s Package.swift relies on this: it adds both a Realm-relative header search path and publicHeadersPath: "include" for the same target, which only works because the files are the same inode on disk.

After resolving through the registry, that’s no longer true:

$ ls -i Realm/RLMProperty.h include/Realm/RLMProperty.h
108569111 Realm/RLMProperty.h
108569912 include/Realm/RLMProperty.h
$ md5 Realm/RLMProperty.h include/Realm/RLMProperty.h
MD5 (Realm/RLMProperty.h) = 929a82123c9bb480d2ab424693d60a2c
MD5 (include/Realm/RLMProperty.h) = 929a82123c9bb480d2ab424693d60a2c

Same content, different files — so now the header gets pulled into the translation unit from two different paths and clang treats it as two separate @interface declarations.

Repro

Package.swift:

// swift-tools-version:5.9
import PackageDescription
let package = Package(
name: "RealmRegistryRepro",
platforms: [.iOS(.v15)],
products: [.library(name: "RealmRegistryRepro", targets: ["RealmRegistryRepro"])],
dependencies: [
.package(id: "realm.realm-swift", exact: "20.0.6")
],
targets: [
.target(
name: "RealmRegistryRepro",
dependencies: [.product(name: "RealmSwift", package: "realm.realm-swift")]
)
]
)

.swiftpm/configuration/registries.json:

{
"registries": {
"[default]": { "url": "https://tuist.dev/api/registry/swift" }
},
"version": 1
}
  1. swift package resolve
  2. Look at ~/Library/Caches/org.swift.swiftpm/registry/downloads/realm/realm-swift/20.0.6/include/Realm/ — these are regular files, not symlinks, unlike a plain git checkout of the same tag.
  3. Build any target that imports RealmSwift — fails with duplicate interface definitions for RLMProperty, RLMArray, RLMResults, RLMObject, etc.

Cloning realm/realm-swift directly at the same tag and checking git ls-tree confirms those paths are mode 120000 (symlink) in the actual repo, so this looks like the archive generation (or the client’s unpacking of it) isn’t preserving symlinks from the source tree.

Worked around it on our end by pointing that one dependency back at remoteSourceControl instead of the registry, but wanted to flag it since it’ll bite anyone resolving realm-swift through this registry.

Flights

Investigate, reproduce, or fix this item in an isolated repository. Each Flight preserves its outcome and agent session.

New Flights are paused Configure model inference, GitHub, and a sandbox provider to start another Flight. Existing results remain available below.
No Flights yet

Start a Flight and preserve its objective, outcome, and session here.

Comments

No GitHub comments yet.