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 build error E0432 on Linux #16

Open
albertzsigovits opened this issue Nov 14, 2022 · 3 comments
Open

Cargo build error E0432 on Linux #16

albertzsigovits opened this issue Nov 14, 2022 · 3 comments

Comments

@albertzsigovits
Copy link

albertzsigovits commented Nov 14, 2022

When compiling under Linux, I get the following error message:

  • cargo update
  • cargo build
error[E0432]: unresolved import `crate::bindings::yr_modules_do_load`
  --> yari-sys/src/lib.rs:23:5
   |
23 | use crate::bindings::yr_modules_do_load;
   |     ^^^^^^^^^^^^^^^^^------------------
   |     |                |
   |     |                help: a similar name exists in the module: `yr_modules_load`
   |     no `yr_modules_do_load` in `bindings`

error[E0432]: unresolved import `crate::bindings::yr_modules_do_unload`
  --> yari-sys/src/lib.rs:24:5
   |
24 | use crate::bindings::yr_modules_do_unload;
   |     ^^^^^^^^^^^^^^^^^--------------------
   |     |                |
   |     |                help: a similar name exists in the module: `yr_modules_load`
   |     no `yr_modules_do_unload` in `bindings`

For more information about this error, try `rustc --explain E0432`.
error: could not compile `yari-sys` due to 2 previous errors

rustc --explain E0432:
An import was unresolved.

uname -a:
Linux Host 5.10.102.1-microsoft-standard-WSL2 SMP Wed Mar 2 00:30:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

lsb_release -a:
Ubuntu 20.04.5 LTS

@MatejKastak
Copy link
Member

Hi Albert! Thanks for the report.

Currently we are building against a slightly modified libyara in this repository. This approach is subject to change, as I would like to integrate this small patch directly into YARA ustream so we don't have to worry about those symbols.

To diagnose your issue further, can you checkout the following commands:

λ ls -lah ./yari-sys/yara/libyara/.libs/libyara.a
Permissions Size User         Date Modified Name
.rw-rw-r--  4.3M matej.kastak  2 Oct 17:04   ./yari-sys/yara/libyara/.libs/libyara.a

λ nm ./yari-sys/yara/libyara/.libs/libyara.a | grep yr_modules_do_load
00000000000001e0 T yr_modules_do_load

λ cd yari-sys/yara && git status
HEAD detached at 38298ca7
nothing to commit, working tree clean

@albertzsigovits
Copy link
Author

albertzsigovits commented Feb 9, 2023

Sorry this took so long, just noticed this reply.
My yari-sys/yara/ folder is completely empty.

Did I miss some pre-req steps?

@MatejKastak
Copy link
Member

It's interesting that it is empty, from the first message it seems that you have upstream yara version installed.

The empty yari-sys/yara dir is because yari uses YARA as a submodule. You will need to clone it with --recursive flag.

If you don't want to clone it again something like this should help: git submodule init && git submodule sync && git submodule update.

There were many changes in YARI since you first opened the issue, before you try anything please update to the latest master commit.

I have prepared instructions how to run it locally for inspiration. Hope it helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants