Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions examples/prelude/.buckconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ name=BUILD
prelude = ./prelude
toolchains = ./toolchains
root = .
platform = no
buck = no
fbcode = no
fbsource = no
ovr_config = no
6 changes: 3 additions & 3 deletions examples/prelude/toolchain/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load(":cxx_hacks.bzl", "cxx_hacks")
load(":toolchain.bzl", "cxx_toolchain", "python_toolchain")
load(":toolchain.bzl", "cxx_toolchain", "python_toolchain", "python_bootstrap_toolchain")

# Required to support the $(cxx-header-tree) macro
cxx_hacks(
Expand All @@ -21,7 +21,7 @@ python_toolchain(
# the bootstrap toolchain is used
# to poentially initialize other
# toolchains
python_toolchain(
python_bootstrap_toolchain(
name="python_bootstrap",
visibility=["PUBLIC"],
)
)
16 changes: 16 additions & 0 deletions examples/prelude/toolchain/toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ load(
"PythonPlatformInfo",
"PythonToolchainInfo",
)
load(
"@prelude//python_bootstrap:python_bootstrap.bzl",
"PythonBootstrapToolchainInfo",
)

DEFAULT_MAKE_COMP_DB = "prelude//cxx/tools:make_comp_db"
DEFAULT_MAKE_PEX_INPLACE = "prelude//python/tools:make_pex_inplace"
Expand Down Expand Up @@ -130,3 +134,15 @@ python_toolchain = rule(
},
is_toolchain_rule = True,
)

def _python_bootstrap_toolchain(ctx):
return [
DefaultInfo(),
PythonBootstrapToolchainInfo(interpreter="python")
]

python_bootstrap_toolchain = rule(
impl = _python_bootstrap_toolchain,
attrs = {},
is_toolchain_rule = True,
)