Skip to content

Commit

Permalink
Merge commit '6dccd64de51ea960cb6f0d975768c874814b4c75' into HEAD
Browse files Browse the repository at this point in the history
Update flatbuffers. Relevant merge tasks:
* A field got added to reflection.fbs; this had fallout in
  reflection_generated.h and the logger_test shas.
* Resolved merge conflict in rust/flatbuffers/src/lib.rs
* Reverted upstream change that made Table rust struct members private.
* FlatBufferBuilder Create*Vector calls now include alignment.
* nim codegen got added; needed to update to use scoped enums.

Main fix that motivated this update is
google/flatbuffers#7588

Change-Id: I6bbe5d56846f426fa5f2a82c4f2bc77be2b93bb0
Signed-off-by: James Kuszmaul <[email protected]>
  • Loading branch information
jameskuszmaul-brt committed Nov 9, 2022
2 parents 5ab990d + 3b15b0c commit 65541cb
Show file tree
Hide file tree
Showing 468 changed files with 19,268 additions and 7,026 deletions.
6 changes: 3 additions & 3 deletions aos/events/logging/logger_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3757,11 +3757,11 @@ TEST_P(MultinodeLoggerTest, DeadNode) {
}

constexpr std::string_view kCombinedConfigSha1(
"c10ca3c1efa7924d48859000b6671eadc007b6373c81d07138a385dfdbb33d69");
"5d73fe35bacaa59d24f8f0c1a806fe10b783b0fcc80809ee30a9db824e82538b");
constexpr std::string_view kSplitConfigSha1(
"f8df4ee52e137025dac96303f8d38a5324fd819d1c22ff018754dd56c3ca64e8");
"f25e8f6f90d61f41c41517e652300566228b077e44cd86f1af2af4a9bed31ad4");
constexpr std::string_view kReloggedSplitConfigSha1(
"3154b2a9f9819d676d40c689a6c2967c2c64152c2845673b78d0c1cdc368d3ec");
"f1fabd629bdf8735c3d81bc791d7a454e8e636951c26cba6426545cbc97f911f");

INSTANTIATE_TEST_SUITE_P(
All, MultinodeLoggerTest,
Expand Down
2 changes: 1 addition & 1 deletion aos/events/shm_event_loop_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ TEST_P(ShmEventLoopTest, GetSenderSharedMemory) {

auto builder = sender.MakeBuilder();
uint8_t *buffer;
builder.fbb()->CreateUninitializedVector(5, 1, &buffer);
builder.fbb()->CreateUninitializedVector(5, &buffer);
EXPECT_GE(reinterpret_cast<char *>(buffer), shared_memory.begin());
EXPECT_LT(reinterpret_cast<char *>(buffer), shared_memory.end());
}
Expand Down
6 changes: 3 additions & 3 deletions aos/flatbuffer_merge.cc
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ void AddVectorOfStrings(flatbuffers::ElementaryType elementary_type,
}

// Start the vector.
fbb->StartVector(size, inline_size);
fbb->StartVector(size, inline_size, /*align=*/inline_size);

for (const flatbuffers::Offset<flatbuffers::String> &element :
string_elements) {
Expand Down Expand Up @@ -214,7 +214,7 @@ void AddVector(flatbuffers::ElementaryType elementary_type,
flatbuffers::InlineSize(elementary_type, nullptr);

// Start the vector.
fbb->StartVector(size, inline_size);
fbb->StartVector(size, inline_size, /*align=*/inline_size);

// Pack the contents in in reverse order.
if (t2_has) {
Expand Down Expand Up @@ -306,7 +306,7 @@ void AddVectorOfObjects(flatbuffers::FlatBufferBuilder *fbb,
}

// Start the vector.
fbb->StartVector(size, inline_size);
fbb->StartVector(size, inline_size, /*align=*/inline_size);

for (const flatbuffers::Offset<flatbuffers::Table> &element :
object_elements) {
Expand Down
5 changes: 3 additions & 2 deletions aos/json_to_flatbuffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -580,8 +580,9 @@ bool AddSingleElement(FlatbufferType type, int field_index,

bool JsonParser::FinishVector(int field_index) {
// Vectors have a start (unfortunately which needs to know the size)
fbb_->StartVector(stack_.back().vector_elements.size(),
stack_.back().type.FieldInlineSize(field_index));
const size_t inline_size = stack_.back().type.FieldInlineSize(field_index);
fbb_->StartVector(stack_.back().vector_elements.size(), inline_size,
/*align=*/inline_size);

const flatbuffers::ElementaryType elementary_type =
stack_.back().type.FieldElementaryType(field_index);
Expand Down
9 changes: 9 additions & 0 deletions third_party/cargo/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,15 @@ alias(
],
)

alias(
name = "rustc_version",
actual = "@raze__rustc_version__0_4_0//:rustc_version",
tags = [
"cargo-raze",
"manual",
],
)

alias(
name = "serde",
actual = "@raze__serde__1_0_139//:serde",
Expand Down
18 changes: 18 additions & 0 deletions third_party/cargo/crates.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -961,6 +961,15 @@ def raze_fetch_remote_crates():
build_file = Label("//third_party/cargo/remote:BUILD.rustc-hash-1.1.0.bazel"),
)

maybe(
http_archive,
name = "raze__rustc_version__0_4_0",
url = "https://crates.io/api/v1/crates/rustc_version/0.4.0/download",
type = "tar.gz",
strip_prefix = "rustc_version-0.4.0",
build_file = Label("//third_party/cargo/remote:BUILD.rustc_version-0.4.0.bazel"),
)

maybe(
http_archive,
name = "raze__rustversion__1_0_8",
Expand All @@ -981,6 +990,15 @@ def raze_fetch_remote_crates():
build_file = Label("//third_party/cargo/remote:BUILD.ryu-1.0.10.bazel"),
)

maybe(
http_archive,
name = "raze__semver__1_0_14",
url = "https://crates.io/api/v1/crates/semver/1.0.14/download",
type = "tar.gz",
strip_prefix = "semver-1.0.14",
build_file = Label("//third_party/cargo/remote:BUILD.semver-1.0.14.bazel"),
)

maybe(
http_archive,
name = "raze__serde__1_0_139",
Expand Down
57 changes: 57 additions & 0 deletions third_party/cargo/remote/BUILD.rustc_version-0.4.0.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
"""
@generated
cargo-raze crate build file.

DO NOT EDIT! Replaced on runs of cargo-raze
"""

# buildifier: disable=load
load("@bazel_skylib//lib:selects.bzl", "selects")

# buildifier: disable=load
load(
"@rules_rust//rust:defs.bzl",
"rust_binary",
"rust_library",
"rust_proc_macro",
"rust_test",
)

package(default_visibility = [
# Public for visibility by "@raze__crate__version//" targets.
#
# Prefer access through "//third_party/cargo", which limits external
# visibility to explicit Cargo.toml dependencies.
"//visibility:public",
])

licenses([
"notice", # MIT from expression "MIT OR Apache-2.0"
])

# Generated Targets

rust_library(
name = "rustc_version",
srcs = glob(["**/*.rs"]),
crate_features = [
],
crate_root = "src/lib.rs",
data = [],
edition = "2018",
rustc_flags = [
"--cap-lints=allow",
],
tags = [
"cargo-raze",
"crate-name=rustc_version",
"manual",
],
version = "0.4.0",
# buildifier: leave-alone
deps = [
"@raze__semver__1_0_14//:semver",
],
)

# Unsupported target "all" with type "test" omitted
98 changes: 98 additions & 0 deletions third_party/cargo/remote/BUILD.semver-1.0.14.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
"""
@generated
cargo-raze crate build file.

DO NOT EDIT! Replaced on runs of cargo-raze
"""

# buildifier: disable=load
load("@bazel_skylib//lib:selects.bzl", "selects")

# buildifier: disable=load
load(
"@rules_rust//rust:defs.bzl",
"rust_binary",
"rust_library",
"rust_proc_macro",
"rust_test",
)

package(default_visibility = [
# Public for visibility by "@raze__crate__version//" targets.
#
# Prefer access through "//third_party/cargo", which limits external
# visibility to explicit Cargo.toml dependencies.
"//visibility:public",
])

licenses([
"notice", # MIT from expression "MIT OR Apache-2.0"
])

# Generated Targets
# buildifier: disable=out-of-order-load
# buildifier: disable=load-on-top
load(
"@rules_rust//cargo:cargo_build_script.bzl",
"cargo_build_script",
)

cargo_build_script(
name = "semver_build_script",
srcs = glob(["**/*.rs"]),
build_script_env = {
},
crate_features = [
"default",
"std",
],
crate_root = "build.rs",
data = glob(["**"]),
edition = "2018",
rustc_flags = [
"--cap-lints=allow",
],
tags = [
"cargo-raze",
"manual",
],
version = "1.0.14",
visibility = ["//visibility:private"],
deps = [
],
)

# Unsupported target "parse" with type "bench" omitted

rust_library(
name = "semver",
srcs = glob(["**/*.rs"]),
crate_features = [
"default",
"std",
],
crate_root = "src/lib.rs",
data = [],
edition = "2018",
rustc_flags = [
"--cap-lints=allow",
],
tags = [
"cargo-raze",
"crate-name=semver",
"manual",
],
version = "1.0.14",
# buildifier: leave-alone
deps = [
":semver_build_script",
],
)

# Unsupported target "test_autotrait" with type "test" omitted

# Unsupported target "test_identifier" with type "test" omitted

# Unsupported target "test_version" with type "test" omitted

# Unsupported target "test_version_req" with type "test" omitted
10 changes: 8 additions & 2 deletions third_party/flatbuffers/.github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ swift:
- tests/swift/**
- src/idl_gen_swift.cpp

nim:
- '**/*.nim'
- nim/**/*
- src/idl_gen_nim.cpp
- src/bfbs_gen_nim.cpp

javascript:
- '**/*.js'
- src/idl_gen_ts.cpp
Expand Down Expand Up @@ -61,7 +67,7 @@ rust:
- '**/*.rs'
- rust/**/*
- src/idl_gen_rust.cpp

dart:
- '**/*.dart'
- src/idl_gen_dart.cpp
Expand All @@ -88,4 +94,4 @@ CI:

grpc:
- grpc/**/*
- src/idl_gen_grpc.cpp
- src/idl_gen_grpc.cpp
22 changes: 19 additions & 3 deletions third_party/flatbuffers/.github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1
- uses: gradle/wrapper-validation-action@v1.0.5
- uses: actions/setup-java@v2
with:
distribution: 'adopt-hotspot'
Expand All @@ -386,11 +386,11 @@ jobs:
with:
distribution: 'adopt-hotspot'
java-version: '11'
- uses: gradle/wrapper-validation-action@v1
- uses: gradle/wrapper-validation-action@v1.0.5
- name: Build
working-directory: kotlin
# we are using docker's version of gradle
# so no need for wrapper validadation or user
# so no need for wrapper validation or user
# gradlew
run: gradle jvmMainClasses jvmTest jsTest jsBrowserTest

Expand Down Expand Up @@ -477,6 +477,22 @@ jobs:
working-directory: tests
run: bash DartTest.sh

build-nim:
name: Build Nim
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: flatc
# FIXME: make test script not rely on flatc
run: cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_INSTALL=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF . && make -j
- uses: jiro4989/setup-nim-action@v1
- name: install library
working-directory: nim
run: nimble -y develop
- name: test
working-directory: tests/nim
run: python3 testnim.py

release-digests:
if: startsWith(github.ref, 'refs/tags/')
needs: [build-linux, build-windows, build-mac-intel, build-mac-universal]
Expand Down
Loading

0 comments on commit 65541cb

Please sign in to comment.