Skip to content

Commit

Permalink
pkgname adjustment avoiding --. (#51)
Browse files Browse the repository at this point in the history
with --, ghc-pkg will complain. That happens if the package is located at the top-level directory in the previous name generation, so it is fixed.
  • Loading branch information
wavewave authored Oct 30, 2024
1 parent de61634 commit e588c99
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion haskell/haskell.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,13 @@ def haskell_library_impl(ctx: AnalysisContext) -> list[Provider]:
indexing_tsets = {}
sub_targets = {}

libname = repr(ctx.label.path).replace("//", "_").replace("/", "_") + "_" + ctx.label.name
libprefix = repr(ctx.label.path).replace("//", "_").replace("/", "_")

# avoid consecutive "--" in package name, which is not allowed by ghc-pkg.
if libprefix[-1] == '_':
libname = libprefix + ctx.label.name
else:
libname = libprefix + "_" + ctx.label.name
pkgname = libname.replace("_", "-")

md_file = target_metadata(
Expand Down

0 comments on commit e588c99

Please sign in to comment.