bazel-runfiles: Locate Bazel runfiles location

[ apache, build-tool, library, program ] [ Propose Tags ]

Please see the README on GitHub at

[Skip to Readme]
Versions [faq],
Dependencies base (>=4.7 && <5), bazel-runfiles, directory, filepath [details]
License Apache-2.0
Copyright 2018 Tweag I/O Limited
Author Tweag I/O Limited
Category Build Tool
Home page
Bug tracker
Source repo head: git clone
Uploaded by shmish111 at Fri Nov 2 11:53:03 UTC 2018
Distributions LTSHaskell:, NixOS:, Stackage:
Executables bazel-runfiles-exe
Downloads 147 total (60 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2018-11-02 [all 1 reports]


[Index] [Quick Jump]


Maintainer's Corner

For package maintainers and hackage trustees

Readme for bazel-runfiles-

[back to package description]

Bazel Runfiles

This is a small utility to enable discovery of the Bazel runfiles location. This is useful in tests for example.

module Main (main) where

import qualified Bazel.Runfiles as Runfiles
import Control.Monad (when)
import System.Process (callProcess)

main :: IO ()
main = do
    r <- Runfiles.create
    foo <- readFile (Runfiles.rlocation r "io_tweag_rules_haskell/tools/runfiles/test-data.txt")
    when (lines foo /= ["foo"]) -- ignore trailing newline
        $ error $ "Incorrect contents: got: " ++ show foo
    callProcess (Runfiles.rlocation r "io_tweag_rules_haskell/tools/runfiles/bin") []