Brendonovich / prisma-client-rust

Type-safe database access for Rust
https://prisma.brendonovich.dev
Apache License 2.0
1.84k stars 108 forks source link

The 0.6.0 version fails to compile in the workspace directory #147

Closed tingfeng-key closed 2 years ago

tingfeng-key commented 2 years ago

My sample code is here, 0.5.2 is no problem. But 0.6.0 compiles and reports an error

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

Caused by:
  process didn't exit successfully: `D:\bt\wwwroot\grammers_prisma_test\target\debug\build\openssl-sys-88cd88a803d80821\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=D:\\bt\\wwwroot\\grammers_prisma_test\\target\\debug\\build\\openssl-sys-4884da697e128e76\\out\\openssl-build\\install" "--openssldir=SYS$MANAGER:[OPENSSL]" "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: Error { kind: NotFound, message: "program not found" }', C:\Users\ld_100\.cargo\registry\src\rsproxy.cn-8f6827c7555bfaf8\openssl-src-111.22.0+1.1.1q\src\lib.rs:488:39
  stack backtrace:
     0: std::panicking::begin_panic_handler
               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library\std\src\panicking.rs:584
     1: core::panicking::panic_fmt
               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library\core\src\panicking.rs:142
     2: core::result::unwrap_failed
               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library\core\src\result.rs:1785
     3: enum$<core::result::Result<std::process::ExitStatus,std::io::error::Error> >::unwrap<std::process::ExitStatus,std::io::error::Error>
               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3\library\core\src\result.rs:1078
     4: openssl_src::Build::run_command
               at C:\Users\xxx\.cargo\registry\src\rsproxy.cn-8f6827c7555bfaf8\openssl-src-111.22.0+1.1.1q\src\lib.rs:488
     5: openssl_src::Build::build
               at C:\Users\xxx\.cargo\registry\src\rsproxy.cn-8f6827c7555bfaf8\openssl-src-111.22.0+1.1.1q\src\lib.rs:429
     6: build_script_main::find_vendored::get_openssl
               at .\build\find_vendored.rs:5
     7: build_script_main::find_openssl
               at .\build\main.rs:57
     8: build_script_main::main
               at .\build\main.rs:68
     9: core::ops::function::FnOnce::call_once<void (*)(),tuple$<> >
               at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3\library\core\src\ops\function.rs:248
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
warning: build failed, waiting for other jobs to finish...
Brendonovich commented 2 years ago

The problem is that your workspace is not using feature resolver version 2. I have just added a note on this in the migration guide.

Usually adding edition = "2021" does the trick, but in workspaces you need to set resolver = "2" in the root Cargo.toml.

tingfeng-key commented 2 years ago

Thank you. This method is useful to me. It can be compiled normally now