@@ -52,6 +52,7 @@ def package(
5252 other_modules ,
5353 my_pkg_id ,
5454 has_hs_library ,
55+ has_iface = True ,
5556 empty_libs_dir = "" ):
5657 """Create GHC package using ghc-pkg.
5758
@@ -65,9 +66,9 @@ def package(
6566 other_modules: List of hidden modules.
6667 my_pkg_id: Package id object for this package.
6768 has_hs_library: Whether hs-libraries should be created.
68- empty_libs_dir: Directory name where the empty library should be.
69- If empty, this is assumed to be a package description
70- for a real library. See Note [Empty Libraries] in haskell_impl.bzl.
69+ has_iface: Whether the import-dirs field should be populated .
70+ empty_libs_dir: Directory name where the empty library should be.
71+ If empty, this is assumed to be a package description for a real library. See Note [Empty Libraries] in haskell_impl.bzl.
7172
7273 Returns:
7374 (File, File): GHC package conf file, GHC package cache file
@@ -98,7 +99,7 @@ def package(
9899 "key" : pkg_id .to_string (my_pkg_id ),
99100 "exposed" : "True" ,
100101 "hidden-modules" : other_modules ,
101- "import-dirs" : [import_dir ],
102+ "import-dirs" : [import_dir ] if has_iface else [] ,
102103 "library-dirs" : [pkgroot_lib_path ] + extra_lib_dirs ,
103104 "dynamic-library-dirs" : [pkgroot_lib_path ] + extra_dynamic_lib_dirs ,
104105 "extra-libraries" : extra_libs ,
0 commit comments