blob: cf925932002add4f1d8e9a61d99539937415a0d9 [file] [log] [blame]
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
NONHERMETIC_ENV_VARS = [
"HOME",
"PATH",
"XILINX_VIVADO",
"XILINX_HLS",
"XILINXD_LICENSE_FILE",
]
def _nonhermetic_repo_impl(rctx):
env = "\n".join([" \"{}\": \"{}\",".format(v, rctx.os.environ.get(v, "")) for v in NONHERMETIC_ENV_VARS])
rctx.file("env.bzl", "ENV = {{\n{}\n}}\n".format(env))
rctx.file("BUILD.bazel", "exports_files(glob([\"**\"]))\n")
nonhermetic_repo = repository_rule(
implementation = _nonhermetic_repo_impl,
attrs = {},
environ = NONHERMETIC_ENV_VARS,
)