djkoloski / rust_serialization_benchmark

Benchmarks for rust serialization frameworks
514 stars 48 forks source link

Can't add new framework on MacOS #60

Closed 8192K closed 3 months ago

8192K commented 4 months ago

I am trying to add bincode2 (RC3 currently) but I can't even run a cargo check on MacOS without any changes. It fails to find capnp. Can this repo currently be run on Windows only?

djkoloski commented 4 months ago

Are you running into issues because of the contents of build.rs? The primary job of build.rs is to generate Rust code for capnproto, flatbuffers, and prost. Right now, on all non-windows platforms, build.rs assumes that your environment is configured with the compilers for those serialization frameworks installed. On linux, you should install the capnproto, flatbuffers, and protobuf compilers through your package manager or provide custom versions via environment variables. My personal development environment is primarily windows, which has worse support for installing those compilers in a structured way. I added some additional logic to that file which uses locally-vendored versions of those compilers to get it working on Windows. I'm not familiar with installing packages on MacOS; the two paths forward are:

  1. Comment out everything in build.rs while you're working. Because the Rust code for those schemas is checked in, you do not need to have those compilers installed unless you need to regenerate them.
  2. Install packages for or vendor the required compilers and configure your environment so they're picked up correctly by build.rs.
8192K commented 4 months ago

I am getting

error[E0554]: #![feature] may not be used on the stable release channel --> /Users/sebastian/.cargo/registry/src/index.crates.io-6f17d22bba15001f/msgpacker-0.4.3/src/lib.rs:3:5 | 3 | iter_array_chunks, | ^^^^^^^^^^^^^^^^^

error[E0554]: #![feature] may not be used on the stable release channel --> /Users/sebastian/.cargo/registry/src/index.crates.io-6f17d22bba15001f/msgpacker-0.4.3/src/lib.rs:4:5 | 4 | maybe_uninit_array_assume_init, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0554]: #![feature] may not be used on the stable release channel --> /Users/sebastian/.cargo/registry/src/index.crates.io-6f17d22bba15001f/msgpacker-0.4.3/src/lib.rs:5:5 | 5 | maybe_uninit_uninit_array | ^^^^^^^^^^^^^^^^^^^^^^^^^

error: could not compile msgpacker (lib) due to 3 previous errors

djkoloski commented 4 months ago

That's because the msgpacker crate is enabled by default and uses nightly features. Your default Rust compiler is stable. You can fix this in a few ways:

djkoloski commented 3 months ago

Assuming this is done since bincode 2 support has landed.