Vendor dependencies
Let's see how I like this workflow.
This commit is contained in:
parent
34d1830413
commit
9c435dc440
7500 changed files with 1665121 additions and 99 deletions
39
vendor/cxx/tools/buck/prelude/platforms/defs.bzl
vendored
Normal file
39
vendor/cxx/tools/buck/prelude/platforms/defs.bzl
vendored
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
#
|
||||
# This source code is licensed under both the MIT license found in the
|
||||
# LICENSE-MIT file in the root directory of this source tree and the Apache
|
||||
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory
|
||||
# of this source tree.
|
||||
|
||||
def _execution_platform_impl(ctx: "context") -> ["provider"]:
|
||||
constraints = dict()
|
||||
constraints.update(ctx.attrs.cpu_configuration[ConfigurationInfo].constraints)
|
||||
constraints.update(ctx.attrs.os_configuration[ConfigurationInfo].constraints)
|
||||
cfg = ConfigurationInfo(constraints = constraints, values = {})
|
||||
|
||||
name = ctx.label.raw_target()
|
||||
platform = ExecutionPlatformInfo(
|
||||
label = name,
|
||||
configuration = cfg,
|
||||
executor_config = CommandExecutorConfig(
|
||||
local_enabled = True,
|
||||
remote_enabled = False,
|
||||
use_windows_path_separators = ctx.attrs.use_windows_path_separators,
|
||||
),
|
||||
)
|
||||
|
||||
return [
|
||||
DefaultInfo(),
|
||||
platform,
|
||||
PlatformInfo(label = str(name), configuration = cfg),
|
||||
ExecutionPlatformRegistrationInfo(platforms = [platform]),
|
||||
]
|
||||
|
||||
execution_platform = rule(
|
||||
impl = _execution_platform_impl,
|
||||
attrs = {
|
||||
"cpu_configuration": attrs.dep(providers = [ConfigurationInfo]),
|
||||
"os_configuration": attrs.dep(providers = [ConfigurationInfo]),
|
||||
"use_windows_path_separators": attrs.bool(),
|
||||
},
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue