• [gentoo-dev] [PATCH 1/2] ninja-utils.eclass: Add NINJA_VERBOSE

    From Matt Turner@21:1/5 to All on Mon Jul 17 17:30:02 2023
    ninja operates in one of three modes:
    - verbose (with -v): prints build commands
    - quiet (with --quiet): prints nothing
    - normal: prints [XX/YY]-style build status updates

    samurai works the same way, except it does not have a quiet mode.

    Thus we can't simply override ninja-utils' hard-coded flag from callers
    of eninja.

    Signed-off-by: Matt Turner <mattst88@gentoo.org>
    ---
    eclass/ninja-utils.eclass | 13 ++++++++++++-
    1 file changed, 12 insertions(+), 1 deletion(-)

    diff --git a/eclass/ninja-utils.eclass b/eclass/ninja-utils.eclass
    index e6d8c9e6c0a9..26ba31678f01 100644
    --- a/eclass/ninja-utils.eclass
    +++ b/eclass/ninja-utils.eclass
    @@ -48,6 +48,12 @@ _NINJA_UTILS_ECLASS=1
    # supposed to be set in make.conf. If unset, eninja() will convert
    # MAKEOPTS instead.

    +# @ECLASS_VARIABLE: NINJA_VERBOSE
    +# @USER_VARIABLE
    +# @DESCRIPTION:
    +# Set to OFF to disable verbose messages during compilation
    +: "${NINJA_VERBOSE:=ON}"
    +
    inherit multiprocessing

    case "${NINJA}" in
    @@ -80,7 +86,12 @@ get_NINJAOPTS() {
    # also supports being called via 'nonfatal'.
    eninja() {
    [[ -n "${NINJA_DEPEND}" ]] || ewarn "Unknown value '${NINJA}' for \${NINJA}"
    - set -- "${NINJA}" -v $(get_NINJAOPTS) "$@"
    + local v
    + case "${NINJA_VERBOSE}" in
    + OFF) ;;
    + *) v="-v"
    + esac
    + set -- "${NINJA}" ${v} $(get_NINJAOPTS) "$@"
    echo "$@" >&2
    "$@" || die -n "${*} failed"
  • From Matt Turner@21:1/5 to All on Mon Jul 17 17:30:02 2023
    Signed-off-by: Matt Turner <mattst88@gentoo.org>
    ---
    eclass/cmake.eclass | 4 ++++
    1 file changed, 4 insertions(+)

    diff --git a/eclass/cmake.eclass b/eclass/cmake.eclass
    index d70f2cbf1fac..16b3e300ccae 100644
    --- a/eclass/cmake.eclass
    +++ b/eclass/cmake.eclass
    @@ -651,6 +651,10 @@ cmake_build() {
    ;;
    ninja)
    [[ -e build.ninja ]] || die "build.ninja not found. Error during configure stage."
    + case ${CMAKE_VERBOSE} in
    + OFF) NINJA_VERBOSE=OFF eninja "$@" ;;
    + *) eninja "$@" ;;
    + esac
    eninja "$@"
    ;;
    esac
    --
    2.41.0

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mike Gilbert@21:1/5 to mattst88@gentoo.org on Tue Jul 18 19:40:01 2023
    On Mon, Jul 17, 2023 at 11:21 AM Matt Turner <mattst88@gentoo.org> wrote:

    ninja operates in one of three modes:
    - verbose (with -v): prints build commands
    - quiet (with --quiet): prints nothing
    - normal: prints [XX/YY]-style build status updates

    samurai works the same way, except it does not have a quiet mode.

    Thus we can't simply override ninja-utils' hard-coded flag from callers
    of eninja.

    Seems ok to me.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)