bazel-runfiles: Locate Bazel runfiles location

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

Please see the README on GitHub at

[Skip to Readme]
Versions [RSS] [faq],, 0.12
Dependencies base (>=4.7 && <5), bazel-runfiles, directory, filepath, transformers [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 MathieuBoespflug at 2020-04-25T19:57:55Z
Distributions LTSHaskell:0.12, NixOS:0.12, Stackage:0.12
Executables bazel-runfiles-exe
Downloads 1938 total (27 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2020-04-25 [all 1 reports]


[Index] [Quick Jump]


Maintainer's Corner

For package maintainers and hackage trustees


Readme for bazel-runfiles-0.12

[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 "rules_haskell/tools/runfiles/test-data.txt")
    when (lines foo /= ["foo"]) -- ignore trailing newline
        $ error $ "Incorrect contents: got: " ++ show foo
    callProcess (Runfiles.rlocation r "rules_haskell/tools/runfiles/bin") []