MCPcopy Create free account
hub / github.com/pytorch/executorch / get_buck2_version

Function get_buck2_version

tools/cmake/buck_util.py:45–59  ·  view source on GitHub ↗
(path: str)

Source from the content-addressed store, hash-verified

43
44
45def get_buck2_version(path: str) -> Optional[str]:
46 try:
47 runner = Buck2Runner(path)
48 output = runner.run(["--version"])
49
50 # Example output:
51 # buck2 38f7c508bf1b87bcdc816bf56d1b9f2d2411c6be <build-id>
52 #
53 # We want the second value.
54
55 return output[0].split()[1]
56
57 except Exception as e:
58 print(f"Failed to retrieve buck2 version: {e}.", file=sys.stderr)
59 return None

Callers

nothing calls this directly

Calls 3

runMethod · 0.95
Buck2RunnerClass · 0.85
splitMethod · 0.80

Tested by

no test coverage detected