Skip to content

dyld error when using R.swift with SwiftPM in custom build configuration #937

Open
@iHarnastaeu

Description

@iHarnastaeu

When building with a custom configuration (e.g. DebugStage), the R.swift plugin fails during the resource generation phase with the following error:

dyld[55220]: Library not loaded: @rpath/RswiftResources.framework/Versions/A/RswiftResources
  Referenced from: <...> /Build/Products/DebugStage/rswift
  Reason: tried:
    '/usr/lib/swift/RswiftResources.framework/Versions/A/RswiftResources' (no such file, not in dyld cache),
    '/System/Volumes/Preboot/Cryptexes/OS/usr/lib/swift/RswiftResources.framework/Versions/A/RswiftResources' (no such file),
    '/usr/lib/swift/RswiftResources.framework/Versions/A/RswiftResources' (no such file, not in dyld cache),
    '/System/Volumes/Preboot/Cryptexes/OS/usr/lib/swift/RswiftResources.framework/Versions/A/RswiftResources' (no such file)
Abort trap: 6
Command PhaseScriptExecution failed with a nonzero exit code

This only happens in the custom configuration. In the standard Debug configuration, everything works as expected.
Build settings between the configurations are nearly identical:

LD_RUNPATH_SEARCH_PATHS and FRAMEWORK_SEARCH_PATHS are the same.

The difference is limited to display names, bundle Ids and a few compilation conditions.

The plugin runs in both configurations, but only fails in the custom one.

Thanks in advance for looking into this!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions