<div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif">Thank you Zubin.</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">In fact the issue has disappeared as mysteriously as it appeared.  CI is green.  I'm baffled, but disinclined to dig further!</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">Simon<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 31 May 2024 at 11:17, Zubin Duggal <<a href="mailto:zubin@well-typed.com">zubin@well-typed.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I think its the annotations on `const` that changed, not on `$`, sorry.<br>
<br>
On 24/05/31 15:38, Zubin Duggal wrote:<br>
>If my reading of the diffs is correct (which I'm not sure it is), then<br>
>it seems some identifiers in the hyperlinked source are missing type<br>
>information.<br>
><br>
>Looking at one of the changes<br>
><br>
>Diff for file "src/Classes.html":<br>
>1194c1194,1198<br>
><       ><span class="hs-identifier hs-type"<br>
>---<br>
>>      ><span class="annottext"<br>
>>      >a -&gt; b -&gt; a<br>
>>forall a b. a -&gt; b -&gt; a<br>
>></span<br>
>>      ><span class="hs-identifier hs-var"<br>
>1281c1285,1289<br>
><       ><span class="hs-identifier hs-type"<br>
>---<br>
>>      ><span class="annottext"<br>
>>      >a -&gt; b -&gt; a<br>
>>forall a b. a -&gt; b -&gt; a<br>
>></span<br>
>>      ><span class="hs-identifier hs-var"<br>
><br>
><br>
>It seems like at certain identifiers, the types a -> b -> a<br>
>and forall a b. a -> b -> a is now not being emitted in a place that<br>
>they previously were.<br>
><br>
>The html files are munged quite a bit to normalise spurious differences,<br>
>but unfortunately this means that they don't render in a browser so well.<br>
><br>
>If you have two builds of haddock (one prior to your patch, possibly<br>
>even the one from your boot ghc bindist), you can run<br>
><br>
>haddock-clean --html --hyperlinked-source utils/haddock/hypsrc-test/src/Classes.hs<br>
>haddock-your-tree --html --hyperlinked-source utils/haddock/hypsrc-test/src/Classes.hs<br>
><br>
>and then inspect/compare the rendered hyperlinked source file it<br>
>produces (for the above command it would be in `src/Classes.html`) with<br>
>your web browser.<br>
><br>
>In the case of `Classes.hs`, it seems like perhaps some annotations on<br>
>some of the `($)` operators in the following snippet are missing, and<br>
>you can find out exactly which one by hovering over each of the `$`<br>
>symbols and comparing with the output from a clean/unpatched haddock<br>
>build.<br>
><br>
>instance Plugh Either where<br>
>    plugh (Left a) _ = Right $ const a<br>
>    plugh (Right a) _ = Right $ const a<br>
>    plugh _ (Left b) = Left $ const b<br>
>    plugh _ (Right b) = Left $ const b<br>
><br>
>These annotations are produced by walking the typechecked AST and asking<br>
>for the types of each `Id` or `HsVar` etc. nodes, so anything your<br>
>patched changed regarding how the AST is constructed could be to blame.<br>
><br>
>On 24/05/31 10:41, Simon Peyton Jones wrote:<br>
>>THanks.  But the trouble is that I don't know whether to accept the change<br>
>>or not. Is it OK?  How could I tell?<br>
>><br>
>>The point of a test is to fail when one has introduced a bug.  This fails<br>
>>-- have I introduced a bug?<br>
>><br>
>>Thanks<br>
>><br>
>>S<br>
>><br>
>>On Fri, 31 May 2024 at 08:58, Zubin Duggal <<a href="mailto:zubin@well-typed.com" target="_blank">zubin@well-typed.com</a>> wrote:<br>
>><br>
>>>You run this locally exactly the same as any other test, using<br>
>>><br>
>>>hadrian/build test --only=haddockHypsrcTest<br>
>>><br>
>>>or<br>
>>><br>
>>>TEST="haddockHypsrcTest" hadrian/build test<br>
>>><br>
>>>I recommend accepting the changes by passing the `-a` option to hadrian,<br>
>>>and then looking over the changes locally using `git diff`.<br>
>>><br>
>>>The diffs reported by the test case itself can be confusing and I think<br>
>>>(not sure) that they are in reversed order to what you would normally<br>
>>>expect.<br>
>>><br>
>>>On 24/05/31 08:48, Simon Peyton Jones wrote:<br>
>>>>Dear Haddock experts<br>
>>>><br>
>>>>I'm getting a failure on !12492<br>
>>>><<a href="https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12492" rel="noreferrer" target="_blank">https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12492</a>> that I can't<br>
>>>>understand or debug.  Can someone guide me?<br>
>>>><br>
>>>>Failure is this:<br>
>>>>/builds/ghc/ghc/tmp/ghctest-2jo7oz8x/test<br>
>>>>spaces/testsuite/tests/haddock/haddock_testsuite/haddockHypsrcTest.run<br>
>>>>haddockHypsrcTest [bad exit code (2)] (normal)<br>
>>>><br>
>>>>A snip of the log is at the end of this message.<br>
>>>><br>
>>>>I want to<br>
>>>><br>
>>>>   - understand what it does<br>
>>>>   - repro it locally.<br>
>>>><br>
>>>>Trying the latter, I tried with my HEAD build and did<br>
>>>>bash$ cd testsuite/tests/haddock/haddock_testsuite<br>
>>>>bash$ make hypsrcTest<br>
>>>><br>
>>>>but that failed on almost all the tests it does, even though HEAD is<br>
>>>>presumably OK.<br>
>>>><br>
>>>>I'm  stumped.  Any ideas?  The patch only changes the type checker!<br>
>>>><br>
>>>>Thanks<br>
>>>><br>
>>>>SImion<br>
>>>><br>
>>>>This is the log from !12492<br>
>>>><br>
>>>>Wrong exit code for haddockHypsrcTest()(expected 0 , actual 2 )<br>
>>>>Stdout ( haddockHypsrcTest ):<br>
>>>>[1 of 7] Compiling Test.Haddock.Process (<br>
>>><br>
>>>>/builds/ghc/ghc/testsuite/../utils/haddock/haddock-test/src/Test/Haddock/Process.hs,<br>
>>>>Test/Haddock/Process.o )<br>
>>>>[2 of 7] Compiling Test.Haddock.Utils (<br>
>>><br>
>>>>/builds/ghc/ghc/testsuite/../utils/haddock/haddock-test/src/Test/Haddock/Utils.hs,<br>
>>>>Test/Haddock/Utils.o )<br>
>>>>[3 of 7] Compiling Test.Haddock.Config (<br>
>>><br>
>>>>/builds/ghc/ghc/testsuite/../utils/haddock/haddock-test/src/Test/Haddock/Config.hs,<br>
>>>>Test/Haddock/Config.o )<br>
>>>>[4 of 7] Compiling Test.Haddock (<br>
>>><br>
>>>>/builds/ghc/ghc/testsuite/../utils/haddock/haddock-test/src/Test/Haddock.hs,<br>
>>>>Test/Haddock.o )<br>
>>>>[5 of 7] Compiling Test.Haddock.Xhtml (<br>
>>><br>
>>>>/builds/ghc/ghc/testsuite/../utils/haddock/haddock-test/src/Test/Haddock/Xhtml.hs,<br>
>>>>Test/Haddock/Xhtml.o )<br>
>>>>[6 of 7] Compiling Main (<br>
>>>>/builds/ghc/ghc/testsuite/../utils/haddock/hypsrc-test/Main.hs, Main.o )<br>
>>>>[7 of 7] Linking hypsrc-test<br>
>>>>Haddock version 2.30.0, (c) Simon Marlow 2006<br>
>>>>Ported to use the GHC API by David Waern 2006-2008<br>
>>>>9.11.20240530<br>
>>>>Generating documentation...<br>
>>>>Testing output files...<br>
>>>>Checking "src/TemplateHaskellSplices.html"... PASS<br>
>>>>Checking "src/Bug1091.html"... PASS<br>
>>>>Checking "src/Polymorphism.html"... PASS<br>
>>>>Checking "src/UsingQuasiquotes.html"... PASS<br>
>>>>Checking "src/Records.html"... PASS<br>
>>>>Checking "src/Quasiquoter.html"... PASS<br>
>>>>Checking "src/CPP.html"... PASS<br>
>>>>Checking "src/Operators.html"... PASS<br>
>>>>Checking "src/Literals.html"... PASS<br>
>>>>Checking "src/LinkingIdentifiers.html"... PASS<br>
>>>>Checking "src/Classes.html"... FAIL<br>
>>>>Checking "src/PositionPragmas.html"... PASS<br>
>>>>Checking "src/Types.html"... PASS<br>
>>>>Checking "src/TemplateHaskellQuasiquotes.html"... PASS<br>
>>>>Checking "src/Constructors.html"... FAIL<br>
>>>>Checking "src/Identifiers.html"... FAIL<br>
>>>>Diffing failed cases...<br>
>>>>Diff for file "src/Classes.html":<br>
>>>>1194c1194,1198<br>
>>>>< ><span class="hs-identifier hs-type"<br>
>>>>---<br>
>>>>> ><span class="annottext"<br>
>>>>> >a -&gt; b -&gt; a<br>
>>>>> forall a b. a -&gt; b -&gt; a<br>
>>>>> </span<br>
>>>>> ><span class="hs-identifier hs-var"<br>
>>>>1281c1285,1289<br>
>>>>< ><span class="hs-identifier hs-type"<br>
>>>>---<br>
>>>>> ><span class="annottext"<br>
>>>>> >a -&gt; b -&gt; a<br>
>>>>> forall a b. a -&gt; b -&gt; a<br>
>>>>> </span<br>
>>>>> ><span class="hs-identifier hs-var"<br>
>>>>1368c1376,1380<br>
>>>>< ><span class="hs-identifier hs-type"<br>
>>>>---<br>
>>>>> ><span class="annottext"<br>
>>>>> >b -&gt; a -&gt; b<br>
>>>>> forall a b. a -&gt; b -&gt; a<br>
>>>>> </span<br>
>>>>> ><span class="hs-identifier hs-var"<br>
>>>>1455c1467,1471<br>
>>>>< ><span class="hs-identifier hs-type"<br>
>>>>---<br>
>>>>> ><span class="annottext"<br>
>>>>> >b -&gt; a -&gt; b<br>
>>>>> forall a b. a -&gt; b -&gt; a<br>
>>>>> </span<br>
>>>>> ><span class="hs-identifier hs-var"<br>
>>>>Diff for file "src/Constructors.html":<br>
>>>>1325c1325,1329<br>
>>>>< ><span class="hs-operator hs-type"<br>
>>>>---<br>
>>>>> ><span class="annottext"<br>
>>>>> >([Int] -&gt; Int) -&gt; (Norf -&gt; [Int]) -&gt; Norf -&gt; Int<br>
>>>>> forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c<br>
>>>>> </span<br>
>>>>> ><span class="hs-operator hs-var"<br>
>>>>Diff for file "src/Identifiers.html":<br>
>>>>1190c1190,1194<br>
>>>>< ><span class="hs-operator hs-type"<br>
>>>>---<br>
>>>>> ><span class="annottext"<br>
>>>>> >(String -&gt; IO ()) -&gt; (Int -&gt; String) -&gt; Int -&gt; IO ()<br>
>>>>> forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c<br>
>>>>> </span<br>
>>>>> ><span class="hs-operator hs-var"<br>
>>>>1216,1217c1220,1224<br>
>>>>< ><a href="Identifiers.html#foo"<br>
>>>>< ><span class="hs-identifier hs-type"<br>
>>>>---<br>
>>>>> ><span class="annottext"<br>
>>>>> >Int -&gt; Int -&gt; Int<br>
>>>>> </span<br>
>>>>> ><a href="Identifiers.html#foo"<br>
>>>>> ><span class="hs-identifier hs-var"<br>
>>>>1260c1267,1271<br>
>>>>< ><span class="hs-operator hs-type"<br>
>>>>---<br>
>>>>> ><span class="annottext"<br>
>>>>> >(String -&gt; IO ()) -&gt; (Int -&gt; String) -&gt; Int -&gt; IO ()<br>
>>>>> forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c<br>
>>>>> </span<br>
>>>>> ><span class="hs-operator hs-var"<br>
>>>>1286,1287c1297,1301<br>
>>>>< ><a href="Identifiers.html#quux"<br>
>>>>< ><span class="hs-identifier hs-type"<br>
>>>>---<br>
>>>>> ><span class="annottext"<br>
>>>>> >Int -&gt; Int<br>
>>>>> </span<br>
>>>>> ><a href="Identifiers.html#quux"<br>
>>>>> ><span class="hs-identifier hs-var"<br>
>>>>1319c1333,1337<br>
>>>>< ><span class="hs-operator hs-type"<br>
>>>>---<br>
>>>>> ><span class="annottext"<br>
>>>>> >(String -&gt; IO ()) -&gt; (Int -&gt; String) -&gt; Int -&gt; IO ()<br>
>>>>> forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c<br>
>>>>> </span<br>
>>>>> ><span class="hs-operator hs-var"<br>
>>>>1345,1346c1363,1367<br>
>>>>< ><a href="Identifiers.html#norf"<br>
>>>>< ><span class="hs-identifier hs-type"<br>
>>>>---<br>
>>>>> ><span class="annottext"<br>
>>>>> >Int -&gt; Int -&gt; Int -&gt; Int<br>
>>>>> </span<br>
>>>>> ><a href="Identifiers.html#norf"<br>
>>>>> ><span class="hs-identifier hs-var"<br>
>>>>Stderr run ( haddockHypsrcTest ):<br>
>>>>gmake: *** [Makefile:68: hypsrcTest] Error 1<br>
>>>>*** unexpected failure for haddockHypsrcTest(normal)<br>
>>><br>
>>>>_______________________________________________<br>
>>>>ghc-devs mailing list<br>
>>>><a href="mailto:ghc-devs@haskell.org" target="_blank">ghc-devs@haskell.org</a><br>
>>>><a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a><br>
>>><br>
>>><br>
</blockquote></div>