avast / avast/yari

Building Yari(-sys) on macOS arm64

Open
#67 16 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
90
Forks
10
PR merge metrics
No merged PRs in 30d

Description

Hey, I saw #14 and tried to compile the project on my setup, however, I fail quite at the start. I have just a very basic Rust knowledge, so any Rust error make me panic a bit. :)

After compiling Yara, I tried to compile `yari-sys` which leads to the following `binding.rs` related error message:

```
error[E0119]: conflicting implementations of trait `std::fmt::Debug` for type `YR_SCAN_CONTEXT`
--> /Users//yari/target/debug/build/yari-sys-04910e37d3f78597/out/bindings.rs:4776:10
|
4776 | #[derive(Debug, Copy, Clone)]
| ^^^^^ conflicting implementation for `YR_SCAN_CONTEXT`
|
::: yari-sys/src/bindings.rs:26:1
|
26 | impl Debug for YR_SCAN_CONTEXT {
| ------------------------------ first implementation here
|
= note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try `rustc --explain E0119`.
error: could not compile `yari-sys` (lib) due to previous error
```

I have no idea about bindgen and the code generating the bindings in `build.rs`, but can help debugging. I attached the resulting [binding.rs.txt](https://github.com/avast/yari/files/13796428/binding.rs.txt) as it may helps finding the issue.

Contributor guide

No contributing guide indexed for this repository

Research direction

Inspect yari-sys/src/bindings.rs and the binding-generation logic in build.rs, then compare them with the generated target/debug/build/yari-sys/out/bindings.rs attached in the report. Reproduce the macOS arm64 compilation failure and determine why YR_SCAN_CONTEXT receives two Debug implementations. Done means yari-sys compiles successfully on that setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.