From igloo at earth.li Tue Nov 28 11:50:22 2006 From: igloo at earth.li (Ian Lynagh) Date: Tue Nov 28 11:48:45 2006 Subject: [nhc-bugs] cpphs and hugs Message-ID: <20061128165022.GA9149@matrix.chaos.earth.li> Hi, With cpphs 0.7 "compiled" with hugs I get the following when trying to haddock missingh: -------------- missingh-0.16.2$ /usr/bin/cpphs -Obar.hs MissingH/Time/ParseDate.hs --noline --strip -Dlinux_BUILD_OS -Dlinux_HOST_OS -Di386_BUILD_ARCH -Di386_HOST_ARCH -D__GLASGOW_HASKELL__=606 -D__HADDOCK__ Program error: : IO.getContents: protocol error (invalid character encoding) missingh-0.16.2$ -------------- I believe this is because there is a mismatch between my locale and the encoding of the file, in particular with the \"o in Bjorn Bringert's name. I think opening the file in binary mode would fix this, but I couldn't swear to it. I tried upgrading to 1.2 to see if it is fixed, and trying to haddock missingh then gave an almighty pattern match failure. A somewhat smaller failure occurs when trying to process /dev/null: -------------- $ /tmp/cpphs/inst/bin/cpphs /dev/null Program error: pattern match failure: macroProcess ((instEq_v4051 `elem` CpphsOption_CpphsLayout) []) Bool_True (preDefine ((instEq_v4051 `elem` CpphsOption_CpphsAnsi) []) Bool_True (runCpphs_v4067 [])) (tokenise_v3906 ((instEq_v4051 `elem` CpphsOption_CpphsAnsi) []) ((instEq_v4051 `elem` CpphsOption_CpphsStrip) []) SubMode_Any) $ -------------- cpphs compiled with GHC seems fine. Thanks Ian From Malcolm.Wallace at cs.york.ac.uk Wed Nov 29 11:49:36 2006 From: Malcolm.Wallace at cs.york.ac.uk (Malcolm Wallace) Date: Wed Nov 29 11:47:58 2006 Subject: [nhc-bugs] cpphs and hugs In-Reply-To: <20061128165022.GA9149@matrix.chaos.earth.li> References: <20061128165022.GA9149@matrix.chaos.earth.li> Message-ID: <20061129164936.1fea7d83.Malcolm.Wallace@cs.york.ac.uk> Ian Lynagh wrote: > With cpphs 0.7 "compiled" with hugs I get the following when trying to > haddock missingh: > > Program error: : IO.getContents: protocol error (invalid > character encoding) missingh-0.16.2$ > -------------- > > I believe this is because there is a mismatch between my locale and > the encoding of the file, in particular with the \"o in Bjorn > Bringert's name. I think opening the file in binary mode would fix > this, but I couldn't swear to it. Hmm. cpphs doesn't do anything special with character encodings, so I would guess this is a Hugs issue maybe? I'm afraid our work firewall blocks all outgoing traffic to port 70, so I can't download MissingH to try to reproduce the error. Also, as you noticed, cpphs-0.7 is kind of old now. > I tried upgrading to 1.2 to see if it is fixed, and trying to haddock > missingh then gave an almighty pattern match failure. Is there a more accessible mirror of MissingH anywhere? > A somewhat > smaller failure occurs when trying to process /dev/null: > > -------------- > $ /tmp/cpphs/inst/bin/cpphs /dev/null > > Program error: pattern match failure: macroProcess ((instEq_v4051 > `elem` CpphsOption_CpphsLayout) []) Bool_True (preDefine > ((instEq_v4051 `elem` CpphsOption_CpphsAnsi) []) Bool_True > (runCpphs_v4067 [])) (tokenise_v3906 ((instEq_v4051 `elem` > CpphsOption_CpphsAnsi) []) ((instEq_v4051 `elem` > CpphsOption_CpphsStrip) []) SubMode_Any) $ I tried this with hugs-Sept2006 and could not reproduce the error. Mystified. Regards, Malcolm From igloo at earth.li Thu Nov 30 08:33:12 2006 From: igloo at earth.li (Ian Lynagh) Date: Thu Nov 30 08:31:30 2006 Subject: [nhc-bugs] cpphs and hugs In-Reply-To: <20061129164936.1fea7d83.Malcolm.Wallace@cs.york.ac.uk> References: <20061128165022.GA9149@matrix.chaos.earth.li> <20061129164936.1fea7d83.Malcolm.Wallace@cs.york.ac.uk> Message-ID: <20061130133312.GA21224@matrix.chaos.earth.li> On Wed, Nov 29, 2006 at 04:49:36PM +0000, Malcolm Wallace wrote: > Ian Lynagh wrote: > > > $ /tmp/cpphs/inst/bin/cpphs /dev/null > > > > Program error: pattern match failure: macroProcess ((instEq_v4051 > > `elem` CpphsOption_CpphsLayout) []) Bool_True (preDefine > > ((instEq_v4051 `elem` CpphsOption_CpphsAnsi) []) Bool_True > > (runCpphs_v4067 [])) (tokenise_v3906 ((instEq_v4051 `elem` > > CpphsOption_CpphsAnsi) []) ((instEq_v4051 `elem` > > CpphsOption_CpphsStrip) []) SubMode_Any) $ > > I tried this with hugs-Sept2006 and could not reproduce the error. > Mystified. Oops, looked like I did that in the wrong window, using an ancient, buggy hugs. Sorry about that. > > I tried upgrading to 1.2 to see if it is fixed, and trying to haddock > > missingh then gave an almighty pattern match failure. > > Is there a more accessible mirror of MissingH anywhere? Sorry, I wasn't expecting you to need it as /dev/null looked like a good first test case. Here's a smaller testcase for the original problem, with hugs September 2006 and cpphs 1.2: $ runhugs -98 Setup.hs --hugs configure --prefix=/tmp/cpphs/inst $ runhugs -98 Setup.hs build $ runhugs -98 Setup.hs install $ export LC_ALL=POSIX $ printf "Bj\xf6rn Bringert" > foo $ /tmp/cpphs/inst/bin/cpphs foo Program error: : IO.getContents: protocol error (input contains non-character data - use binary I/O for binary data) $ Thanks Ian