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

cargo-crev can't build on stock windows because of the openssl dependency #372

Closed
Lokathor opened this issue Aug 18, 2020 · 12 comments
Closed

Comments

@Lokathor
Copy link
Contributor

Is there a reason for not using rustls?

@dpc
Copy link
Collaborator

dpc commented Aug 18, 2020

I don't think we're using openssl directly. IIRC it is a git2 pulling it in. It would be great to get rid of it.

@dpc
Copy link
Collaborator

dpc commented Aug 18, 2020

BTW. Releases do have windows binaries built automatically so it does seem to work (at least it used to). Just some extra steps are required.

@TheGoddessInari
Copy link

You are using openssl-sys directly in https://github.com/crev-dev/cargo-crev/blob/master/cargo-crev/Cargo.toml, and git2 needs the vendored-openssl feature, in effect, for this to work right. Unless you want to pass -C target-feature=+crt-static to RUSTFLAGS.

@dpc
Copy link
Collaborator

dpc commented Jun 7, 2021

Should be fixed now.

@dpc dpc closed this as completed Jun 7, 2021
@btrepp
Copy link

btrepp commented Jul 15, 2021

Still seems to be an issue, I'm sure there might be a combination of flags or something. Might be nice to document this for windows if required?

   Compiling block-buffer v0.9.0
error: failed to run custom build command for `openssl-sys v0.9.65`

Caused by:
  process didn't exit successfully: `C:\Users\Beau\AppData\Local\Temp\cargo-installH1DdsH\release\build\openssl-sys-757e6b8db1e6f053\build-script-main` (exit code: 101)
  --- stdout
  cargo:rustc-cfg=const_fn
  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\\Beau\\AppData\\Local\\Temp\\cargo-installH1DdsH\\release\\build\\openssl-sys-28c449d5f55acb72\\out\\openssl-build\\install" "no-dso" "no-shared" "no-ssl3" "no-unit-test" "no-comp" "no-zlib" "no-zlib-dynamic" "no-md2" "no-rc5" "no-weak-ssl-ciphers" "no-camellia" "no-idea" "no-seed" "no-engine" "no-asm" "VC-WIN64A"

  --- stderr
  thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', C:\Users\Beau\.cargo\registry\src\github.com-1ecc6299db9ec823\openssl-src-111.15.0+1.1.1k\src\lib.rs:469:39
  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 `cargo-crev v0.21.0`, intermediate artifacts can be found at `C:\Users\Beau\AppData\Local\Temp\cargo-installH1DdsH`

Caused by:
  build failed

@dpc
Copy link
Collaborator

dpc commented Jul 15, 2021

@btrepp I'm not sure if we released it already. Can you try building from git?

@thargy
Copy link

thargy commented Aug 19, 2021

Just ran cargo install cargo-crev on fresh Windows 11 and got a similar but different error:

   ...
   Compiling darling_core v0.12.4
error: failed to run custom build command for `openssl-sys v0.9.66`

Caused by:
  process didn't exit successfully: `C:\Users\tharg\AppData\Local\Temp\cargo-install9rw87r\release\build\openssl-sys-86c843182c0bcf1d\build-script-main` (exit code: 101)
  --- stdout
  cargo:rustc-cfg=const_fn
  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\\tharg\\AppData\\Local\\Temp\\cargo-install9rw87r\\release\\build\\openssl-sys-dfc12431a78801ab\\out\\openssl-build\\install" "no-dso" "no-shared" "no-ssl3" "no-unit-test" "no-comp" "no-zlib" "no-zlib-dynamic" "no-md2" "no-rc5" "no-weak-ssl-ciphers" "no-camellia" "no-idea" "no-seed" "no-engine" "no-asm" "VC-WIN64A"
  Configuring OpenSSL version 1.1.1k (0x101010bfL) for VC-WIN64A
  Using os-specific seed configuration

  --- stderr

  ******************************************************************************
  This perl implementation doesn't produce Windows like paths (with backward
  slash directory separators).  Please use an implementation that matches your
  building platform.

  This Perl version: 5.32.1 for x86_64-msys-thread-multi
  ******************************************************************************
  thread 'main' panicked at '


  Error configuring OpenSSL build:
      Command: "perl" "./Configure" "--prefix=C:\\Users\\tharg\\AppData\\Local\\Temp\\cargo-install9rw87r\\release\\build\\openssl-sys-dfc12431a78801ab\\out\\openssl-build\\install" "no-dso" "no-shared" "no-ssl3" "no-unit-test" "no-comp" "no-zlib" "no-zlib-dynamic" "no-md2" "no-rc5" "no-weak-ssl-ciphers" "no-camellia" "no-idea" "no-seed" "no-engine" "no-asm" "VC-WIN64A"
      Exit status: exit code: 127


      ', C:\Users\tharg\.cargo\registry\src\github.com-1ecc6299db9ec823\openssl-src-111.15.0+1.1.1k\src\lib.rs:471:13
  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 `cargo-crev v0.21.1`, intermediate artifacts can be found at `C:\Users\tharg\AppData\Local\Temp\cargo-install9rw87r`

Caused by:
  build failed

@thargy
Copy link

thargy commented Aug 19, 2021

Did the following:

  • Read this 🧑‍🎓
  • Installed Strawberry Perl 🍓
  • Ran again - same error 😖
  • Realised was running from git bash terminal (MSYS) 😀
  • Ran from PowerShell 😟
  • Got new error 😩:
   Compiling opener v0.4.1
error: failed to run custom build command for `openssl-sys v0.9.66`

Caused by:
  process didn't exit successfully: `C:\Users\tharg\AppData\Local\Temp\cargo-installj0FF3p\release\build\openssl-sys-86c843182c0bcf1d\build-script-main` (exit code: 101)
  --- stdout
  cargo:rustc-cfg=const_fn
  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\\tharg\\AppData\\Local\\Temp\\cargo-installj0FF3p\\release\\build\\openssl-sys-dfc12431a78801ab\\out\\openssl-build\\install" "no-dso" "no-shared" "no-ssl3" "no-unit-test" "no-comp" "no-zlib" "no-zlib-dynamic" "no-md2" "no-rc5" "no-weak-ssl-ciphers" "no-camellia" "no-idea" "no-seed" "no-engine" "no-asm" "VC-WIN64A"

  --- stderr
  thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', C:\Users\tharg\.cargo\registry\src\github.com-1ecc6299db9ec823\openssl-src-111.15.0+1.1.1k\src\lib.rs:469:39
  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 `cargo-crev v0.21.1`, intermediate artifacts can be found at `C:\Users\tharg\AppData\Local\Temp\cargo-installj0FF3p`

Caused by:
  build failed

@dpc
Copy link
Collaborator

dpc commented Aug 19, 2021

We have (used to have) a CI building windows releases. You might want to give them a try as a workaround.

@thargy
Copy link

thargy commented Aug 19, 2021

Thanks, @dpc! I have found success 🥂

  • Downloaded the binaries, but there's no installation instructions. Worried I'd be missing some installation magic. 😟
  • Started looking and found this page which said I needed to install OpenSSL 👍🏻
  • Downloaded and installed from here - lots of requests for money, but TBYB! 😰
  • Reran cargo install cargo-crev 🙏🏻
  • Same error 😩
  • Researched cargo (I'm new) 🧑‍🎓
  • Dumped downloaded binary into C:\Users\<USER>\.cargo\bin
  • Executed cargo crev and got help message 🥳

Not the best onboarding experience for a nOOb, but not the worst. Documenting my journey here to save the embarrassment of others 😊, and to allow anyone collaborators interested in fixing the experience on Windows to understand the steps taken.

TL;DR Please can the getting started documents explain how to install the release binaries (i.e. unzip, and copy the cargo-crev.exe executable to the %USERPROFILE%\.cargo\bin folder on windows). I know that will be obvious to anyone with more experience of Rust, but it will make it slightly more user friendly.

Also, if there's a way to detect the error on build and provide a more helpful message (or even just recommend downloading the release binary and installing it into the above folder), that too would be grand. 👍🏻

@dpc2035
Copy link

dpc2035 commented Jan 5, 2022

Thanks, @dpc2! I have found success 🥂

* Downloaded the binaries, but there's no installation instructions. Worried I'd be missing some installation magic. 😟

* Started looking and found [this page](https://github.com/crev-dev/cargo-crev/blob/master/cargo-crev/src/doc/compiling.md) which said I needed to install OpenSSL 👍🏻

* Downloaded and installed [from here](https://slproweb.com/products/Win32OpenSSL.html) - lots of requests for money, but TBYB! 😰

* Reran `cargo install cargo-crev` 🙏🏻

* Same error 😩

* Researched cargo (I'm new) 🧑‍🎓

* Dumped downloaded binary into `C:\Users\<USER>\.cargo\bin`

* Executed `cargo crev` and got help message 🥳

Not the best onboarding experience for a nOOb, but not the worst. Documenting my journey here to save the embarrassment of others 😊, and to allow anyone collaborators interested in fixing the experience on Windows to understand the steps taken.

TL;DR Please can the getting started documents explain how to install the release binaries (i.e. unzip, and copy the cargo-crev.exe executable to the %USERPROFILE%\.cargo\bin folder on windows). I know that will be obvious to anyone with more experience of Rust, but it will make it slightly more user friendly.

Also, if there's a way to detect the error on build and provide a more helpful message (or even just recommend downloading the release binary and installing it into the above folder), that too would be grand. 👍🏻

you should thank @dpc , not @dpc2, we are different person :-)

@thargy
Copy link

thargy commented Jan 5, 2022

you should thank @dpc , not @dpc2, we are different person :-)

Ooops! Edited original.

Thanks!

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

6 participants