run_tool.py 621 B

12345678910111213141516171819202122
  1. #!/usr/bin/env python3
  2. """Runs the tool specified in argv.
  3. This script is essentially just a bounce-through to get an appropriate arg0.
  4. See the TODO in run_tool.bzl.
  5. """
  6. __copyright__ = """
  7. Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  8. Exceptions. See /LICENSE for license information.
  9. SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  10. """
  11. import os
  12. import sys
  13. from pathlib import Path
  14. if __name__ == "__main__":
  15. symbolizer = str(Path(os.environ["LLVM_SYMBOLIZER_PATH"]).absolute())
  16. os.environ["LLVM_SYMBOLIZER_PATH"] = symbolizer
  17. os.execv(sys.argv[1], sys.argv[1:])