Skip to content

Commit

Permalink
Work around wrong haddock-html path on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
avdv committed Dec 4, 2023
1 parent c7246da commit f307eb7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions haskell/private/pkgdb_to_bzl.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ def hs_library_pattern(name, mode = "static", profiling = False):
# generate the database entry even if no haddock was generated.
resolved_haddock_html = resolve(pkg.haddock_html, pkgroot)

if not os.path.exists(resolved_haddock_html):
# try to resolve relative to the package.conf.d dir
# see https://gitlab.haskell.org/ghc/ghc/-/issues/23476
resolved_haddock_html = resolve(pkg.haddock_html, package_conf_dir)

if os.path.exists(resolved_haddock_html):
haddock_html = path_to_label(pkg.haddock_html, pkgroot)
if not haddock_html:
Expand All @@ -146,6 +151,11 @@ def hs_library_pattern(name, mode = "static", profiling = False):
for interface_path in pkg.haddock_interfaces:
resolved_path = resolve(interface_path, pkgroot).replace('\\', '/')

if not os.path.exists(resolved_path):
# try to resolve relative to the package.conf.d dir
# see https://gitlab.haskell.org/ghc/ghc/-/issues/23476
resolved_path = resolve(interface_path, package_conf_dir)

# We check if the file exists because cabal will unconditionally
# generate the database entry even if no haddock was generated.
if not os.path.exists(resolved_path): continue
Expand Down

0 comments on commit f307eb7

Please sign in to comment.