mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 20:20:10 +01:00
I think this will work on linux/mac, not windows obviously. But the essence is that running `bazel run -c opt //installers/local:install` will create: Symlink: /usr/bin/carbon-explorer -> /usr/lib/carbon/carbon BusyBox-style binary: /usr/lib/carbon/carbon File: /usr/lib/carbon/data/prelude.carbon And then just running `carbon-explorer foo.carbon` with no flags (in particular, not --prelude) will work. Since this removes the need for prelude_file in most cases, I'm removing the relative path logic added in #1179 -- it would otherwise conflict with what I'm doing here. I *think* overall this will result in something even simpler and more reliable for compiler explorer to use, and hopefully with enough flexibility that it's easy for us to change how it's implemented later without breaking much.
19 lines
575 B
Python
19 lines
575 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
|
|
|
|
"""Install-related rules."""
|
|
|
|
def _install_path_rule_impl(ctx):
|
|
"""Turns the install path into a variable for rules to use."""
|
|
return [
|
|
platform_common.TemplateVariableInfo({
|
|
"INSTALL_PATH": ctx.build_setting_value,
|
|
}),
|
|
]
|
|
|
|
install_path_rule = rule(
|
|
implementation = _install_path_rule_impl,
|
|
build_setting = config.string(flag = True),
|
|
)
|