Page MenuHomeFreeBSD

security/clamav: update to 1.0.1
AbandonedPublic

Authored by dvl on Jan 30 2023, 4:07 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Apr 27, 4:20 PM
Unknown Object (File)
Sat, Apr 27, 4:20 PM
Unknown Object (File)
Sat, Apr 27, 3:07 PM
Unknown Object (File)
Dec 22 2023, 11:37 PM
Unknown Object (File)
Nov 10 2023, 3:11 PM
Unknown Object (File)
Nov 9 2023, 7:19 PM
Unknown Object (File)
Nov 8 2023, 3:19 PM
Unknown Object (File)
Nov 1 2023, 1:26 PM
Subscribers

Details

Reviewers
yasu
Summary

I have access to a pre-release of clamav - I am trying to modify my copy of the port to make it build. The first errors I got, without the CARGO directives shown in the diff, was:

FAILED: x86_64-unknown-freebsd/release/libclamav_rust.a /wrkdirs/usr/ports/security/clamav/work/.build/x86_64-unknown-freebsd/release/libclamav_rust.a 
cd /wrkdirs/usr/ports/security/clamav/work/clamav-1.0.1/libclamav_rust && /usr/local/bin/cmake -E env CARGO_CMD=build CARGO_TARGET_DIR=/wrkdirs/usr/ports/security/clamav/work/.build MAINTAINER_MODE=OFF RUSTFLAGS="" /usr/local/bin/cargo build --target x86_64-unknown-freebsd --release --target-dir /wrkdirs/usr/ports/security/clamav/work/.build
    Updating crates.io index
warning: spurious network error (2 tries remaining): failed to resolve address for github.com: Name does not resolve; class=Net (12)
warning: spurious network error (1 tries remaining): failed to resolve address for github.com: Name does not resolve; class=Net (12)
error: failed to get `flate2` as a dependency of package `clamav_rust v0.0.1 (/wrkdirs/usr/ports/security/clamav/work/clamav-1.0.1/libclamav_rust)`

Caused by:
  failed to load source for dependency `flate2`

Caused by:
  Unable to update registry `crates-io`

Caused by:
  failed to fetch `https://github.com/rust-lang/crates.io-index`

Caused by:
  network failure seems to have happened
  if a proxy or similar is necessary `net.git-fetch-with-cli` may help here
  https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli

Caused by:
  failed to resolve address for github.com: Name does not resolve; class=Net (12)

This is output from poudriere testport on FreeBDS 13.1 with a recent clone of the ports tree. Following on from docs: https://docs.freebsd.org/en/books/porters-handbook/book/#using-cargo I tried USES= cargo and make cargo-crates, followed by make distinfo

However, now distinfo does not contain anything for clamav-1.0.1. I am not convinced this is the way.

Help please.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

dvl requested review of this revision.Jan 30 2023, 4:07 PM
dvl created this revision.
security/clamav/Makefile
6

To get clamav into distinfo, I added this line here:

DISTFILES?=    ${DISTNAME}${EXTRACT_SUFX}

Credit to nimaje for the idea.

With that change, the next block was:

error: found a virtual manifest at /wrkdirs/usr/ports/security/clamav/work/clamav-1.0.1/Cargo.toml` instead of a package manifest`

I also added:

CARGO_BUILD=   no
CARGO_INSTALL= no

That fixed the build.

This pre-release didn't have any docs, so the install failed until I added this to my make.conf:

security_clamav_UNSET+=DOCS
security/clamav/Makefile
6

That file contained:

root@131R-dvl:/wrkdirs/usr/ports/security/clamav/work/clamav-1.0.1 # cat Cargo.toml 
[workspace]

members = [
    "libclamav_rust",
]

[profile.dev.package."*"]
opt-level = 2

[profile.release]
opt-level = 2
debug = false

@dvl What are you going to do? Do you want to update security/clamav to development snapshot of upstream reposittory?

In D38278#869863, @yasu wrote:

@dvl What are you going to do? Do you want to update security/clamav to development snapshot of upstream reposittory?

I was building 1.0.1 inhouse for our use. I suspect what I've done will be needed for 1.0.1 when it comes out too. I was having trouble and figured I would let you know what I was having to do. Mostly because I thought I must be doing it wrong given how big the changes are.

I will update the diff with full changes. Perhaps the final release won't need all this.

In D38278#869863, @yasu wrote:

@dvl What are you going to do? Do you want to update security/clamav to development snapshot of upstream reposittory?

I have adjusted the original post to indicate I'm not planning to modify security/clamav.

In D38278#869919, @dvl wrote:
In D38278#869863, @yasu wrote:

@dvl What are you going to do? Do you want to update security/clamav to development snapshot of upstream reposittory?

I was building 1.0.1 inhouse for our use. I suspect what I've done will be needed for 1.0.1 when it comes out too. I was having trouble and figured I would let you know what I was having to do. Mostly because I thought I must be doing it wrong given how big the changes are.

Source archive of ClamAV includes all 3rd-party components necessary to build it. So if you build ClamAV from source archive, all you need to do is to download archive file and extract it. Then you get all required 3rd-party components as well as source files of ClamAV. But not all of such 3rd-party components are registered to upstream repository. So if you want to build ClamAV from snapshot of upstream repository, you need to checkout source files of ClamAV and then download some of 3rd-party components sepalately.

@

In D38278#869933, @yasu wrote:
In D38278#869919, @dvl wrote:
In D38278#869863, @yasu wrote:

@dvl What are you going to do? Do you want to update security/clamav to development snapshot of upstream reposittory?

I was building 1.0.1 inhouse for our use. I suspect what I've done will be needed for 1.0.1 when it comes out too. I was having trouble and figured I would let you know what I was having to do. Mostly because I thought I must be doing it wrong given how big the changes are.

Source archive of ClamAV includes all 3rd-party components necessary to build it. So if you build ClamAV from source archive, all you need to do is to download archive file and extract it. Then you get all required 3rd-party components as well as source files of ClamAV. But not all of such 3rd-party components are registered to upstream repository. So if you want to build ClamAV from snapshot of upstream repository, you need to checkout source files of ClamAV and then download some of 3rd-party components sepalately.

With https://github.com/Cisco-Talos/clamav/releases/tag/clamav-1.0.1 out now, it patches two known vulns.

Perhaps my patch isn't want you need for that update.

Port has been updated.