rdbo / libmem

Advanced Game Hacking Library for C, Modern C++, Rust and Python (Windows/Linux/FreeBSD) (Process/Memory Hacking) (Hooking/Detouring) (Cross Platform) (x86/x64) (DLL/SO Injection) (Internal/External) (Assembler/Disassembler)
GNU Affero General Public License v3.0
830 stars 101 forks source link

Fixed x86 lib fetch for windows. #249

Closed luadebug closed 3 months ago

luadebug commented 3 months ago

Fixed x86 lib fetch for windows.

rdbo commented 3 months ago

image It should already be i686 according to Rust platform supports... https://doc.rust-lang.org/nightly/rustc/platform-support.html

luadebug commented 3 months ago

I still getting issues while trying to build it for i686 target. Maybe I do something wrong? image Build command:

cargo run --target i686-pc-windows-msvc --release
error: failed to run custom build command for `libmem-sys v5.0.1 (https://github.com/rdbo/libmem?branch=master#84e6344b)`                                                                                                                                                                               

Caused by:
  process didn't exit successfully: `C:\Users\Admin\RustroverProjects\testing\target\release\build\libmem-sys-5e389c45f4e76d0f\build-script-build` (exit code: 101)
  --- stderr
  Download URL: https://github.com/rdbo/libmem/releases/download/5.0.1/libmem-5.0.1-x86-windows-msvc-static-mt.tar.gz
  thread 'main' panicked at C:\Users\Admin\.cargo\git\checkouts\libmem-068a89b46ad12359\84e6344\bindings\rust\libmem-sys\build.rs:54:13:
  Request to download URL failed with code '404 Not Found': https://github.com/rdbo/libmem/releases/download/5.0.1/libmem-5.0.1-x86-windows-msvc-static-mt.tar.gz
  stack backtrace:
     0:     0x7ff7cb1ac2dd - std::backtrace_rs::backtrace::dbghelp64::trace
                                 at /rustc/f8060d282d42770fadd73905e3eefb85660d3278/library\std\src\..\..\backtrace\src\backtrace\dbghelp64.rs:91

image Toolchain is nightly as you mentioned, nightly docs. (although it remains same algorithm of acquiring all those variables) image Swapping to image resolves my issue all linked and working. Can you provide me some solution for my case @rdbo ? According to docs https://doc.rust-lang.org/reference/conditional-compilation.html image I have found some way out using env variables. This way we will extract i686 as it goes first over according to a pic you showed me over in your reply.

let target = env::var("TARGET").unwrap();
let parts = target.splitn(4, '-').collect::<Vec<_>>();
let arch = parts[0];

image Looks fitting for your workflow file building mechanism.

luadebug commented 3 months ago

Resolve by #250