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

Fix a build error on linux: kCFStringEncodingUTF8 is not defined. #173

Merged
merged 3 commits into from
Jul 21, 2020

Conversation

adamleonard
Copy link
Contributor

kCFStringEncodingUTF8 is available in C, but not in swift. I think CFStringBuiltInEncodings.UTF8.rawValue is what's intended. However, I didn't take a close look at this code, so please let me know if I'm missing something.

Also fix a type error I was getting in a unit test with Swift 5.3.

`kCFStringEncodingUTF8` is not defined.
Instead, use `CFStringBuiltInEncodings.UTF8.rawValue`.

Also fix a type error I was getting in a unit test.
@broadwaylamb
Copy link
Member

It seems like this is a breaking change in the core libraries that come with Swift 5.3. Could you please guard your change with #if swift(>=5.3) so that it would still work with earlier versions of Swift?

@codecov
Copy link

codecov bot commented Jul 17, 2020

Codecov Report

Merging #173 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #173   +/-   ##
=======================================
  Coverage   98.01%   98.02%           
=======================================
  Files          91       91           
  Lines        5909     5914    +5     
=======================================
+ Hits         5792     5797    +5     
  Misses        117      117           
Impacted Files Coverage Δ
...ources/OpenCombineFoundation/Timer+Publisher.swift 98.70% <100.00%> (+0.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8cf59d6...81bf68f. Read the comment docs.

@OpenCombineBot
Copy link

OpenCombineBot commented Jul 17, 2020

LGTM

Generated by 🚫 Danger Swift against 81bf68f

…wift 5.3 and later, as it does not compile on swift 5.2 on linux (but does on swift 5.2 for mac, suggesting a fixed bug in the open source version of CoreFoundation?)
@adamleonard
Copy link
Contributor Author

Thanks for the super quick response. You're right, this does seem to be a swift 5.3 change on linux. Oddly, the fix compiles for me on swift 5.2 with macOS CoreFoundation, but not the linux CoreFoundation.

Pushed a commit that makes this conditional for 5.3. I verified the project compiles against the swift:5.2-bionic and swiftlang/swift:nightly-5.3-bionic docker images. Also, it looks like the iOS 9.3 sim used by the iOS circleci tests isn't available to download anymore?

Thanks for this amazing project! It's been a joy to work with.

Copy link
Member

@broadwaylamb broadwaylamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

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

Successfully merging this pull request may close these issues.

None yet

4 participants