bazel-runfiles: Locate Bazel runfiles location

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

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.7.0.0, 0.7.0.1, 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
Maintainer m@tweag.io
Category Build Tool
Home page https://github.com/tweag/rules_haskell#readme
Bug tracker https://github.com/tweag/rules_haskell/issues
Source repo head: git clone https://github.com/tweag/rules_haskell
Uploaded by MathieuBoespflug at 2020-04-25T19:57:55Z
Distributions LTSHaskell:0.12, NixOS:0.12, Stackage:0.12
Executables bazel-runfiles-exe
Downloads 2554 total (20 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2020-04-25 [all 1 reports]

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") []