Hive Hive
Sign in

Static framework with .metal produces default.metallib that ignores Metal-related build settings

GitHub issue · Open

Metadata
Source
tuist/tuist #8299
Updated
Jun 11, 2026
Domains
Generated projects
Details

What happened?

If you have a static framework with .metal files, as of this PR being merged, the default.metallib produced doesn’t respect build settings such as "MTL_ENABLE_DEBUG_INFO": "INCLUDE_SOURCE". Passing along metal-related build settings to the generated bundle with the .metal files makes sense to me as a solution.

How do we reproduce it?

Inspect the generated bundle with the metal files. If you set MTL_ENABLE_DEBUG_INFO on the framework, it doesn’t appear in the generated bundle containing the metal files and you can’t debug shaders. If you set it on the bundle, it is respected and the application can debug shaders if the value is set to INCLUDE_SOURCE.

Error log

Unable to create shader debug session when attempting to debug a shader.

macOS version

26.0

Tuist version

4.79.3

Xcode version

26.0

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
D
dosubot[bot] Sep 25, 2025

The metallib generated for static frameworks with .metal files does not respect Metal-related build settings like MTL_ENABLE_DEBUG_INFO because Tuist creates a separate resource bundle target for these files. This bundle target does not inherit custom build settings from the static framework—only minimal defaults like disabling code signing and installation are set. As a result, Metal build settings on the framework are ignored, and you can’t debug shaders unless you explicitly set those settings on the generated bundle target itself. This is a known limitation in how Tuist currently handles resource bundles for static frameworks, and a common workaround is to use a normal framework with MACH_O_TYPE set to staticlib and manage resource access manually, which allows Metal build settings to be respected community discussion ResourcesProjectMapper.swift.

To ensure MTL_ENABLE_DEBUG_INFO is respected, you need to set it directly on the generated bundle target in your project definition. There is ongoing discussion about improving this behavior, but for now, explicit configuration is required.

To reply, just mention @dosu.


Docs are dead. Just use Dosu.

Leave Feedback Ask Dosu about tuist Share Dosu with your team