From 2da33a57a617d2dd8a86f1e8c366234ec6c616ec Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Wed, 2 Aug 2023 17:08:40 +0200 Subject: [PATCH] Fix missing include directory making hsc2hs fail --- haskell/ghc_bindist.bzl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/haskell/ghc_bindist.bzl b/haskell/ghc_bindist.bzl index 4a1190d703..876668335b 100644 --- a/haskell/ghc_bindist.bzl +++ b/haskell/ghc_bindist.bzl @@ -164,6 +164,15 @@ include Makefile""") working_directory = unpack_dir, ) + unpack_include_dir = ctx.path(paths.join(unpack_dir, "include")) + bindist_include_dir = ctx.path(paths.join(str(bindist_dir), "include")) + + # if the `make install` step above did not create the `include` directory, symlink it + # to the `include` directory when it exists in the distribution + # see https://gitlab.haskell.org/ghc/ghc/-/issues/23769 + if unpack_include_dir.exists and not bindist_include_dir.exists: + ctx.symlink(unpack_include, bindist_include) + if not is_hadrian_dist: ctx.file(paths.join(unpack_dir, "patch_bins"), executable = True, content = r"""#!/usr/bin/env bash find bin -type f -print0 | xargs -0 \