Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 670788 - meson.eclass: meson_src_compile() and meson_src_install() should pass their arguments to eninja()
Summary: meson.eclass: meson_src_compile() and meson_src_install() should pass their a...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All All
: Normal enhancement (vote)
Assignee: William Hubbs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 670790
  Show dependency tree
 
Reported: 2018-11-09 20:44 UTC by Arfrever Frehtes Taifersar Arahesis
Modified: 2019-08-19 19:25 UTC (History)
1 user (show)

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


Attachments
Patch (meson.eclass.patch,1.22 KB, patch)
2018-11-09 20:46 UTC, Arfrever Frehtes Taifersar Arahesis
Details | Diff
Patch (meson.eclass.patch,1.29 KB, patch)
2019-08-16 19:26 UTC, Arfrever Frehtes Taifersar Arahesis
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Arfrever Frehtes Taifersar Arahesis 2018-11-09 20:44:59 UTC
Sometimes ebuild using meson.eclass might need to pass additional arguments to ninja.

It would be more convenient if it was possible to do:
src_compile() {
    meson_src_compile some_argument
}
Instead of:
src_compile() {
    eninja -C "${BUILD_DIR}" some_argument
}
Comment 1 Arfrever Frehtes Taifersar Arahesis 2018-11-09 20:46:48 UTC
Created attachment 554702 [details, diff]
Patch
Comment 2 William Hubbs gentoo-dev 2018-11-25 01:08:13 UTC
I think we should create a variable, eninjaargs, that works like
emesonargs to be consistent with how we pass arguments to meson.

What do you think?
Comment 3 Arfrever Frehtes Taifersar Arahesis 2018-11-25 21:32:05 UTC
meson_src_configure() function supports 2 ways of passing arguments (which can be combined):

1. Passing arguments directly to meson_src_configure() function.

   meson_src_configure arg1 arg2 ...

2. Setting emesonargs array.

   emesonargs=(arg1 arg2 ...)
   meson_src_configure


Arguments passed directly to meson_src_configure() function take precedence over arguments set in emesonargs array.
Comment 4 William Hubbs gentoo-dev 2018-11-25 22:48:41 UTC
It does, but I don't remember the reason we supported passing arguments
to the src_configure function like this. The documented method in the
eclass is to use the e*args variable.
Comment 5 Mike Gilbert gentoo-dev 2018-11-26 04:36:52 UTC
The emesonargs variable seems pretty redundant to me. The only benefit I can see is that it encourages developers to use array syntax instead of ugly backslash escapes for passing values on multiple lines. But that would be accomplished just as easily by passing an array as function arguments instead.

Passing arguments to meson_src_compile and meson_src_install seems acceptable to me. This also has precedent in other similar eclasses like cmake-utils, which pass "$@" to either make or ninja in src_compile and src_install.

I would rather not invent another variable for passing arguments to ninja.
Comment 6 Arfrever Frehtes Taifersar Arahesis 2019-08-16 19:05:20 UTC
In the meantime, meson_src_test() was changed to use 'meson test' instead of 'ninja test' and it now uses "$@" properly:
https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fe02c66d4b7638575778dcb7cbeb09c42a83c764
https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e9c146e4335d47d61e415efa81f002e600e226f6


Only meson_src_compile() and meson_src_install() still need to be fixed.
Comment 7 Arfrever Frehtes Taifersar Arahesis 2019-08-16 19:26:44 UTC
Created attachment 587064 [details, diff]
Patch
Comment 8 Larry the Git Cow gentoo-dev 2019-08-19 19:25:33 UTC
The bug has been closed via the following commit(s):

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

commit 16b26361305e37258317cae0b29327de732e83c7
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
AuthorDate: 2018-11-09 20:39:48 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2019-08-19 19:24:51 +0000

    meson.eclass: meson_src_{compile,install}: Pass "$@" to eninja.
    
    Closes: https://bugs.gentoo.org/670788
    Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 eclass/meson.eclass | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)