How to solve ghc-stage2: mkTextEncoding: invalid argument (Invalid argument) issue.

Karel Gardas karel.gardas at centrum.cz
Wed Sep 16 10:06:38 EDT 2009


Thanks to Christian note I solved the issue. Also thanks to Matthias'
advice I've been able to configure ghc to use GNU iconv in /usr/local,
but the result was still the same. I later used Christian advice to
force ghc not to use /usr/local's iconv and this really configured
correctly (like sparky's: checking for library containing iconv... none
required) and now finally my buildbot is working even for head.

Note the provided /usr/local iconv is probably from package provided by
sunfreeware.com and is there from the old SXDE 1/08 installation. Now
I'm using OpenSolaris 2009.06 and trying to get rid of such additions
which are no longer needed.

Thanks for all the help provided!
Karel

Christian Maeder wrote:
> I've experienced a similar problem under i386 solaris, see
> http://www.haskell.org/pipermail/glasgow-haskell-users/2009-June/017376.html
> 
> The problem seems to be the file /usr/local/include/iconv.h without a
> corresponding library.
> 
> HTH Christian
> 
> Karel Gardas wrote:
>> Before going to trace anything I've compared sparky and my setup and it
>> seems I've had forgotten libiconv library in /usr/local/lib and
>> LD_LIBRARY_PATH contained this lib. So I've modified LD_LIBRARY_PATH to
>> exclude /usr/local/lib and now surprisingly base configure fails with:
>>
>> checking for library containing iconv... no
>> configure: error: iconv is required on non-Windows platforms
>> make[1]: *** [libraries/base/dist-install/package-data.mk] Error 1
>> make: *** [all] Error 2
>>
>> see:
>> http://darcs.haskell.org/buildbot/all/builders/kgardas%20head/builds/205/steps/compile/logs/stdio
>>
>> When I've seen the code it's not so surprising that it fails in this
>> way, what's in fact surprising to me is that sparky passes belong this
>> point:
>>
>> checking for library containing iconv... none required
>> configure: creating ./config.status
>> config.status: creating base.buildinfo
>> config.status: creating include/HsBaseConfig.h
>> [...]
>>
>> See:
>> http://darcs.haskell.org/buildbot/head/builders/sparky%20head/builds/91/steps/compile/logs/stdio
>>
>> I'm sorry for starting this #91 build on sparky, but I'd like verify
>> that it does not build older source-code than my buildbot.
>>
>> So now, the question is: is GNU iconv really required or if it's not,
>> how to make my buildbot ignoring it as sparky's buldbot seems to be doing?
>>
>> Thanks,
>> Karel
>>
>> Duncan Coutts wrote:
>>> Dig into base/GHC/IO/Encoding/Iconv.hs mkTextEncoding function where it
>>> calls iconv_open, see what it's being called with.
>>>
>>> In particular check if HAVE_LANGINFO_H is getting defined. If it's not
>>> then the code assumes GNU iconv.
>>>
>>>> PS: for reference, please have a look at
>>>> http://darcs.haskell.org/buildbot/all/builders/kgardas%20head
>>> See also the
>>>
>>> http://darcs.haskell.org/buildbot/head/builders/sparky%20head
>>>
>>> Which is running Solaris 10 on sparc and seems to be working fine.
>>>
>>> Duncan
>>>
>>>
>>>
> 
> 



More information about the Glasgow-haskell-users mailing list