Skip to content
This repository was archived by the owner on Aug 3, 2024. It is now read-only.
This repository was archived by the owner on Aug 3, 2024. It is now read-only.

Hyperlinked sources as generated by the Nix toolchain prepend ../ in absolute paths #1481

Closed
@lf-

Description

@lf-

Sample bit of bad source from the Persistent Database.Persist.TH hyperlinked docs generated by haddock 2.25.1:

<span class="annot"><span class="annottext">Exp -&gt; Stmt
</span><a href="../file:///nix/store/3bwbsy0llxxn1pixx3ll02alln56ivxy-ghc-9.0.2-doc/share/doc/ghc/html/libraries/template-haskell-2.17.0.0/src" class=""><span class="hs-identifier hs-var">NoBindS</span></a></span>

It's also the case in other packages such as aeson linking to functions in packages included with ghc. I don't know/remember if it affects links to packages sourced from hackage.

I am guessing that the following code, or code near it, is the cause of the leading ../:

Just SrcLocal -> Html.anchor content !
[ Html.href $ hypSrcModuleUrl' moduleName ]
Just (SrcExternal path) -> Html.anchor content !
[ Html.href $ spliceURL' Nothing (Just moduleName) Nothing Nothing (".." </> path) ]
Nothing -> content

However, setting up a development environment such that I can test it with the Nix builder is running into some bugs in nixpkgs, so I can't proceed any further on figuring this out myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions