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

Fixed x86 lib fetch for windows. #249

Closed
wants to merge 2 commits into from
Closed

Conversation

luadebug
Copy link
Contributor

Fixed x86 lib fetch for windows.

Fixed x86 lib fetch for windows.
@rdbo
Copy link
Owner

rdbo commented Aug 16, 2024

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

@luadebug
Copy link
Contributor Author

luadebug commented Aug 17, 2024

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 luadebug changed the title Update build.rs Fixed x86 lib fetch for windows. Aug 17, 2024
@luadebug
Copy link
Contributor Author

Resolve by #250

@luadebug luadebug closed this Aug 17, 2024
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

Successfully merging this pull request may close these issues.

2 participants