check_build_graph.py 555 B

1234567891011121314151617181920212223
  1. #!/usr/bin/env python3
  2. """Verify that the bazel build graph is in a valid state, for pre-commit."""
  3. __copyright__ = """
  4. Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  5. Exceptions. See /LICENSE for license information.
  6. SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  7. """
  8. import subprocess
  9. import scripts_utils
  10. def main() -> None:
  11. scripts_utils.chdir_repo_root()
  12. bazel = scripts_utils.locate_bazel()
  13. subprocess.check_call([bazel, "build", "--nobuild", "//..."])
  14. if __name__ == "__main__":
  15. main()