VirusTotal / yara-x

A rewrite of YARA in Rust.
https://virustotal.github.io/yara-x/
BSD 3-Clause "New" or "Revised" License
565 stars 46 forks source link

Fails to compile on x86 and arm #108

Open russellbanks opened 1 month ago

russellbanks commented 1 month ago

Compiling an application that uses this library fails on x86 and arm targets due to Wasmtime. I've tested this on i686-pc-windows-msvc, i686-unknown-linux-gnu, armv7-unknown-linux-gnueabihf, and i686-unknown-freebsd.

On x86 architectures, the build for wasmtime with no 'asm_sym' in the root or Wasmtime is being compiled for an architecture that it does not support.

On arm architectures, the build for cranelift-codegen fails with no supported isa found for arch 'armv7'.

plusvic commented 1 month ago

Yep, that's a known issue. If wasmtime adds support for these platforms that would be great, if not, we must live without support for them. To be honest, I'm not very worried about not supporting those old platforms. Most users nowadays have 64-bits machines.

However, I would like to improve the experience for any developer that wants to depend on the yara-x crate, at least by breaking the compilation with a more explicative message in those unsupported platforms. Also, if you are only using this crate for the yara_x::mods::invoke feature, wasmtime is not really needed at all, and I think I may do something for supporting that feature in all platforms. Are you in this case? Or you plan to use the yara-x crate for scanning files with YARA rules?

russellbanks commented 1 month ago

I personally just use yara_x::mods::invoke with the PE module to get resources, vs_version_info, etc, from PE files. I am considering looking into yara rules but currently, I just use the PE module.

plusvic commented 1 month ago

Do you actually need support for x86 and armv7? Or just wanted to give a heads up?

russellbanks commented 1 month ago

It's not imperative but I aim for my application to build and be built on as many platforms and architectures as I can so my users can run it on any device.