mirror of
https://github.com/google/flatbuffers.git
synced 2026-11-08 05:09:09 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
197e659b4d |
+28
-28
@@ -30,7 +30,7 @@ jobs:
|
|||||||
cxx: [g++-13, clang++-18]
|
cxx: [g++-13, clang++-18]
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- name: cmake
|
- name: cmake
|
||||||
run: CXX=${{ matrix.cxx }} cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON -DFLATBUFFERS_STATIC_FLATC=ON .
|
run: CXX=${{ matrix.cxx }} cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON -DFLATBUFFERS_STATIC_FLATC=ON .
|
||||||
- name: build
|
- name: build
|
||||||
@@ -68,7 +68,7 @@ jobs:
|
|||||||
name: Build Linux with -DFLATBUFFERS_NO_FILE_TESTS
|
name: Build Linux with -DFLATBUFFERS_NO_FILE_TESTS
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- name: cmake
|
- name: cmake
|
||||||
run: CXX=clang++-18 cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON -DFLATBUFFERS_CXX_FLAGS="-DFLATBUFFERS_NO_FILE_TESTS" .
|
run: CXX=clang++-18 cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON -DFLATBUFFERS_CXX_FLAGS="-DFLATBUFFERS_NO_FILE_TESTS" .
|
||||||
- name: build
|
- name: build
|
||||||
@@ -80,7 +80,7 @@ jobs:
|
|||||||
name: Build Linux with out-of-source build location
|
name: Build Linux with out-of-source build location
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- name: make build directory
|
- name: make build directory
|
||||||
run: mkdir build
|
run: mkdir build
|
||||||
- name: cmake
|
- name: cmake
|
||||||
@@ -112,7 +112,7 @@ jobs:
|
|||||||
std: 23
|
std: 23
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- name: cmake
|
- name: cmake
|
||||||
run: >
|
run: >
|
||||||
CXX=${{ matrix.cxx }} cmake -G "Unix Makefiles"
|
CXX=${{ matrix.cxx }} cmake -G "Unix Makefiles"
|
||||||
@@ -135,7 +135,7 @@ jobs:
|
|||||||
std: [11, 14, 17, 20, 23]
|
std: [11, 14, 17, 20, 23]
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- name: Add msbuild to PATH
|
- name: Add msbuild to PATH
|
||||||
uses: microsoft/setup-msbuild@v2
|
uses: microsoft/setup-msbuild@v2
|
||||||
- name: cmake
|
- name: cmake
|
||||||
@@ -160,7 +160,7 @@ jobs:
|
|||||||
name: Build Windows 2022
|
name: Build Windows 2022
|
||||||
runs-on: windows-2022
|
runs-on: windows-2022
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- name: Add msbuild to PATH
|
- name: Add msbuild to PATH
|
||||||
uses: microsoft/setup-msbuild@v2
|
uses: microsoft/setup-msbuild@v2
|
||||||
- name: cmake
|
- name: cmake
|
||||||
@@ -200,7 +200,7 @@ jobs:
|
|||||||
'-p:EnableSpanT=true,UnsafeByteBuffer=true'
|
'-p:EnableSpanT=true,UnsafeByteBuffer=true'
|
||||||
]
|
]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- name: Setup .NET Core SDK
|
- name: Setup .NET Core SDK
|
||||||
uses: actions/setup-dotnet@v5
|
uses: actions/setup-dotnet@v5
|
||||||
with:
|
with:
|
||||||
@@ -229,7 +229,7 @@ jobs:
|
|||||||
name: Build Mac (for Intel)
|
name: Build Mac (for Intel)
|
||||||
runs-on: macos-15-intel
|
runs-on: macos-15-intel
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- name: cmake
|
- name: cmake
|
||||||
run: cmake -G "Xcode" -DCMAKE_OSX_ARCHITECTURES="x86_64" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON .
|
run: cmake -G "Xcode" -DCMAKE_OSX_ARCHITECTURES="x86_64" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON .
|
||||||
- name: build
|
- name: build
|
||||||
@@ -272,7 +272,7 @@ jobs:
|
|||||||
name: Build Mac (universal build)
|
name: Build Mac (universal build)
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- name: cmake
|
- name: cmake
|
||||||
run: cmake -G "Xcode" -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON .
|
run: cmake -G "Xcode" -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON .
|
||||||
- name: build
|
- name: build
|
||||||
@@ -312,7 +312,7 @@ jobs:
|
|||||||
if: false #disabled due to continual failure
|
if: false #disabled due to continual failure
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- name: set up Java
|
- name: set up Java
|
||||||
uses: actions/setup-java@v5
|
uses: actions/setup-java@v5
|
||||||
with:
|
with:
|
||||||
@@ -336,7 +336,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
cxx: [g++-13, clang++-18]
|
cxx: [g++-13, clang++-18]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- name: cmake
|
- name: cmake
|
||||||
run: CXX=${{ matrix.cxx }} cmake -G "Unix Makefiles" -DFLATBUFFERS_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON . && make -j
|
run: CXX=${{ matrix.cxx }} cmake -G "Unix Makefiles" -DFLATBUFFERS_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON . && make -j
|
||||||
- name: Generate
|
- name: Generate
|
||||||
@@ -348,7 +348,7 @@ jobs:
|
|||||||
name: Check Generated Code on Windows
|
name: Check Generated Code on Windows
|
||||||
runs-on: windows-2022
|
runs-on: windows-2022
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- name: Add msbuild to PATH
|
- name: Add msbuild to PATH
|
||||||
uses: microsoft/setup-msbuild@v2
|
uses: microsoft/setup-msbuild@v2
|
||||||
- name: cmake
|
- name: cmake
|
||||||
@@ -367,7 +367,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
cxx: [g++-13]
|
cxx: [g++-13]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- name: cmake
|
- name: cmake
|
||||||
run: CXX=${{ matrix.cxx }} cmake -G "Unix Makefiles" -DFLATBUFFERS_CXX_FLAGS="-Wno-unused-parameter -fno-aligned-new" -DFLATBUFFERS_BUILD_BENCHMARKS=ON -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON . && make -j
|
run: CXX=${{ matrix.cxx }} cmake -G "Unix Makefiles" -DFLATBUFFERS_CXX_FLAGS="-Wno-unused-parameter -fno-aligned-new" -DFLATBUFFERS_BUILD_BENCHMARKS=ON -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON . && make -j
|
||||||
- name: Run benchmarks
|
- name: Run benchmarks
|
||||||
@@ -382,7 +382,7 @@ jobs:
|
|||||||
name: Build Java
|
name: Build Java
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- name: test
|
- name: test
|
||||||
working-directory: java
|
working-directory: java
|
||||||
run: mvn test
|
run: mvn test
|
||||||
@@ -392,7 +392,7 @@ jobs:
|
|||||||
runs-on: macos-15
|
runs-on: macos-15
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
- name: set up Java
|
- name: set up Java
|
||||||
uses: actions/setup-java@v5
|
uses: actions/setup-java@v5
|
||||||
with:
|
with:
|
||||||
@@ -415,7 +415,7 @@ jobs:
|
|||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
- name: set up Java
|
- name: set up Java
|
||||||
uses: actions/setup-java@v5
|
uses: actions/setup-java@v5
|
||||||
with:
|
with:
|
||||||
@@ -439,7 +439,7 @@ jobs:
|
|||||||
name: Build Rust Linux
|
name: Build Rust Linux
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- name: test
|
- name: test
|
||||||
working-directory: tests
|
working-directory: tests
|
||||||
run: bash RustTest.sh
|
run: bash RustTest.sh
|
||||||
@@ -448,7 +448,7 @@ jobs:
|
|||||||
name: Build Rust Windows
|
name: Build Rust Windows
|
||||||
runs-on: windows-2022
|
runs-on: windows-2022
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- name: test
|
- name: test
|
||||||
working-directory: tests
|
working-directory: tests
|
||||||
run: ./RustTest.bat
|
run: ./RustTest.bat
|
||||||
@@ -457,7 +457,7 @@ jobs:
|
|||||||
name: Build Python
|
name: Build Python
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- name: flatc
|
- name: flatc
|
||||||
# FIXME: make test script not rely on 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 -DFLATBUFFERS_STRICT_MODE=ON . && make -j
|
run: cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_INSTALL=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF -DFLATBUFFERS_STRICT_MODE=ON . && make -j
|
||||||
@@ -469,7 +469,7 @@ jobs:
|
|||||||
name: Build Go
|
name: Build Go
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- name: flatc
|
- name: flatc
|
||||||
# FIXME: make test script not rely on 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 -DFLATBUFFERS_STRICT_MODE=ON . && make -j
|
run: cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_INSTALL=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF -DFLATBUFFERS_STRICT_MODE=ON . && make -j
|
||||||
@@ -481,7 +481,7 @@ jobs:
|
|||||||
name: Build PHP
|
name: Build PHP
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- name: flatc
|
- name: flatc
|
||||||
# FIXME: make test script not rely on 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 -DFLATBUFFERS_STRICT_MODE=ON . && make -j
|
run: cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_INSTALL=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF -DFLATBUFFERS_STRICT_MODE=ON . && make -j
|
||||||
@@ -498,7 +498,7 @@ jobs:
|
|||||||
swift: ["6.0", "6.1", "6.2"]
|
swift: ["6.0", "6.1", "6.2"]
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- uses: swift-actions/setup-swift@v2
|
- uses: swift-actions/setup-swift@v2
|
||||||
with:
|
with:
|
||||||
swift-version: ${{ matrix.swift }}
|
swift-version: ${{ matrix.swift }}
|
||||||
@@ -511,7 +511,7 @@ jobs:
|
|||||||
name: Test swift windows
|
name: Test swift windows
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- uses: SwiftyLab/setup-swift@latest
|
- uses: SwiftyLab/setup-swift@latest
|
||||||
with:
|
with:
|
||||||
swift-version: '6.1'
|
swift-version: '6.1'
|
||||||
@@ -522,7 +522,7 @@ jobs:
|
|||||||
name: Test Swift Wasm
|
name: Test Swift Wasm
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- uses: swift-actions/setup-swift@v2
|
- uses: swift-actions/setup-swift@v2
|
||||||
with:
|
with:
|
||||||
swift-version: 6.2.1
|
swift-version: 6.2.1
|
||||||
@@ -540,7 +540,7 @@ jobs:
|
|||||||
name: Build TS
|
name: Build TS
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- name: flatc
|
- name: flatc
|
||||||
# FIXME: make test script not rely on 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
|
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
|
||||||
@@ -559,7 +559,7 @@ jobs:
|
|||||||
name: Build Dart
|
name: Build Dart
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- uses: dart-lang/setup-dart@v1
|
- uses: dart-lang/setup-dart@v1
|
||||||
with:
|
with:
|
||||||
sdk: stable
|
sdk: stable
|
||||||
@@ -574,7 +574,7 @@ jobs:
|
|||||||
name: Build Nim
|
name: Build Nim
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- name: flatc
|
- name: flatc
|
||||||
# FIXME: make test script not rely on 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
|
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
|
||||||
@@ -590,7 +590,7 @@ jobs:
|
|||||||
name: Bazel
|
name: Bazel
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
# Explicitly use 8.5.1 until we can update or https://github.com/actions/runner-images/issues/13564 is fixed.
|
# Explicitly use 8.5.1 until we can update or https://github.com/actions/runner-images/issues/13564 is fixed.
|
||||||
- name: Set env
|
- name: Set env
|
||||||
run: >
|
run: >
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ jobs:
|
|||||||
deploy:
|
deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- name: Configure Git Credentials
|
- name: Configure Git Credentials
|
||||||
run: |
|
run: |
|
||||||
git config user.name github-actions[bot]
|
git config user.name github-actions[bot]
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ jobs:
|
|||||||
name: Publish NPM
|
name: Publish NPM
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: '20.x'
|
node-version: '20.x'
|
||||||
@@ -29,7 +29,7 @@ jobs:
|
|||||||
run:
|
run:
|
||||||
working-directory: ./python
|
working-directory: ./python
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-python@v6
|
- uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: '3.10'
|
python-version: '3.10'
|
||||||
@@ -57,7 +57,7 @@ jobs:
|
|||||||
run:
|
run:
|
||||||
working-directory: ./net/flatbuffers
|
working-directory: ./net/flatbuffers
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-dotnet@v5
|
- uses: actions/setup-dotnet@v5
|
||||||
with:
|
with:
|
||||||
dotnet-version: '8.0.x'
|
dotnet-version: '8.0.x'
|
||||||
@@ -80,7 +80,7 @@ jobs:
|
|||||||
run:
|
run:
|
||||||
working-directory: ./java
|
working-directory: ./java
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
|
|
||||||
- name: Set up Maven Central Repository
|
- name: Set up Maven Central Repository
|
||||||
uses: actions/setup-java@v5
|
uses: actions/setup-java@v5
|
||||||
@@ -108,7 +108,7 @@ jobs:
|
|||||||
run:
|
run:
|
||||||
working-directory: ./kotlin
|
working-directory: ./kotlin
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- name: Set up Maven Central Repository
|
- name: Set up Maven Central Repository
|
||||||
uses: actions/setup-java@v5
|
uses: actions/setup-java@v5
|
||||||
with:
|
with:
|
||||||
@@ -133,7 +133,7 @@ jobs:
|
|||||||
name: Publish crates.io
|
name: Publish crates.io
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- uses: actions-rs/toolchain@v1
|
- uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
toolchain: stable
|
toolchain: stable
|
||||||
|
|||||||
@@ -75,17 +75,6 @@ extension Array where Element == Package.Dependency {
|
|||||||
.package(
|
.package(
|
||||||
url: "https://github.com/grpc/grpc-swift-nio-transport.git",
|
url: "https://github.com/grpc/grpc-swift-nio-transport.git",
|
||||||
from: "2.0.0"),
|
from: "2.0.0"),
|
||||||
// swift-crypto arrives through grpc-swift-nio-transport -> swift-nio-ssl
|
|
||||||
// and is otherwise resolved afresh on every build, because this package
|
|
||||||
// ships no Package.resolved. 5.x asks for swift-tools-version 6.2, so only
|
|
||||||
// the 6.2 CI job selects it - and then fails to compile it, because 5.x
|
|
||||||
// uses `@nonexhaustive`, which the 6.2.x toolchains do not accept yet.
|
|
||||||
// Stay on the last 4.x release that still builds with every toolchain in
|
|
||||||
// the Swift CI matrix (4.3.0 declares swift-tools-version 6.0; 4.4+ asks
|
|
||||||
// for 6.1 and would drop the 6.0 job).
|
|
||||||
.package(
|
|
||||||
url: "https://github.com/apple/swift-crypto.git",
|
|
||||||
"4.0.0" ..< "4.4.0"),
|
|
||||||
]
|
]
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -271,7 +271,7 @@ namespace flatbuffers {
|
|||||||
#if (defined(_MSC_VER) && _MSC_VER >= 1800) || \
|
#if (defined(_MSC_VER) && _MSC_VER >= 1800) || \
|
||||||
(defined(__ANDROID__) && defined(__ANDROID_API__) && __ANDROID_API__>= 26) || \
|
(defined(__ANDROID__) && defined(__ANDROID_API__) && __ANDROID_API__>= 26) || \
|
||||||
(defined(_XOPEN_VERSION) && (_XOPEN_VERSION >= 700)) && \
|
(defined(_XOPEN_VERSION) && (_XOPEN_VERSION >= 700)) && \
|
||||||
!defined(__Fuchsia__) && (!defined(__linux__) || defined(__GLIBC__))
|
!defined(__Fuchsia__)
|
||||||
#define FLATBUFFERS_LOCALE_INDEPENDENT 1
|
#define FLATBUFFERS_LOCALE_INDEPENDENT 1
|
||||||
#else
|
#else
|
||||||
#define FLATBUFFERS_LOCALE_INDEPENDENT 0
|
#define FLATBUFFERS_LOCALE_INDEPENDENT 0
|
||||||
|
|||||||
@@ -24,14 +24,15 @@ class handle:
|
|||||||
struct offset:
|
struct offset:
|
||||||
o:int
|
o:int
|
||||||
|
|
||||||
let sz_8 = 1
|
enum sizeof:
|
||||||
let sz_16 = 2
|
sz_8 = 1
|
||||||
let sz_32 = 4
|
sz_16 = 2
|
||||||
let sz_64 = 8
|
sz_32 = 4
|
||||||
let sz_voffset = 2
|
sz_64 = 8
|
||||||
let sz_uoffset = 4
|
sz_voffset = 2
|
||||||
let sz_soffset = 4
|
sz_uoffset = 4
|
||||||
let sz_metadata_fields = 2
|
sz_soffset = 4
|
||||||
|
sz_metadata_fields = 2
|
||||||
|
|
||||||
class builder:
|
class builder:
|
||||||
buf = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
|
buf = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
|
||||||
|
|||||||
@@ -83,11 +83,6 @@ macro_rules! impl_push_for_endian_scalar {
|
|||||||
unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
|
unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
|
||||||
emplace_scalar::<$ty>(dst, *self);
|
emplace_scalar::<$ty>(dst, *self);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
|
||||||
fn alignment() -> PushAlignment {
|
|
||||||
PushAlignment::new(size_of::<$ty>())
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -103,23 +98,3 @@ impl_push_for_endian_scalar!(u64);
|
|||||||
impl_push_for_endian_scalar!(i64);
|
impl_push_for_endian_scalar!(i64);
|
||||||
impl_push_for_endian_scalar!(f32);
|
impl_push_for_endian_scalar!(f32);
|
||||||
impl_push_for_endian_scalar!(f64);
|
impl_push_for_endian_scalar!(f64);
|
||||||
|
|
||||||
#[cfg(test)]
|
|
||||||
mod tests {
|
|
||||||
use super::*;
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn endian_scalar_push_alignment_matches_wire_size() {
|
|
||||||
assert_eq!(<bool as Push>::alignment().value(), 1);
|
|
||||||
assert_eq!(<u8 as Push>::alignment().value(), 1);
|
|
||||||
assert_eq!(<i8 as Push>::alignment().value(), 1);
|
|
||||||
assert_eq!(<u16 as Push>::alignment().value(), 2);
|
|
||||||
assert_eq!(<i16 as Push>::alignment().value(), 2);
|
|
||||||
assert_eq!(<u32 as Push>::alignment().value(), 4);
|
|
||||||
assert_eq!(<i32 as Push>::alignment().value(), 4);
|
|
||||||
assert_eq!(<f32 as Push>::alignment().value(), 4);
|
|
||||||
assert_eq!(<u64 as Push>::alignment().value(), 8);
|
|
||||||
assert_eq!(<i64 as Push>::alignment().value(), 8);
|
|
||||||
assert_eq!(<f64 as Push>::alignment().value(), 8);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
+1
-1
@@ -404,7 +404,7 @@ class CppGenerator : public BaseGenerator {
|
|||||||
code_ += "struct {{STRUCT_NAME}}BinarySchema {";
|
code_ += "struct {{STRUCT_NAME}}BinarySchema {";
|
||||||
code_ += " static const uint8_t *data() {";
|
code_ += " static const uint8_t *data() {";
|
||||||
code_ += " // Buffer containing the binary schema.";
|
code_ += " // Buffer containing the binary schema.";
|
||||||
code_ += " alignas(uint64_t) static const uint8_t bfbsData[" +
|
code_ += " static const uint8_t bfbsData[" +
|
||||||
NumToString(parser_.builder_.GetSize()) + "] = {";
|
NumToString(parser_.builder_.GetSize()) + "] = {";
|
||||||
code_ += binary_schema_hex_text;
|
code_ += binary_schema_hex_text;
|
||||||
code_ += " };";
|
code_ += " };";
|
||||||
|
|||||||
@@ -16,30 +16,6 @@
|
|||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
@inline(__always)
|
|
||||||
private func verifySizePrefix(
|
|
||||||
byteBuffer: inout ByteBuffer,
|
|
||||||
requireExactSize: Bool,
|
|
||||||
options: VerifierOptions) throws
|
|
||||||
{
|
|
||||||
let verifier = try Verifier(buffer: &byteBuffer, options: options)
|
|
||||||
let prefixPosition = byteBuffer.reader
|
|
||||||
let prefix: UOffset = try verifier.getValue(at: prefixPosition)
|
|
||||||
let availableSize = byteBuffer.size &- UOffset(MemoryLayout<UOffset>.size)
|
|
||||||
|
|
||||||
if requireExactSize {
|
|
||||||
guard prefix == availableSize else {
|
|
||||||
throw FlatbuffersErrors.prefixedSizeNotEqualToBufferSize
|
|
||||||
}
|
|
||||||
} else if prefix > availableSize {
|
|
||||||
throw FlatbuffersErrors.outOfBounds(
|
|
||||||
position: UInt(prefixPosition)
|
|
||||||
&+ UInt(MemoryLayout<UOffset>.size)
|
|
||||||
&+ UInt(prefix),
|
|
||||||
end: byteBuffer.capacity)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Takes in a prefixed sized buffer, where the prefixed size would be skipped.
|
/// Takes in a prefixed sized buffer, where the prefixed size would be skipped.
|
||||||
/// And would verify that the buffer passed is a valid `Flatbuffers` Object.
|
/// And would verify that the buffer passed is a valid `Flatbuffers` Object.
|
||||||
/// - Parameters:
|
/// - Parameters:
|
||||||
@@ -55,10 +31,6 @@ public func getPrefixedSizeCheckedRoot<T: FlatBufferTable & Verifiable>(
|
|||||||
fileId: String? = nil,
|
fileId: String? = nil,
|
||||||
options: VerifierOptions = .init()) throws -> T
|
options: VerifierOptions = .init()) throws -> T
|
||||||
{
|
{
|
||||||
try verifySizePrefix(
|
|
||||||
byteBuffer: &byteBuffer,
|
|
||||||
requireExactSize: false,
|
|
||||||
options: options)
|
|
||||||
byteBuffer.skipPrefix()
|
byteBuffer.skipPrefix()
|
||||||
return try getCheckedRoot(
|
return try getCheckedRoot(
|
||||||
byteBuffer: &byteBuffer,
|
byteBuffer: &byteBuffer,
|
||||||
@@ -81,11 +53,10 @@ public func getCheckedPrefixedSizeRoot<T: FlatBufferTable & Verifiable>(
|
|||||||
fileId: String? = nil,
|
fileId: String? = nil,
|
||||||
options: VerifierOptions = .init()) throws -> T
|
options: VerifierOptions = .init()) throws -> T
|
||||||
{
|
{
|
||||||
try verifySizePrefix(
|
let prefix = byteBuffer.skipPrefix()
|
||||||
byteBuffer: &byteBuffer,
|
if prefix != byteBuffer.size {
|
||||||
requireExactSize: true,
|
throw FlatbuffersErrors.prefixedSizeNotEqualToBufferSize
|
||||||
options: options)
|
}
|
||||||
byteBuffer.skipPrefix()
|
|
||||||
return try getCheckedRoot(
|
return try getCheckedRoot(
|
||||||
byteBuffer: &byteBuffer,
|
byteBuffer: &byteBuffer,
|
||||||
fileId: fileId,
|
fileId: fileId,
|
||||||
@@ -124,15 +95,14 @@ public func getCheckedRoot<T: FlatBufferTable & Verifiable>(
|
|||||||
options: VerifierOptions = .init()) throws -> T
|
options: VerifierOptions = .init()) throws -> T
|
||||||
{
|
{
|
||||||
var verifier = try Verifier(buffer: &byteBuffer, options: options)
|
var verifier = try Verifier(buffer: &byteBuffer, options: options)
|
||||||
let rootPosition = byteBuffer.reader
|
|
||||||
if let fileId = fileId {
|
if let fileId = fileId {
|
||||||
try verifier.verify(id: fileId, at: rootPosition)
|
try verifier.verify(id: fileId)
|
||||||
}
|
}
|
||||||
try ForwardOffset<T>.verify(&verifier, at: rootPosition, of: T.self)
|
try ForwardOffset<T>.verify(&verifier, at: 0, of: T.self)
|
||||||
return T.init(
|
return T.init(
|
||||||
byteBuffer,
|
byteBuffer,
|
||||||
o: Int32(byteBuffer.read(def: UOffset.self, position: rootPosition))
|
o: Int32(byteBuffer.read(def: UOffset.self, position: byteBuffer.reader))
|
||||||
&+ Int32(rootPosition))
|
&+ Int32(byteBuffer.reader))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns a `NON-Checked` flatbuffers object
|
/// Returns a `NON-Checked` flatbuffers object
|
||||||
|
|||||||
@@ -215,16 +215,12 @@ public struct Verifier {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@inline(__always)
|
@inline(__always)
|
||||||
func verify(id: String, at position: Int) throws {
|
func verify(id: String) throws {
|
||||||
let size = MemoryLayout<Int32>.size
|
let size = MemoryLayout<Int32>.size
|
||||||
guard
|
guard storage.capacity >= (size &* 2) else {
|
||||||
position >= 0,
|
|
||||||
position <= storage.capacity,
|
|
||||||
storage.capacity - position >= size &* 2
|
|
||||||
else {
|
|
||||||
throw FlatbuffersErrors.bufferDoesntContainID
|
throw FlatbuffersErrors.bufferDoesntContainID
|
||||||
}
|
}
|
||||||
let str = _buffer.readString(at: position &+ size, count: size)
|
let str = _buffer.readString(at: size, count: size)
|
||||||
if id == str {
|
if id == str {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ namespace Example {
|
|||||||
struct MonsterBinarySchema {
|
struct MonsterBinarySchema {
|
||||||
static const uint8_t *data() {
|
static const uint8_t *data() {
|
||||||
// Buffer containing the binary schema.
|
// Buffer containing the binary schema.
|
||||||
alignas(uint64_t) static const uint8_t bfbsData[14520] = {
|
static const uint8_t bfbsData[14520] = {
|
||||||
0x20,0x00,0x00,0x00,0x42,0x46,0x42,0x53,0x00,0x00,0x00,0x00,0x14,0x00,0x20,0x00,0x04,0x00,0x08,0x00,
|
0x20,0x00,0x00,0x00,0x42,0x46,0x42,0x53,0x00,0x00,0x00,0x00,0x14,0x00,0x20,0x00,0x04,0x00,0x08,0x00,
|
||||||
0x0C,0x00,0x10,0x00,0x14,0x00,0x18,0x00,0x00,0x00,0x1C,0x00,0x14,0x00,0x00,0x00,0x58,0x00,0x00,0x00,
|
0x0C,0x00,0x10,0x00,0x14,0x00,0x18,0x00,0x00,0x00,0x1C,0x00,0x14,0x00,0x00,0x00,0x58,0x00,0x00,0x00,
|
||||||
0x34,0x00,0x00,0x00,0x24,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x70,0x0D,0x00,0x00,0x08,0x00,0x00,0x00,
|
0x34,0x00,0x00,0x00,0x24,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x70,0x0D,0x00,0x00,0x08,0x00,0x00,0x00,
|
||||||
|
|||||||
@@ -373,58 +373,6 @@ final class FlatbuffersVerifierTests {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
func testSizePrefixedVerifierUsesPostPrefixRoot() throws {
|
|
||||||
// The size prefix points to a valid empty decoy table at byte 44. The real
|
|
||||||
// root at byte 4 points to a truncated UInt64 vector that must be rejected.
|
|
||||||
let bytes: [UInt8] = [
|
|
||||||
44, 0, 0, 0,
|
|
||||||
16, 0, 0, 0,
|
|
||||||
6, 0, 8, 0, 4, 0,
|
|
||||||
0, 0, 0, 0, 0, 0,
|
|
||||||
12, 0, 0, 0,
|
|
||||||
8, 0, 0, 0, 0, 0, 0, 0,
|
|
||||||
2, 0, 0, 0, 65, 66,
|
|
||||||
0, 0,
|
|
||||||
4, 0, 4, 0,
|
|
||||||
4, 0, 0, 0,
|
|
||||||
]
|
|
||||||
|
|
||||||
var strictBuffer = ByteBuffer(bytes: bytes)
|
|
||||||
#expect(throws: FlatbuffersErrors.self) {
|
|
||||||
try getCheckedPrefixedSizeRoot(
|
|
||||||
byteBuffer: &strictBuffer) as Swift_Tests_Vectors
|
|
||||||
}
|
|
||||||
|
|
||||||
var prefixedBuffer = ByteBuffer(bytes: bytes)
|
|
||||||
#expect(throws: FlatbuffersErrors.self) {
|
|
||||||
try getPrefixedSizeCheckedRoot(
|
|
||||||
byteBuffer: &prefixedBuffer) as Swift_Tests_Vectors
|
|
||||||
}
|
|
||||||
|
|
||||||
var builder = FlatBufferBuilder()
|
|
||||||
let movie = Movie.createMovie(&builder)
|
|
||||||
Movie.finish(&builder, end: movie, prefix: true)
|
|
||||||
var validBuffer = builder.sizedBuffer
|
|
||||||
let _: Movie = try getCheckedPrefixedSizeRoot(
|
|
||||||
byteBuffer: &validBuffer,
|
|
||||||
fileId: Movie.id)
|
|
||||||
|
|
||||||
var shortBuffer = ByteBuffer(bytes: [0, 0, 0, 0])
|
|
||||||
#expect(throws: FlatbuffersErrors.bufferDoesntContainID) {
|
|
||||||
try getCheckedRoot(
|
|
||||||
byteBuffer: &shortBuffer,
|
|
||||||
fileId: Movie.id) as Movie
|
|
||||||
}
|
|
||||||
|
|
||||||
var oversizedPrefix = ByteBuffer(bytes: [5, 0, 0, 0, 0, 0, 0, 0])
|
|
||||||
#expect(throws: FlatbuffersErrors.outOfBounds(position: 9, end: 8)) {
|
|
||||||
try getPrefixedSizeCheckedRoot(
|
|
||||||
byteBuffer: &oversizedPrefix) as Movie
|
|
||||||
}
|
|
||||||
#expect(oversizedPrefix.reader == 0)
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
func testFullVerifier() throws {
|
func testFullVerifier() throws {
|
||||||
_ =
|
_ =
|
||||||
|
|||||||
Reference in New Issue
Block a user