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 c fails building - package.metadata does not exist - incompatibility with Rust 1.60 ? #49

Open
the-Arioch opened this issue Apr 14, 2022 · 3 comments

Comments

@the-Arioch
Copy link

the-Arioch commented Apr 14, 2022

e:\RustProjects\yasfw>rustup update
info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
info: checking for self-updates

  stable-x86_64-pc-windows-msvc unchanged - rustc 1.60.0 (7737e0b5c 2022-04-04)

info: cleaning up downloads & tmp directories

and

e:\RustProjects\yasfw>"C:\Program Files (x86)\Windows Kits\10\bin\10.0.20348.0\x
64\rc.exe"

e:\RustProjects\yasfw>"C:\Program Files (x86)\Windows Kits\10\bin\10.0.20348.0\x
64\rc.exe" /?

Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
Copyright (C) Microsoft Corporation.  All rights reserved.

Usage:  rc [options] .RC input file
Switches:
   /r       Emit .RES file (optional)
   /v       Verbose (print progress messages)
   /d       Define a symbol
   /u       Undefine a symbol
   /fo      Rename .RES file
....

So, basically, it seems one has to either run the Resource Compiler passing it an .RC script - or do not call it at all.

However...

e:\RustProjects\yasfw>cargo c  
   Compiling yasfw v0.1.2 (E:\RustProjects\yasfw)
error: failed to run custom build command for `yasfw v0.1.2 (E:\RustProjects\yas
fw)`

Caused by:
  process didn't exit successfully: `e:\RustProjects\yasfw\target\debug\build\ya
sfw-d518b4ce6ff52aa5\build-script-build` (exit code: 101)
  --- stdout
  package.metadata does not exist
  "C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.20348.0\\x64\\rc.exe"
  Selected RC path: 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.20348.0\x64
\rc.exe'
  RC Output:
  Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
  Copyright (C) Microsoft Corporation.  All rights reserved.


  ------
  RC Error:

  ------
  cargo:rustc-link-search=native=e:\RustProjects\yasfw\target\debug\build\yasfw-
3c8b5814059d5415\out
  cargo:rustc-link-lib=dylib=resource
  cargo:rerun-if-changed=.git/logs/HEAD
  cargo:rerun-if-changed=.git/refs/tags
  cargo:rustc-env=YASFW_VERSION=v0.1.2-9-gded24cb
  cargo:rerun-if-env-changed=LIBSSH_STATIC

  --- stderr
  thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: NotPre
sent', build.rs:80:105
  stack backtrace:
     0: std::panicking::begin_panic_handler
               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c\/library\std\s
rc\panicking.rs:584
     1: core::panicking::panic_fmt
               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c\/library\core\
src\panicking.rs:143
     2: core::result::unwrap_failed
               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c\/library\core\
src\result.rs:1749
     3: enum$<core::result::Result<alloc::string::String,enum$<std::env::VarErro
r, 1, 18446744073709551615, NotUnicode> > >::unwrap<alloc::string::String,enum$<
std::env::VarError, 1, 18446744073709551615, NotUnicode> >
               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c\library\core\s
rc\result.rs:1065
     4: build_script_build::find_deps
               at .\build.rs:80
     5: build_script_build::main
               at .\build.rs:118
     6: core::ops::function::FnOnce::call_once<void (*)(),tuple$<> >
               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c\library\core\s
rc\ops\function.rs:227
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose b
acktrace.

I googled around for package.metadata does not exist but not found a thing.

https://doc.rust-lang.org/cargo/reference/manifest.html#the-metadata-table=

This claims that "metadata" is optional and gives no example for Windows-specific metadata, not any further link to dig deeper for Windows-specific docs.

Basically, this looks like some error in Rust build scripts but i can not be sure, as i am newb.

Can you verify it, maybe it is some fault in YASFW manifests, or indeed a regression in Rust ?

@the-Arioch the-Arioch changed the title cargo c fails buildign over metadata missing - package.metadata does not exist - incompatibility with Rust 1.60 ? cargo c fails building - package.metadata does not exist - incompatibility with Rust 1.60 ? Apr 14, 2022
@Cerber-Ursi
Copy link

The backtrace points on build.rs:80, that is, on the following line:

let vcpkg_toolchain = format!("{}/scripts/buildsystems/vcpkg.cmake", env::var("VCPKG_ROOT").unwrap());

Seems that the VCPKG_ROOT environment variable is simply not set. Do you ever have vcpkg in your system?

@the-Arioch
Copy link
Author

the-Arioch commented Apr 15, 2022 via email

@the-Arioch
Copy link
Author

There ZLIB is AFAIR known for having stable sources but rather unstable ABI (different C++ compilers and flags), so it was always suggested to bungle specific binary ZLIB DLL (or to statically compile ZLIB objs into your project binary) to one's projects, rather than gambling that "some random ZLIB download" would work.

After making amends with vcpkg and cmake (CMAKE Rust package is obsoleted...) i have another barrier.

I think that ZLIB has to be added as a sub-module into YASFW, the same way it was done with the Putty ssh lib.

Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)

in

  cargo:rustc-env=YASFW_VERSION=v0.1.2-9-gded24cb
  cargo:rerun-if-env-changed=LIBSSH_STATIC
  running: "cmake" "e:\\RustProjects\\yasfw\\libssh-pageant" "-G" "Visual Studio
 16 2019" "-Thost=x64" "-Ax64" "-DCMAKE_TOOLCHAIN_FILE=e:\\dev\\VCPKG/scripts/bu
ildsystems/vcpkg.cmake" "-DVCPKG_TARGET_TRIPLET=x64-windows" "-DBUILD_SHARED_LIB
S=ON" "-DWITH_MBEDTLS=ON" "-DWITH_EXAMPLES=OFF" "-DCMAKE_INSTALL_PREFIX=e:\\Rust
Projects\\yasfw\\target\\debug\\build\\yasfw-3c8b5814059d5415\\out" "-DCMAKE_C_F
LAGS= -nologo -MD -Brepro" "-DCMAKE_C_FLAGS_RELEASE= -nologo -MD -Brepro" "-DCMA
KE_CXX_FLAGS= -nologo -MD -Brepro" "-DCMAKE_CXX_FLAGS_RELEASE= -nologo -MD -Brep
ro" "-DCMAKE_ASM_FLAGS= -nologo -MD -Brepro" "-DCMAKE_ASM_FLAGS_RELEASE= -nologo
 -MD -Brepro" "-DCMAKE_BUILD_TYPE=Release"
  -- Selecting Windows SDK version 10.0.20348.0 to target Windows 6.1.7601.
  -- The C compiler identification is MSVC 19.29.30142.1
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working C compiler: e:/Microsoft Visual Studio/2019/BuildTools/VC
/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- Could NOT find NSIS (missing: NSIS_MAKE)
  -- Performing Test WITH_/D__CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_1_FLAG
  -- Performing Test WITH_/D__CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_1_FLAG - Su
ccess
  -- Performing Test WITH_/D__CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT_1_FLA
G
  -- Performing Test WITH_/D__CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT_1_FLA
G - Success
  -- Performing Test WITH_/D__CRT_NONSTDC_NO_WARNINGS_1_FLAG
  -- Performing Test WITH_/D__CRT_NONSTDC_NO_WARNINGS_1_FLAG - Success
  -- Performing Test WITH_/D__CRT_SECURE_NO_WARNINGS_1_FLAG
  -- Performing Test WITH_/D__CRT_SECURE_NO_WARNINGS_1_FLAG - Success
  -- Configuring incomplete, errors occurred!
  See also "E:/RustProjects/yasfw/target/debug/build/yasfw-3c8b5814059d5415/out/
build/CMakeFiles/CMakeOutput.log".

  --- stderr
  CMake Error at E:/dev/vcpkg/downloads/tools/cmake-3.22.2-windows/cmake-3.22.2-
windows-i386/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (m
essage):
    Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
  Call Stack (most recent call first):
    E:/dev/vcpkg/downloads/tools/cmake-3.22.2-windows/cmake-3.22.2-windows-i386/
share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE
_MESSAGE)
    E:/dev/vcpkg/downloads/tools/cmake-3.22.2-windows/cmake-3.22.2-windows-i386/
share/cmake-3.22/Modules/FindZLIB.cmake:120 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
    E:/dev/vcpkg/scripts/buildsystems/vcpkg.cmake:816 (_find_package)
    CMakeLists.txt:47 (find_package)


  thread 'main' panicked at '
  command did not execute successfully, got: exit code: 1

  build script failed, must exit now', C:\Users\burov.PC-ANALYTICDEV\.cargo\regi
stry\src\github.com-1ecc6299db9ec823\cmake-0.1.45\src\lib.rs:894:5

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