Skip to content

Commit

Permalink
Add use_worker attribute to Haskell toolchain
Browse files Browse the repository at this point in the history
The worker is not used by default, it needs to be enabled explicitly.
  • Loading branch information
avdv authored and tek committed Nov 7, 2024
1 parent c5f2f58 commit cc041b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions haskell/haskell.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1510,6 +1510,9 @@ def _persistent_worker(ctx: AnalysisContext) -> WorkerInfo | None:
if ctx.label.cell == "prelude":
return None

if not ctx.attrs._haskell_toolchain[HaskellToolchainInfo].use_worker:
return None

worker_target = ctx.actions.anon_target(
worker,
{
Expand Down
1 change: 1 addition & 0 deletions haskell/toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ HaskellToolchainInfo = provider(
"cache_links": provider_field(typing.Any, default = None),
"script_template_processor": provider_field(typing.Any, default = None),
"packages": provider_field(typing.Any, default = None),
"use_worker": provider_field(bool, default = False),
},
)

Expand Down

0 comments on commit cc041b6

Please sign in to comment.