djkoloski / rust_serialization_benchmark

Benchmarks for rust serialization frameworks
527 stars 48 forks source link

Compilation failure on MX-LINUX. #9

Closed prataprc closed 3 years ago

prataprc commented 3 years ago

Cloned the repo and ran:

$ cargo bench

Machine: AMD64 / Mx-linux.

Had a compilation error due to build.rs script.

  --- stderr                                                                          
  thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { kind: Failed, description: "Error while trying to execute `capnp compile`: Failed: Permission denied (os erro
r 13).  Please verify that version 0.5.2 or higher of the capnp executable is installed on your system. See https://capnproto.org/install.html" }', build.rs:9:10                             
  stack backtrace:    
...
...
17:     0x563db33e0c69 - build_script_build::main::h48173f533a2f1a5e
                                 at /home/prataprc/tmp/rust_serialization_benchmark/build.rs:3:5 
...
...

Can't decipher the reasoning behind the tools/ directory. Looks like they contain windows executable. Let me know whether I am missing something here. Thanks,

djkoloski commented 3 years ago

Ah, you're absolutely right. I've only been running these benchmarks under Windows, and haven't gotten around to building out support for other operating systems.

Both flatbuffers and capnp lean on pre-packaged binaries to build source code. I checked in those compiled sources, so if you wanted to run the tests you could comment out the capnp build step and that should work.

If you want to change the schemas or add new datasets, you'll need a the compilers for those two.

prataprc commented 3 years ago

A simple fix could be to wrap the CompilerCommand() within cfg!(windows).

    if cfg!(windows) {
        capnpc::CompilerCommand::new()
            .capnp_executable("tools/capnp.exe")
            .file("src/datasets/log/log.capnp")
            .output_path(".")
            .default_parent_module(vec!["datasets".into(), "log".into()])
            .run()
            .unwrap();
        capnpc::CompilerCommand::new()
            .capnp_executable("tools/capnp.exe")
            .file("src/datasets/mesh/mesh.capnp")
            .output_path(".")
            .default_parent_module(vec!["datasets".into(), "mesh".into()])
            .run()
            .unwrap();
        capnpc::CompilerCommand::new()
            .capnp_executable("tools/capnp.exe")
            .file("src/datasets/minecraft_savedata/minecraft_savedata.capnp")
            .output_path(".")
            .default_parent_module(vec!["datasets".into(), "minecraft_savedata".into()])
            .run()
            .unwrap();
    }
djkoloski commented 3 years ago

That would work and I think it would be a good enough fix for now, but ideally I'd like to get the complete workflow available on linux.

djkoloski commented 3 years ago

Fixed by e09544aee5f778b274169d091599346f511bb121. You will need to install the capnproto package for your distribution; see the unix installation section on the Cap'n Proto site.