diff mbox series

[v4,06/15] bugreport: add glibc version

Message ID 20191213004312.169753-7-emilyshaffer@google.com (mailing list archive)
State New, archived
Headers show
Series [v4,01/15] bugreport: add tool to generate debugging info | expand

Commit Message

Emily Shaffer Dec. 13, 2019, 12:43 a.m. UTC
To help pinpoint the source of a regression, it is useful to know the
version of libc which the user's Git client was built with. Let's
include it alongside the other versioning information, which is used to
identify how the client was built.

Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
---
 bugreport.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Junio C Hamano Dec. 13, 2019, 9:18 p.m. UTC | #1
Emily Shaffer <emilyshaffer@google.com> writes:

> To help pinpoint the source of a regression, it is useful to know the
> version of libc which the user's Git client was built with. Let's
> include it alongside the other versioning information, which is used to
> identify how the client was built.
>
> Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
> ---
>  bugreport.c | 5 +++++
>  1 file changed, 5 insertions(+)

This is the first iffy one in the series.  It is unreasonable to
assume that we can dictate that Git can be built only on glibc
systems, no?

Making this conditional, perhaps make "bugreport.c" depend on
"extern void get_compiler_info(struct strbuf *sys_info)" and require
the function to be defined in compat/; the glibc variant that uses
gnu_get_libc_version() would become just one of them.

> diff --git a/bugreport.c b/bugreport.c
> index 9c69e3fa34..af715dc157 100644
> --- a/bugreport.c
> +++ b/bugreport.c
> @@ -4,6 +4,7 @@
>  #include "strbuf.h"
>  #include "time.h"
>  #include "help.h"
> +#include <gnu/libc-version.h>
>  
>  static void get_system_info(struct strbuf *sys_info)
>  {
> @@ -27,6 +28,10 @@ static void get_system_info(struct strbuf *sys_info)
>  			    uname_info.release,
>  			    uname_info.version,
>  			    uname_info.machine);
> +
> +	strbuf_addstr(sys_info, "glibc version: ");
> +	strbuf_addstr(sys_info, gnu_get_libc_version());
> +	strbuf_complete_line(sys_info);
>  }
>  
>  static const char * const bugreport_usage[] = {
Emily Shaffer Dec. 16, 2019, 10:39 p.m. UTC | #2
On Fri, Dec 13, 2019 at 01:18:44PM -0800, Junio C Hamano wrote:
> Emily Shaffer <emilyshaffer@google.com> writes:
> 
> > To help pinpoint the source of a regression, it is useful to know the
> > version of libc which the user's Git client was built with. Let's
> > include it alongside the other versioning information, which is used to
> > identify how the client was built.
> >
> > Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
> > ---
> >  bugreport.c | 5 +++++
> >  1 file changed, 5 insertions(+)
> 
> This is the first iffy one in the series.  It is unreasonable to
> assume that we can dictate that Git can be built only on glibc
> systems, no?
> 
> Making this conditional, perhaps make "bugreport.c" depend on
> "extern void get_compiler_info(struct strbuf *sys_info)" and require
> the function to be defined in compat/; the glibc variant that uses
> gnu_get_libc_version() would become just one of them.

Interesting. This sounds like a good approach - thanks, I'll look into
it.

 - Emily
diff mbox series

Patch

diff --git a/bugreport.c b/bugreport.c
index 9c69e3fa34..af715dc157 100644
--- a/bugreport.c
+++ b/bugreport.c
@@ -4,6 +4,7 @@ 
 #include "strbuf.h"
 #include "time.h"
 #include "help.h"
+#include <gnu/libc-version.h>
 
 static void get_system_info(struct strbuf *sys_info)
 {
@@ -27,6 +28,10 @@  static void get_system_info(struct strbuf *sys_info)
 			    uname_info.release,
 			    uname_info.version,
 			    uname_info.machine);
+
+	strbuf_addstr(sys_info, "glibc version: ");
+	strbuf_addstr(sys_info, gnu_get_libc_version());
+	strbuf_complete_line(sys_info);
 }
 
 static const char * const bugreport_usage[] = {