Giter Club home page Giter Club logo

Comments (7)

zaddach avatar zaddach commented on June 28, 2024

Hi, I'll need a bit more context to understand what is going on. It's fairly tricky to get the dependencies in the clamav-sys crate for ClamAV right, did you follow the README?

If you still have problems, please post the whole log output of building clamav-sys and clamav-rs here. Thanks!

from clamav-rs.

r3dlight avatar r3dlight commented on June 28, 2024

Hi again,
Everything seems to be ok with the README (libclamav-dev & libclamav are installed).

Here is the full trace (if you need more, fell free to ask me) :

➜  clamav-rs git:(master) cargo build --verbose
       Fresh version_check v0.9.2
       Fresh glob v0.3.0
       Fresh cc v1.0.66
       Fresh lazy_static v1.4.0
       Fresh regex-syntax v0.6.22
       Fresh cfg-if v0.1.10
       Fresh unicode-width v0.1.8
       Fresh unicode-xid v0.2.1
       Fresh quick-error v1.2.3
       Fresh vec_map v0.8.2
       Fresh strsim v0.8.0
       Fresh termcolor v1.1.2
       Fresh ansi_term v0.11.0
       Fresh lazycell v1.3.0
       Fresh peeking_take_while v0.1.2
       Fresh shlex v0.1.1
       Fresh rustc-hash v1.1.0
       Fresh pkg-config v0.3.19
       Fresh vcpkg v0.2.11
       Fresh thread_local v1.1.0
       Fresh humantime v1.3.0
       Fresh textwrap v0.11.0
       Fresh libc v0.2.82
       Fresh memchr v2.3.4
       Fresh proc-macro2 v1.0.24
       Fresh bitflags v1.2.1
       Fresh log v0.4.13
       Fresh atty v0.2.14
       Fresh aho-corasick v0.7.15
       Fresh libloading v0.5.2
       Fresh nom v5.1.2
       Fresh quote v1.0.8
       Fresh which v3.1.1
       Fresh regex v1.4.3
       Fresh cexpr v0.4.0
       Fresh clap v2.33.3
       Fresh clang-sys v0.29.3
       Fresh env_logger v0.7.1
       Fresh bindgen v0.53.3
       Fresh clamav-sys v0.0.2
   Compiling clamav-rs v0.5.2 (/home/stefek/github/clamav-rs)
     Running `rustc --crate-name clamav_rs --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=4a0f27872300a6d0 -C extra-filename=-4a0f27872300a6d0 --out-dir /home/stefek/github/clamav-rs/target/debug/deps -C incremental=/home/stefek/github/clamav-rs/target/debug/incremental -L dependency=/home/stefek/github/clamav-rs/target/debug/deps --extern bitflags=/home/stefek/github/clamav-rs/target/debug/deps/libbitflags-de31228f2c0549ed.rmeta --extern clamav_sys=/home/stefek/github/clamav-rs/target/debug/deps/libclamav_sys-3f7846ece2ec2a41.rmeta --extern libc=/home/stefek/github/clamav-rs/target/debug/deps/liblibc-b10eb6ae9a053f40.rmeta -L native=/usr/lib/x86_64-linux-gnu`
error[E0432]: unresolved import `clamav_sys::cl_error_t`
 --> src/engine.rs:8:5
  |
8 |     cl_error_t,
  |     ^^^^^^^^^^ no `cl_error_t` in the root

error[E0432]: unresolved import `clamav_sys::cl_error_t`
 --> src/error.rs:5:5
  |
5 | use clamav_sys::cl_error_t;
  |     ^^^^^^^^^^^^^^^^^^^^^^ no `cl_error_t` in the root

error[E0432]: unresolved import `clamav_sys::CL_SCAN_HEURISTIC_STRUCTURED_CC`
  --> src/scan_settings.rs:31:5
   |
31 |     CL_SCAN_HEURISTIC_STRUCTURED_CC,
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |     |
   |     no `CL_SCAN_HEURISTIC_STRUCTURED_CC` in the root
   |     help: a similar name exists in the module: `CL_SCAN_HEURISTIC_STRUCTURED`

error[E0432]: unresolved import `clamav_sys::cl_error_t`
  --> src/lib.rs:13:5
   |
13 |     cl_error_t,
   |     ^^^^^^^^^^ no `cl_error_t` in the root

error[E0061]: this function takes 3 arguments but 2 arguments were supplied
   --> src/engine.rs:230:14
    |
230 |         self.scan_descriptor(file.as_raw_fd(), settings)
    |              ^^^^^^^^^^^^^^^ ----------------  -------- supplied 2 arguments
    |              |
    |              expected 3 arguments
    |
note: associated function defined here
   --> src/engine.rs:210:12
    |
210 |     pub fn scan_descriptor(&self, descriptor: i32, settings: &mut ScanSettings, filename: Option< &str >) -> Result<ScanResult, ClamError> {
    |            ^^^^^^^^^^^^^^^ -----  ---------------  ---------------------------  ------------------------

error: aborting due to 5 previous errors

Some errors have detailed explanations: E0061, E0432.
For more information about an error, try `rustc --explain E0061`.
error: could not compile `clamav-rs`

Caused by:
  process didn't exit successfully: `rustc --crate-name clamav_rs --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=4a0f27872300a6d0 -C extra-filename=-4a0f27872300a6d0 --out-dir /home/stefek/github/clamav-rs/target/debug/deps -C incremental=/home/stefek/github/clamav-rs/target/debug/incremental -L dependency=/home/stefek/github/clamav-rs/target/debug/deps --extern bitflags=/home/stefek/github/clamav-rs/target/debug/deps/libbitflags-de31228f2c0549ed.rmeta --extern clamav_sys=/home/stefek/github/clamav-rs/target/debug/deps/libclamav_sys-3f7846ece2ec2a41.rmeta --extern libc=/home/stefek/github/clamav-rs/target/debug/deps/liblibc-b10eb6ae9a053f40.rmeta -L native=/usr/lib/x86_64-linux-gnu` (exit code: 1)

clamav-sys is building with few warnings :

➜  clamav-sys git:(master) cargo build
    Updating crates.io index
   Compiling memchr v2.3.4
   Compiling libc v0.2.82
   Compiling version_check v0.9.2
   Compiling glob v0.3.0
   Compiling cc v1.0.66
   Compiling log v0.4.13
   Compiling bitflags v1.2.1
   Compiling proc-macro2 v1.0.24
   Compiling lazy_static v1.4.0
   Compiling regex-syntax v0.6.22
   Compiling quick-error v1.2.3
   Compiling unicode-width v0.1.8
   Compiling unicode-xid v0.2.1
   Compiling cfg-if v0.1.10
   Compiling termcolor v1.1.2
   Compiling ansi_term v0.11.0
   Compiling vec_map v0.8.2
   Compiling strsim v0.8.0
   Compiling bindgen v0.53.3
   Compiling lazycell v1.3.0
   Compiling peeking_take_while v0.1.2
   Compiling shlex v0.1.1
   Compiling rustc-hash v1.1.0
   Compiling pkg-config v0.3.19
   Compiling vcpkg v0.2.11
   Compiling thread_local v1.1.0
   Compiling textwrap v0.11.0
   Compiling humantime v1.3.0
   Compiling nom v5.1.2
   Compiling clang-sys v0.29.3
   Compiling aho-corasick v0.7.15
   Compiling libloading v0.5.2
   Compiling quote v1.0.8
   Compiling atty v0.2.14
   Compiling which v3.1.1
   Compiling clap v2.33.3
   Compiling regex v1.4.3
   Compiling cexpr v0.4.0
   Compiling env_logger v0.7.1
   Compiling clamav-sys v0.0.2 (/home/stefek/github/clamav-sys)
warning: unused import: `Path`
  --> build.rs:18:26
   |
18 | use std::path::{PathBuf, Path};
   |                          ^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

warning: 1 warning emitted

warning: couldn't execute `llvm-config --prefix` (error: No such file or directory (os error 2))
warning: set the LLVM_CONFIG_PATH environment variable to the full path to a valid `llvm-config` executable (including the executable itself)
    Finished dev [unoptimized + debuginfo] target(s) in 22.78s

from clamav-rs.

zaddach avatar zaddach commented on June 28, 2024

What OS are you building on? What distribution? What version?

from clamav-rs.

r3dlight avatar r3dlight commented on June 28, 2024

Ubuntu 20.04.1 LTS

from clamav-rs.

zaddach avatar zaddach commented on June 28, 2024

Okay, I've figured it out what the problem was. Bindgen on Linux didn't include the cl_error_t where bindgen on Windows did. I'm going to push the fixes after the weekend.

from clamav-rs.

r3dlight avatar r3dlight commented on June 28, 2024

Great thank you !

from clamav-rs.

zaddach avatar zaddach commented on June 28, 2024

The problem was actually that the ClamAV interface changed between 0.102 and 0.103. I tested only on Windows with 0.103, which is why I didn't realize the issue. I've bumped the requirement to 0.103+, and I hope the API will stay stable so that future version build. Let me know if you still have problems.

from clamav-rs.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.