[Buildroot] [PATCH] utils/checkpackagelib/lib_mk.py: fix check for overridden variable
ricardo.martincoski at gmail.com
ricardo.martincoski at gmail.com
Mon Dec 27 10:45:00 UTC 2021
Hello Thomas,
On Sun, Dec 26, 2021 at 07:39 PM, Thomas Petazzoni wrote:
> On Mon, 15 Nov 2021 20:53:36 -0300
> Ricardo Martincoski <ricardo.martincoski at gmail.com> wrote:
>
>> Currently this .mk snippet results in unexpected behavior from
>> check-package:
>> |VAR_1 = VALUE1
>> |ifeq (condition)
>> |VAR_1 := $(VAR_1), VALUE2
>> |endif
>
> There is apparently still a problem with this check. Indeed, I just
> committed 1118f2c51c357d968e2d08e31ad3c741f5fa7df8 which adds an
> unconditional:
>
> +# https://www.mail-archive.com/lttng-dev@lists.lttng.org/msg12950.html
> +LTTNG_LIBUST_CONF_ENV = CFLAGS="$(TARGET_CFLAGS) -DUATOMIC_NO_LINK_ERROR"
>
> but even though it is outside of any condition, check-package complains:
>
> package/lttng-libust/lttng-libust.mk:30: conditional override of variable LTTNG_LIBUST_CONF_ENV
20 |# https://www.mail-archive.com/lttng-dev@lists.lttng.org/msg12950.html
21 |LTTNG_LIBUST_CONF_ENV = CFLAGS="$(TARGET_CFLAGS) -DUATOMIC_NO_LINK_ERROR"
22 |
23 |ifeq ($(BR2_PACKAGE_PYTHON),y)
24 |LTTNG_LIBUST_DEPENDENCIES += python
25 |LTTNG_LIBUST_CONF_OPTS += --enable-python-agent
26 |else ifeq ($(BR2_PACKAGE_PYTHON3),y)
27 |LTTNG_LIBUST_DEPENDENCIES += python3
28 |LTTNG_LIBUST_CONF_OPTS += --enable-python-agent
29 |else
30 |LTTNG_LIBUST_CONF_ENV = am_cv_pathless_PYTHON="none"
31 |LTTNG_LIBUST_CONF_OPTS += --disable-python-agent
32 |endif
Well, it seems that line 30 is indeed overriding line 21 when python is not
enabled.
As check-package is today, except for _DEPENDENCIES, all other variables can
have either:
|ifeq (condition)
|VAR_1 = value
|endif
or:
|ifeq (condition)
|VAR_1 += value
|endif
check-package will only complain when there is an actual override:
|VAR_1 = value
|ifeq (condition)
|VAR_1 = value
|endif
We could, for instance, change it to always expect:
|ifeq (condition)
|VAR_1 += value
|endif
... catching potential overrides.
Regards,
Ricardo
More information about the buildroot
mailing list