Skip to content

Cannot use different module aliases of dependency in the same package #8119

@ahoppen

Description

@ahoppen

If you have a package with two targets like

.target(
name: "LibA",
dependencies: [.product(name: "Crypto", package: "swift-crypto")]
),

.target(
name: "LibB",
dependencies: [.product(name: "Crypto", package: "swift-crypto", moduleAliases: ["Crypto": "CryptoAlias"])]
),

then compilation will fail with error: no such module 'CryptoAlias'. We should be building swift-crypto twice, once with the module alias and once without so that both LibA and LibB can build.

test.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions