Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defined platforms are wrongfully elevated to support more then indented #5978

Closed
alexanderwe opened this issue Feb 22, 2024 · 0 comments · Fixed by #6251
Closed

Defined platforms are wrongfully elevated to support more then indented #5978

alexanderwe opened this issue Feb 22, 2024 · 0 comments · Fixed by #6251
Labels
type:bug Something isn't working

Comments

@alexanderwe
Copy link
Collaborator

What happened?

When linking a target with a subset of supported platforms without a specified condition to a target with a superset of platforms the linked target will be linked as "Always" without any filters.

This is incorrect. Imagine having a target A that defines destinations like so:

destinations: [.iPad, .iPhone]

Another target B defines its destination as:

destinations: [.iPad, .iPhone, .mac, .appleTv]

And then target B links target A:

dependencies: [
    .target(name: "TargetA")
]

TargetA will get always linked even though it only supports the iOS platform

Screenshot 2024-02-22 at 08 28 37
Screenshot 2024-02-22 at 08 28 33

How do we reproduce it?

Add an iOS only framework to the multiplatform_app_with_sdk fixture

.target(
    name: "MultiPlatformFramework",
    destinations: [.iPad, .iPhone, .mac, .appleTv],
    product: .framework,
    bundleId: "io.tuist.MacFramework",
    infoPlist: "Support/Framework-Info.plist",
    sources: [
        .glob("Framework/Shared/**"),
        .glob("Framework/tvOS/**", compilationCondition: .when([.tvos])),
        .glob("Framework/macOS/**", compilationCondition: .when([.macos])),
        .glob("Framework/iOS/**", compilationCondition: .when([.ios])),
    ],
    dependencies: [
        .sdk(name: "CloudKit", type: .framework, status: .optional),
        .sdk(name: "sqlite3", type: .library),
        .target(name: "iOSFramework")
    ]
),
.target(
    name: "iOSFramework",
    destinations: [.iPad, .iPhone],
    product: .framework,
    bundleId: "io.tuist.iOSFramework",
    infoPlist: "Support/Framework-Info.plist",
    sources: [
        .glob("iOSFramework/**"),
    ]
),

Error log

N/A

macOS version

14.3.1 (23D60)

Tuist version

4.3.4

Xcode version

15.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
1 participant