-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
stack: update to 2.13.1, enable arm64 #20722
Conversation
Notifying maintainers: |
Seems the libiconv problem still persists... |
@i0ntempest Any way to make progress on this? |
See #19317 and the upstream ticket in it. Until this is resolved I can’t move forward. I could |
Did you try @kencu's suggestion of overriding the |
I believe he's talking about overriding the path for the one component of the temporary compiler, not the whole port. I can't figure out how to do that unfortunately. |
libiconv is a big pain in the keester, being loose there in ${prefix} and therefore being opportunistically found by every single build in macports. I found a way to force /usr/lib/libiconv.dylib to be loaded ahead of the one in ${prefix} -- nothing to do with pkgconfig -- by using a link line sent to the compiler. I'd have to find the PR where I sorted this out, a ghc PR I think, last year or the year before, but it went something like this:
but that was not exactly it I think. |
oh, it was like this, for stack: build.args-append --ghc-options -optl=-Wl,/usr/lib/libiconv.dylib the thing about pkgconfig was trying to see what was bringing in the -L${prefix}/lib in the first place, and I though it was zlib through it's pkgconfig file:
|
well, that is not presently working:
I think I previously found a way beyond this before, but I can't find it just now... |
This works to force the system one to be found ahead of the one in ${prefix}/lib:
|
Ok, well here is a workaround to get it installed:
I'm not going to brag about it, but it works around macports' libiconv issues.
You can't just remove pkgconfig or the pkgconfig zlib file as the build errors. One way this could be done in the Portfile is to copy the zlib pkgconfig file somewhere, reinplace /opt/local with /usr and then direct macports' pkgconfig to look in that new directory first for pkgconfig files. It should find the altered one, and then the build would succeed. Pretty? No it is not. |
It is tidier to include the modified zlib.pc file in a folder inside the filesdir, and direct the build to use that. This works (but might break some build with legacysupport, etc, on old systems):
|
@kencu Thank you so much for helping with this! It's very much appreciated! What do you think the right next step should be? |
Given the inelegance of this fix, nobody is going to be very happy about it...as far as I can see, solutions would appear to be:
So whoever commits this zlib.pc fix, if it is committed, can expect a lot of questions about it, as it is very nonstandard. |
Oh, and this zlib.pc sterilization fix might completely break the use of legacysupport... someone would need to test that. |
From my understanding this is at its root a mismatch between the included iconv.h and the linked libiconv dylib. So apart from a bunch of ports depend on libiconv, is there anything preventing us from |
Many (nearly 1000) ports depend on libiconv. The CI fails here because at least one of them pulled in libiconv. So that might be hard in practice. pkgconfig, needed for the build, depends on libiconv, for example. |
because macports' libiconv is free in the ${prefix}, it is picked up opportunistically by the build of ghc. macports version of libiconv is different than the system version of libiconv. The bootstrap ghc compiler is built against the system libiconv, and so requires linking against that version. during the build of stack, pkg-config calls for the zlib.pc. In macports, the zlib.pc file brings in flags that link against the libraries in ${prefix}/lib, where libiconv is then found. to get around this, bring in a modified zlib.pc that uses only system paths. This forces the use of and link against the system zlib, and prevents libiconv in the ${prefix} from being opportunistically linked.
well, this builds for me, and currently seems to be our only path forward, so I'll push it to this branch and see if the CI system likes it as much as my system does. |
worked on all three systems.... what do you think? Hopelessly broken otherwise, I believe. |
done. now I own the headache, it seems, at least fornow. |
Thanks. Does seem to be the only way tho. |
IMHO, the fact that the decision to use a non-system Perhaps, after 20 years it's time for MacPorts to reconsider. |
Description
Type(s)
Tested on
macOS x.y
Xcode x.y / Command Line Tools x.y.z
Verification
Have you
port lint --nitpick
?sudo port test
?sudo port -vst install
?