Bazel "missing input file" in CI
A rule references a source file that is not present in the package directory. The file was renamed, deleted, or never committed to the CI checkout.
What this error means
Analysis or execution fails with "ERROR: <pkg>/BUILD.bazel: missing input file <label>". The build stops because a declared input cannot be found.
bazel
ERROR: /workspace/libs/auth/BUILD.bazel:3:11: in srcs attribute of
cc_library rule //libs/auth:auth: missing input file '//libs/auth:token.cc'Common causes
Source renamed or deleted
A file listed explicitly in srcs/data was renamed or removed without updating the BUILD file, so the label no longer resolves to a real file.
File not committed to CI
The source exists locally but is untracked, so a clean CI checkout is missing it.
Generated file expected as a source
A file produced by another rule is listed as a plain source instead of referencing the generating target output.
How to fix it
Confirm the file is tracked and present
- Map the missing label to a path and check git tracks it.
- Stage and commit any new sources the BUILD references.
Terminal
git ls-files libs/auth/token.ccUpdate srcs or use glob carefully
- Remove or rename the stale entry in srcs.
- Prefer glob() for source lists, but commit new matching files.
How to prevent it
- Keep srcs in sync with the filesystem; CI catches drift if you run bazel build //... on every change.
Related guides
Bazel "no such package" / BUILD file not found in CIFix Bazel "ERROR: no such package" / BUILD file not found in CI. Bazel could not find a BUILD or BUILD.bazel…
Bazel action failed: exit code 1 in CIFix Bazel "action failed (Exit 1)" in CI. A build action ran a tool that returned non-zero - read the tool ou…
Bazel "Skipping ... no such target" in CIFix Bazel "ERROR: Skipping target: no such target" in CI. The package exists but has no rule with the name in…