Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 927214 - app-antivirus/clamav-1.3.0 fails to compile: error: literal out of range for isize
Summary: app-antivirus/clamav-1.3.0 fails to compile: error: literal out of range for ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Antivirus Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-17 20:40 UTC by Agostino Sarubbo
Modified: 2024-06-24 11:35 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,328.78 KB, text/plain)
2024-03-17 20:40 UTC, Agostino Sarubbo
Details
patch for onenote to fix 32bit platforms (onenote-32bit.patch,429 bytes, patch)
2024-05-28 12:42 UTC, Steven Newbury
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2024-03-17 20:40:39 UTC
https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/

Issue: app-antivirus/clamav-1.3.0 fails to compile.
Discovered on: arm (internal ref: tinderbox_arm)

Info about the issue:
https://wiki.gentoo.org/wiki/Project:Tinderbox/Common_Issues_Helper#CF0014
Comment 1 Agostino Sarubbo gentoo-dev 2024-03-17 20:40:41 UTC
Created attachment 887856 [details]
build.log

build log and emerge --info
Comment 2 Agostino Sarubbo gentoo-dev 2024-03-17 20:40:42 UTC
Error(s) that match a know pattern in addition to what has been reported in the summary:


FAILED: armv7-unknown-linux-gnueabihf/release/libclamav_rust.a /var/tmp/portage/app-antivirus/clamav-1.3.0/work/clamav-clamav-1.3.0_build/armv7-unknown-linux-gnueabihf/release/libclamav_rust.a 
error: literal out of range for `isize`
Comment 3 Steven Newbury 2024-05-28 12:33:31 UTC
Also fails to build on x32.

This is due to a bug in the "onenote" component.  It uses custom discriminant values for enum variants for "PropertType" without specifying the type.  This causes it to default to "isize" which on 64bit platforms is big enough to hold the 32bit constants, but causes overflow when isize is 32bit.

It should be using u32.

I guess nobody tests 32bit platforms with Rust?!?

I'll attach a patch...
Comment 4 Steven Newbury 2024-05-28 12:42:36 UTC
Created attachment 894555 [details, diff]
patch for onenote to fix 32bit platforms

This will need to be applied via eapply due to onenote being unpacked above ${S}.

Patch against clamav-1.3.1, probably applies cleanly to 1.3.0 too.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-05-28 14:17:57 UTC
Please send the patch upstream.
Comment 6 Larry the Git Cow gentoo-dev 2024-06-24 11:04:59 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7b99345bb35e9a6a208a3aa3cd6660b4d606cdb3

commit 7b99345bb35e9a6a208a3aa3cd6660b4d606cdb3
Author:     Matt Jolly <kangie@gentoo.org>
AuthorDate: 2024-06-24 10:24:55 +0000
Commit:     Matt Jolly <kangie@gentoo.org>
CommitDate: 2024-06-24 11:04:15 +0000

    app-antivirus/clamav: package maintenance
    
    revbump 1.3.1 with the following fixes:
    
    - add postinst message for 'clamonacc'
    - fix x32 builds
    - fix PID paths
    - drop py310; add py313
    
    Bug: https://github.com/Cisco-Talos/clamav/issues/1076
    Bug: https://bugs.gentoo.org/921088
    Bug: https://bugs.gentoo.org/916147
    Bug: https://bugs.gentoo.org/787233
    Closes: https://bugs.gentoo.org/927214
    Signed-off-by: Matt Jolly <kangie@gentoo.org>

 app-antivirus/clamav/clamav-1.3.1-r1.ebuild        | 409 +++++++++++++++++++++
 .../clamav/files/clamav-1.3.1-onenote-rs.patch     |  30 ++
 2 files changed, 439 insertions(+)
Comment 7 Matt Jolly gentoo-dev 2024-06-24 11:35:57 UTC
I've submitted a PR upstream, however it looks pretty dead - outstanding PR from micah for the git crate we're using from clamav.

I've raised a linked issue on the clamav GitHub so that this can be addressed upstream in the git crate or something, but until then we have a patch that we can apply.