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

Error doing a test program #1

Open
AlbertoVPersonal opened this issue Dec 18, 2024 · 3 comments
Open

Error doing a test program #1

AlbertoVPersonal opened this issue Dec 18, 2024 · 3 comments

Comments

@AlbertoVPersonal
Copy link

Hi,

I would like to test the library and I'm getting the following error.

Environment

  • Windows 11 Pro x64
  • libclang v19.1.0.0
  • cargo 1.83.0

Cargo.toml

[package]
name = "tests_lib_manifold"
version = "0.1.0"
edition = "2021"

[dependencies]
libloading = "0.8.6"
manifold3d = "0.0.5"

Cargo build

cargo build

Cargo build log

   Compiling manifold3d v0.0.5
error[E0308]: mismatched types
  --> <...>\manifold3d-0.0.5\src\error.rs:54:37
   |
54 |             value => Error::Unknown(value),
   |                      -------------- ^^^^^ expected `u32`, found `i32`
   |                      |
   |                      arguments to this enum variant are incorrect

Regards,
Alberto

@NickUfer
Copy link
Owner

Hey,
this is probably caused by this piece of code I added:

// These error codes will, with high probability, never reach i32::MAX.
#[cfg(windows)]
value => Error::Unknown(value as u32),
#[cfg(not(windows))]
value => Error::Unknown(value),

When I tried to build for windows on my linux machine it told me the value is of i32. I added special code for windows to handle this. But now I cannot even reproduce the cause for why I added that...

I will remove it real quick and release a new version so you can continue your tests. But keep in mind:

  • this is not yet ready for use
  • the API can change drastically
  • not all types and methods are implemented yet
  • documentation is still missing in some places
  • windows support is not really that great yet, especially with the available crate features - I'm focusing on linux for now

@NickUfer
Copy link
Owner

0.0.6 with a potential fix is published. I'm unable to fully verify this on a windows machine right now, so would be great if you could tell me if this fixes your problem 😄

If thats not the case I need to look into this some days later.

@AlbertoVPersonal
Copy link
Author

The new change generates an error too.

Cargo.toml

[package]
name = "tests_lib_manifold"
version = "0.1.0"
edition = "2021"

[dependencies]
libloading = "0.8.6"
manifold3d = "0.0.6"

Log output

 ...  
 Compiling manifold3d-sys v0.0.6
error: failed to run custom build command for `manifold3d-sys v0.0.6`

Caused by:
  process didn't exit successfully: `.\manifold-3.0.0\samples\tests_lib_manifold\target\debug\build\manifold3d-sys-a281c000bb636646\build-script-build` (exit code: 101)
  --- stdout
  CMAKE_TOOLCHAIN_FILE_x86_64-pc-windows-msvc = None
  CMAKE_TOOLCHAIN_FILE_x86_64_pc_windows_msvc = None
  HOST_CMAKE_TOOLCHAIN_FILE = None
  CMAKE_TOOLCHAIN_FILE = None
  CMAKE_GENERATOR_x86_64-pc-windows-msvc = None
  CMAKE_GENERATOR_x86_64_pc_windows_msvc = None
  HOST_CMAKE_GENERATOR = None
  CMAKE_GENERATOR = None
  CMAKE_PREFIX_PATH_x86_64-pc-windows-msvc = None
  CMAKE_PREFIX_PATH_x86_64_pc_windows_msvc = None
  HOST_CMAKE_PREFIX_PATH = None
  CMAKE_PREFIX_PATH = None
  CMAKE_x86_64-pc-windows-msvc = None
  CMAKE_x86_64_pc_windows_msvc = None
  HOST_CMAKE = None
  CMAKE = None
  running: "cmake" "C:\\Users\\<my_user>\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\manifold3d-sys-0.0.6\\vendor/manifold" "-G" "Visual Studio 17 2022" "-Thost=x64" "-Ax64" "-DBUILD_SHARED_LIBS=ON" "-DMANIFOLD_TEST=OFF" "-DMANIFOLD_CBIND=ON" "-DMANIFOLD_CROSS_SECTION=ON" "-DMANIFOLD_PAR=OFF" "-DMANIFOLD_EXPORT=OFF" "-DCMAKE_INSTALL_PREFIX=C:\\Users\\<my_user>\\Downloads\\manifold-3.0.0\\samples\\tests_lib_manifold\\target\\debug\\build\\manifold3d-sys-c9bbf60fc5cd0aff\\out" "-DCMAKE_C_FLAGS= -nologo -MD -Brepro" "-DCMAKE_C_FLAGS_DEBUG= -nologo -MD -Brepro" "-DCMAKE_CXX_FLAGS= /EHsc -nologo -MD -Brepro" "-DCMAKE_CXX_FLAGS_DEBUG= /EHsc -nologo -MD -Brepro" "-DCMAKE_ASM_FLAGS= -nologo -MD -Brepro" "-DCMAKE_ASM_FLAGS_DEBUG= -nologo -MD -Brepro" "-DCMAKE_BUILD_TYPE=Debug"

  --- stderr
  thread 'main' panicked at C:\Users\<my_user>\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cmake-0.1.52\src/lib.rs:1115:5:

  failed to execute command: program not found
  is `cmake` not installed?

  build script failed, must exit now
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Possibly this issue can be resolved whether I knew that environment variable is using to run the command because I have cmake as a portable version.

Log output using $env:CARGO_PROFILE_DEV_BUILD_OVERRIDE_DEBUG=1

The log is the same.

Log output using $env:RUST_BACKTRACE=1

I think that it does not add more interesting information.

stack backtrace:
     0: std::panicking::begin_panic_handler
               at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf\library/std\src\panicking.rs:665
     1: core::panicking::panic_fmt
               at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf\library/core\src\panicking.rs:74
     2: cmake::fail
               at C:\Users\<my_user>\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cmake-0.1.52\src\lib.rs:1115
     3: cmake::run
               at C:\Users\<my_user>\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cmake-0.1.52\src\lib.rs:1079
     4: cmake::Config::build
               at C:\Users\<my_user>\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cmake-0.1.52\src\lib.rs:823
     5: build_script_build::main
               at .\build.rs:38
     6: core::ops::function::FnOnce::call_once<void (*)(),tuple$<> >
               at C:\Users\<my_user>\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ops\function.rs:250
     7: core::hint::black_box
               at C:\Users\<my_user>\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\hint.rs:389
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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