Describe the bug
I’m trying to build some source that accesses filesystem locations and generates code based on these files. (Gnarly, I know.) I ran into #1246, which interfered with our approach up until now (using cabal’s data-files), so I thought I’d try the haskell_library function’s data field, accessing the paths with the bazel-runfiles package. Unfortunately, though this works inside REPLs and executables, it doesn’t appear to work from Template Haskell splices. The call to getExecutableName here returns the path to the relevant ghc executable, which interferes when lookup up runfiles and their manifests.
To Reproduce
Call Runfiles.rlocation from a Template Haskell splice and observe the resulting error message.
Expected behavior
A clear and concise description of what you expected to happen.
Environment
- OS name + version: macOS catalina
- Bazel version: 3.10
- Version of the rules: 0.12
Additional context
I’m probably going to work around this with file-embed for the time being, but I figured I’d file it for posterity.
Describe the bug
I’m trying to build some source that accesses filesystem locations and generates code based on these files. (Gnarly, I know.) I ran into #1246, which interfered with our approach up until now (using cabal’s
data-files), so I thought I’d try thehaskell_libraryfunction’sdatafield, accessing the paths with thebazel-runfilespackage. Unfortunately, though this works inside REPLs and executables, it doesn’t appear to work from Template Haskell splices. The call togetExecutableNamehere returns the path to the relevantghcexecutable, which interferes when lookup up runfiles and their manifests.To Reproduce
Call
Runfiles.rlocationfrom a Template Haskell splice and observe the resulting error message.Expected behavior
A clear and concise description of what you expected to happen.
Environment
Additional context
I’m probably going to work around this with
file-embedfor the time being, but I figured I’d file it for posterity.