Open rickeylev opened 3 months ago
cc @hvadehra for triage
I'd be happy to review a PR that implements this.
It's been a while so my memory is a little hazy on the details, but some potential things to watch out for are:
aquery
print for such an action?
Description of the feature request:
Allow TemplateDict to accept File objects and have it expand them to the content of the file.
This idea comes from wanting to concat files together in an action. Normally this requires
run_shell
, which poses multi-platform complications.So instead of this:
One could do this:
Similarly, this would come in handy for a two-stage bootstrap I need to create: stage one is some shell code that computes some values to feed into the second stage python file. Basically a template that looks like
Having it all in one file is sort of annoying. Being able to split it in two would be handy.
Which category does this issue belong to?
Rules API
What underlying problem are you trying to solve with this feature?
Being able to use file content in template actions
Which operating system are you running Bazel on?
linux
What is the output of
bazel info release
?7.x
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse HEAD
?No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
No response