Hive
Missing symbols when an SPM target has no sources
GitHub issue · Open
Source
tuist/tuist #6164
Updated
Jun 11, 2026
Domains
Generated projects
What happened?
https://github.com/Datadog/dd-sdk-ios makes Tuist break when using this dependency.
How do we reproduce it?
Create a project with this dependency:
Package.swift
let package = Package(
name: "Package",
platforms: [
.iOS(.v16)
],
products: [
...
],
dependencies: [
.package(
url: "https://github.com/Datadog/dd-sdk-ios.git",
from: "2.5.0"),
],
targets: [
.target(
name: "Target",
dependencies: [
.product(
name: "DatadogCore",
package: "dd-sdk-ios",
condition: .when(platforms: [.iOS, .macCatalyst])),
.product(
name: "DatadogLogs",
package: "dd-sdk-ios",
condition: .when(platforms: [.iOS, .macCatalyst])),
.product(
name: "DatadogTrace",
package: "dd-sdk-ios",
condition: .when(platforms: [.iOS, .macCatalyst])),
.product(
name: "DatadogRUM",
package: "dd-sdk-ios",
condition: .when(platforms: [.iOS, .macCatalyst])),
]
)
]
)
Run tuist install && tuist generate
Error log
Undefined symbol: std::__1::__shared_weak_count::__get_deleter(std::type_info const&) const
Undefined symbol: std::exception::what() const
Undefined symbol: std::logic_error::logic_error(char const*)
Undefined symbol: std::length_error::~length_error()
Undefined symbol: std::bad_array_new_length::bad_array_new_length()
Undefined symbol: std::bad_array_new_length::~bad_array_new_length()
Undefined symbol: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::resize(unsigned long, char)
Undefined symbol: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::basic_string(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&)
Undefined symbol: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::operator=(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&)
Undefined symbol: std::__1::__shared_weak_count::__release_weak()
Undefined symbol: std::__1::__shared_weak_count::~__shared_weak_count()
Undefined symbol: std::__1::mutex::lock()
Undefined symbol: std::__1::mutex::unlock()
Undefined symbol: std::__1::mutex::~mutex()
Undefined symbol: std::exception::~exception()
Undefined symbol: std::set_terminate(void (*)())
Undefined symbol: std::terminate()
Undefined symbol: typeinfo for std::__1::__shared_weak_count
Undefined symbol: typeinfo for char*
Undefined symbol: typeinfo for std::length_error
Undefined symbol: typeinfo for std::bad_array_new_length
Undefined symbol: typeinfo for std::exception
Undefined symbol: typeinfo for char
Undefined symbol: typeinfo for double
Undefined symbol: typeinfo for long double
Undefined symbol: typeinfo for float
Undefined symbol: typeinfo for unsigned char
Undefined symbol: typeinfo for int
Undefined symbol: typeinfo for unsigned int
Undefined symbol: __swift_FORCE_LOAD_$_swiftCompatibility56
Undefined symbol: __swift_FORCE_LOAD_$_swiftCompatibilityConcurrency
Linker command failed with exit code 1 (use -v to see invocation)
macOS version
14.4.1
Tuist version
4.9.0
Xcode version
15.2.0
fortmarek
Apr 10, 2024
You can update the target settings, and thus also compiler flags, using the targetSettings from PackageSettings.
Would you mind adding a zip with a reproducible project? 🙏
fortmarek
Apr 22, 2024
@NachoSoto provided us with the above sample. The issue is because of LibraryTarget that has no sources. If sources are added to the target, the symbol issues are resolved. It’s likely we’re doing some configuration only if a file has sources – further investigation is needed.