From b5e1fea9676e5096fc955dc3dd494dd19adef3e0 Mon Sep 17 00:00:00 2001 From: Andreas Herrmann Date: Thu, 5 Mar 2020 18:13:03 +0100 Subject: [PATCH] Filter for haskell_binary|library|test These are the only kinds of targets that produce the `compile_info_output_groups` that `hrepl` requires. This is to avoid errors if non-Haskell targets are picked up as intermediate dependencies between targets specified on the command-line, e.g. through `data` dependencies. Additionally, this enables users to call `hrepl` on wild-card targets. E.g. in the `rules_haskell` repository ``` hrepl //tests/binary-with-lib:all ``` Now no longer fails on with an error of the form ``` hrepl: .../tests/binary-with-lib/binary-with-lib@repl.HaskellCompile.pb: openBinaryFile: does not exist (No such file or directory) ``` --- hrepl/Repl.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/hrepl/Repl.hs b/hrepl/Repl.hs index 9c40d61..ebef61d 100644 --- a/hrepl/Repl.hs +++ b/hrepl/Repl.hs @@ -79,6 +79,7 @@ getAllIntermediateTargets bazelOpts interpretDeps targetLabels = bazelQuery bazelOpts queryAllPaths where queryAllPaths = + Q.kind "\"haskell_binary|haskell_library|haskell_test\"" $ let targetQueries = map Q.labelToQuery targetLabels in Q.letIn ("ts", Q.union targetQueries) $ Q.letIn ("tds", Q.var "ts"