From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Romain Naour <romain.naour@gmail.com>
Cc: Titouan Christophe <titouanchristophe@gmail.com>,
buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH] package/python-avro: don't refer to avro-c version variable
Date: Sun, 15 May 2022 00:04:57 +0200 [thread overview]
Message-ID: <20220514220457.GF1597494@scaer> (raw)
In-Reply-To: <20220514195711.169277-1-romain.naour@gmail.com>
Romain, All,
On 2022-05-14 21:57 +0200, Romain Naour spake thusly:
> Like for other packages sharing the same version number, we
> can't rely on Make variable expansion. It's working by chance
> since avro-c is sorted before python-avro by the Buildroot
> main Makefile [1].
>
> [1] https://git.buildroot.net/buildroot/tree/Makefile?h=2022.02.1#n533
>
> Signed-off-by: Romain Naour <romain.naour@gmail.com>
> Cc: Titouan Christophe <titouanchristophe@gmail.com>
> ---
> package/avro-c/avro-c.mk | 1 +
> package/python-avro/python-avro.mk | 4 +++-
> 2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/package/avro-c/avro-c.mk b/package/avro-c/avro-c.mk
> index 262a0fee5f..f55c579656 100644
> --- a/package/avro-c/avro-c.mk
> +++ b/package/avro-c/avro-c.mk
> @@ -4,6 +4,7 @@
> #
> ################################################################################
>
> +# When updating the version, please also update python-avro
> AVRO_C_VERSION = 1.11.0
> AVRO_C_SITE = https://www-eu.apache.org/dist/avro/avro-$(AVRO_C_VERSION)/c
> AVRO_C_LICENSE = Apache-2.0
> diff --git a/package/python-avro/python-avro.mk b/package/python-avro/python-avro.mk
> index 0c4c431777..973107979c 100644
> --- a/package/python-avro/python-avro.mk
> +++ b/package/python-avro/python-avro.mk
> @@ -4,7 +4,9 @@
> #
> ################################################################################
>
> -PYTHON_AVRO_VERSION = $(AVRO_C_VERSION)
> +# Not possible to directly refer to avro-c variables, because of
> +# first/second expansion trickery...
In fact, this is not really a problem with first/secod expansion like I
thought initially.
So, first, the current code does work, because avro-c is parsed before
python-avro, so AVRO_C_VERSION *is* defined by the moment we call
$(eval $(python-package)) in pyhon-avro.mk.
And this is what is important: the _VERSION must be known by the time a
*-package infra is called, becasue _VERSION is used to generate Makefile
code, in the form of rules that boils down to:
$(pkgname-$($(pkgname)_VERSION): some-stamp-file
some commands to run
So, if _VERSION is defined after *-package is caleed, that breaks; if it
is defined before, that works.
However, this is still fragile, and we try to avoid it. For example,
mesa3d and mesa3d-headers duplicate the version string. That's because
$(wildcard package/*/*.mk) would sort them in the inverse order we'd
want::
package/mesa3d-headers/mesa3d-headers.mk
package/mesa3d/mesa3d.mk
So, mesa3d-headers can't use mesa3d version string (note the other way
around would work).
So, I changed that comment to also point to avro-c when updating the
version (and as I forgot to commit, I had to push a follow-up patch).
Applied to master, thanks.
Regards,
Yann E. MORIN.
> +PYTHON_AVRO_VERSION = 1.11.0
> PYTHON_AVRO_SITE = \
> https://www-eu.apache.org/dist/avro/avro-$(PYTHON_AVRO_VERSION)/py
> PYTHON_AVRO_SOURCE = avro-$(PYTHON_AVRO_VERSION).tar.gz
> --
> 2.35.3
>
> _______________________________________________
> 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
prev parent reply other threads:[~2022-05-14 22:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-14 19:57 [Buildroot] [PATCH] package/python-avro: don't refer to avro-c version variable Romain Naour
2022-05-14 22:04 ` Yann E. MORIN [this message]
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=20220514220457.GF1597494@scaer \
--to=yann.morin.1998@free.fr \
--cc=buildroot@buildroot.org \
--cc=romain.naour@gmail.com \
--cc=titouanchristophe@gmail.com \
/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 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.