Skip to content

Commit

Permalink
Merge branch 'master' into cmake-3-13-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-lavrenov authored Jan 27, 2023
2 parents 2ee0c7d + 5b7a02d commit d6195e8
Show file tree
Hide file tree
Showing 667 changed files with 22,547 additions and 21,621 deletions.
347 changes: 347 additions & 0 deletions .clang-tidy

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Thank you for submitting a PR!
Please delete this standard text once you've created your own description.

If you make changes to any of the code generators (`src/idl_gen*`) be sure to
build your project, as it will generate code based on the changes. If necessary
[build](https://google.github.io/flatbuffers/flatbuffers_guide_building.html) your project, as it will generate code based on the changes. If necessary
the code generation script can be directly run (`scripts/generate_code.py`),
requires Python3. This allows us to better see the effect of the PR.

Expand Down
44 changes: 37 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ jobs:
run: |
chmod +x flatc
./flatc --version
- name: flatc tests
run: python3 tests/flatc/main.py
# - name: flatc tests
# run: |
# yarn global add esbuild
# python3 tests/flatc/main.py
- name: upload build artifacts
uses: actions/upload-artifact@v1
with:
Expand All @@ -62,6 +64,16 @@ jobs:
if: matrix.cxx == 'g++-10' && startsWith(github.ref, 'refs/tags/')
id: hash-gcc
run: echo "::set-output name=hashes::$(sha256sum Linux.flatc.binary.${{ matrix.cxx }}.zip | base64 -w0)"

build-linux-no-file-tests:
name: Build Linux with -DFLATBUFFERS_NO_FILE_TESTS
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: cmake
run: CXX=clang++-12 cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON -DFLATBUFFERS_CXX_FLAGS="-DFLATBUFFERS_NO_FILE_TESTS" .
- name: build
run: make -j

build-linux-cpp-std:
name: Build Linux C++
Expand Down Expand Up @@ -133,8 +145,8 @@ jobs:
run: msbuild.exe FlatBuffers.sln /p:Configuration=Release /p:Platform=x64
- name: test
run: Release\flattests.exe
- name: flatc tests
run: python3 tests/flatc/main.py --flatc Release\flatc.exe
# - name: flatc tests
# run: python3 tests/flatc/main.py --flatc Release\flatc.exe
- name: upload build artifacts
uses: actions/upload-artifact@v1
with:
Expand Down Expand Up @@ -235,8 +247,8 @@ jobs:
run: |
chmod +x Release/flatc
Release/flatc --version
- name: flatc tests
run: python3 tests/flatc/main.py --flatc Release/flatc
# - name: flatc tests
# run: python3 tests/flatc/main.py --flatc Release/flatc
- name: upload build artifacts
uses: actions/upload-artifact@v1
with:
Expand Down Expand Up @@ -333,6 +345,22 @@ jobs:
- name: Generate gRPC
run: scripts/check-grpc-generated-code.py

build-generator-windows:
name: Check Generated Code on Windows
runs-on: windows-2019
steps:
- uses: actions/checkout@v3
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1
- name: cmake
run: cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_CPP17=ON -DFLATBUFFERS_STRICT_MODE=ON .
- name: build
run: msbuild.exe FlatBuffers.sln /p:Configuration=Release /p:Platform=x64
- name: Generate
run: python3 scripts/check_generate_code.py --flatc Release\flatc.exe
- name: Generate gRPC
run: python3 scripts/check-grpc-generated-code.py --flatc Release\flatc.exe

build-benchmarks:
name: Build Benchmarks (on Linux)
runs-on: ubuntu-latest
Expand Down Expand Up @@ -475,7 +503,9 @@ jobs:
run: yarn compile
- name: test
working-directory: tests/ts
run: python3 TypeScriptTest.py
run: |
yarn global add esbuild
python3 TypeScriptTest.py
build-dart:
name: Build Dart
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/extrabuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build and unit tests that are more time consuming
permissions: read-all

on:
# For manual tests.
workflow_dispatch:
pull_request:
types:
- closed
schedule:
- cron: "30 20 * * *"

jobs:
build-linux-s390x:
name: Build Linux on s390x arch and run unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: uraimo/run-on-arch-action@v2
name: Run commands
id: runcmd
with:
arch: s390x
distro: ubuntu_latest
install: |
apt-get update -q -y
apt-get -y install cmake
apt-get -y install make
apt-get -y install g++
run: |
lscpu | grep Endian
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release
make -j
./flattests
1 change: 1 addition & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ filegroup(
"include/flatbuffers/bfbs_generator.h",
"include/flatbuffers/buffer.h",
"include/flatbuffers/buffer_ref.h",
"include/flatbuffers/code_generator.h",
"include/flatbuffers/code_generators.h",
"include/flatbuffers/default_allocator.h",
"include/flatbuffers/detached_buffer.h",
Expand Down
37 changes: 32 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,46 @@ All major or breaking changes will be documented in this file, as well as any
new features that should be highlighted. Minor fixes or improvements are not
necessarily listed.

## 22.12.06 (Dec 06 2022)
## [23.1.21 (Jan 21 2023)](https://github.com/google/flatbuffers/releases/tag/v23.1.20)

* Reworked entry points for Typescript/Javascript and compatibility for single
file build (#7510)

## [23.1.20 (Jan 20 2023)](https://github.com/google/flatbuffers/releases/tag/v23.1.20)

* Removed go.mod files after some versioning issues were being report (#7780).

## [23.1.4 (Jan 4 2023)](https://github.com/google/flatbuffers/releases/tag/v23.1.4)

* Major release! Just kidding, we are continuing the
[versioning scheme](https://github.com/google/flatbuffers/wiki/Versioning) of
using a date to signify releases. This results in the first release of the new
year to bump the tradition major version field.

* Go minimum version is now 1.19 (#7720) with the addition of Go modules.

* Added CI support for Big Endian regression testing (#7707).

* Fixed `getFullyQualifiedName` in typescript to return name delimited by '.'
instead of '_' (#7730).

* Fixed the versioning scheme to not include leading zeros which are not
consistently handled by every package manager. Only the last release
(12.12.06) should have suffered from this.

## [22.12.06 (Dec 06 2022)](https://github.com/google/flatbuffers/releases/tag/v22.12.06)

* Bug fixing release, no major changes.

## 22.10.25 (Oct 25 2022)
## [22.10.25 (Oct 25 2022)](https://github.com/google/flatbuffers/releases/tag/v22.10.25)

* Added Nim language support with generator and runtime libraries (#7534).

## 22.9.29 (Sept 29 2022)
## [22.9.29 (Sept 29 2022)](https://github.com/google/flatbuffers/releases/tag/v22.9.29)

* Rust soundness fixes to avoid the crate from bing labelled unsafe (#7518).

## 22.9.24 (Sept 24 2022)
## [22.9.24 (Sept 24 2022)](https://github.com/google/flatbuffers/releases/tag/v22.9.24)

* 20 Major releases in a row? Nope, we switched to a new
[versioning scheme](https://github.com/google/flatbuffers/wiki/Versioning)
Expand Down Expand Up @@ -67,4 +94,4 @@ necessarily listed.

* First binary schema generator (Lua) to generate Lua code via a .bfbs file.
This is mostly an implementation detail of flatc internals, but will be slowly
applied to the other language generators.
applied to the other language generators.
12 changes: 5 additions & 7 deletions CMake/CMakeLists_legacy.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -467,14 +467,12 @@ endif()
if(FLATBUFFERS_BUILD_SHAREDLIB)
add_library(flatbuffers_shared SHARED ${FlatBuffers_Library_SRCS})

# Shared object version: "major.minor.micro"
# - micro updated every release when there is no API/ABI changes
# - minor updated when there are additions in API/ABI
# - major (ABI number) updated when there are changes in ABI (or removals)
set(FlatBuffers_Library_SONAME_MAJOR ${VERSION_MAJOR})
set(FlatBuffers_Library_SONAME_FULL "${FlatBuffers_Library_SONAME_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
# FlatBuffers use calendar-based versioning and do not provide any ABI
# stability guarantees. Therefore, always use the full version as SOVERSION
# in order to avoid breaking reverse dependencies on upgrades.
set(FlatBuffers_Library_SONAME_FULL "${PROJECT_VERSION}")
set_target_properties(flatbuffers_shared PROPERTIES OUTPUT_NAME flatbuffers
SOVERSION "${FlatBuffers_Library_SONAME_MAJOR}"
SOVERSION "${FlatBuffers_Library_SONAME_FULL}"
VERSION "${FlatBuffers_Library_SONAME_FULL}")
if(FLATBUFFERS_ENABLE_PCH)
add_pch_to_target(flatbuffers_shared include/flatbuffers/pch/pch.h)
Expand Down
6 changes: 3 additions & 3 deletions CMake/Version.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set(VERSION_MAJOR 22)
set(VERSION_MINOR 12)
set(VERSION_PATCH 06)
set(VERSION_MAJOR 23)
set(VERSION_MINOR 1)
set(VERSION_PATCH 21)
set(VERSION_COMMIT 0)

if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
Expand Down
16 changes: 9 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ set(FlatBuffers_Library_SRCS
include/flatbuffers/buffer_ref.h
include/flatbuffers/default_allocator.h
include/flatbuffers/detached_buffer.h
include/flatbuffers/code_generator.h
include/flatbuffers/flatbuffer_builder.h
include/flatbuffers/flatbuffers.h
include/flatbuffers/flexbuffers.h
Expand All @@ -167,6 +168,8 @@ set(FlatBuffers_Library_SRCS

set(FlatBuffers_Compiler_SRCS
${FlatBuffers_Library_SRCS}
src/idl_gen_binary.cpp
src/idl_gen_text.cpp
src/idl_gen_cpp.cpp
src/idl_gen_csharp.cpp
src/idl_gen_dart.cpp
Expand Down Expand Up @@ -426,6 +429,7 @@ else()

# This isn't working for some reason: $<$<CXX_COMPILER_ID:CLANG>:
$<$<BOOL:${IS_CLANG}>:
-Wnewline-eof
-Wno-unknown-warning-option
-Wmissing-declarations
-Wzero-as-null-pointer-constant
Expand Down Expand Up @@ -523,14 +527,12 @@ endif()
if(FLATBUFFERS_BUILD_SHAREDLIB)
add_library(flatbuffers_shared SHARED ${FlatBuffers_Library_SRCS})
target_link_libraries(flatbuffers_shared PRIVATE $<BUILD_INTERFACE:ProjectConfig>)
# Shared object version: "major.minor.micro"
# - micro updated every release when there is no API/ABI changes
# - minor updated when there are additions in API/ABI
# - major (ABI number) updated when there are changes in ABI (or removals)
set(FlatBuffers_Library_SONAME_MAJOR ${VERSION_MAJOR})
set(FlatBuffers_Library_SONAME_FULL "${FlatBuffers_Library_SONAME_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
# FlatBuffers use calendar-based versioning and do not provide any ABI
# stability guarantees. Therefore, always use the full version as SOVERSION
# in order to avoid breaking reverse dependencies on upgrades.
set(FlatBuffers_Library_SONAME_FULL "${PROJECT_VERSION}")
set_target_properties(flatbuffers_shared PROPERTIES OUTPUT_NAME flatbuffers
SOVERSION "${FlatBuffers_Library_SONAME_MAJOR}"
SOVERSION "${FlatBuffers_Library_SONAME_FULL}"
VERSION "${FlatBuffers_Library_SONAME_FULL}")
if(FLATBUFFERS_ENABLE_PCH)
add_pch_to_target(flatbuffers_shared include/flatbuffers/pch/pch.h)
Expand Down
2 changes: 1 addition & 1 deletion FlatBuffers.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'FlatBuffers'
s.version = '22.12.06'
s.version = '23.1.21'
s.summary = 'FlatBuffers: Memory Efficient Serialization Library'

s.description = "FlatBuffers is a cross platform serialization library architected for
Expand Down
2 changes: 1 addition & 1 deletion Package@swift-5.5.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ let package = Package(
.target(
name: "FlatBuffers",
dependencies: [],
path: "swift/Sources")
path: "swift/Sources"),
])

6 changes: 5 additions & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,12 @@ yarn_install(
name = "npm",
exports_directories_only = False,
# Unfreeze to add/remove packages.
frozen_lockfile = True,
frozen_lockfile = False,
package_json = "//:package.json",
symlink_node_modules = False,
yarn_lock = "//:yarn.lock",
)

load("@build_bazel_rules_nodejs//toolchains/esbuild:esbuild_repositories.bzl", "esbuild_repositories")

esbuild_repositories(npm_repository = "npm")
18 changes: 15 additions & 3 deletions android/app/src/main/java/generated/com/fbs/app/Animal.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,21 @@

package com.fbs.app

import java.nio.*
import com.google.flatbuffers.BaseVector
import com.google.flatbuffers.BooleanVector
import com.google.flatbuffers.ByteVector
import com.google.flatbuffers.Constants
import com.google.flatbuffers.DoubleVector
import com.google.flatbuffers.FlatBufferBuilder
import com.google.flatbuffers.FloatVector
import com.google.flatbuffers.LongVector
import com.google.flatbuffers.StringVector
import com.google.flatbuffers.Struct
import com.google.flatbuffers.Table
import com.google.flatbuffers.UnionVector
import java.nio.ByteBuffer
import java.nio.ByteOrder
import kotlin.math.sign
import com.google.flatbuffers.*

@Suppress("unused")
class Animal : Table() {
Expand Down Expand Up @@ -36,7 +48,7 @@ class Animal : Table() {
return if(o != 0) bb.getShort(o + bb_pos).toUShort() else 0u
}
companion object {
fun validateVersion() = Constants.FLATBUFFERS_22_12_06()
fun validateVersion() = Constants.FLATBUFFERS_23_1_21()
fun getRootAsAnimal(_bb: ByteBuffer): Animal = getRootAsAnimal(_bb, Animal())
fun getRootAsAnimal(_bb: ByteBuffer, obj: Animal): Animal {
_bb.order(ByteOrder.LITTLE_ENDIAN)
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ FetchContent_MakeAvailable(
googlebenchmark
)

set(CPP_BENCH_DIR cpp)
set(CPP_BENCH_DIR ${CMAKE_CURRENT_SOURCE_DIR}/cpp)
set(CPP_FB_BENCH_DIR ${CPP_BENCH_DIR}/flatbuffers)
set(CPP_RAW_BENCH_DIR ${CPP_BENCH_DIR}/raw)
set(CPP_BENCH_FBS ${CPP_FB_BENCH_DIR}/bench.fbs)
Expand Down
Loading

0 comments on commit d6195e8

Please sign in to comment.