• [gentoo-dev] [PATCH] java-utils-2.eclass: remove ebegin calls that lack

    From Mike Gilbert@21:1/5 to All on Fri Apr 15 16:20:01 2022
    Instead, echo the command we are about to run.

    Closes: https://bugs.gentoo.org/838475
    Closes: https://bugs.gentoo.org/838478
    Closes: https://bugs.gentoo.org/838481
    Closes: https://bugs.gentoo.org/838487
    Closes: https://bugs.gentoo.org/838490
    Closes: https://bugs.gentoo.org/838493
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>
    ---
    eclass/java-utils-2.eclass | 10 ++++++----
    1 file changed, 6 insertions(+), 4 deletions(-)

    diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass
    index 11798908dae..2a649942550 100644
    --- a/eclass/java-utils-2.eclass
    +++ b/eclass/java-utils-2.eclass
    @@ -2099,8 +2099,9 @@ ejavac() {
    einfo "${compiler_executable} ${javac_args} ${@}"
    fi

    - ebegin "Compiling"
    - ${compiler_executable} ${javac_args} "${@}" || die "ejavac failed"
    + local args=( ${compiler_executable} ${javac_args} "${@}" )
    + echo "${args[@]}" >&2
    + "${args[@]}" || die "ejavac failed"
    }

    # @FUNCTION: ejavadoc
    @@ -2125,8 +2126,9 @@ ejavadoc() {
    einfo "javadoc ${javadoc_args} ${@}"
    fi

    - ebegin "Generating JavaDoc"
    - javadoc ${javadoc_args} "${@}" || die "ejavadoc failed"
    + local args=( javadoc ${javadoc_args} "${@}" )
    + echo "${args[@]}" >&2
    + "${args[@]}" || die "ejavadoc failed"
    }

    # @FUNCTION: java-pkg_filter-compiler
    --
    2.35.1

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet
  • From David Seifert@21:1/5 to Mike Gilbert on Fri Apr 15 16:30:02 2022
    On Fri, 2022-04-15 at 10:11 -0400, Mike Gilbert wrote:
    Instead, echo the command we are about to run.

    Closes: https://bugs.gentoo.org/838475
    Closes: https://bugs.gentoo.org/838478
    Closes: https://bugs.gentoo.org/838481
    Closes: https://bugs.gentoo.org/838487
    Closes: https://bugs.gentoo.org/838490
    Closes: https://bugs.gentoo.org/838493
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>
    ---
     eclass/java-utils-2.eclass | 10 ++++++----
     1 file changed, 6 insertions(+), 4 deletions(-)

    diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass
    index 11798908dae..2a649942550 100644
    --- a/eclass/java-utils-2.eclass
    +++ b/eclass/java-utils-2.eclass
    @@ -2099,8 +2099,9 @@ ejavac() {
                    einfo "${compiler_executable} ${javac_args} ${@}"
            fi
     
    -       ebegin "Compiling"
    -       ${compiler_executable} ${javac_args} "${@}" || die "ejavac failed"
    +       local args=( ${compiler_executable} ${javac_args} "${@}" ) +       echo "${args[@]}" >&2
    +       "${args[@]}" || die "ejavac failed"
     }
     
     # @FUNCTION: ejavadoc
    @@ -2125,8 +2126,9 @@ ejavadoc() {
                    einfo "javadoc ${javadoc_args} ${@}"         fi
     
    -       ebegin "Generating JavaDoc"
    -       javadoc ${javadoc_args} "${@}" || die "ejavadoc failed" +       local args=( javadoc ${javadoc_args} "${@}" ) +       echo "${args[@]}" >&2
    +       "${args[@]}" || die "ejavadoc failed"
     }
     
     # @FUNCTION: java-pkg_filter-compiler

    Another nice example of "edo" being reinvented. LGTM

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Yuan Liao (Leo)@21:1/5 to All on Fri Apr 15 17:50:01 2022
    Instead, echo the command we are about to run.

    Closes: https://bugs.gentoo.org/838475
    Closes: https://bugs.gentoo.org/838478
    Closes: https://bugs.gentoo.org/838481
    Closes: https://bugs.gentoo.org/838487
    Closes: https://bugs.gentoo.org/838490
    Closes: https://bugs.gentoo.org/838493
    Signed-off-by: Mike Gilbert <floppym@g.o>
    ---
    eclass/java-utils-2.eclass | 10 ++++++----
    1 file changed, 6 insertions(+), 4 deletions(-)

    diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass
    index 11798908dae..2a649942550 100644
    --- a/eclass/java-utils-2.eclass
    +++ b/eclass/java-utils-2.eclass
    @@ -2099,8 +2099,9 @@ ejavac() {
    einfo "${compiler_executable} ${javac_args} ${@}"
    fi

    - ebegin "Compiling"
    - ${compiler_executable} ${javac_args} "${@}" || die "ejavac
    failed"
    + local args=( ${compiler_executable} ${javac_args} "${@}" )
    + echo "${args[@]}" >&2
    + "${args[@]}" || die "ejavac failed"
    }

    # @FUNCTION: ejavadoc
    @@ -2125,8 +2126,9 @@ ejavadoc() {
    einfo "javadoc ${javadoc_args} ${@}"
    fi

    - ebegin "Generating JavaDoc"
    - javadoc ${javadoc_args} "${@}" || die "ejavadoc failed"
    + local args=( javadoc ${javadoc_args} "${@}" )
    + echo "${args[@]}" >&2
    + "${args[@]}" || die "ejavadoc failed"
    }

    # @FUNCTION: java-pkg_filter-compiler

    I've got only a minor concern regarding printing the full 'javac' and
    'javadoc' command with arguments: for Java packages that use a lot of
    Java dependencies (including indirect, transitive Java dependencies)
    and/or call the 'ejavac' function with a very long list of arguments,
    this might generate way more verbose output than before. A good
    example package is dev-java/log4j-core, which does both of these
    things -- try compiling it and compare the Portage output.

    Though, this opinion is merely from a humble man who's been mostly
    working on Java packages exclusively. Actually, many non-Java ebuilds
    produce output with similar verbosity. One thing that is still worth
    noting is, unlike compilation of a C/C++ program, where each compiler invocation usually just processes a few files, a single invocation of
    javac usually involves putting _all_ Java source files' names into the command-line arguments.

    Best regards,
    Leo

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Florian Schmaus@21:1/5 to All on Fri Apr 15 18:20:01 2022
    On 15/04/2022 17.43, Yuan Liao (Leo) wrote:
    noting is, unlike compilation of a C/C++ program, where each compiler
    […] a single invocation of
    javac usually involves putting _all_ Java source files' names into the command-line arguments.

    We do use javac's @argfiles, e.g., @sources.lst, some places (probably
    not in all). Otherwise, where @argfiles are not used, I think it is more
    likely that you run into an exec() argument length issue with a large
    source file count before the emerge output becomes an issue.

    That said, I am sympathetic to the concerns you raised. Ideally the
    build.log should include the full command while only a shortened version
    is printed to the console. However, I am not aware that this is possible
    with portage. And if it is not (yet) possible, then I lean towards
    capturing the whole command line.

    - Flow

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