Skip to content

Commit

Permalink
Simplify determining the root module
Browse files Browse the repository at this point in the history
It is always the first one.
  • Loading branch information
avdv committed Sep 1, 2023
1 parent 818c288 commit 8a5350e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions extensions/ghc_version.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ load(
)

def _ghc_default_version_impl(mctx):
root_module = [ module.name for module in mctx.modules if module.is_root ]
root_module = mctx.modules[0].name

if root_module and root_module[0] in ['rules_haskell', 'rules_haskell_tests']:
if root_module in ['rules_haskell', 'rules_haskell_tests']:
_ghc_version(name = "rules_haskell_ghc_version")
else:
_ghc_default_version(name = "rules_haskell_ghc_version")
Expand Down

0 comments on commit 8a5350e

Please sign in to comment.