All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/collectd: disable libupsclient
@ 2022-08-28 22:17 Fabrice Fontaine
  2022-08-29  7:30 ` Yann E. MORIN
  0 siblings, 1 reply; 3+ messages in thread
From: Fabrice Fontaine @ 2022-08-28 22:17 UTC (permalink / raw)
  To: buildroot; +Cc: Fabrice Fontaine, Asaf Kahlon

Disable libupsclient to avoid the following build failure if
libupsclient is installed on host:

src/nut.c:40:2: error: #error "Unable to determine the UPS connection type."
   40 | #error "Unable to determine the UPS connection type."
      |  ^~~~~
src/nut.c:46:3: error: unknown type name 'collectd_upsconn_t'
   46 |   collectd_upsconn_t *conn;
      |   ^~~~~~~~~~~~~~~~~~

libupsclient is an optional dependency of nut plugin since version
5.10.0 and
https://github.com/collectd/collectd/commit/bc2d94024d0250211c1e498db1b43bb4525324da

Fixes:
 - http://autobuild.buildroot.org/results/22b758097e8fb72c68e41329cbc7abc748d81ca6

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 package/collectd/collectd.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/collectd/collectd.mk b/package/collectd/collectd.mk
index 5751757040..e0f40095aa 100644
--- a/package/collectd/collectd.mk
+++ b/package/collectd/collectd.mk
@@ -45,6 +45,7 @@ COLLECTD_CONF_OPTS += \
 	--with-nan-emulation \
 	--with-fp-layout=$(COLLECTD_FP_LAYOUT) \
 	--with-perl-bindings=no \
+	--without-libupsclient \
 	--disable-werror \
 	$(foreach p, $(COLLECTD_PLUGINS_DISABLE), --disable-$(p)) \
 	$(if $(BR2_PACKAGE_COLLECTD_AGGREGATION),--enable-aggregation,--disable-aggregation) \
-- 
2.35.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/1] package/collectd: disable libupsclient
  2022-08-28 22:17 [Buildroot] [PATCH 1/1] package/collectd: disable libupsclient Fabrice Fontaine
@ 2022-08-29  7:30 ` Yann E. MORIN
  2022-08-29  8:07   ` Yann E. MORIN
  0 siblings, 1 reply; 3+ messages in thread
From: Yann E. MORIN @ 2022-08-29  7:30 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: Asaf Kahlon, buildroot

Fabrice, All,

On 2022-08-29 00:17 +0200, Fabrice Fontaine spake thusly:
> Disable libupsclient to avoid the following build failure if
> libupsclient is installed on host:
> 
> src/nut.c:40:2: error: #error "Unable to determine the UPS connection type."
>    40 | #error "Unable to determine the UPS connection type."
>       |  ^~~~~
> src/nut.c:46:3: error: unknown type name 'collectd_upsconn_t'
>    46 |   collectd_upsconn_t *conn;
>       |   ^~~~~~~~~~~~~~~~~~
> 
> libupsclient is an optional dependency of nut plugin since version
> 5.10.0 and
> https://github.com/collectd/collectd/commit/bc2d94024d0250211c1e498db1b43bb4525324da
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/22b758097e8fb72c68e41329cbc7abc748d81ca6
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

Applied to master, thanks.

However, I think a better fix would be to understand why this breaks,
even though we do have nut enabled in the config, and collectd's
configure did detect it correctly.

The issue is that collectd's configure script can not detect the type
(as in, a C type) for the structure that hols a UPS connection. And the
issue has nothing to do with the actual type:

    http://autobuild.buildroot.org/results/22b758097e8fb72c68e41329cbc7abc748d81ca6/collectd-5.12.0/config.log

    configure:107607: checking for UPSCONN_t
    configure:107607: /usr/lfs/hdd_v1/rc-buildroot-test/scripts/instance-1/output-1/host/bin/i586-linux-gcc -c -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os -g0  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 conftest.c >&5
    In file included from conftest.c:155:
    /usr/lfs/hdd_v1/rc-buildroot-test/scripts/instance-1/output-1/host/i586-buildroot-linux-musl/sysroot/usr/include/upsclient.h:102:87: error: unknown type name 'time_t'
      102 | ssize_t upscli_sendline_timeout(UPSCONN_t *ups, const char *buf, size_t buflen, const time_t timeout);
          |                                                                                       ^~~~~~

So, the detection fails, not because of the upsclient is missing (it is
not!), but because the detection fails. Why does that toolchan not have
the time_t type defined? It is a musl toolchain, so maybe, just maybe?

So, I reverted the patch because I applied too fast...

Regards,
Yann E. MORIN.

> ---
>  package/collectd/collectd.mk | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/package/collectd/collectd.mk b/package/collectd/collectd.mk
> index 5751757040..e0f40095aa 100644
> --- a/package/collectd/collectd.mk
> +++ b/package/collectd/collectd.mk
> @@ -45,6 +45,7 @@ COLLECTD_CONF_OPTS += \
>  	--with-nan-emulation \
>  	--with-fp-layout=$(COLLECTD_FP_LAYOUT) \
>  	--with-perl-bindings=no \
> +	--without-libupsclient \
>  	--disable-werror \
>  	$(foreach p, $(COLLECTD_PLUGINS_DISABLE), --disable-$(p)) \
>  	$(if $(BR2_PACKAGE_COLLECTD_AGGREGATION),--enable-aggregation,--disable-aggregation) \
> -- 
> 2.35.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/1] package/collectd: disable libupsclient
  2022-08-29  7:30 ` Yann E. MORIN
@ 2022-08-29  8:07   ` Yann E. MORIN
  0 siblings, 0 replies; 3+ messages in thread
From: Yann E. MORIN @ 2022-08-29  8:07 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: Asaf Kahlon, buildroot

Fabrice, All,

On 2022-08-29 09:30 +0200, Yann E. MORIN spake thusly:
> On 2022-08-29 00:17 +0200, Fabrice Fontaine spake thusly:
> > Disable libupsclient to avoid the following build failure if
> > libupsclient is installed on host:
[--SNIP--]
> However, I think a better fix would be to understand why this breaks,
> even though we do have nut enabled in the config, and collectd's
> configure did detect it correctly.
[--SNIP--]
> So, the detection fails, not because of the upsclient is missing (it is
> not!), but because the detection fails. Why does that toolchan not have
> the time_t type defined? It is a musl toolchain, so maybe, just maybe?

Maybe something in nut, along the lines of (totally untested):

    diff --git a/clients/upsclient.h b/clients/upsclient.h
    index 08574b8f8..8f7a95759 100644
    --- a/clients/upsclient.h
    +++ b/clients/upsclient.h
    @@ -41,6 +41,10 @@
     	#include <limits.h>
     #endif

    +#if defined HAVE_TIME_H
    +	#include <time.h>
    +#endif
    +
     #ifdef __cplusplus
     /* *INDENT-OFF* */
     extern "C" {

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2022-08-29  8:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-28 22:17 [Buildroot] [PATCH 1/1] package/collectd: disable libupsclient Fabrice Fontaine
2022-08-29  7:30 ` Yann E. MORIN
2022-08-29  8:07   ` Yann E. MORIN

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.