Skip to content

[SR-14555] Bundle.module searches for bundle in swift binary location instead of Bundle.main of compiled binary #4432

Closed
@ffried

Description

@ffried
Previous ID SR-14555
Radar None
Original Reporter @ffried
Type Bug
Status Resolved
Resolution Done
Environment

Swift 5.4 on linux

Additional Detail from JIRA
Votes 0
Component/s Package Manager
Labels Bug
Assignee None
Priority Medium

md5: 93bc9ff244e85867c9beadfa5de9bb20

relates to:

  • SR-14592 Create functional test for movable executable with resource bundle in SwiftPM

Issue Description:

Since Swift 5.4, the Bundle.module lookup searches for the resource bundle next to the location where swift binary was located during compilation (e.g. /usr/bin in swift:5.4 linux docker image) instead of the location where the compiled binary lies.

This is due to the following change executing Bundle.main during the build instead of at execution time.
https://github.com/apple/swift-package-manager/pull/2972/files#diff-13eb4b18e8a4f2de8467dae905be6bdc133208159aded4aa6dbb6a03be21c6bdL584

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions