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

Can't build in Xcode (Redefinition of module 'FFI' error) #514

Open
inamiy opened this issue Sep 5, 2022 · 0 comments
Open

Can't build in Xcode (Redefinition of module 'FFI' error) #514

inamiy opened this issue Sep 5, 2022 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@inamiy
Copy link

inamiy commented Sep 5, 2022

Describe the bug

After making a new project from a template, building from Xcode (not carton dev) fails with the following error:

image

This error becomes annoying when I want to support Tokamak for my SwiftUI library.

To Reproduce

  1. carton init --template tokamak
  2. Build from Xcode

Expected behavior

  1. Xcode build works properly, or
  2. Have some way to optionally add Tokamak as dependency in library's Package.swift so that carton dev recognizes its condition but Xcode build won't. For example:
let package = /* My SwiftUI library */

// Carton recognizes this condition but Xcode (or non-SwiftWasm `swift build`) won't.
if ProcessInfo.processInfo.environment["CARTON"] != nil {
    package.dependencies.append(
        .package(url: "https://github.com/TokamakUI/Tokamak", from: "0.10.0")
    )

    let index = package.targets.firstIndex(where: { $0.name == "MyLib" })
    if let index = index {
        package.targets[index].dependencies.append(
            .product(
                name: "TokamakShim",
                package: "Tokamak",
                condition: .when(platforms: [.wasi])
            )
        )
    }
}

Desktop (please complete the following information):

  • OS: macOS 12.4
  • Version of Tokamak: 0.10.1
@inamiy inamiy added the bug Something isn't working label Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants