fpco / inline-c

284 stars 51 forks source link

Don't link to libstdc++ on darwin #145

Closed twesterhout closed 1 year ago

twesterhout commented 1 year ago

I believe that on OS X, one is expected to use libc++ instead of libstdc++ as the C++ standard library implementation.

roberth commented 1 year ago

This seems to be the state of the art: https://github.com/haskell/text/pull/455/files I don't think we need that level of complexity, as GHC 9.4 basically fixes the problem for us with the new pseudo package, but feel free to keep your new logic as a fallback if you need that, ie for <9.4.

bitonic commented 1 year ago

I have no opinion (nor a great way to test) this. If you guys have a consensus on what to do, I'll just do that.

twesterhout commented 1 year ago

@roberth thanks for the pointer, I didn't know about system-cxx-std-lib. Shall I adapt the PR to use it on GHC 9.4 and onwards and have the branch for older versions?

roberth commented 1 year ago

@twesterhout sounds good

twesterhout commented 1 year ago

Sorry for the delay. Tested locally on Linux on GHC 9.2 and 9.6, and both cases seem to compile and pass the tests.

bitonic commented 1 year ago

Uploaded (0.5.0.1)

domenkozar commented 1 year ago

https://hydra.nixos.org/build/230964714/nixlog/1 it fails on darwin

bitonic commented 1 year ago

BTW, I'd be happy to give merge/hackage permissions to @roberth or @junjihashimoto since I'm mostly rubber stamping changes I don't even really test by now, so things might go a bit quicker that way.

junjihashimoto commented 1 year ago

@bitonic Hi, it is also helpful to get permissions for me. I started using darwin environment, so I can debug the above error.

junjihashimoto commented 1 year ago

@domenkozar https://hydra.nixos.org/build/231020800 passes. Do you fix it on darwin?

domenkozar commented 1 year ago

We applied a patch that reverses this PR.

roberth commented 1 year ago

It appears that this error has been reproduced before:

And from the issue I gather that this ghc patch would fix the problem

It refers to ghci, which I presume is also infrastructure that's used by TemplateHaskell underneath.

junjihashimoto commented 1 year ago

https://github.com/fpco/inline-c/commit/e8dc553b13bb847409fdced649a6a863323cff8a.patch The reverse patch removes build-depends: system-cxx-std-lib == 1.0 and replaces extra-libraries: stdc++ with extra-libraries: c++.

bitonic commented 1 year ago

Actually, I noticed we had already added @roberth as a collaborator -- so I don't think you need to me to merge PRs or similar. I think @junjihashimoto can also be added (only @snoyberg or somebody else at FPCo can do that though).

snoyberg commented 1 year ago

@bitonic I've made you a maintainer so you can add additional collaborators.