mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-24 06:41:48 +00:00
Rust reflection: simplify dependencies, fix Android build compatibility (#8512)
* flatbuffers Rust reflection: replace num with num-traits num crate is a wrapper over num-traits and a few other crates, that reexports the APIs from all of them. We only need num-traits. Signed-off-by: Marcin Radomski <dextero@google.com> * Rust reflection: drop dependency on stdint crate We only use it to get intmax_t for deriving alignment, which is an alias for `core::ffi::c_long` [1]. We can use that directly instead. [1] https://docs.rs/stdint/1.0.0/stdint/type.intmax_t.html Signed-off-by: Marcin Radomski <dextero@google.com> * Rust reflection: drop dependency on escape_string crate It's used to format a string used for debugging only, so we might as well use the builtin Debug representation of a string. Signed-off-by: Marcin Radomski <dextero@google.com> * Rust codegen: add derives on generated bitflags Otherwise it limits the use of structs generated for reflection.fbs in Rust reflection API. Signed-off-by: Marcin Radomski <dextero@google.com> * Rust flatbuffers: update bitflags dependency to 2.8 Signed-off-by: Marcin Radomski <dextero@google.com> * Rust codegen: use bitflags v2 API for converting from bits from_bits_unchecked was replaced with safe from_bits_retain. Signed-off-by: Marcin Radomski <dextero@google.com> * Regenerate Rust code after idl change Signed-off-by: Marcin Radomski <dextero@google.com> * Regenerate reflection_generated.rs With flatc --rust ../../../reflection/reflection.fbs Signed-off-by: Marcin Radomski <dextero@google.com> * ts/BUILD.bazel: add missing import Found by Buildifire presubmit: Function "sh_binary" is not global anymore and needs to be loaded from "@rules_shell//shell:sh_binary.bzl". Signed-off-by: Marcin Radomski <dextero@google.com> * Update expected value in generated_code_debug_prints_correctly test In bitflags v2, the debug string representation of enum values is different than it was in v1: Blue -> Color(Blue) (empty) -> LongEnum(0x0) This change adjusts the expected test value. Signed-off-by: Marcin Radomski <dextero@google.com> * Fix tests build on Swift 5.8 grpc-swift 1.4.1 depends on swift-nio-ssl 2.14.0+ [1]. swift-nio-ssl 2.29.1 published on 2025-01-30, introduced some code [2] that uses a "switch expression syntax" supported since Swift 5.9 [3]. Attempts to compile it with Swift 5.8 cause build errors. swift-nio-ssl project doesn't seem to support Swift 5.8. A commit from 2024-10-29 removes a "deprecated reference to a Swift 5.8 pipeline" [4]. swift-nio-ssl 2.29.0 is the last version that can be compiled with Swift 5.8. This commit pins it to that exact version. [1]66e27d7e84/Package.swift (L33)[2]3cb4d5ad12 (diff-bc1db1321ff689c2819245dcce1a3080554f0fc13f81b8d326c97e7d42717c8fR54)[3] https://github.com/swiftlang/swift-evolution/blob/main/proposals/0380-if-switch-expressions.md [4]8a6b89d9a4--------- Signed-off-by: Marcin Radomski <dextero@google.com> Co-authored-by: Marcin Radomski <dextero@google.com>
This commit is contained in:
@@ -43,6 +43,10 @@ bazel_dep(
|
|||||||
name = "rules_nodejs",
|
name = "rules_nodejs",
|
||||||
version = "6.3.3",
|
version = "6.3.3",
|
||||||
)
|
)
|
||||||
|
bazel_dep(
|
||||||
|
name = "rules_shell",
|
||||||
|
version = "0.3.0",
|
||||||
|
)
|
||||||
bazel_dep(
|
bazel_dep(
|
||||||
name = "rules_swift",
|
name = "rules_swift",
|
||||||
version = "1.18.0",
|
version = "1.18.0",
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ std = []
|
|||||||
serialize = ["serde"]
|
serialize = ["serde"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
bitflags = "1.2.1"
|
bitflags = "2.8.0"
|
||||||
serde = { version = "1.0", optional = true }
|
serde = { version = "1.0", optional = true }
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ edition = "2021"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
flatbuffers = { path = "../flatbuffers"}
|
flatbuffers = { path = "../flatbuffers"}
|
||||||
escape_string = "0.1.2"
|
num-traits = "0.2.19"
|
||||||
stdint = "0.2.0"
|
|
||||||
num = "0.4.1"
|
|
||||||
anyhow = "1.0.75"
|
anyhow = "1.0.75"
|
||||||
thiserror = "1.0"
|
thiserror = "1.0"
|
||||||
|
|||||||
@@ -29,11 +29,9 @@ use flatbuffers::{
|
|||||||
use reflection_generated::reflection::{BaseType, Field, Object, Schema};
|
use reflection_generated::reflection::{BaseType, Field, Object, Schema};
|
||||||
|
|
||||||
use core::mem::size_of;
|
use core::mem::size_of;
|
||||||
use escape_string::escape;
|
use num_traits::float::Float;
|
||||||
use num::traits::float::Float;
|
use num_traits::int::PrimInt;
|
||||||
use num::traits::int::PrimInt;
|
use num_traits::FromPrimitive;
|
||||||
use num::traits::FromPrimitive;
|
|
||||||
use stdint::uintmax_t;
|
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
#[derive(Error, Debug, PartialEq)]
|
#[derive(Error, Debug, PartialEq)]
|
||||||
@@ -541,7 +539,9 @@ pub unsafe fn set_string(
|
|||||||
|
|
||||||
if delta != 0 {
|
if delta != 0 {
|
||||||
// Rounds the delta up to the nearest multiple of the maximum int size to keep the types after the insersion point aligned.
|
// Rounds the delta up to the nearest multiple of the maximum int size to keep the types after the insersion point aligned.
|
||||||
let mask = (size_of::<uintmax_t>() - 1) as isize;
|
// stdint crate defines intmax_t as an alias for c_long; use it directly to avoid extra
|
||||||
|
// dependency.
|
||||||
|
let mask = (size_of::<core::ffi::c_long>() - 1) as isize;
|
||||||
let offset = (delta + mask) & !mask;
|
let offset = (delta + mask) & !mask;
|
||||||
let mut visited_vec = vec![false; buf.len()];
|
let mut visited_vec = vec![false; buf.len()];
|
||||||
|
|
||||||
@@ -715,7 +715,8 @@ unsafe fn get_any_value_string(
|
|||||||
}
|
}
|
||||||
let mut field_value = get_any_field_string(&table, &field, schema);
|
let mut field_value = get_any_field_string(&table, &field, schema);
|
||||||
if field.type_().base_type() == BaseType::String {
|
if field.type_().base_type() == BaseType::String {
|
||||||
field_value = escape(field_value.as_str()).to_string();
|
// Escape the string
|
||||||
|
field_value = format!("{:?}", field_value.as_str());
|
||||||
}
|
}
|
||||||
s += field.name();
|
s += field.name();
|
||||||
s += ": ";
|
s += ": ";
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -25,9 +25,9 @@ use crate::{
|
|||||||
FlatbufferResult, ForwardsUOffset,
|
FlatbufferResult, ForwardsUOffset,
|
||||||
};
|
};
|
||||||
use flatbuffers::{Follow, Table, Vector, VerifierOptions};
|
use flatbuffers::{Follow, Table, Vector, VerifierOptions};
|
||||||
use num::traits::float::Float;
|
use num_traits::float::Float;
|
||||||
use num::traits::int::PrimInt;
|
use num_traits::int::PrimInt;
|
||||||
use num::traits::FromPrimitive;
|
use num_traits::FromPrimitive;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
|||||||
@@ -727,7 +727,7 @@ class RustGenerator : public BaseGenerator {
|
|||||||
code_ += "mod bitflags_{{ENUM_NAMESPACE}} {";
|
code_ += "mod bitflags_{{ENUM_NAMESPACE}} {";
|
||||||
code_ += " flatbuffers::bitflags::bitflags! {";
|
code_ += " flatbuffers::bitflags::bitflags! {";
|
||||||
GenComment(enum_def.doc_comment, " ");
|
GenComment(enum_def.doc_comment, " ");
|
||||||
code_ += " #[derive(Default)]";
|
code_ += " #[derive(Default, Debug, Clone, Copy, PartialEq)]";
|
||||||
code_ += " {{ACCESS_TYPE}} struct {{ENUM_TY}}: {{BASE_TYPE}} {";
|
code_ += " {{ACCESS_TYPE}} struct {{ENUM_TY}}: {{BASE_TYPE}} {";
|
||||||
ForAllEnumValues1(enum_def, [&](const EnumVal &ev) {
|
ForAllEnumValues1(enum_def, [&](const EnumVal &ev) {
|
||||||
this->GenComment(ev.doc_comment, " ");
|
this->GenComment(ev.doc_comment, " ");
|
||||||
@@ -843,20 +843,7 @@ class RustGenerator : public BaseGenerator {
|
|||||||
code_ +=
|
code_ +=
|
||||||
" let b = flatbuffers::read_scalar_at::<{{BASE_TYPE}}>(buf, loc);";
|
" let b = flatbuffers::read_scalar_at::<{{BASE_TYPE}}>(buf, loc);";
|
||||||
if (IsBitFlagsEnum(enum_def)) {
|
if (IsBitFlagsEnum(enum_def)) {
|
||||||
// Safety:
|
code_ += " Self::from_bits_retain(b)";
|
||||||
// This is safe because we know bitflags is implemented with a repr
|
|
||||||
// transparent uint of the correct size. from_bits_unchecked will be
|
|
||||||
// replaced by an equivalent but safe from_bits_retain in bitflags 2.0
|
|
||||||
// https://github.com/bitflags/bitflags/issues/262
|
|
||||||
code_ += " // Safety:";
|
|
||||||
code_ +=
|
|
||||||
" // This is safe because we know bitflags is implemented with a "
|
|
||||||
"repr transparent uint of the correct size.";
|
|
||||||
code_ +=
|
|
||||||
" // from_bits_unchecked will be replaced by an equivalent but "
|
|
||||||
"safe from_bits_retain in bitflags 2.0";
|
|
||||||
code_ += " // https://github.com/bitflags/bitflags/issues/262";
|
|
||||||
code_ += " Self::from_bits_unchecked(b)";
|
|
||||||
} else {
|
} else {
|
||||||
code_ += " Self(b)";
|
code_ += " Self(b)";
|
||||||
}
|
}
|
||||||
@@ -884,20 +871,7 @@ class RustGenerator : public BaseGenerator {
|
|||||||
code_ += " fn from_little_endian(v: {{BASE_TYPE}}) -> Self {";
|
code_ += " fn from_little_endian(v: {{BASE_TYPE}}) -> Self {";
|
||||||
code_ += " let b = {{BASE_TYPE}}::from_le(v);";
|
code_ += " let b = {{BASE_TYPE}}::from_le(v);";
|
||||||
if (IsBitFlagsEnum(enum_def)) {
|
if (IsBitFlagsEnum(enum_def)) {
|
||||||
// Safety:
|
code_ += " Self::from_bits_retain(b)";
|
||||||
// This is safe because we know bitflags is implemented with a repr
|
|
||||||
// transparent uint of the correct size. from_bits_unchecked will be
|
|
||||||
// replaced by an equivalent but safe from_bits_retain in bitflags 2.0
|
|
||||||
// https://github.com/bitflags/bitflags/issues/262
|
|
||||||
code_ += " // Safety:";
|
|
||||||
code_ +=
|
|
||||||
" // This is safe because we know bitflags is implemented with a "
|
|
||||||
"repr transparent uint of the correct size.";
|
|
||||||
code_ +=
|
|
||||||
" // from_bits_unchecked will be replaced by an equivalent but "
|
|
||||||
"safe from_bits_retain in bitflags 2.0";
|
|
||||||
code_ += " // https://github.com/bitflags/bitflags/issues/262";
|
|
||||||
code_ += " unsafe { Self::from_bits_unchecked(b) }";
|
|
||||||
} else {
|
} else {
|
||||||
code_ += " Self(b)";
|
code_ += " Self(b)";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ use super::*;
|
|||||||
mod bitflags_color {
|
mod bitflags_color {
|
||||||
flatbuffers::bitflags::bitflags! {
|
flatbuffers::bitflags::bitflags! {
|
||||||
/// Composite components of Monster color.
|
/// Composite components of Monster color.
|
||||||
#[derive(Default)]
|
#[derive(Default, Debug, Clone, Copy, PartialEq)]
|
||||||
pub struct Color: u8 {
|
pub struct Color: u8 {
|
||||||
const Red = 1;
|
const Red = 1;
|
||||||
/// \brief color Green
|
/// \brief color Green
|
||||||
@@ -31,11 +31,7 @@ impl<'a> flatbuffers::Follow<'a> for Color {
|
|||||||
#[inline]
|
#[inline]
|
||||||
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
|
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
|
||||||
let b = flatbuffers::read_scalar_at::<u8>(buf, loc);
|
let b = flatbuffers::read_scalar_at::<u8>(buf, loc);
|
||||||
// Safety:
|
Self::from_bits_retain(b)
|
||||||
// This is safe because we know bitflags is implemented with a repr transparent uint of the correct size.
|
|
||||||
// from_bits_unchecked will be replaced by an equivalent but safe from_bits_retain in bitflags 2.0
|
|
||||||
// https://github.com/bitflags/bitflags/issues/262
|
|
||||||
Self::from_bits_unchecked(b)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,11 +53,7 @@ impl flatbuffers::EndianScalar for Color {
|
|||||||
#[allow(clippy::wrong_self_convention)]
|
#[allow(clippy::wrong_self_convention)]
|
||||||
fn from_little_endian(v: u8) -> Self {
|
fn from_little_endian(v: u8) -> Self {
|
||||||
let b = u8::from_le(v);
|
let b = u8::from_le(v);
|
||||||
// Safety:
|
Self::from_bits_retain(b)
|
||||||
// This is safe because we know bitflags is implemented with a repr transparent uint of the correct size.
|
|
||||||
// from_bits_unchecked will be replaced by an equivalent but safe from_bits_retain in bitflags 2.0
|
|
||||||
// https://github.com/bitflags/bitflags/issues/262
|
|
||||||
unsafe { Self::from_bits_unchecked(b) }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ use super::*;
|
|||||||
#[allow(non_upper_case_globals)]
|
#[allow(non_upper_case_globals)]
|
||||||
mod bitflags_long_enum {
|
mod bitflags_long_enum {
|
||||||
flatbuffers::bitflags::bitflags! {
|
flatbuffers::bitflags::bitflags! {
|
||||||
#[derive(Default)]
|
#[derive(Default, Debug, Clone, Copy, PartialEq)]
|
||||||
pub struct LongEnum: u64 {
|
pub struct LongEnum: u64 {
|
||||||
const LongOne = 2;
|
const LongOne = 2;
|
||||||
const LongTwo = 4;
|
const LongTwo = 4;
|
||||||
@@ -27,11 +27,7 @@ impl<'a> flatbuffers::Follow<'a> for LongEnum {
|
|||||||
#[inline]
|
#[inline]
|
||||||
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
|
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
|
||||||
let b = flatbuffers::read_scalar_at::<u64>(buf, loc);
|
let b = flatbuffers::read_scalar_at::<u64>(buf, loc);
|
||||||
// Safety:
|
Self::from_bits_retain(b)
|
||||||
// This is safe because we know bitflags is implemented with a repr transparent uint of the correct size.
|
|
||||||
// from_bits_unchecked will be replaced by an equivalent but safe from_bits_retain in bitflags 2.0
|
|
||||||
// https://github.com/bitflags/bitflags/issues/262
|
|
||||||
Self::from_bits_unchecked(b)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,11 +49,7 @@ impl flatbuffers::EndianScalar for LongEnum {
|
|||||||
#[allow(clippy::wrong_self_convention)]
|
#[allow(clippy::wrong_self_convention)]
|
||||||
fn from_little_endian(v: u64) -> Self {
|
fn from_little_endian(v: u64) -> Self {
|
||||||
let b = u64::from_le(v);
|
let b = u64::from_le(v);
|
||||||
// Safety:
|
Self::from_bits_retain(b)
|
||||||
// This is safe because we know bitflags is implemented with a repr transparent uint of the correct size.
|
|
||||||
// from_bits_unchecked will be replaced by an equivalent but safe from_bits_retain in bitflags 2.0
|
|
||||||
// https://github.com/bitflags/bitflags/issues/262
|
|
||||||
unsafe { Self::from_bits_unchecked(b) }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ use super::*;
|
|||||||
mod bitflags_color {
|
mod bitflags_color {
|
||||||
flatbuffers::bitflags::bitflags! {
|
flatbuffers::bitflags::bitflags! {
|
||||||
/// Composite components of Monster color.
|
/// Composite components of Monster color.
|
||||||
#[derive(Default)]
|
#[derive(Default, Debug, Clone, Copy, PartialEq)]
|
||||||
pub struct Color: u8 {
|
pub struct Color: u8 {
|
||||||
const Red = 1;
|
const Red = 1;
|
||||||
/// \brief color Green
|
/// \brief color Green
|
||||||
@@ -42,11 +42,7 @@ impl<'a> flatbuffers::Follow<'a> for Color {
|
|||||||
#[inline]
|
#[inline]
|
||||||
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
|
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
|
||||||
let b = flatbuffers::read_scalar_at::<u8>(buf, loc);
|
let b = flatbuffers::read_scalar_at::<u8>(buf, loc);
|
||||||
// Safety:
|
Self::from_bits_retain(b)
|
||||||
// This is safe because we know bitflags is implemented with a repr transparent uint of the correct size.
|
|
||||||
// from_bits_unchecked will be replaced by an equivalent but safe from_bits_retain in bitflags 2.0
|
|
||||||
// https://github.com/bitflags/bitflags/issues/262
|
|
||||||
Self::from_bits_unchecked(b)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -68,11 +64,7 @@ impl flatbuffers::EndianScalar for Color {
|
|||||||
#[allow(clippy::wrong_self_convention)]
|
#[allow(clippy::wrong_self_convention)]
|
||||||
fn from_little_endian(v: u8) -> Self {
|
fn from_little_endian(v: u8) -> Self {
|
||||||
let b = u8::from_le(v);
|
let b = u8::from_le(v);
|
||||||
// Safety:
|
Self::from_bits_retain(b)
|
||||||
// This is safe because we know bitflags is implemented with a repr transparent uint of the correct size.
|
|
||||||
// from_bits_unchecked will be replaced by an equivalent but safe from_bits_retain in bitflags 2.0
|
|
||||||
// https://github.com/bitflags/bitflags/issues/262
|
|
||||||
unsafe { Self::from_bits_unchecked(b) }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ use super::*;
|
|||||||
#[allow(non_upper_case_globals)]
|
#[allow(non_upper_case_globals)]
|
||||||
mod bitflags_long_enum {
|
mod bitflags_long_enum {
|
||||||
flatbuffers::bitflags::bitflags! {
|
flatbuffers::bitflags::bitflags! {
|
||||||
#[derive(Default)]
|
#[derive(Default, Debug, Clone, Copy, PartialEq)]
|
||||||
pub struct LongEnum: u64 {
|
pub struct LongEnum: u64 {
|
||||||
const LongOne = 2;
|
const LongOne = 2;
|
||||||
const LongTwo = 4;
|
const LongTwo = 4;
|
||||||
@@ -38,11 +38,7 @@ impl<'a> flatbuffers::Follow<'a> for LongEnum {
|
|||||||
#[inline]
|
#[inline]
|
||||||
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
|
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
|
||||||
let b = flatbuffers::read_scalar_at::<u64>(buf, loc);
|
let b = flatbuffers::read_scalar_at::<u64>(buf, loc);
|
||||||
// Safety:
|
Self::from_bits_retain(b)
|
||||||
// This is safe because we know bitflags is implemented with a repr transparent uint of the correct size.
|
|
||||||
// from_bits_unchecked will be replaced by an equivalent but safe from_bits_retain in bitflags 2.0
|
|
||||||
// https://github.com/bitflags/bitflags/issues/262
|
|
||||||
Self::from_bits_unchecked(b)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,11 +60,7 @@ impl flatbuffers::EndianScalar for LongEnum {
|
|||||||
#[allow(clippy::wrong_self_convention)]
|
#[allow(clippy::wrong_self_convention)]
|
||||||
fn from_little_endian(v: u64) -> Self {
|
fn from_little_endian(v: u64) -> Self {
|
||||||
let b = u64::from_le(v);
|
let b = u64::from_le(v);
|
||||||
// Safety:
|
Self::from_bits_retain(b)
|
||||||
// This is safe because we know bitflags is implemented with a repr transparent uint of the correct size.
|
|
||||||
// from_bits_unchecked will be replaced by an equivalent but safe from_bits_retain in bitflags 2.0
|
|
||||||
// https://github.com/bitflags/bitflags/issues/262
|
|
||||||
unsafe { Self::from_bits_unchecked(b) }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1767,19 +1767,19 @@ mod write_and_read_examples {
|
|||||||
assert_eq!(
|
assert_eq!(
|
||||||
format!("{:.5?}", &m),
|
format!("{:.5?}", &m),
|
||||||
"Monster { pos: Some(Vec3 { x: 1.00000, y: 2.00000, z: 3.00000, \
|
"Monster { pos: Some(Vec3 { x: 1.00000, y: 2.00000, z: 3.00000, \
|
||||||
test1: 3.00000, test2: Green, test3: Test { a: 5, b: 6 } }), \
|
test1: 3.00000, test2: Color(Green), test3: Test { a: 5, b: 6 } \
|
||||||
mana: 150, hp: 80, name: \"MyMonster\", \
|
}), mana: 150, hp: 80, name: \"MyMonster\", inventory: Some([0, 1, \
|
||||||
inventory: Some([0, 1, 2, 3, 4]), color: Blue, test_type: Monster, \
|
2, 3, 4]), color: Color(Blue), test_type: Monster, test: Monster { \
|
||||||
test: Monster { pos: None, mana: 150, hp: 100, name: \"Fred\", \
|
pos: None, mana: 150, hp: 100, name: \"Fred\", inventory: None, \
|
||||||
inventory: None, color: Blue, test_type: NONE, test: None, \
|
color: Color(Blue), test_type: NONE, test: None, test4: None, \
|
||||||
test4: None, testarrayofstring: None, testarrayoftables: None, \
|
testarrayofstring: None, testarrayoftables: None, enemy: None, \
|
||||||
enemy: None, testnestedflatbuffer: None, testempty: None, \
|
testnestedflatbuffer: None, testempty: None, testbool: false, \
|
||||||
testbool: false, testhashs32_fnv1: 0, testhashu32_fnv1: 0, \
|
testhashs32_fnv1: 0, testhashu32_fnv1: 0, testhashs64_fnv1: 0, \
|
||||||
testhashs64_fnv1: 0, testhashu64_fnv1: 0, testhashs32_fnv1a: 0, \
|
testhashu64_fnv1: 0, testhashs32_fnv1a: 0, testhashu32_fnv1a: 0, \
|
||||||
testhashu32_fnv1a: 0, testhashs64_fnv1a: 0, testhashu64_fnv1a: 0, \
|
testhashs64_fnv1a: 0, testhashu64_fnv1a: 0, testarrayofbools: \
|
||||||
testarrayofbools: None, testf: 3.14159, testf2: 3.00000, testf3: 0.00000, \
|
None, testf: 3.14159, testf2: 3.00000, testf3: 0.00000, \
|
||||||
testarrayofstring2: None, testarrayofsortedstruct: None, flex: None, \
|
testarrayofstring2: None, testarrayofsortedstruct: None, flex: \
|
||||||
test5: None, vector_of_longs: None, vector_of_doubles: None, \
|
None, test5: None, vector_of_longs: None, vector_of_doubles: None, \
|
||||||
parent_namespace_test: None, vector_of_referrables: None, \
|
parent_namespace_test: None, vector_of_referrables: None, \
|
||||||
single_weak_reference: 0, vector_of_weak_references: None, \
|
single_weak_reference: 0, vector_of_weak_references: None, \
|
||||||
vector_of_strong_referrables: None, co_owning_reference: 0, \
|
vector_of_strong_referrables: None, co_owning_reference: 0, \
|
||||||
@@ -1787,22 +1787,22 @@ mod write_and_read_examples {
|
|||||||
vector_of_non_owning_references: None, any_unique_type: NONE, \
|
vector_of_non_owning_references: None, any_unique_type: NONE, \
|
||||||
any_unique: None, any_ambiguous_type: NONE, any_ambiguous: None, \
|
any_unique: None, any_ambiguous_type: NONE, any_ambiguous: None, \
|
||||||
vector_of_enums: None, signed_enum: None, \
|
vector_of_enums: None, signed_enum: None, \
|
||||||
testrequirednestedflatbuffer: None, scalar_key_sorted_tables: None, \
|
testrequirednestedflatbuffer: None, scalar_key_sorted_tables: \
|
||||||
native_inline: None, long_enum_non_enum_default: (empty), \
|
None, native_inline: None, long_enum_non_enum_default: \
|
||||||
long_enum_normal_default: LongOne, nan_default: NaN, inf_default: \
|
LongEnum(0x0), long_enum_normal_default: LongEnum(LongOne), \
|
||||||
inf, positive_inf_default: inf, infinity_default: inf, \
|
nan_default: NaN, inf_default: inf, positive_inf_default: inf, \
|
||||||
positive_infinity_default: inf, negative_inf_default: -inf, \
|
infinity_default: inf, positive_infinity_default: inf, \
|
||||||
negative_infinity_default: -inf, double_inf_default: inf }, \
|
negative_inf_default: -inf, negative_infinity_default: -inf, \
|
||||||
test4: Some([Test { a: 10, b: 20 }, Test { a: 30, b: 40 }]), \
|
double_inf_default: inf }, test4: Some([Test { a: 10, b: 20 }, \
|
||||||
testarrayofstring: Some([\"test1\", \"test2\"]), \
|
Test { a: 30, b: 40 }]), testarrayofstring: Some([\"test1\", \
|
||||||
testarrayoftables: None, enemy: None, testnestedflatbuffer: None, \
|
\"test2\"]), testarrayoftables: None, enemy: None, \
|
||||||
testempty: None, testbool: false, testhashs32_fnv1: 0, \
|
testnestedflatbuffer: None, testempty: None, testbool: false, \
|
||||||
testhashu32_fnv1: 0, testhashs64_fnv1: 0, testhashu64_fnv1: 0, \
|
testhashs32_fnv1: 0, testhashu32_fnv1: 0, testhashs64_fnv1: 0, \
|
||||||
testhashs32_fnv1a: 0, testhashu32_fnv1a: 0, testhashs64_fnv1a: 0, \
|
testhashu64_fnv1: 0, testhashs32_fnv1a: 0, testhashu32_fnv1a: 0, \
|
||||||
testhashu64_fnv1a: 0, testarrayofbools: None, testf: 3.14159, \
|
testhashs64_fnv1a: 0, testhashu64_fnv1a: 0, testarrayofbools: \
|
||||||
testf2: 3.00000, testf3: 0.00000, testarrayofstring2: None, \
|
None, testf: 3.14159, testf2: 3.00000, testf3: 0.00000, \
|
||||||
testarrayofsortedstruct: None, flex: None, test5: None, \
|
testarrayofstring2: None, testarrayofsortedstruct: None, flex: \
|
||||||
vector_of_longs: None, vector_of_doubles: None, \
|
None, test5: None, vector_of_longs: None, vector_of_doubles: None, \
|
||||||
parent_namespace_test: None, vector_of_referrables: None, \
|
parent_namespace_test: None, vector_of_referrables: None, \
|
||||||
single_weak_reference: 0, vector_of_weak_references: None, \
|
single_weak_reference: 0, vector_of_weak_references: None, \
|
||||||
vector_of_strong_referrables: None, co_owning_reference: 0, \
|
vector_of_strong_referrables: None, co_owning_reference: 0, \
|
||||||
@@ -1810,12 +1810,13 @@ mod write_and_read_examples {
|
|||||||
vector_of_non_owning_references: None, any_unique_type: NONE, \
|
vector_of_non_owning_references: None, any_unique_type: NONE, \
|
||||||
any_unique: None, any_ambiguous_type: NONE, any_ambiguous: None, \
|
any_unique: None, any_ambiguous_type: NONE, any_ambiguous: None, \
|
||||||
vector_of_enums: None, signed_enum: None, \
|
vector_of_enums: None, signed_enum: None, \
|
||||||
testrequirednestedflatbuffer: None, scalar_key_sorted_tables: None, \
|
testrequirednestedflatbuffer: None, scalar_key_sorted_tables: \
|
||||||
native_inline: None, long_enum_non_enum_default: (empty), \
|
None, native_inline: None, long_enum_non_enum_default: \
|
||||||
long_enum_normal_default: LongOne, nan_default: NaN, inf_default: \
|
LongEnum(0x0), long_enum_normal_default: LongEnum(LongOne), \
|
||||||
inf, positive_inf_default: inf, infinity_default: inf, \
|
nan_default: NaN, inf_default: inf, positive_inf_default: inf, \
|
||||||
positive_infinity_default: inf, negative_inf_default: -inf, \
|
infinity_default: inf, positive_infinity_default: inf, \
|
||||||
negative_infinity_default: -inf, double_inf_default: inf }"
|
negative_inf_default: -inf, negative_infinity_default: -inf, \
|
||||||
|
double_inf_default: inf }"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,10 @@ let package = Package(
|
|||||||
dependencies: [
|
dependencies: [
|
||||||
.package(path: "../../.."),
|
.package(path: "../../.."),
|
||||||
.package(url: "https://github.com/grpc/grpc-swift.git", from: "1.4.1"),
|
.package(url: "https://github.com/grpc/grpc-swift.git", from: "1.4.1"),
|
||||||
|
// Prevent the build system from pulling 2.29.1 to prevent Swift 5.8 build breaks.
|
||||||
|
// The patch update introduced code that uses "switch expression syntax" that wasn't valid until Swift 5.9 [1].
|
||||||
|
// [1] https://github.com/swiftlang/swift-evolution/blob/main/proposals/0380-if-switch-expressions.md
|
||||||
|
.package(url: "https://github.com/apple/swift-nio-ssl.git", exact: "2.29.0"),
|
||||||
],
|
],
|
||||||
targets: [
|
targets: [
|
||||||
.executableTarget(
|
.executableTarget(
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
load("@aspect_rules_js//npm:defs.bzl", "npm_package")
|
load("@aspect_rules_js//npm:defs.bzl", "npm_package")
|
||||||
load("@aspect_rules_ts//ts:defs.bzl", "ts_project")
|
load("@aspect_rules_ts//ts:defs.bzl", "ts_project")
|
||||||
load("@flatbuffers_npm//:defs.bzl", "npm_link_all_packages")
|
load("@flatbuffers_npm//:defs.bzl", "npm_link_all_packages")
|
||||||
|
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
|
||||||
|
|
||||||
filegroup(
|
filegroup(
|
||||||
name = "distribution",
|
name = "distribution",
|
||||||
|
|||||||
Reference in New Issue
Block a user