public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] java-utils-2.eclass: remove ebegin calls that lack eend calls
@ 2022-04-15 14:11 Mike Gilbert
  2022-04-15 14:23 ` David Seifert
  0 siblings, 1 reply; 4+ messages in thread
From: Mike Gilbert @ 2022-04-15 14:11 UTC (permalink / raw
  To: gentoo-dev; +Cc: java, Mike Gilbert

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



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [gentoo-dev] [PATCH] java-utils-2.eclass: remove ebegin calls that lack eend calls
  2022-04-15 14:11 [gentoo-dev] [PATCH] java-utils-2.eclass: remove ebegin calls that lack eend calls Mike Gilbert
@ 2022-04-15 14:23 ` David Seifert
  0 siblings, 0 replies; 4+ messages in thread
From: David Seifert @ 2022-04-15 14:23 UTC (permalink / raw
  To: gentoo-dev; +Cc: java, Mike Gilbert

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-dev] [PATCH] java-utils-2.eclass: remove ebegin calls that lack eend calls
@ 2022-04-15 15:43 Yuan Liao (Leo)
  2022-04-15 16:17 ` Florian Schmaus
  0 siblings, 1 reply; 4+ messages in thread
From: Yuan Liao (Leo) @ 2022-04-15 15:43 UTC (permalink / raw
  To: gentoo-dev

> 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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-dev] [PATCH] java-utils-2.eclass: remove ebegin calls that lack eend calls
  2022-04-15 15:43 Yuan Liao (Leo)
@ 2022-04-15 16:17 ` Florian Schmaus
  0 siblings, 0 replies; 4+ messages in thread
From: Florian Schmaus @ 2022-04-15 16:17 UTC (permalink / raw
  To: gentoo-dev

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-04-15 16:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-15 14:11 [gentoo-dev] [PATCH] java-utils-2.eclass: remove ebegin calls that lack eend calls Mike Gilbert
2022-04-15 14:23 ` David Seifert
  -- strict thread matches above, loose matches on Subject: below --
2022-04-15 15:43 Yuan Liao (Leo)
2022-04-15 16:17 ` Florian Schmaus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox