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

Build fails on Windows #110

Open
xobs opened this issue Apr 8, 2024 · 2 comments
Open

Build fails on Windows #110

xobs opened this issue Apr 8, 2024 · 2 comments

Comments

@xobs
Copy link

xobs commented Apr 8, 2024

Running cargo install --no-default-features pq as it says in the readme fails because I don't have Perl installed:

error: failed to run custom build command for `openssl-sys v0.9.102`

Caused by:
  process didn't exit successfully: `C:\Users\Sean\AppData\Local\Temp\cargo-installd9xwa7\release\build\openssl-sys-b8dbedb3f6d2712d\build-script-main` (exit code: 101)
  --- stdout
  cargo:rerun-if-env-changed=X86_64_PC_WINDOWS_MSVC_OPENSSL_NO_VENDOR
  X86_64_PC_WINDOWS_MSVC_OPENSSL_NO_VENDOR unset
  cargo:rerun-if-env-changed=OPENSSL_NO_VENDOR
  OPENSSL_NO_VENDOR unset
  running "perl" "./Configure" "--prefix=C:/Users/Sean/AppData/Local/Temp/cargo-installd9xwa7/release/build/openssl-sys-1bd94b2fc2c3dd8d/out/openssl-build/install" "--openssldir=SYS$MANAGER:[OPENSSL]" "no-dso" "no-shared" "no-ssl3" "no-tests" "no-comp" "no-zlib" "no-zlib-dynamic" "--libdir=lib" "no-md2" "no-rc5" "no-weak-ssl-ciphers" "no-camellia" "no-idea" "no-seed" "no-capieng" "no-asm" "VC-WIN64A"

  --- stderr
  thread 'main' panicked at C:\Users\Sean\.cargo\registry\src\index.crates.io-6f17d22bba15001f\openssl-src-300.2.3+3.2.1\src\lib.rs:611:9:



  Error configuring OpenSSL build:
      Command: "perl" "./Configure" "--prefix=C:/Users/Sean/AppData/Local/Temp/cargo-installd9xwa7/release/build/openssl-sys-1bd94b2fc2c3dd8d/out/openssl-build/install" "--openssldir=SYS$MANAGER:[OPENSSL]" "no-dso" "no-shared" "no-ssl3" "no-tests" "no-comp" "no-zlib" "no-zlib-dynamic" "--libdir=lib" "no-md2" "no-rc5" "no-weak-ssl-ciphers" "no-camellia" "no-idea" "no-seed" "no-capieng" "no-asm" "VC-WIN64A"
      Failed to execute: program not found



  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: failed to compile `pq v1.4.3`, intermediate artifacts can be found at `C:\Users\Sean\AppData\Local\Temp\cargo-installd9xwa7`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
@xobs
Copy link
Author

xobs commented Apr 8, 2024

I got it to build by applying this patch:

diff --git a/Cargo.toml b/Cargo.toml
index 89bca6c..0cbb396 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -12,7 +12,6 @@ exclude = ["pq-bin.tar.gz", "pq", "target/**"]
 edition = "2021"

 [dependencies]
-openssl = { version = "0.10", features = ["vendored"] }
 serde = "1.0"
 erased_serde_json = { path = "erased-serde-json", version = "0.1.3" }
 serde_json = "1.0"

@vincentdephily
Copy link
Contributor

That patch fails the build unless kafka is disabled though. This is probably better, tying the use of openssl to the use of kafka:

diff --git a/Cargo.toml b/Cargo.toml
index 89bca6c..0cbb396 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -12,7 +12,6 @@ exclude = ["pq-bin.tar.gz", "pq", "target/**"]
 edition = "2021"
 
 [dependencies]
-openssl = { version = "0.10", features = ["vendored"] }
 serde = "1.0"
 erased_serde_json = { path = "erased-serde-json", version = "0.1.3" }
 serde_json = "1.0"
diff --git a/stream-delimit/Cargo.toml b/stream-delimit/Cargo.toml
index 7de208a..ec35235 100644
--- a/stream-delimit/Cargo.toml
+++ b/stream-delimit/Cargo.toml
@@ -11,9 +11,10 @@ keywords = ["protobuf", "serde"]
 edition = "2018"
 
 [dependencies]
+openssl = { version = "0.10", features = ["vendored"], optional = true }
 kafka = { version = "0.8", optional = true }
 byteorder = "1.3"
 
 [features]
 default = []
-with_kafka = ["kafka"]
+with_kafka = ["kafka", "openssl"]

See also sfackler/rust-openssl#2149 for the perl-on-windows issue.

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