Skip to content

Commit

Permalink
Merge branch 'main' into darwin48v_platform_3
Browse files Browse the repository at this point in the history
  • Loading branch information
adamcalabrigo authored Nov 1, 2024
2 parents b5d4494 + 23a4bd0 commit b4f81d4
Show file tree
Hide file tree
Showing 926 changed files with 34,437 additions and 30,343 deletions.
20 changes: 3 additions & 17 deletions .buckconfig
Original file line number Diff line number Diff line change
@@ -1,23 +1,9 @@
[repositories]
root = .
prelude = prelude
shim = shim
gh_facebook_fboss = .
shim_DISABLED = shim

[repository_aliases]
config = prelude
ovr_config = prelude
toolchains = shim
fbcode = shim
fbcode_macros = shim
fbsource = shim
buck = shim
bazel_skylib = shim

[external_cells]
prelude = bundled

[parser]
target_platform_detector_spec = target:root//...->prelude//platforms:default target:shim//...->prelude//platforms:default
root = gh_facebook_fboss

[buildfile]
name=BUCK
20 changes: 20 additions & 0 deletions .buckconfig.d/common.buckconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[cells]
prelude = prelude
none = none

[cell_aliases]
config = prelude
ovr_config = prelude
bazel_skylib = gh_facebook_buck2_shims_meta
buck = gh_facebook_buck2_shims_meta
fbcode = gh_facebook_buck2_shims_meta
fbcode_macros = gh_facebook_buck2_shims_meta
fbsource = gh_facebook_buck2_shims_meta
shim = gh_facebook_buck2_shims_meta
toolchains = gh_facebook_buck2_shims_meta

[external_cells]
prelude = bundled

[parser]
target_platform_detector_spec = target:root//...->prelude//platforms:default target:shim//...->prelude//platforms:default
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[cells]
gh_facebook_buck2_shims_meta = gh_facebook_buck2_shims_meta

[external_cells]
gh_facebook_buck2_shims_meta = git

[external_cell_gh_facebook_buck2_shims_meta]
git_origin = https://github.com/facebook/buck2-shims-meta.git
commit_hash = 461a1b10af7eb8af2f6d0eb0129009d60048e6de
9 changes: 7 additions & 2 deletions .github/workflows/platform-services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@ on:
pull_request:
# Allow manually triggering the workflow
workflow_dispatch:
# Also schedule the workflow to run hourly automatically
# Also schedule the workflow to run every 3 hours during day only
# ShipIt job will sync hourly around HH:21, so schedule the run with 15 minute offset
schedule:
- cron: '36 * * * *'
# Run daily at 1:36AM UTC = 6:36PM PDT
# Run daily at 1:36PM UTC = 6:36AM PDT
# Run daily at 4:36PM UTC = 9:36AM PDT
# Run daily at 7:36PM UTC = 12:36PM PDT
# Run daily at 10:36PM UTC = 3:36PM PDT
- cron: '36 1,13,16,19,22 * * *'
jobs:
Platform-Services-Build:
runs-on: 32-core-ubuntu
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/qsfp-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@ on:
pull_request:
# Allow manually triggering the workflow
workflow_dispatch:
# Also schedule the workflow to run hourly automatically
# Also schedule the workflow to run every 3 hours during day only
# ShipIt job will sync hourly around HH:21, so schedule the run with 15 minute offset
schedule:
- cron: '36 * * * *'
# Run daily at 1:36AM UTC = 6:36PM PDT
# Run daily at 1:36PM UTC = 6:36AM PDT
# Run daily at 4:36PM UTC = 9:36AM PDT
# Run daily at 7:36PM UTC = 12:36PM PDT
# Run daily at 10:36PM UTC = 3:36PM PDT
- cron: '36 1,13,16,19,22 * * *'
jobs:
Qsfp-Service-Build-Hourly:
runs-on: 32-core-ubuntu
Expand Down
23 changes: 23 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
cmake_minimum_required(VERSION 3.8)

include(functions.cmake)

option(WITH_ASAN "Turn ON address sanitizer build options" OFF)
if ($ENV{WITH_ASAN})
message(STATUS "ENV WITH_ASAN is set")
Expand Down Expand Up @@ -70,6 +72,14 @@ if ($ENV{SAI_BRCM_IMPL})
set (SAI_BRCM_IMPL ON)
endif()

option(CHENAB_SAI_SDK "Build SAI api with CHENAB-SAI extensions" OFF)
if ($ENV{CHENAB_SAI_SDK})
message(STATUS "ENV CHENAB_SAI_SDK is set")
set (CHENAB_SAI_SDK ON)
link_directories(/var/FBOSS/sai_impl/lib)
link_directories(/var/FBOSS/sdk/usr/lib64)
endif()

option(BUILD_SAI_FAKE_LINK_TEST "Building of SAI Fake Link Test binaries" OFF)
if ($ENV{BUILD_SAI_FAKE_LINK_TEST})
message(STATUS "ENV BUILD_SAI_FAKE_LINK_TEST is set")
Expand Down Expand Up @@ -185,6 +195,11 @@ if (SAI_BRCM_IMPL)
find_path(SAI_EXPERIMENTAL_INCLUDE_DIR NAMES saiswitchextensions.h)
include_directories(${SAI_EXPERIMENTAL_INCLUDE_DIR})
message(STATUS, "Experimental dir: ${SAI_EXPERIMENTAL_INCLUDE_DIR}")
elseif(CHENAB_SAI_SDK)
# Chenab-TODO: set experimental directories appropriately
set(SAI_EXPERIMENTAL_INCLUDE_DIR "/var/FBOSS/sai_impl_output/include")
include_directories(${SAI_EXPERIMENTAL_INCLUDE_DIR})
message(STATUS, "Experimental dir: ${SAI_EXPERIMENTAL_INCLUDE_DIR}")
else()
find_path(SAI_EXPERIMENTAL_INCLUDE_DIR
NAMES
Expand Down Expand Up @@ -525,6 +540,13 @@ add_fbthrift_cpp_library(
json
reflection
)
add_fbthrift_cpp_library(
link_test_production_features_cpp2
fboss/agent/test/link_tests/link_test_production_features.thrift
OPTIONS
json
reflection
)
add_fbthrift_cpp_library(
i2c_controller_stats_cpp2
fboss/lib/i2c/i2c_controller_stats.thrift
Expand Down Expand Up @@ -648,6 +670,7 @@ add_fbthrift_cpp_library(
fboss_cpp2
switch_state_cpp2
network_address_cpp2
mpls_cpp2
phy_cpp2
prbs_cpp2
OPTIONS
Expand Down
30 changes: 15 additions & 15 deletions buck2
Original file line number Diff line number Diff line change
Expand Up @@ -4,62 +4,62 @@
"name": "buck2",
"platforms": {
"macos-aarch64": {
"size": 24192649,
"size": 24650797,
"hash": "blake3",
"digest": "ada5e17e47e3751ceb767d342ae2cb87b1e8c8d909592a0a272af100e36087d9",
"digest": "c1d538cde7ac6ad0d8f12671420d09786622a97ae186ce4f8e676861910ae45b",
"format": "zst",
"path": "buck2-aarch64-apple-darwin",
"providers": [
{
"url": "https://github.com/facebook/buck2/releases/download/2024-10-01/buck2-aarch64-apple-darwin.zst"
"url": "https://github.com/facebook/buck2/releases/download/2024-10-15/buck2-aarch64-apple-darwin.zst"
}
]
},
"linux-aarch64": {
"size": 26342488,
"size": 26956137,
"hash": "blake3",
"digest": "c1b2a83f1730a98245c34e27562346f69e323d785ec0d0779707c2e99d6a455b",
"digest": "5bcb0ee9ed84799206d0cffd52e4b5ff4cacc9b1522d984f25e17c94414519c3",
"format": "zst",
"path": "buck2-aarch64-unknown-linux-musl",
"providers": [
{
"url": "https://github.com/facebook/buck2/releases/download/2024-10-01/buck2-aarch64-unknown-linux-musl.zst"
"url": "https://github.com/facebook/buck2/releases/download/2024-10-15/buck2-aarch64-unknown-linux-musl.zst"
}
]
},
"macos-x86_64": {
"size": 25779123,
"size": 26405161,
"hash": "blake3",
"digest": "900916c38b1c16a511ddccf62d649c9ce7a263f04aec586597f84658d922e67d",
"digest": "e388933ebd3bf8e2f9dcd20dbba33fe033319b1a07a67d92ef33e6c188512cb2",
"format": "zst",
"path": "buck2-x86_64-apple-darwin",
"providers": [
{
"url": "https://github.com/facebook/buck2/releases/download/2024-10-01/buck2-x86_64-apple-darwin.zst"
"url": "https://github.com/facebook/buck2/releases/download/2024-10-15/buck2-x86_64-apple-darwin.zst"
}
]
},
"windows-x86_64": {
"size": 21230675,
"size": 21795979,
"hash": "blake3",
"digest": "4001f9995d0c5dd57848a5a3b704abb12c034a2c3dccc5bf1f10eab8a01a3f98",
"digest": "7712324d3e71e487b76860f42f9a0d0e8bc49e692c13ce5053aabe8f1a30be8d",
"format": "zst",
"path": "buck2-x86_64-pc-windows-msvc.exe",
"providers": [
{
"url": "https://github.com/facebook/buck2/releases/download/2024-10-01/buck2-x86_64-pc-windows-msvc.exe.zst"
"url": "https://github.com/facebook/buck2/releases/download/2024-10-15/buck2-x86_64-pc-windows-msvc.exe.zst"
}
]
},
"linux-x86_64": {
"size": 27176398,
"size": 27977618,
"hash": "blake3",
"digest": "608d882a5ad55f8170e68849211c7e22d7f42fbf9fd1605dc03c93f85cf4a907",
"digest": "6f611bbf77c9544831405e68607682523f20f22aa55df1c5a3461f9c3a0cfa03",
"format": "zst",
"path": "buck2-x86_64-unknown-linux-musl",
"providers": [
{
"url": "https://github.com/facebook/buck2/releases/download/2024-10-01/buck2-x86_64-unknown-linux-musl.zst"
"url": "https://github.com/facebook/buck2/releases/download/2024-10-15/buck2-x86_64-unknown-linux-musl.zst"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion build/buck2/install_deps/install_deps.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
# (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
# Copyright (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.

if [ -z "$INSTALL_COMMAND" ]; then
if [ -f /etc/os-release ]; then
Expand Down
2 changes: 1 addition & 1 deletion build/deps/github_hashes/facebook/fb303-rev.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Subproject commit c1f74beb3889d54a5c60ae7c033947e338e249ed
Subproject commit 416aa3d1ff335d0dea665989ade77dd9f2a2a99c
2 changes: 1 addition & 1 deletion build/deps/github_hashes/facebook/fbthrift-rev.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Subproject commit b6f6f91a4294b03100d2c4dd512eb269fa385b2d
Subproject commit 78e5b27861982706b85ff5c9009c68d360f042aa
2 changes: 1 addition & 1 deletion build/deps/github_hashes/facebook/folly-rev.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Subproject commit 45ffb40f2beebb08b37df9b81b39193a6e2057a4
Subproject commit b8b1850df06e286ab510dafc1ebe7ab91ecd4141
2 changes: 1 addition & 1 deletion build/deps/github_hashes/facebook/wangle-rev.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Subproject commit ae6297f4994fe0ba78f265589ac7e3c96d2215f8
Subproject commit 1fc174e3de49c385f33b4fbb4a4e8e0798e15122
2 changes: 1 addition & 1 deletion build/deps/github_hashes/facebookincubator/fizz-rev.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Subproject commit c7976216bd64502f11b1b504da7a2e26d820ea8a
Subproject commit 787df81d7a579315e35b71500fc358582045c2a5
40 changes: 40 additions & 0 deletions build/fbcode_builder/CMake/FindXxhash.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Copyright (c) Facebook, Inc. and its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

#
# - Try to find Facebook xxhash library
# This will define
# Xxhash_FOUND
# Xxhash_INCLUDE_DIR
# Xxhash_LIBRARY
#

find_path(Xxhash_INCLUDE_DIR NAMES xxhash.h)

find_library(Xxhash_LIBRARY_RELEASE NAMES xxhash)

include(SelectLibraryConfigurations)
SELECT_LIBRARY_CONFIGURATIONS(Xxhash)

include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
Xxhash DEFAULT_MSG
Xxhash_LIBRARY Xxhash_INCLUDE_DIR
)

if (Xxhash_FOUND)
message(STATUS "Found xxhash: ${Xxhash_LIBRARY}")
endif()

mark_as_advanced(Xxhash_INCLUDE_DIR Xxhash_LIBRARY)
39 changes: 35 additions & 4 deletions build/fbcode_builder/getdeps.py
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,27 @@ def run_project_cmd(self, args, loader, manifest):
self.create_builder(loader, manifest).debug(reconfigure=False)


@cmd(
"env",
"print the environment in a shell sourceable format",
)
class EnvCmd(ProjectCmdBase):
def setup_project_cmd_parser(self, parser):
parser.add_argument(
"--os-type",
help="Filter to just this OS type to run",
choices=["linux", "darwin", "windows"],
action="store",
dest="ostype",
default=None,
)

def run_project_cmd(self, args, loader, manifest):
if args.ostype:
loader.build_opts.host_type.ostype = args.ostype
self.create_builder(loader, manifest).printenv(reconfigure=False)


@cmd("generate-github-actions", "generate a GitHub actions configuration")
class GenerateGitHubActionsCmd(ProjectCmdBase):
RUN_ON_ALL = """ [push, pull_request]"""
Expand Down Expand Up @@ -959,6 +980,10 @@ def get_run_on(self, args):
def write_job_for_platform(self, platform, args): # noqa: C901
build_opts = setup_build_options(args, platform)
ctx_gen = build_opts.get_context_generator()
if args.enable_tests:
ctx_gen.set_value_for_project(args.project, "test", "on")
else:
ctx_gen.set_value_for_project(args.project, "test", "off")
loader = ManifestLoader(build_opts, ctx_gen)
self.process_project_dir_arguments(args, loader)
manifest = loader.load_manifest(args.project)
Expand Down Expand Up @@ -1081,7 +1106,10 @@ def write_job_for_platform(self, platform, args): # noqa: C901
free_up_disk = ""

allow_sys_arg = ""
if run_tests:
if (
build_opts.allow_system_packages
and build_opts.host_type.get_package_manager()
):
sudo_arg = "sudo "
allow_sys_arg = " --allow-system-packages"
if build_opts.host_type.get_package_manager() == "deb":
Expand All @@ -1092,13 +1120,16 @@ def write_job_for_platform(self, platform, args): # noqa: C901
if build_opts.is_darwin():
# brew is installed as regular user
sudo_arg = ""
tests_arg = "--no-tests "
if run_tests:
tests_arg = ""
out.write(
f" run: {sudo_arg}python3 build/fbcode_builder/getdeps.py --allow-system-packages install-system-deps --recursive {manifest.name}\n"
f" run: {sudo_arg}python3 build/fbcode_builder/getdeps.py --allow-system-packages install-system-deps {tests_arg}--recursive {manifest.name}\n"
)
if build_opts.is_linux() or build_opts.is_freebsd():
out.write(" - name: Install packaging system deps\n")
out.write(
f" run: {sudo_arg}python3 build/fbcode_builder/getdeps.py --allow-system-packages install-system-deps --recursive patchelf\n"
f" run: {sudo_arg}python3 build/fbcode_builder/getdeps.py --allow-system-packages install-system-deps {tests_arg}--recursive patchelf\n"
)
required_locales = manifest.get(
"github.actions", "required_locales", ctx=manifest_ctx
Expand Down Expand Up @@ -1176,7 +1207,7 @@ def write_job_for_platform(self, platform, args): # noqa: C901
no_deps_arg = "--no-deps "

no_tests_arg = ""
if not args.enable_tests:
if not run_tests:
no_tests_arg = "--no-tests "

out.write(
Expand Down
Loading

0 comments on commit b4f81d4

Please sign in to comment.