pulsar-edit / pulsar

A Community-led Hyper-Hackable Text Editor
https://pulsar-edit.dev
Other
3.24k stars 137 forks source link

Link to Homebrew version of `libiconv`… #1039

Closed savetheclocktower closed 3 months ago

savetheclocktower commented 3 months ago

…to work around incompatible version of libiconv bundled with newer versions of XCode.

For whatever reason, macOS v13 and greater have a version of libiconv with API incompatibilities with what superstring expects. The fix is to use Homebrew's version of libiconv and specify the library path via LDFLAGS and CPPFLAGS (though it's possible we only need the former).

It's nearly certain that we'll eventually need this fix for building Intel Mac binaries as well. I think it's just that CirrusCI forced us off of macOS 12 before GitHub did.

DeeDeeG commented 3 months ago

Context, in case anyone is trying to look this stuff up...

This forum post was somewhat helpful to me when researching this problem: https://discuss.cocos2d-x.org/t/latest-xcode-failing-with-iconv-close/59507/16. Some comments in there explain about there being a changed iconv.h header with breaking changes introduced in more-recent XCode versions (15+) (which in turn appear to be associated with newer macOS versions, macOS 13+).

There was somewhat extensive discussion on our Discord trying to work this out, a lot of angles were tried and discussed. Starting around here: https://discord.com/channels/992103415163396136/992109539346370661/1255939168866140284

(And some prior discussions, but this is around where the working workaround was figured out. Although it turned out a lot simpler than all that, so most of this isn't super helpful to review, maybe. But all this was worked through already, feels right to document what was learned.)