Skip to content

Commit 5d0a7a0

Browse files
Re-sync with internal repository (#1993)
The internal and external repositories are out of sync. This Pull Request attempts to brings them back in sync by patching the GitHub repository. Please carefully review this patch. You must disable ShipIt for your project in order to merge this pull request. DO NOT IMPORT this pull request. Instead, merge it directly on GitHub using the MERGE BUTTON. Re-enable ShipIt after merging.
1 parent 027ad54 commit 5d0a7a0

File tree

147 files changed

+2266
-32
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+2266
-32
lines changed

shim/.buckconfig

Whitespace-only changes.

shim/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# We currently expect end users to run reindeer vendor themselves
2+
# so mark these things as to ignore
3+
/third-party/rust/.cargo/
4+
/third-party/rust/BUCK
5+
/third-party/rust/vendor/

shim/BUCK

Lines changed: 4 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,5 @@
1-
"""Copied from prelude since we need to put this file under shim/
2-
"""
1+
load("@prelude//toolchains:demo.bzl", "system_demo_toolchains")
32

4-
load("@prelude//toolchains:cxx.bzl", "system_cxx_toolchain")
5-
load("@prelude//toolchains:genrule.bzl", "system_genrule_toolchain")
6-
load("@prelude//toolchains:python.bzl", "system_python_bootstrap_toolchain", "system_python_toolchain")
7-
load("@prelude//toolchains:rust.bzl", "system_rust_toolchain")
8-
9-
system_cxx_toolchain(
10-
name = "cxx",
11-
visibility = ["PUBLIC"],
12-
)
13-
14-
system_genrule_toolchain(
15-
name = "genrule",
16-
visibility = ["PUBLIC"],
17-
)
18-
19-
system_rust_toolchain(
20-
name = "rust",
21-
default_edition = "2021",
22-
visibility = ["PUBLIC"],
23-
)
24-
25-
system_python_toolchain(
26-
name = "python",
27-
visibility = ["PUBLIC"],
28-
)
29-
30-
system_python_bootstrap_toolchain(
31-
name = "python_bootstrap",
32-
visibility = ["PUBLIC"],
33-
)
3+
# All the default toolchains, suitable for a quick demo or early prototyping.
4+
# Most real projects should copy/paste the implementation to configure them.
5+
system_demo_toolchains()

shim/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Open Source Shim
2+
3+
These files are a shim that allow us to build Buck2 with Buck2 outside Meta in
4+
the open source world.

shim/buck2/buck_rust_binary.bzl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
#
3+
# This source code is licensed under both the MIT license found in the
4+
# LICENSE-MIT file in the root directory of this source tree and the Apache
5+
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory
6+
# of this source tree.
7+
8+
load(
9+
"//:shims.bzl",
10+
_rust_binary = "rust_binary",
11+
)
12+
13+
buck_rust_binary = _rust_binary

shim/buck2/proto_defs.bzl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
#
3+
# This source code is licensed under both the MIT license found in the
4+
# LICENSE-MIT file in the root directory of this source tree and the Apache
5+
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory
6+
# of this source tree.
7+
8+
load(
9+
"//:shims.bzl",
10+
_rust_protobuf_library = "rust_protobuf_library",
11+
)
12+
13+
rust_protobuf_library = _rust_protobuf_library

shim/build_defs/cpp_library.bzl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
#
3+
# This source code is licensed under both the MIT license found in the
4+
# LICENSE-MIT file in the root directory of this source tree and the Apache
5+
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory
6+
# of this source tree.
7+
8+
load("//:shims.bzl", _cpp_library = "cpp_library")
9+
10+
cpp_library = _cpp_library

shim/build_defs/custom_unittest.bzl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
#
3+
# This source code is licensed under both the MIT license found in the
4+
# LICENSE-MIT file in the root directory of this source tree and the Apache
5+
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory
6+
# of this source tree.
7+
8+
def custom_unittest(**_):
9+
pass

shim/build_defs/export_files.bzl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
#
3+
# This source code is licensed under both the MIT license found in the
4+
# LICENSE-MIT file in the root directory of this source tree and the Apache
5+
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory
6+
# of this source tree.
7+
8+
def export_file(visibility = ["PUBLIC"], **kwargs):
9+
# @lint-ignore BUCKLINT: avoid "native is forbidden in fbcode"
10+
native.export_file(visibility = visibility, **kwargs)

shim/build_defs/lib/python_common.bzl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
#
3+
# This source code is licensed under both the MIT license found in the
4+
# LICENSE-MIT file in the root directory of this source tree and the Apache
5+
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory
6+
# of this source tree.
7+
8+
def get_ldflags(*args):
9+
_unused = args # @unused
10+
return []
11+
12+
def get_strip_mode(*args):
13+
_unused = args # @unused
14+
return ""

shim/build_defs/native_rules.bzl

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
#
3+
# This source code is licensed under both the MIT license found in the
4+
# LICENSE-MIT file in the root directory of this source tree and the Apache
5+
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory
6+
# of this source tree.
7+
8+
def buck_genrule(visibility = ["PUBLIC"], **kwargs):
9+
# @lint-ignore BUCKLINT: avoid "native is forbidden in fbcode"
10+
native.genrule(visibility = visibility, **kwargs)
11+
12+
def buck_command_alias(**_):
13+
pass
14+
15+
def buck_filegroup(visibility = ["PUBLIC"], **kwargs):
16+
# @lint-ignore BUCKLINT: avoid "native is forbidden in fbcode"
17+
native.filegroup(visibility = visibility, **kwargs)
18+
19+
def alias(actual, visibility = ["PUBLIC"], **kwargs):
20+
if actual.startswith("//buck2/"):
21+
actual = "root//" + actual.removeprefix("//buck2/")
22+
native.alias(actual = actual, visibility = visibility, **kwargs)

shim/build_defs/ocaml_binary.bzl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
#
3+
# This source code is licensed under both the MIT license found in the
4+
# LICENSE-MIT file in the root directory of this source tree and the Apache
5+
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory
6+
# of this source tree.
7+
8+
load("//:shims.bzl", _ocaml_binary = "ocaml_binary")
9+
10+
ocaml_binary = _ocaml_binary
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
#
3+
# This source code is licensed under both the MIT license found in the
4+
# LICENSE-MIT file in the root directory of this source tree and the Apache
5+
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory
6+
# of this source tree.
7+
8+
def _set_clang_version(_version, _overwrite = False):
9+
pass
10+
11+
package_local_utils = struct(
12+
set_clang_version = _set_clang_version,
13+
)

shim/build_defs/platform_utils.bzl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
#
3+
# This source code is licensed under both the MIT license found in the
4+
# LICENSE-MIT file in the root directory of this source tree and the Apache
5+
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory
6+
# of this source tree.
7+
8+
def _get_cxx_platform_for_base_path(_base_path):
9+
return struct(target_platform = None)
10+
11+
platform_utils = struct(get_cxx_platform_for_base_path = _get_cxx_platform_for_base_path)

shim/build_defs/python_binary.bzl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
#
3+
# This source code is licensed under both the MIT license found in the
4+
# LICENSE-MIT file in the root directory of this source tree and the Apache
5+
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory
6+
# of this source tree.
7+
8+
def python_binary(srcs = [], **kwargs):
9+
_unused = srcs # @unused
10+
11+
# @lint-ignore BUCKLINT: avoid "Direct usage of native rules is not allowed."
12+
native.python_binary(**kwargs)

shim/build_defs/rust_binary.bzl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
#
3+
# This source code is licensed under both the MIT license found in the
4+
# LICENSE-MIT file in the root directory of this source tree and the Apache
5+
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory
6+
# of this source tree.
7+
8+
load("//:shims.bzl", _rust_binary = "rust_binary")
9+
10+
rust_binary = _rust_binary

shim/build_defs/rust_library.bzl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
#
3+
# This source code is licensed under both the MIT license found in the
4+
# LICENSE-MIT file in the root directory of this source tree and the Apache
5+
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory
6+
# of this source tree.
7+
8+
load("//:shims.bzl", _rust_library = "rust_library")
9+
10+
rust_library = _rust_library

shim/build_defs/rust_unittest.bzl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
#
3+
# This source code is licensed under both the MIT license found in the
4+
# LICENSE-MIT file in the root directory of this source tree and the Apache
5+
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory
6+
# of this source tree.
7+
8+
load("//:shims.bzl", _rust_unittest = "rust_unittest")
9+
10+
rust_unittest = _rust_unittest

shim/common/ocaml/interop/defs.bzl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
load("@root//defs.bzl", _RUST_FLAGS_2018 = "RUST_FLAGS_2018")
2+
3+
RUST_FLAGS_2018 = _RUST_FLAGS_2018

shim/grpc_fb/codegen/buck_macros.bzl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
#
3+
# This source code is licensed under both the MIT license found in the
4+
# LICENSE-MIT file in the root directory of this source tree and the Apache
5+
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory
6+
# of this source tree.
7+
8+
def grpc_library(**kwargs):
9+
_unused = kwargs # @unused
10+
pass

0 commit comments

Comments
 (0)