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

Linux Build Broken on Swift 5.3+: kCFStringEncodingUTF8 not in scope #183

Closed
xanderdunn opened this issue Sep 14, 2020 · 2 comments
Closed

Comments

@xanderdunn
Copy link

xanderdunn commented Sep 14, 2020

Added to Package.swift:

.package(name: "OpenCombine",
    url: "https://github.com/OpenCombine/OpenCombine.git",
    from: "0.10.0")

// Added to target dependencies:
.product(name: "OpenCombine", package: "OpenCombine"),
.product(name: "OpenCombineDispatch", package: "OpenCombine"),
.product(name: "OpenCombineFoundation", package: "OpenCombine"),

On macOS 10.15.6 using Swift for Tensorflow v0.11 I am able to build successfully:

$ which swift
/Library/Developer/Toolchains/swift-tensorflow-RELEASE-0.11.xctoolchain/usr/bin/swift
$ swift --version
Swift version 5.3-dev (LLVM db8896f3f345af2, Swift 61684f62a6132c0)
Target: x86_64-apple-darwin19.6.0

However, on Ubuntu 18.04 using Swift for Tensorflow v0.10 I am unable to build successfully:

$ which swift
/home/xander/swift-tensorflow-RELEASE-0.10-cuda10.2-cudnn7-ubuntu18.04/usr/bin/swift
$ swift --version
Swift version 5.3-dev (LLVM 55d27a5828, Swift 6a5d84ec08)
Target: x86_64-unknown-linux-gnu
$ swift build
.build/checkouts/OpenCombine/Sources/OpenCombineFoundation/Timer+Publisher.swift:343:34: error: cannot find 'kCFStringEncodingUTF8' in scope
                CFStringEncoding(kCFStringEncodingUTF8)
                                 ^~~~~~~~~~~~~~~~~~~~~

Swift for Tensorflow is based on the official dev branch.

I also tried building on the latest official 5.3 release branch on Ubuntu 18.04, still same error:

$ which swift
/home/xander/swift-5.3-DEVELOPMENT-SNAPSHOT-2020-08-31-a-ubuntu18.04/usr/bin/swift
$ swift --version
Swift version 5.3-dev (LLVM 3fa9679add, Swift d24649a4d6)
Target: x86_64-unknown-linux-gnu
$ swift build
.build/checkouts/OpenCombine/Sources/OpenCombineFoundation/Timer+Publisher.swift:343:34: error: cannot find 'kCFStringEncodingUTF8' in scope
                CFStringEncoding(kCFStringEncodingUTF8)
                                 ^~~~~~~~~~~~~~~~~~~~~

However, I can successfully build on Ubuntu 18.04 with Swift 5.2.5 official release toolchain:

$ which swift
/home/xander/swift-5.2.5-RELEASE-ubuntu18.04/usr/bin/swift
$ swift --version
Swift version 5.2.5 (swift-5.2.5-RELEASE)
Target: x86_64-unknown-linux-gnu

It appears specifically on Linux, the build is broken on Swift 5.3 release branch, as well as dev trunk.

Strangely, I do see kCFStringEncodingUTF8 referenced in the swift-corelibs-foundation. Is there an additional #include that's required now?

@broadwaylamb
Copy link
Member

broadwaylamb commented Sep 14, 2020

Hello!

Could you please try building from the master branch?

.package(name: "OpenCombine",
    url: "https://github.com/OpenCombine/OpenCombine.git",
    .branch("master"))

The issue should have been fixed in #173.

@xanderdunn
Copy link
Author

Oh yeah, that resolves it, thanks! Should've thought to try off master.

I searched the issues for kCFStringEncodingUTF8 and didn't see anything, but I didn't search the pull requests!

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