Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Haddock links to types in other packages are broken #1231

Closed
massysett opened this issue Oct 25, 2015 · 11 comments
Closed

Haddock links to types in other packages are broken #1231

massysett opened this issue Oct 25, 2015 · 11 comments
Assignees
Milestone

Comments

@massysett
Copy link
Contributor

When I build Haddocks, the links to types from other packages are broken.

Steps to replicate:

  1. wget https://github.com/massysett/penny/archive/stack-haddock-bug.tar.gz
  2. tar xf stack-haddock-bug.tar.gz
  3. cd penny-stack-haddock-bug
  4. ./buildprep
  5. cd package
  6. stack build --haddock --haddock-deps
  7. open .stack-work/dist/x86_64-osx/Cabal-1.22.4.0/doc/html/penny/index.html
  8. Click on "Penny.Commodity", then "Text"

I get a 404. Links work to other types in the same package, but all links to types in other packages are broken. I believe this used to work with older versions of stack.

Output from stack --version:

Version 0.1.6.0, Git revision e22271f (2313 commits) x86_64

@snoyberg
Copy link
Contributor

I think I saw that this was just fixed on master. Can you try upgrading and
see if the behavior is corrected?

On Sun, Oct 25, 2015 at 6:37 PM, Omari Norman notifications@github.com
wrote:

When I build Haddock, the links to types from other packages are broken.

Steps to replicate:

wget
https://github.com/massysett/penny/archive/stack-haddock-bug.tar.gz
2.

cd penny-stack-haddock-bug
3.

./buildprep
4.

cd package
5.

stack build --haddock --haddock-deps
6.

open
.stack-work/dist/x86_64-osx/Cabal-1.22.4.0/doc/html/penny/index.html
7.

Click on "Penny.Commodity", then "Text"

I get a 404. Links work to other types in the same package, but all links
to types in other packages are broken. I believe this used to work with
older versions of stack.

Output from stack --version:

Version 0.1.6.0, Git revision e22271f
e22271f
(2313 commits) x86_64


Reply to this email directly or view it on GitHub
#1231.

@massysett
Copy link
Contributor Author

Unfortunately I'm getting the same behavior on master. Output from stack --version:

Version 0.1.7.0, Git revision b6c5233 (2413 commits) x86_64

@massysett
Copy link
Contributor Author

After looking at issue #1105 I see a few things that aren't working:

  1. The Haddock HTML links to other packages in the package's .stack-work/dist/x86_64-osx/Cabal-1.22.4.0/doc directory are still pointing at the .stack-work directory, when they need to be pointing at the .stack/snapshots directory.
  2. The Haddock index.html in my ~/.stack/snapshots/x86_64-osx/nightly-2015-09-21/7.10.2/doc directory has no links to the Data.Text modules or to many other modules that are part of that snapshot. It appears there are no links to packages that were originally installed as part of other snapshots and that are being linked to from this snapshot.

@massysett
Copy link
Contributor Author

Because this bug seems to depend on what other snapshots are installed, it may not replicate on different systems.

@borsboom borsboom added this to the P1: Must milestone Oct 26, 2015
@borsboom borsboom self-assigned this Oct 26, 2015
@borsboom
Copy link
Contributor

borsboom commented Nov 8, 2015

@massysett: I haven't been able to reproduce your exact issue, but in the process of trying I did come across other problems with haddocks for packages that were copied from another snapshot. I've overhauled the way haddocks for dependencies are found and then put where they belong, and I don't think the issue you're describing should happen anymore. Can you try the latest master, and close this issue if it is resolved for you?

@massysett said:

The Haddock HTML links to other packages in the package's .stack-work/dist/x86_64-osx/Cabal-1.22.4.0/doc directory are still pointing at the .stack-work directory, when they need to be pointing at the .stack/snapshots directory.

This is actually expected. All links in the HTML are relative to make it easy to copy the haddocks elsewhere (e.g. to a web server) and have all the inter-package links continue to work. What was broken is that the haddocks for dependencies were not copied to .stack-work/dist/x86_64-osx/Cabal-1.22.4.0/doc properly.

@massysett
Copy link
Contributor Author

After doing stack build --haddock --haddock-deps I have only the Haddocks for my project in .stack-work/dist/x86_64-osx/Cabal-1.22.4.0/doc. None of the other dependencies are in there. Links to other packages in the Haddocks for my project are broken; I've got a link to Text that points to something in a Turtle directory in .stack-work. My index.html in /Users/massysett/unix/penny/.stack-work/install/x86_64-osx/nightly-2015-11-08/7.10.2/doc/all/index.html also is not fully populated with all packages. This is with stack from Git 7019ed3.

I made a tarball of my project directory with the Haddocks and put it here:

https://drive.google.com/file/d/0B2jkntipVFPZOEZ5clQ5S2tOdFk/view?usp=sharing

I will try nuking my ~/.stack directory and trying again.

@massysett
Copy link
Contributor Author

Nuking the ~/.stack directory and rerunning stack build --haddock --haddock-deps improves the quality of /Users/massysett/unix/penny/.stack-work/install/x86_64-osx/nightly-2015-11-08/7.10.2/doc/all/index.html but none of the hyperlinks to types to other packages in .stack-work/dist/x86_64-osx/Cabal-1.22.4.0/doc/html/penny/index.html are working.

@massysett
Copy link
Contributor Author

I'm on Mac OS X El Capitan if that makes any difference.

@borsboom
Copy link
Contributor

Based on what I see in your tarball, this looks like the same problem reported in #1317. When I run stack haddock in there, the files end up in the right places (I'm on Yosemite).

@borsboom
Copy link
Contributor

I've pushed a fix for #1317. Can you try the latest master and close this
issue if that fixes it?

On Sun, Nov 8, 2015 at 8:00 PM Omari Norman notifications@github.com
wrote:

I'm on Mac OS X El Capitan if that makes any difference.


Reply to this email directly or view it on GitHub
#1231 (comment)
.

@massysett
Copy link
Contributor Author

It's working great with the latest master, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants