Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: ricardo.martincoski@gmail.com
To: thomas.petazzoni@bootlin.com
Cc: titouan.christophe@railnova.eu, fontaine.fabrice@gmail.com,
	buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH] utils/checkpackagelib/lib_mk.py: fix check for overridden variable
Date: Mon, 27 Dec 2021 07:45:00 -0300	[thread overview]
Message-ID: <61c9992c2d979_7a709ec608a0@xultri.mail> (raw)
In-Reply-To: 20211226233920.53e17619@windsurf

[-- Attachment #1: Type: text/plain, Size: 1914 bytes --]

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@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

[-- Attachment #2: Type: text/plain, Size: 150 bytes --]

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

  reply	other threads:[~2021-12-27 10:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-15 23:53 [Buildroot] [PATCH] utils/checkpackagelib/lib_mk.py: fix check for overridden variable Ricardo Martincoski
2021-12-10 19:09 ` Arnout Vandecappelle
2021-12-26 22:39 ` Thomas Petazzoni
2021-12-27 10:45   ` ricardo.martincoski [this message]
2021-12-27 11:05     ` Thomas Petazzoni
2022-01-14 16:05 ` Peter Korsgaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=61c9992c2d979_7a709ec608a0@xultri.mail \
    --to=ricardo.martincoski@gmail.com \
    --cc=buildroot@buildroot.org \
    --cc=fontaine.fabrice@gmail.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=titouan.christophe@railnova.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox