bazel-runfiles-0.7.0.1: Locate Bazel runfiles location

Safe HaskellSafe
LanguageHaskell2010

Bazel.Runfiles

Description

This module enables finding data dependencies ("runfiles") of Haskell binaries at runtime.

For more information, see: https://github.com/bazelbuild/bazel/issues/4460

Note: this does not currently support the RUNFILES_MANIFEST environmental variable. However, that's only necessary on Windows, which rules_haskell doesn't support yet.

Additionally, this is not yet supported by the REPL.

Synopsis

Documentation

data Runfiles Source #

A path to a directory tree containing runfiles for the given

Instances
Show Runfiles Source # 
Instance details

Defined in Bazel.Runfiles

create :: IO Runfiles Source #

Locate the runfiles directory for the current binary.

This behaves according to the specification in: https://docs.google.com/document/d/e/2PACX-1vSDIrFnFvEYhKsCMdGdD40wZRBX3m3aZ5HhVj4CtHPmiXKDCxioTUbYsDydjKtFDAzER5eg7OjJWs3V/pub

Note: it does not currently support the RUNFILES_MANIFEST environmental variable. However, that's only necessary on Windows, which rules_haskell doesn't support yet anyway.

rlocation :: Runfiles -> FilePath -> FilePath Source #

Construct a path to a data dependency within the given runfiles.

For example: rlocation "myworkspacemypackagemyfile.txt"

env :: Runfiles -> [(String, String)] Source #

Set environmental variables for locating the given runfiles directory.

Note that Bazel will set these automatically when it runs tests (bazel test). However, it will not automatically set them during "bazel run"; thus, non-test binaries should set the environment manually for processes that they call.