Skip to content

Commit

Permalink
Merge branch 'master' into bugfix/goGenerateFiles
Browse files Browse the repository at this point in the history
  • Loading branch information
dbaileychess authored Nov 19, 2023
2 parents 25bdb2b + a632c3c commit 97b525f
Show file tree
Hide file tree
Showing 29 changed files with 259 additions and 364 deletions.
78 changes: 36 additions & 42 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:
- "*" # new tag version, like `0.8.4` or else
branches:
- master
- flatbuffers-64
pull_request:
branches:
- master
Expand All @@ -22,10 +21,10 @@ jobs:
digests-gcc: ${{ steps.hash-gcc.outputs.hashes }}
digests-clang: ${{ steps.hash-clang.outputs.hashes }}
name: Build Linux
runs-on: ubuntu-latest
runs-on: ubuntu-22.04-64core
strategy:
matrix:
cxx: [g++-10, clang++-14]
cxx: [g++-13, clang++-15]
fail-fast: false
steps:
- uses: actions/checkout@v3
Expand All @@ -39,10 +38,6 @@ jobs:
run: |
chmod +x flatc
./flatc --version
# - 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 @@ -58,35 +53,37 @@ jobs:
with:
files: Linux.flatc.binary.${{ matrix.cxx }}.zip
- name: Generate SLSA subjects - clang
if: matrix.cxx == 'clang++-14' && startsWith(github.ref, 'refs/tags/')
if: matrix.cxx == 'clang++-15' && startsWith(github.ref, 'refs/tags/')
id: hash-clang
run: echo "hashes=$(sha256sum Linux.flatc.binary.${{ matrix.cxx }}.zip | base64 -w0)" >> $GITHUB_OUTPUT
- name: Generate SLSA subjects - gcc
if: matrix.cxx == 'g++-10' && startsWith(github.ref, 'refs/tags/')
if: matrix.cxx == 'g++-13' && startsWith(github.ref, 'refs/tags/')
id: hash-gcc
run: echo "hashes=$(sha256sum Linux.flatc.binary.${{ matrix.cxx }}.zip | base64 -w0)" >> $GITHUB_OUTPUT

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

build-linux-out-of-source:
name: Build Linux with out-of-source build location
runs-on: ubuntu-latest
runs-on: ubuntu-22.04-64core
steps:
- uses: actions/checkout@v3
- name: make build directory
run: mkdir build
- name: cmake
working-directory: build
run: >
CXX=clang++-14 cmake .. -G "Unix Makefiles" -DFLATBUFFERS_STRICT_MODE=ON
CXX=clang++-15 cmake .. -G "Unix Makefiles" -DFLATBUFFERS_STRICT_MODE=ON
-DFLATBUFFERS_BUILD_CPP17=ON -DFLATBUFFERS_CPP_STD=17
- name: build
working-directory: build
Expand All @@ -100,16 +97,17 @@ jobs:

build-linux-cpp-std:
name: Build Linux C++
runs-on: ubuntu-latest
runs-on: ubuntu-22.04-64core
strategy:
fail-fast: false
matrix:
std: [11, 14, 17, 20, 23]
cxx: [g++-10, clang++-14]
cxx: [g++-13, clang++-15]
exclude:
# GCC 10.3.0 doesn't support std 23
- cxx: g++-10
std: 23
# Clang++15 10.3.0 stdlibc++ doesn't fully support std 23
- cxx: clang++-15
std: 23

steps:
- uses: actions/checkout@v3
- name: cmake
Expand All @@ -126,7 +124,7 @@ jobs:
if: matrix.std >= 17
run: ./flattests_cpp17

build-windows-cpp-std:
build-cpp-std:
name: Build Windows C++
runs-on: windows-2019
strategy:
Expand Down Expand Up @@ -168,8 +166,6 @@ 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: upload build artifacts
uses: actions/upload-artifact@v1
with:
Expand Down Expand Up @@ -220,7 +216,7 @@ jobs:

build-dotnet-windows:
name: Build .NET Windows
runs-on: windows-2019
runs-on: windows-2022-64core
strategy:
matrix:
configuration: [
Expand Down Expand Up @@ -270,8 +266,6 @@ jobs:
run: |
chmod +x Release/flatc
Release/flatc --version
# - 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 @@ -336,7 +330,7 @@ jobs:

build-android:
name: Build Android (on Linux)
runs-on: ubuntu-latest
runs-on: ubuntu-22.04-64core
steps:
- uses: actions/checkout@v3
- name: set up Java
Expand All @@ -355,10 +349,10 @@ jobs:

build-generator:
name: Check Generated Code
runs-on: ubuntu-latest
runs-on: ubuntu-22.04-64core
strategy:
matrix:
cxx: [g++-10, clang++-14]
cxx: [g++-13, clang++-15]
steps:
- uses: actions/checkout@v3
- name: cmake
Expand Down Expand Up @@ -386,10 +380,10 @@ jobs:

build-benchmarks:
name: Build Benchmarks (on Linux)
runs-on: ubuntu-latest
runs-on: ubuntu-22.04-64core
strategy:
matrix:
cxx: [g++-10]
cxx: [g++-13]
steps:
- uses: actions/checkout@v3
- name: cmake
Expand All @@ -404,7 +398,7 @@ jobs:

build-java:
name: Build Java
runs-on: ubuntu-latest
runs-on: ubuntu-22.04-64core
steps:
- uses: actions/checkout@v3
- name: test
Expand Down Expand Up @@ -433,7 +427,7 @@ jobs:

build-kotlin-linux:
name: Build Kotlin Linux
runs-on: ubuntu-latest
runs-on: ubuntu-22.04-64core
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -456,7 +450,7 @@ jobs:

build-rust-linux:
name: Build Rust Linux
runs-on: ubuntu-latest
runs-on: ubuntu-22.04-64core
steps:
- uses: actions/checkout@v3
- name: test
Expand All @@ -465,7 +459,7 @@ jobs:

build-rust-windows:
name: Build Rust Windows
runs-on: windows-2019
runs-on: windows-2022-64core
steps:
- uses: actions/checkout@v3
- name: test
Expand All @@ -474,7 +468,7 @@ jobs:

build-python:
name: Build Python
runs-on: ubuntu-latest
runs-on: ubuntu-22.04-64core
steps:
- uses: actions/checkout@v3
- name: flatc
Expand All @@ -486,7 +480,7 @@ jobs:

build-go:
name: Build Go
runs-on: ubuntu-latest
runs-on: ubuntu-22.04-64core
steps:
- uses: actions/checkout@v3
- name: flatc
Expand All @@ -498,7 +492,7 @@ jobs:

build-php:
name: Build PHP
runs-on: ubuntu-latest
runs-on: ubuntu-22.04-64core
steps:
- uses: actions/checkout@v3
- name: flatc
Expand All @@ -512,7 +506,7 @@ jobs:
build-swift:
name: Build Swift
runs-on: ubuntu-latest
runs-on: ubuntu-22.04-64core
steps:
- uses: actions/checkout@v3
- name: test
Expand All @@ -523,7 +517,7 @@ jobs:
build-swift-wasm:
name: Build Swift Wasm
runs-on: ubuntu-latest
runs-on: ubuntu-22.04-64core
container:
image: ghcr.io/swiftwasm/carton:0.15.3
steps:
Expand All @@ -536,7 +530,7 @@ jobs:

build-ts:
name: Build TS
runs-on: ubuntu-latest
runs-on: ubuntu-22.04-64core
steps:
- uses: actions/checkout@v3
- name: flatc
Expand All @@ -554,7 +548,7 @@ jobs:
build-dart:
name: Build Dart
runs-on: ubuntu-latest
runs-on: ubuntu-22.04-64core
steps:
- uses: actions/checkout@v3
- uses: dart-lang/setup-dart@v1
Expand All @@ -569,7 +563,7 @@ jobs:

build-nim:
name: Build Nim
runs-on: ubuntu-latest
runs-on: ubuntu-22.04-64core
steps:
- uses: actions/checkout@v3
- name: flatc
Expand All @@ -588,7 +582,7 @@ jobs:
needs: [build-linux, build-windows, build-mac-intel, build-mac-universal]
outputs:
digests: ${{ steps.hash.outputs.digests }}
runs-on: ubuntu-latest
runs-on: ubuntu-22.04-64core
steps:
- name: Merge results
id: hash
Expand Down
2 changes: 1 addition & 1 deletion CMake/Version.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
message(WARNING "\"${GIT_DESCRIBE_DIRTY}\" does not match pattern v<major>.<minor>.<patch>-<commit>")
endif()
else()
message(WARNING "git describe failed with exit code: ${GIT_DESCRIBE_RESULT}")
message(WARNING "git describe failed with exit code: ${GIT_DESCRIBE_RESULT}\nMake sure you cloned with tags or run 'git fetch --tags'.")
endif()
else()
message(WARNING "git is not found")
Expand Down
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,11 @@ if(FLATBUFFERS_BUILD_TESTS)

# Add a library so there is a single target that the generated samples can
# link too.
add_library(flatsample INTERFACE)
if(MSVC)
add_library(flatsample INTERFACE)
else()
add_library(flatsample STATIC)
endif()

# Since flatsample has no sources, we have to explicitly set the linker lang.
set_target_properties(flatsample PROPERTIES LINKER_LANGUAGE CXX)
Expand Down
14 changes: 14 additions & 0 deletions dart/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Changelog

## 23.5.26

- omit type annotationes for local variables (#7067, #7069, #7070)
- remove BSD 3-clause license (#7073)
- correctly parse lists of enums (#7157)
- align naming conventions for generated code (#7187)
- add `putBool` to fix errors when serializing structs with booleans (#7359)
- fix handling of +/-inf defaults in codegen (#7588)
- fix import issues in generated code (#7621)
- Fix incorrect storage of floats as ints in some cases (#7703)
- add final modifiers to the library implementation (#7943)

## 2.0.5

- switch to null safety (#6696)
Expand Down
10 changes: 1 addition & 9 deletions dart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This package is used to read and write [FlatBuffers](https://google.github.io/flatbuffers/).

Most consumers will want to use the [`flatc` - FlatBuffer compiler](https://github.com/google/flatbuffers) binary for your platform.
You can find it in the `generator/{Platform}` directory of the [released package archive](https://pub.dev/packages/flat_buffers/versions/2.0.5.tar.gz).
You can download the flatc version matching your dart package version from [GitHub releases](https://github.com/google/flatbuffers/releases).

The FlatBuffer compiler `flatc` reads a FlatBuffers IDL schema and generates Dart code.
The generated classes can be used to read or write binary data/files that are interoperable with
Expand All @@ -13,11 +13,3 @@ examples folder.
For more details and documentation, head over to the official site and read the
[Tutorial](https://google.github.io/flatbuffers/flatbuffers_guide_tutorial.html) and how to
[use FlatBuffers in Dart](https://google.github.io/flatbuffers/flatbuffers_guide_use_dart.html).

## Dart 2.0 notes
Version 2.0.5 ships with it's own custom build of `flatc` because this is an extraordinary release to catch-up
with FlatBuffers for other platforms. This generator can only generate dart code (to avoid generating code for other platforms which isn't released yet).
On the other hand, the generated code still produces standard binary FlatBuffers compatible with other languages.
In other words: only `flatc --dart ...` works with this generator, but your app will be able to produce and read standard binary (`Uint8List`) FlatBuffers that are fully compotible with other languages supporting FlatBuffers (e.g. Java, C++, ...).

In the future a common `flatc` binary for all platforms would be shipped through GitHub release page instead.
3 changes: 1 addition & 2 deletions dart/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ homepage: https://github.com/google/flatbuffers
documentation: https://google.github.io/flatbuffers/index.html

environment:
sdk: '>=2.12.0 <3.0.0'
sdk: '>=2.12.0 <4.0.0'

dev_dependencies:
test: ^1.17.7
test_reflective_loader: ^0.2.0
path: ^1.8.0
lints: ^1.0.1

Loading

0 comments on commit 97b525f

Please sign in to comment.