diff options
author | Vincent Ambo <tazjin@google.com> | 2019-08-15T15·11+0100 |
---|---|---|
committer | Vincent Ambo <tazjin@google.com> | 2019-08-15T15·11+0100 |
commit | 128875b501bc2989617ae553317b80faa556d752 (patch) | |
tree | 9b32d12123801179ebe900980556486ad4803482 /third_party/bazel/rules_haskell/tools/runfiles/src/Bazel/Runfiles.hs | |
parent | a20daf87265a62b494d67f86d4a5199f14394973 (diff) |
chore: Remove remaining Bazel-related files r/31
Diffstat (limited to 'third_party/bazel/rules_haskell/tools/runfiles/src/Bazel/Runfiles.hs')
-rw-r--r-- | third_party/bazel/rules_haskell/tools/runfiles/src/Bazel/Runfiles.hs | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/third_party/bazel/rules_haskell/tools/runfiles/src/Bazel/Runfiles.hs b/third_party/bazel/rules_haskell/tools/runfiles/src/Bazel/Runfiles.hs deleted file mode 100644 index 8dfb980e1801..000000000000 --- a/third_party/bazel/rules_haskell/tools/runfiles/src/Bazel/Runfiles.hs +++ /dev/null @@ -1,62 +0,0 @@ --- | 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. -module Bazel.Runfiles - ( Runfiles - , create - , rlocation - , env - ) where - -import System.Directory (doesDirectoryExist) -import System.Environment (getExecutablePath, lookupEnv) -import System.FilePath (FilePath, (</>), (<.>)) - --- | A path to a directory tree containing runfiles for the given -newtype Runfiles = Runfiles FilePath - deriving Show - --- | Construct a path to a data dependency within the given runfiles. --- --- For example: @rlocation \"myworkspace/mypackage/myfile.txt\"@ -rlocation :: Runfiles -> FilePath -> FilePath -rlocation (Runfiles f) g = f </> g - --- | 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. -env :: Runfiles -> [(String, String)] -env (Runfiles f) = [(runfilesDirEnv, f)] - -runfilesDirEnv :: String -runfilesDirEnv = "RUNFILES_DIR" - --- | 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. -create :: IO Runfiles -create = do - exeRunfilesPath <- fmap (<.> "runfiles") getExecutablePath - exeRunfilesExists <- doesDirectoryExist exeRunfilesPath - if exeRunfilesExists - then return $ Runfiles exeRunfilesPath - else do - envDir <- lookupEnv runfilesDirEnv - case envDir of - Just f -> return $ Runfiles f - Nothing -> error "Unable to locate runfiles directory" |