Skip to content

Commit 2c8ba56

Browse files
committed
Ignore non-existent directories running ghc-pkg
When creating a merged package database of dependencies (only done on Windows), packages are checked for validity. This includes empty packages such as bytestring-builder which would fail: ``` bytestring-builder-0.10.8.2.0: import-dirs: C:\_bzl\ptbwskyc\execroot\rules_haskell_examples\bazel-out\x64_windows-fastbuild\bin\external\stackage/externalZSstackageZSbytestring-builder/_iface doesn't exist or isn't a directory (use --force to override) ```
1 parent efb2450 commit 2c8ba56

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

haskell/private/cabal_wrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ def distdir_prefix():
245245
for db in deps_package_databases:
246246
try:
247247
ps = subprocess.Popen([ghc_pkg, "dump", "--expand-pkgroot", "-f", os.path.dirname(os.path.join(execroot,db))], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
248-
subprocess.check_output([ghc_pkg, "update", "-f", deps_package_db, "-"], stdin=ps.stdout, stderr=subprocess.PIPE)
248+
subprocess.check_output([ghc_pkg, "update", "--force", "-f", deps_package_db, "-"], stdin=ps.stdout, stderr=subprocess.PIPE)
249249
ps.wait()
250250
except subprocess.CalledProcessError as err:
251251
sys.stdout.buffer.write(err.stdout)

0 commit comments

Comments
 (0)