mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Because install_paths is not presently validated, and it's resolved after the `SetWorkingDirForBazel` call, if a relative path is used with bazel then it would fail silently. This starts making the driver share install path errors, and starts changing how `//toolchain` launches `carbon`. Note the implementation is still brittle and will break with symlinks. That's something I plan to address as part of busyboxing.
18 lines
586 B
Python
18 lines
586 B
Python
# 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
|
|
|
|
"""Supports running a tool from the install filegroup."""
|
|
|
|
load("@rules_python//python:defs.bzl", "py_binary")
|
|
|
|
def run_tool(name, tool, data):
|
|
# TODO: Fix the driver file discovery in order to allow symlinks.
|
|
py_binary(
|
|
name = name,
|
|
main = "run_tool.py",
|
|
srcs = ["run_tool.py"],
|
|
args = ["$(location {})".format(tool)],
|
|
data = [tool] + data,
|
|
)
|