Skip to content

Commit a2533f6

Browse files
committed
Work around wrong haddock-html path on Windows
See https://gitlab.haskell.org/ghc/ghc/-/issues/23476
1 parent ac05cc8 commit a2533f6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

haskell/private/pkgdb_to_bzl.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,11 @@ def hs_library_pattern(name, mode = "static", profiling = False):
134134
# generate the database entry even if no haddock was generated.
135135
resolved_haddock_html = resolve(pkg.haddock_html, pkgroot)
136136

137+
if not os.path.exists(resolved_haddock_html):
138+
# try to resolve relative to the package.conf.d dir
139+
# see https://gitlab.haskell.org/ghc/ghc/-/issues/23476
140+
resolved_haddock_html = resolve(pkg.haddock_html, package_conf_dir)
141+
137142
if os.path.exists(resolved_haddock_html):
138143
haddock_html = path_to_label(pkg.haddock_html, pkgroot)
139144
if not haddock_html:
@@ -146,6 +151,11 @@ def hs_library_pattern(name, mode = "static", profiling = False):
146151
for interface_path in pkg.haddock_interfaces:
147152
resolved_path = resolve(interface_path, pkgroot).replace('\\', '/')
148153

154+
if not os.path.exists(resolved_path):
155+
# try to resolve relative to the package.conf.d dir
156+
# see https://gitlab.haskell.org/ghc/ghc/-/issues/23476
157+
resolved_path = resolve(interface_path, package_conf_dir)
158+
149159
# We check if the file exists because cabal will unconditionally
150160
# generate the database entry even if no haddock was generated.
151161
if not os.path.exists(resolved_path): continue

0 commit comments

Comments
 (0)