I am trying to setup my custom build system for TensorFlow using Bazel. I need to create a temporary file during the configure step that I will use as a cache during the building step. I was able to create it in my .bzl file with:
repository_ctx.file(filename)
And after a configure I can see that it inside the folder:
$HOME/.cache/bazel/_bazel_$USERNAME/%MD5%/external/%repository_name%
where repository_name is actually repository_ctx.name
But I can't access to this path from my .tpl script during build time. I wanted to send it from the .bzl script via the substitutions of repository_ctx.template
but even here I haven't found how to find this path!
It doesn't look like I can access this folder using the symbolic links like bazel-out or bazel-genfiles (which sounds very promising but is not...). I also wasn't able to create the file outside of this folder.
It's a very simple problem and I just cannot believe that there is no other way than to hardcode the path or to find
it...