mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 10:54:49 +01:00
Add pre-commit check for invalid build graph state (#5658)
This can catch things like dependency cycles introduced by `fix-cc-deps`.
This commit is contained in:
Executable
+23
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
"""Verify that the bazel build graph is in a valid state, for pre-commit."""
|
||||
|
||||
__copyright__ = """
|
||||
Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
||||
Exceptions. See /LICENSE for license information.
|
||||
SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
"""
|
||||
|
||||
import subprocess
|
||||
|
||||
import scripts_utils
|
||||
|
||||
|
||||
def main() -> None:
|
||||
scripts_utils.chdir_repo_root()
|
||||
bazel = scripts_utils.locate_bazel()
|
||||
subprocess.check_call([bazel, "build", "--nobuild", "//..."])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user