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

protobuf-src build requires autotools, which is not available on windows (by default) #142

Closed
nolmelab opened this issue Sep 5, 2023 · 6 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@nolmelab
Copy link

nolmelab commented Sep 5, 2023

Description of the problem encountered

I tried to build examples with ractor and ractor_cluster on windows 10 machine
and encountered following error:

Compiling protobuf-src v1.1.0+21.5
error: failed to run custom build command for `protobuf-src v1.1.0+21.5`

Caused by:
  process didn't exit successfully: `D:\nolmelab\daily_rust\target\debug\build\protobuf-src-fa7f52d64a0497cb\build-script-build` (exit code: 101)
  --- stderr
  thread 'main' panicked at '
  `sh` is required to run `configure`

  build script failed, must exit now', C:\Users\keedongpark\.cargo\registry\src\index.crates.io-6f17d22bba15001f\autotools-0.2.6\src\lib.rs:781:5
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish... 

autotools requires configure & make, which are not available on windows by default.

Describe the solution you'd like
I tried to remove dependency on protobuf-src in ractor repository by removing
protobuf-src line in ractor_cluster/Cargo.toml and std::env::set_var("PROTOC", ... )
line in build.rs file.

Then the build complains about missing google.protobuf.Timestamp and some other files while compiling *.proto files. (I made protoc.exe available via PATH env variable)

If ractor_cluster requires some of the .proto files from protobuf and protoc only,
then I think the dependency on protobuf-src can be removed.

It will make using ractor_cluster on windows really simple.

Describe alternatives you've considered
I also consider that dependency on protobuf can be removed entirely using rust serialization
(binary or json) in platform compatible way. Then it can make building and using ractor_cluster easier than now still supporting (possibly) other languages and platforms.

Additional context

@nolmelab nolmelab added the enhancement New feature or request label Sep 5, 2023
@nolmelab
Copy link
Author

nolmelab commented Sep 5, 2023

fn build_protobufs() {
    // std::env::set_var("PROTOC", protobuf_src::protoc());
    std::env::set_var("PROTOC", "D:/App/protoc-24.2-win64/bin/protoc.exe");
...
}

Setting protoc.exe to the downloaded folder made the ractor crate build success on windows.
I think this can be optional for windows.

@slawlor
Copy link
Owner

slawlor commented Sep 6, 2023

I'll try and look into it, sounds like a bug for Windows. Thanks for reporting.

@slawlor slawlor added the bug Something isn't working label Sep 6, 2023
@slawlor
Copy link
Owner

slawlor commented Sep 6, 2023

Related: MaterializeInc/rust-protobuf-native#4

@hemaolong
Copy link

Any suggestion to solve/bypass the problem?

@benesch
Copy link

benesch commented May 13, 2024

The latest version of protobuf-src now builds with CMake rather than autotools. I've not yet tested this, but it may "just work" with Windows now.

@slawlor
Copy link
Owner

slawlor commented Dec 17, 2024

Fixed with #296 by using vendored binaries instead of building protoc from source.

@slawlor slawlor closed this as completed Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants