Documentation: FAQ about reading files and alternatives #13300
Labels
P3
We're not considering working on this, but happy to review a PR. (No assignee)
team-Documentation
Documentation improvements that cannot be directly linked to other team labels
team-Rules-API
API for writing rules/aspects: providers, runfiles, actions, artifacts
type: documentation (cleanup)
I not-infrequently see internal questions about reading files in Starlark or (equivalently) defining targets (e.g. generating library targets or generating tests) based on (non-BUILD/bzl) files. FWICT, the Bazel docs currently don't address this directly. Thus, similar questions get asked and answered, wasting effort. Since these questions are about somewhat obscure corners of Starlark, they don't always get a swift answer. And the quality/detail of example code in the answers varies. Hence these suggestions.
open()
/file()
functions..bzl
file instead; possibly writing a Starlark rule to generate the previous data file.I have no opinion on whether (parts of) these answers belong in an actual "FAQs" page.
Have you found anything relevant by searching the web?
The text was updated successfully, but these errors were encountered: