Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 810655 - dev-util/meson: meson compile: error: argument -l/--load-average: invalid int value: '41.95'
Summary: dev-util/meson: meson compile: error: argument -l/--load-average: invalid int...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Mike Gilbert
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-27 12:14 UTC by Thomas Deutschmann (RETIRED)
Modified: 2021-09-21 13:38 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Deutschmann (RETIRED) gentoo-dev 2021-08-27 12:14:28 UTC
I have set

> # portageq envvar MAKEOPTS
--jobs 42 --load-average 41.95

which worked fine until I upgraded from >=dev-util/meson-0.58.2 to 0.59.1. Now I see failures like

> >>> Source configured.
> >>> Compiling source in /var/tmp/portage/media-video/pipewire-0.3.34/work/pipewire-0.3.34 ...
>  * abi_x86_32.x86: running multilib-minimal_abi_src_compile
> meson compile -C /var/tmp/portage/media-video/pipewire-0.3.34/work/pipewire-0.3.34-abi_x86_32.x86 --jobs 42 --load-average 41.95 --verbose
> usage: meson compile [-h] [--clean] [-C BUILDDIR] [-j JOBS] [-l LOAD_AVERAGE] [-v] [--ninja-args NINJA_ARGS]
>                      [--vs-args VS_ARGS] [--xcode-args XCODE_ARGS]
>                      [TARGET ...]
> meson compile: error: argument -l/--load-average: invalid int value: '41.95'
>  * ERROR: media-video/pipewire-0.3.34::gentoo failed (compile phase):
>  *   compile failed
>  *
>
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-08-27 12:18:28 UTC
Definitely not related to eclass change? https://www.mail-archive.com/gentoo-dev@lists.gentoo.org/msg93286.html
Comment 2 Mike Gilbert gentoo-dev 2021-08-27 13:29:50 UTC
Both meson compile and ninja treat the load average as an integer.

For ninja, the value is parsed using strtod(). The fractional portion of the value is ignored.

For meson compile, the argument parser is a bit more strict, and a fractional value causes an exception to be raised.

If we want to restore the previous behavior, we could probably just truncate the result of makeopts_loadavg to convert it to an integer before passing it to meson compile.
Comment 3 Mike Gilbert gentoo-dev 2021-08-27 13:41:30 UTC
(In reply to Mike Gilbert from comment #2)
> For ninja, the value is parsed using strtod(). The fractional portion of the
> value is ignored.

I take that back: strtod() parses the argument as a double, and ninja fully supports fractional load average values.

I think the argument parser in meson compile should be updated to take a floating point value instead of an integer.

I'll work on a patch to implement that.
Comment 4 Larry the Git Cow gentoo-dev 2021-08-27 17:06:40 UTC
The bug has been closed via the following commit(s):

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

commit c7c6ead31a2d6047ef2d3dd3fb60182f1456124f
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2021-08-27 17:05:07 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2021-08-27 17:05:07 +0000

    dev-util/meson: accept floating point values for load-average
    
    Closes: https://bugs.gentoo.org/810655
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 ...on-mcompile-treat-load-average-as-a-float.patch | 28 ++++++++++++++++++++++
 ...{meson-0.58.2.ebuild => meson-0.58.2-r1.ebuild} |  4 ++++
 ...{meson-0.59.1.ebuild => meson-0.59.1-r1.ebuild} |  4 ++++
 3 files changed, 36 insertions(+)
Comment 5 Larry the Git Cow gentoo-dev 2021-09-21 13:38:07 UTC
The bug has been referenced in the following commit(s):

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

commit c6a3fa54b14b1ccbf2cd7703061e6a19c735dde8
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2021-09-21 13:37:27 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2021-09-21 13:37:27 +0000

    meson.eclass: depend in >=dev-util/meson-0.58.2-r1
    
    Bug: https://bugs.gentoo.org/810655
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 eclass/meson.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)