Skip to content

Commit

Permalink
Fix the Haskell indexer again
Browse files Browse the repository at this point in the history
Summary:
Now we switched Glean to GHC 9.2.4, we have to override the GHC
version to build the Haskell indexer so we can continue to index with
8.8.3.

Reviewed By: donsbot

Differential Revision: D62580324

fbshipit-source-id: 686d0a5ea9b4a94499cbdad7639fc9ff091ae744
  • Loading branch information
Simon Marlow authored and facebook-github-bot committed Sep 13, 2024
1 parent e32da7c commit 7c49b3e
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions glean/lang/haskell/index.bxl
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
load("//common/hs/index:rules.bzl", "haskell_index_rule")

def _impl(ctx):
hie_indexer = ctx.unconfigured_sub_targets("fbcode//glean/lang/haskell:indexer")
bxl_actions = ctx.bxl_actions(exec_deps = [hie_indexer])
bxl_actions = ctx.bxl_actions()
action_factory = bxl_actions.actions

# TODO: have a separate indexer for each compiler version, and index targets using
# the correct one. Probably needs a provider or an attribute to tell us which
# compiler to use.
ctargets = ctx.configured_targets(
ctx.cli_args.targets,
modifiers = ["ovr_config//third-party/ghc/constraints:8.8.3"],
Expand All @@ -31,8 +33,13 @@ def _impl(ctx):
hie_result = ctx.resolve(action_factory, hie.promise)
hie_files = (hie_result[DefaultInfo].default_outputs[0])

hie_indexer = ctx.analysis(ctx.configured_targets(
"fbcode//glean/lang/haskell:indexer",
modifiers = ["ovr_config//third-party/ghc/constraints:8.8.3"],
))

facts = action_factory.declare_output("facts")
args = cmd_args(bxl_actions.exec_deps[hie_indexer][RunInfo])
args = cmd_args(hie_indexer.providers()[RunInfo])
args.add(ctx.cli_args.backend)
args.add("--repo-path", ctx.root())
args.add("--output", facts.as_output())
Expand Down

0 comments on commit 7c49b3e

Please sign in to comment.