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

Broken documentation links #231

Closed
gdeest opened this issue May 2, 2018 · 0 comments · Fixed by #233
Closed

Broken documentation links #231

gdeest opened this issue May 2, 2018 · 0 comments · Fixed by #233

Comments

@gdeest
Copy link
Contributor

gdeest commented May 2, 2018

It looks like documentation links between Bazel packages are broken. I can reproduce the issue with the following setup:

./WORKSPACE:

workspace(name = "bugrepro")

rules_haskell_rev="fa789428cbc95746effc793c353cb46507580729"
http_archive(
    name = "io_tweag_rules_haskell",
    strip_prefix = "rules_haskell-{}".format(rules_haskell_rev),
    urls = ["https://github.com/tweag/rules_haskell/archive/{}.tar.gz".format(rules_haskell_rev)],
)

load("@io_tweag_rules_haskell//haskell:repositories.bzl", "haskell_repositories")
haskell_repositories()

http_archive(
  name = "io_tweag_rules_nixpkgs",
  strip_prefix = "rules_nixpkgs-0.2",
  urls = ["https://github.com/tweag/rules_nixpkgs/archive/v0.2.tar.gz"],
)

load("@io_tweag_rules_nixpkgs//nixpkgs:nixpkgs.bzl", "nixpkgs_package")

nixpkgs_package(
  name = "ghc",
  attribute_path = "haskell.compiler.ghc822",
)

register_toolchains("//:ghc")

./BUILD:

package(default_visibility = ["//visibility:public"])

load(
  "@io_tweag_rules_haskell//haskell:haskell.bzl",
  "haskell_doc",
  "haskell_toolchain",
)

haskell_toolchain(
  name = "ghc",
  version = "8.2.2",
  tools = "@ghc//:bin",
)

haskell_doc(
  name = "my-doc",
  deps = ["//libB"],
)

./libA/BUILD:

package(default_visibility = ["//visibility:public"])

load(
  "@io_tweag_rules_haskell//haskell:haskell.bzl",
  "haskell_library",
  "haskell_toolchain",
)

haskell_toolchain(
  name = "ghc",
  version = "8.2.2",
  tools = "@ghc//:bin",
)

haskell_library(
  name = "libA",
  srcs = ['LibA.hs'],
  prebuilt_dependencies = ["base"],
)

./libA/LibA.hs:

module LibA where

newtype MyFoo = MyFoo String

./libB/BUILD:

package(default_visibility = ["//visibility:public"])

load(
  "@io_tweag_rules_haskell//haskell:haskell.bzl",
  "haskell_library",
  "haskell_toolchain",
)

haskell_toolchain(
  name = "ghc",
  version = "8.2.2",
  tools = "@ghc//:bin",
)

haskell_library(
  name = "libB",
  srcs = glob(['LibB.hs']),
  prebuilt_dependencies = ["base"],
  deps = ["//libA"]
)

./libB/LibB.hs:

module LibB where

import LibA

foo :: MyFoo
foo = MyFoo "foo"

When running bazel build //..., documentation for libB is properly generated and can be opened in a web browser. However, the link to the MyFoo type is broken.

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

Successfully merging a pull request may close this issue.

1 participant