libredefender icon indicating copy to clipboard operation
libredefender copied to clipboard

Fails to build on FreeBSD

Open Martinfx opened this issue 3 years ago • 12 comments

Hi, i tried compile source code on FreeBSD 13.1 and cargo 1.63.0, rustc 1.63.0 and I have issue with missing libc compile_rust_libredeferender.TXT

     |

error[E0277]: the trait bound `<<D as si::Dimension>::L as std::ops::Neg>::Output: Integer` is not satisfied
   --> code/FreeBSD-Ports/libredefender/work/libredefender-0.6.0/cargo-crates/uom-0.21.1/src/system.rs:716:18
    |
716 |               ) -> Quantity<$quantities<$($crate::typenum::Negate<D::$symbol>),+>, U, V>
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Integer` is not implemented for `<<D as si::Dimension>::L as std::ops::Neg>::Output`
    |
   ::: code/FreeBSD-Ports/libredefender/work/libredefender-0.6.0/cargo-crates/uom-0.21.1/src/si/mod.rs:10:1
    |
10  | / system! {
11  | |     /// [International System of Quantities](http://jcgm.bipm.org/vim/en/1.6.html) (ISQ).
12  | |     quantities: ISQ {
13  | |         length: meter, L;
...   |
55  | |     }
56  | | }
    | |_- in this macro invocation
    |
note: required by a bound in `si::Quantity`
   --> code/FreeBSD-Ports/libredefender/work/libredefender-0.6.0/cargo-crates/uom-0.21.1/src/system.rs:232:16
    |
230 |           pub struct Quantity<D, U, V>
    |                      -------- required by a bound in this
231 |           where
232 |               D: Dimension + ?Sized,
    |                  ^^^^^^^^^ required by this bound in `si::Quantity`
    |
   ::: code/FreeBSD-Ports/libredefender/work/libredefender-0.6.0/cargo-crates/uom-0.21.1/src/si/mod.rs:10:1
    |
10  | / system! {
11  | |     /// [International System of Quantities](http://jcgm.bipm.org/vim/en/1.6.html) (ISQ).
12  | |     quantities: ISQ {
13  | |         length: meter, L;
...   |
55  | |     }
56  | | }
    | |_- in this macro invocation
    = note: this error originates in the macro `system` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `<<D as si::Dimension>::M as std::ops::Neg>::Output: Integer` is not satisfied
   --> code/FreeBSD-Ports/libredefender/work/libredefender-0.6.0/cargo-crates/uom-0.21.1/src/system.rs:716:18
    |
716 |               ) -> Quantity<$quantities<$($crate::typenum::Negate<D::$symbol>),+>, U, V>
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Integer` is not implemented for `<<D as si::Dimension>::M as std::ops::Neg>::Output`
    |
   ::: code/FreeBSD-Ports/libredefender/work/libredefender-0.6.0/cargo-crates/uom-0.21.1/src/si/mod.rs:10:1
    |
10  | / system! {
11  | |     /// [International System of Quantities](http://jcgm.bipm.org/vim/en/1.6.html) (ISQ).
12  | |     quantities: ISQ {
13  | |         length: meter, L;
...   |
55  | |     }
56  | | }


Martinfx avatar Oct 12 '22 19:10 Martinfx

One of the dependencies fails to build. you could retry with the current master at https://github.com/iliekturtles/uom but the crate doesn't seem to have any platform specific code so I'm not sure why it doesn't build on FreeBSD.

Does the project build successfully with a more recent Cargo.lock, if you run cargo update in advance?

kpcyrd avatar Oct 13 '22 13:10 kpcyrd

This is after update packages. I open bug about uom: https://github.com/iliekturtles/uom/issues/382

Martinfx avatar Oct 13 '22 15:10 Martinfx

As noted in https://github.com/iliekturtles/uom/issues/382 an ancient version of uom is being used. Using v0.30.0 resolve this error.

iliekturtles avatar Oct 18 '22 18:10 iliekturtles

As noted in iliekturtles/uom#382 an ancient version of uom is being used. Using v0.30.0 resolve this error.

good news thank you.

Martinfx avatar Oct 18 '22 18:10 Martinfx

This version of uom is pulled in by https://github.com/svartalf/rust-battery, it needs to be bumped there and after they released a new version it can be fixed here.

kpcyrd avatar Oct 19 '22 10:10 kpcyrd

libredefender is dependent for package uom 0.21..1 and without I cannot compile this library. I tried add uom 0.30.0 and I cannot compile.

   Compiling ioprio v0.2.0
     Running `CARGO=/usr/local/bin/cargo CARGO_CRATE_NAME=ioprio CARGO_MANIFEST_DIR=/code/FreeBSD-Ports/libredefender/work/libredefender-0.6.0/cargo-crates/ioprio-0.2.0 CARGO_PKG_AUTHORS='4lDO2 <[email protected]>' CARGO_PKG_DESCRIPTION='A Linux-only crate for managing I/O priorities' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE=MIT CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=ioprio CARGO_PKG_REPOSITORY='https://github.com/4lDO2/ioprio-rs' CARGO_PKG_RUST_VERSION='' CARGO_PKG_VERSION=0.2.0 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=2 CARGO_PKG_VERSION_PATCH=0 CARGO_PKG_VERSION_PRE='' LD_LIBRARY_PATH='/code/FreeBSD-Ports/libredefender/work/target/debug/deps:/usr/local/lib' /usr/local/bin/rustc --crate-name ioprio --edition=2018 /code/FreeBSD-Ports/libredefender/work/libredefender-0.6.0/cargo-crates/ioprio-0.2.0/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="default"' -C metadata=2acf7605da5ecceb -C extra-filename=-2acf7605da5ecceb --out-dir /code/FreeBSD-Ports/libredefender/work/target/x86_64-unknown-freebsd/debug/deps --target x86_64-unknown-freebsd -C linker=cc -L dependency=/code/FreeBSD-Ports/libredefender/work/target/x86_64-unknown-freebsd/debug/deps -L dependency=/code/FreeBSD-Ports/libredefender/work/target/debug/deps --extern libc=/code/FreeBSD-Ports/libredefender/work/target/x86_64-unknown-freebsd/debug/deps/liblibc-1cab4b372f53efbc.rmeta --extern nix=/code/FreeBSD-Ports/libredefender/work/target/x86_64-unknown-freebsd/debug/deps/libnix-792ea115fcc82d6f.rmeta --cap-lints warn -C link-arg=-fstack-protector-strong`
error[E0425]: cannot find value `SYS_ioprio_get` in crate `libc`
   --> /code/FreeBSD-Ports/libredefender/work/libredefender-0.6.0/cargo-crates/ioprio-0.2.0/src/lib.rs:257:44
    |
257 |     let res = unsafe { libc::syscall(libc::SYS_ioprio_get, which, who) };
    |                                            ^^^^^^^^^^^^^^ not found in `libc`

error[E0425]: cannot find value `SYS_ioprio_set` in crate `libc`
   --> /code/FreeBSD-Ports/libredefender/work/libredefender-0.6.0/cargo-crates/ioprio-0.2.0/src/lib.rs:273:19
    |
273 |             libc::SYS_ioprio_set,
    |                   ^^^^^^^^^^^^^^ not found in `libc`

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

Caused by:
  process didn't exit successfully: `CARGO=/usr/local/bin/cargo CARGO_CRATE_NAME=ioprio CARGO_MANIFEST_DIR=/code/FreeBSD-Ports/libredefender/work/libredefender-0.6.0/cargo-crates/ioprio-0.2.0 CARGO_PKG_AUTHORS='4lDO2 <[email protected]>' CARGO_PKG_DESCRIPTION='A Linux-only crate for managing I/O priorities' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE=MIT CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=ioprio CARGO_PKG_REPOSITORY='https://github.com/4lDO2/ioprio-rs' CARGO_PKG_RUST_VERSION='' CARGO_PKG_VERSION=0.2.0 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=2 CARGO_PKG_VERSION_PATCH=0 CARGO_PKG_VERSION_PRE='' LD_LIBRARY_PATH='/code/FreeBSD-Ports/libredefender/work/target/debug/deps:/usr/local/lib' /usr/local/bin/rustc --crate-name ioprio --edition=2018 /code/FreeBSD-Ports/libredefender/work/libredefender-0.6.0/cargo-crates/ioprio-0.2.0/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="default"' -C metadata=2acf7605da5ecceb -C extra-filename=-2acf7605da5ecceb --out-dir /code/FreeBSD-Ports/libredefender/work/target/x86_64-unknown-freebsd/debug/deps --target x86_64-unknown-freebsd -C linker=cc -L dependency=/code/FreeBSD-Ports/libredefender/work/target/x86_64-unknown-freebsd/debug/deps -L dependency=/code/FreeBSD-Ports/libredefender/work/target/debug/deps --extern libc=/code/FreeBSD-Ports/libredefender/work/target/x86_64-unknown-freebsd/debug/deps/liblibc-1cab4b372f53efbc.rmeta --extern nix=/code/FreeBSD-Ports/libredefender/work/target/x86_64-unknown-freebsd/debug/deps/libnix-792ea115fcc82d6f.rmeta --cap-lints warn -C link-arg=-fstack-protector-strong` (exit status: 1)

Martinfx avatar Oct 23 '22 19:10 Martinfx

Disregard my comment, I see that "ioprio" package causing problems now states " A Linux-only crate for managing I/O priorities "

micwoj92 avatar Jan 02 '23 20:01 micwoj92

I have new issue with package

     Running `/media/ST3000DM007-1WY10G_ZTT0SM4Q_p1/code/FreeBSD-Ports/libredefender/work/target/debug/build/clamav-sys-49b0b3eb3ef33f51/build-script-build`
[clamav-sys 0.0.3] cargo:rerun-if-env-changed=LIBCLAMAV_NO_PKG_CONFIG
[clamav-sys 0.0.3] cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-freebsd
[clamav-sys 0.0.3] cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_freebsd
[clamav-sys 0.0.3] cargo:rerun-if-env-changed=HOST_PKG_CONFIG
[clamav-sys 0.0.3] cargo:rerun-if-env-changed=PKG_CONFIG
[clamav-sys 0.0.3] cargo:rerun-if-env-changed=LIBCLAMAV_STATIC
[clamav-sys 0.0.3] cargo:rerun-if-env-changed=LIBCLAMAV_DYNAMIC
[clamav-sys 0.0.3] cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
[clamav-sys 0.0.3] cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
[clamav-sys 0.0.3] cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-freebsd
[clamav-sys 0.0.3] cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_freebsd
[clamav-sys 0.0.3] cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
[clamav-sys 0.0.3] cargo:rerun-if-env-changed=PKG_CONFIG_PATH
[clamav-sys 0.0.3] cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-freebsd
[clamav-sys 0.0.3] cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_freebsd
[clamav-sys 0.0.3] cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
[clamav-sys 0.0.3] cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
[clamav-sys 0.0.3] cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-freebsd
[clamav-sys 0.0.3] cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_freebsd
[clamav-sys 0.0.3] cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
[clamav-sys 0.0.3] cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
[clamav-sys 0.0.3] thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: `"pkg-config" "--libs" "--cflags" "libclamav" "libclamav >= 0.103"` did not exit successfully: exit status: 1
[clamav-sys 0.0.3] error: could not find system library 'libclamav' required by the 'clamav-sys' crate
[clamav-sys 0.0.3] 
[clamav-sys 0.0.3] --- stderr
[clamav-sys 0.0.3] Package libclamav was not found in the pkg-config search path.
[clamav-sys 0.0.3] Perhaps you should add the directory containing `libclamav.pc'
[clamav-sys 0.0.3] to the PKG_CONFIG_PATH environment variable
[clamav-sys 0.0.3] Package 'libclamav', required by 'virtual:world', not found
[clamav-sys 0.0.3] Package 'libclamav', required by 'virtual:world', not found
[clamav-sys 0.0.3] ', /media/ST3000DM007-1WY10G_ZTT0SM4Q_p1/code/FreeBSD-Ports/libredefender/work/libredefender-0.6.0/cargo-crates/clamav-sys-0.0.3/build.rs:112:10
[clamav-sys 0.0.3] stack backtrace:
[clamav-sys 0.0.3]    0: rust_begin_unwind
[clamav-sys 0.0.3]    1: core::panicking::panic_fmt
[clamav-sys 0.0.3]    2: core::result::unwrap_failed
[clamav-sys 0.0.3]    3: core::result::Result<T,E>::unwrap
[clamav-sys 0.0.3]              at /usr/ports/lang/rust/work/rustc-1.65.0-src/library/core/src/result.rs:1107:23
[clamav-sys 0.0.3]    4: build_script_build::main
[clamav-sys 0.0.3]              at ./build.rs:109:5
[clamav-sys 0.0.3]    5: core::ops::function::FnOnce::call_once
[clamav-sys 0.0.3]              at /usr/ports/lang/rust/work/rustc-1.65.0-src/library/core/src/ops/function.rs:248:5
[clamav-sys 0.0.3] note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
error: failed to run custom build command for `clamav-sys v0.0.3`

Martinfx avatar Jan 05 '23 15:01 Martinfx

libclamav.pc is missing on your system, this file is most likely in the same package that also provides the header files for libclamav.

kpcyrd avatar Jan 05 '23 15:01 kpcyrd

Yes, i have clamav includes but clamav.h not found

/usr/local/bin/clamav-config
/usr/local/include/clamav-version.h
/usr/local/include/clamav-config.h
/usr/local/include/clamav.h
/usr/local/include/clamav-types.h
[clamav-sys 0.0.3] wrapper.h:1:10: fatal error: 'clamav.h' file not found
[clamav-sys 0.0.3] wrapper.h:1:10: fatal error: 'clamav.h' file not found, err: true
[clamav-sys 0.0.3] thread 'main' panicked at 'Unable to generate bindings: ()', /media/ST3000DM007-1WY10G_ZTT0SM4Q_p1/code/FreeBSD-Ports/libredefender/work/libredefender-e9fac36c9d5b45de021f4b22c6d71c604bc44ae8/cargo-crates/clamav-sys-0.0.3/build.rs:66:10
[clamav-sys 0.0.3] stack backtrace:
[clamav-sys 0.0.3]    0: rust_begin_unwind
[clamav-sys 0.0.3]    1: core::panicking::panic_fmt
[clamav-sys 0.0.3]    2: core::result::unwrap_failed
[clamav-sys 0.0.3]    3: core::result::Result<T,E>::expect
[clamav-sys 0.0.3]              at /usr/ports/lang/rust/work/rustc-1.65.0-src/library/core/src/result.rs:1064:23
[clamav-sys 0.0.3]    4: build_script_build::generate_bindings
[clamav-sys 0.0.3]              at ./build.rs:62:5
[clamav-sys 0.0.3]    5: build_script_build::main
[clamav-sys 0.0.3]              at ./build.rs:115:5
[clamav-sys 0.0.3]    6: core::ops::function::FnOnce::call_once
[clamav-sys 0.0.3]              at /usr/ports/lang/rust/work/rustc-1.65.0-src/library/core/src/ops/function.rs:248:5
[clamav-sys 0.0.3] note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
error: failed to run custom build command for `clamav-sys v0.0.3`

Martinfx avatar Jan 05 '23 16:01 Martinfx

How did you resolve libclamav.pc missing? This file is supposed to point to the correct header file location, on my system libclamav.pc looks like this:

prefix=/usr
exec_prefix=/usr
libdir=/usr/lib
includedir=/usr/include

Name: libclamav
Description: A GPL virus scanner
Version: 0.105.1
Libs: -L${libdir} -lclamav
Libs.private:
Cflags: -I${includedir}

kpcyrd avatar Jan 05 '23 18:01 kpcyrd

i resolved missing "libclamav.pc" so i install "pkg install clamav" and "/usr/local/libdata/pkgconfig/libclamav.pc"

Martinfx avatar Jan 05 '23 18:01 Martinfx