• tymcauley's avatar
    Fix rust crate for big-endian targets (#5229) · 9e82ee25
    tymcauley authored
    Thanks for tackling this, @tymcauley !
    
    * big endian docker test -- wip
    
    * tweaks
    
    * tweaks
    
    * tweaks
    
    * docker tweaks
    
    * fix conditional compilation issues
    
    * reactivate other docker tests
    
    * try some more cross-platform config (from tymcauley)
    
    * Update tests/docker/languages/Dockerfile.testing.rust.big_endian.1_30_1
    Co-Authored-By: 's avatarrw <rw@users.noreply.github.com>
    
    * Update tests/docker/languages/Dockerfile.testing.rust.big_endian.1_30_1
    Co-Authored-By: 's avatarrw <rw@users.noreply.github.com>
    
    * Update tests/docker/languages/Dockerfile.testing.rust.big_endian.1_30_1
    Co-Authored-By: 's avatarrw <rw@users.noreply.github.com>
    
    * Resolved Rust warnings during big-endian builds.
    
    * Unify Rust test suites for x86 and MIPS builds.
    
    Note that I had to add four extra packages to the MIPS `Dockerfile`:
    `libexpat1`, `libmagic1`, `libmpdec2`, and `libreadline7`. For a reason
    I couldn't identify, even the simplest Rust MIPS binaries run with
    `qemu-mips` would fail with a segfault when run through this
    `Dockerfile`. After installing the `gdb-multiarch` package to attempt to
    debug the issue, the binaries ran successfully. I pared down the
    packages installed by `gdb-multiarch`, and these four packages are the
    minimum subset necessary to get Rust MIPS binaries running under
    `qemu-mips`.
    
    * Changed Rust tests to use `Vector`s instead of direct-slice-access.
    
    The direct-slice-access method is not available on big-endian targets,
    but `flatbuffers::Vector`s provide an array interface that is available
    on all platforms.
    
    * Resolved FooStruct endianness issues using explicit struct constructor.
    
    This more closely resembles how FlatBuffers structs are constructed in
    generated Rust code.
    
    * Added explanation of how `FooStruct` parallels generated struct code.
    
    Also collected duplicate implementations of `FooStruct` into a common
    location.
    9e82ee25
Name
Last commit
Last update
.appveyor Loading commit data...
.bazelci Loading commit data...
.github Loading commit data...
.travis Loading commit data...
CMake Loading commit data...
android Loading commit data...
conan Loading commit data...
dart Loading commit data...
docs Loading commit data...
go Loading commit data...
grpc Loading commit data...
include/flatbuffers Loading commit data...
java/com/google/flatbuffers Loading commit data...
js Loading commit data...
lobster Loading commit data...
lua Loading commit data...
net/FlatBuffers Loading commit data...
php Loading commit data...
python Loading commit data...
reflection Loading commit data...
rust/flatbuffers Loading commit data...
samples Loading commit data...
src Loading commit data...
tests Loading commit data...
.clang-format Loading commit data...
.editorconfig Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.travis.yml Loading commit data...
BUILD Loading commit data...
CMakeLists.txt Loading commit data...
CONTRIBUTING.md Loading commit data...
LICENSE.txt Loading commit data...
WORKSPACE Loading commit data...
appveyor.yml Loading commit data...
build_defs.bzl Loading commit data...
composer.json Loading commit data...
conanfile.py Loading commit data...
package.json Loading commit data...
pom.xml Loading commit data...
readme.md Loading commit data...