Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't add new framework on MacOS #60

Closed
8192K opened this issue Jan 5, 2024 · 4 comments
Closed

Can't add new framework on MacOS #60

8192K opened this issue Jan 5, 2024 · 4 comments

Comments

@8192K
Copy link
Contributor

8192K commented Jan 5, 2024

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
Copy link
Owner

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
Copy link
Contributor Author

8192K commented Jan 5, 2024

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
Copy link
Owner

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:

  • Comment out msgpacker from the list of default features in Cargo.toml.
  • When building or running from the command line, specify --no-default-features --features "..." with the explicit list of crates you want to enable benchmarking for.
  • Temporarily override to a nightly compiler by running rustup override add nightly in your workspace.
    If you're working in an editor, you may be better off with the first or third options. LSPs like rust-analyzer use all of the default settings for a workspace and will continue to show errors based on those default settings.

@djkoloski
Copy link
Owner

Assuming this is done since bincode 2 support has landed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants