[MacPorts] #60477: stack @2.3.1_0: Undefined symbols: _utimensat
MacPorts
noreply at macports.org
Sat Feb 6 00:47:34 UTC 2021
#60477: stack @2.3.1_0: Undefined symbols: _utimensat
-------------------------+-------------------------------------------------
Reporter: macdeport | Owner: essandess
Type: defect | Status: assigned
Priority: Normal | Milestone:
Component: ports | Version: 2.6.2
Resolution: | Keywords: sierra elcapitan yosemite mavericks
Port: stack | mountainlion lion snowleopard leopard tiger
-------------------------+-------------------------------------------------
Comment (by Ionic):
It's tricky and almost impossible because of some bugs.
The general idea is to pass `--ghc-options
"-optc-I${prefix}/include/LegacySupport
-optl${prefix}/lib/libMacportsLegacySupport.dylib"` to the build process,
which works surprisingly well.
Sadly, turning `${configure.cflags}` and `${configure.ldflags}` into ghc
options (i.e., `-optc...` and `-optl...`) won't work, because this will
also add `-optl-L${prefix}/lib` and `-optc-I${prefix}/include`, which will
make packages within stack link against the GNU iconv implementation and
fail to find the symbols later on. Not sure why, probably because Apple's
iconv implementation is different, but that's definitely an issue to
avoid, so we'll just the library and add the `legacy-support`-related
include directory only manually.
That works... beautifully.
Up until the destroot phase, when everything blows up.
For some reason, `stack` does not pass down `--ghc-options` in the
`install` command (which is really just an alias for `build --copy-bins`).
I haven't found a way to make it do this, because I really can't wrap my
head around Haskell well enough.
That's bad enough already, but here comes #62228: `stack install` will
actually rebuild EVERYTHING a second time because it doesn't respect
`STACK_ROOT`, which is where the stack database is written to. Instead, it
seems to use `~/.stack` in a hardcoded fashion, re-download GHC and re-
build everything. Without any way to pass special GHC options.
Luckily, the workaround for that is an easy one: just define STACK_ROOT as
`${workpath}/.home/.stack` (which is really `${HOME}/.stack` as far as the
process is concerned) and this second rebuild, including its issues, will
vanish completely.
--
Ticket URL: <https://trac.macports.org/ticket/60477#comment:21>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list