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

This library has a problem using xcframeworks #4

Open
wweevv-johndpope opened this issue Sep 5, 2022 · 1 comment
Open

This library has a problem using xcframeworks #4

wweevv-johndpope opened this issue Sep 5, 2022 · 1 comment

Comments

@wweevv-johndpope
Copy link

wweevv-johndpope commented Sep 5, 2022

background
https://github.com/unsignedapps/swift-create-xcframework/issues/80

swiftlang/swift#56573

warning: public struct 'AnyCodable.AnyCodable' shadows module 'AnyCodable', which may cause failures when importing 'AnyCodable' or its clients in some configurations; please rename either the struct 'AnyCodable.AnyCodable' or the module 'AnyCodable', or see https://bugs.swift.org/browse/SR-14195 for workarounds
@Frozen public struct AnyCodable: Codable {

to verify

brew install mint
mint install unsignedapps/swift-create-xcframework
swift create-xcframework URLQueryEncoder
should see above error.

Seems like either the class or module has to be renamed.

// swift-tools-version:5.5
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
    name: "URLQueryEncoderKit",
    platforms: [
        .macOS(.v10_13),
        .iOS(.v11),
        .tvOS(.v11),
        .watchOS(.v4)
    ],
    products: [
        .library(
            name: "URLQueryEncoderKit",
            targets: ["URLQueryEncoderKit"]),
    ],
    targets: [
        .target(
            name: "URLQueryEncoderKit",
            dependencies: []),
        .testTarget(
            name: "URLQueryEncoderTests",
            dependencies: ["URLQueryEncoderKit"]),
    ]
)

rename sources/URLQueryEncoder -> sources/URLQueryEncoderKit

working branch

// swift-tools-version:5.5
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
  name: "GoTrue",
  platforms: [
    .iOS(.v13),
    .macCatalyst(.v13),
    .macOS(.v10_15),
    .watchOS(.v6),
    .tvOS(.v13),
  ],
  products: [
    .library(name: "GoTrue", targets: ["GoTrue"])
  ],
  dependencies: [
    .package(url: "https://github.com/WeTransfer/Mocker", from: "2.7.0"),
    .package(url: "https://github.com/binaryscraping/swift-composable-keychain", from: "0.0.2"),
    .package(url: "https://github.com/kean/Get", from: "2.0.0"),
    .package(url: "https://github.com/wweevv-johndpope/URLQueryEncoderKit", from: "0.2.2"),
  ],
  targets: [
    .target(
      name: "GoTrue",
      dependencies: [
        .product(name: "Get", package: "Get"),
        .product(name: "ComposableKeychain", package: "swift-composable-keychain"),
        .product(name: "URLQueryEncoderKit", package: "URLQueryEncoderKit"),
      ]
    ),
    .testTarget(
      name: "GoTrueTests",
      dependencies: [
        "GoTrue",
        "Mocker",
      ],
      resources: [
        .process("Resources")
      ]
    ),
  ]
)
@liamnichols
Copy link
Member

Thanks for raising this issue, sorry that you're having problems here!

Unfortunately renaming the module is quite the breaking change which will introduce breaking changes that need to be addressed downstream in CreateAPI as well so its a bit tricky.

Before we look into that, did you by any chance see this workaround screeningeagledreamlab/YapDatabase#4? Could that help in your use case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants