From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Giulio Benetti <giulio.benetti@benettiengineering.com>,
Romain Naour <romain.naour@gmail.com>,
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>,
Buildroot List <buildroot@buildroot.org>
Subject: Re: [Buildroot] [PATCH 3/3] toolchain/toolchain-wrapper: don't hardcode CCACHE_BASEDIR
Date: Sat, 30 Jul 2022 14:11:03 +0200 [thread overview]
Message-ID: <20220730121103.GR3168@scaer> (raw)
In-Reply-To: <20220727184850.2857314-3-thomas.petazzoni@bootlin.com>
Thomas, All,
On 2022-07-27 20:48 +0200, Thomas Petazzoni via buildroot spake thusly:
> The CCACHE_BASEDIR variable was hardcoded to $(BASE_DIR), and
> therefore when moving around the toolchain-wrapper as part of the SDK,
> the CCACHE_BASEDIR would still point to the original location of the
> Buildroot build.
>
> Instead of doing this, leverage the logic we already have in the
> toolchain wrapper, which determines based on the toolchain wrapper
> location itself what is the base directory.
>
> So now, toolchain-wrapper.mk is only passing a boolean to
> toolchain-wrapper.c, that tells whether the BR2_USE_CCACHE_BASEDIR
> option is enabled or not.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> ---
> toolchain/toolchain-wrapper.c | 6 +++---
> toolchain/toolchain-wrapper.mk | 2 +-
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/toolchain/toolchain-wrapper.c b/toolchain/toolchain-wrapper.c
> index 37b24dd24a..bed90d6292 100644
> --- a/toolchain/toolchain-wrapper.c
> +++ b/toolchain/toolchain-wrapper.c
> @@ -538,9 +538,9 @@ int main(int argc, char **argv)
> return 3;
> }
> #endif
> -#ifdef BR_CCACHE_BASEDIR
> - /* Allow compilercheck to be overridden through the environment */
> - if (setenv("CCACHE_BASEDIR", BR_CCACHE_BASEDIR, 0)) {
> +#ifdef BR_USE_CCACHE_BASEDIR
> + /* Allow basedir to be overridden through the environment */
> + if (setenv("CCACHE_BASEDIR", absbasedir, 0)) {
You forgot the one instance in the debug code, lines 524 and 525.
And once this is fixed, you'll notice that the old and the new
CCACHE_BASEDIR will be different:
(before)$ BR2_DEBUG_WRAPPER=2 ./host/bin/arm-linux-gcc --help
...
Toolchain wrapper executing:
CCACHE_BASEDIR='/home/ymorin/dev/buildroot/O/master'
'/home/ymorin/dev/buildroot/O/master/host/opt/ext-toolchain/bin/arm-linux-gcc.br_real'
...
(after)$ BR2_DEBUG_WRAPPER=2 ./host/bin/arm-linux-gcc --help
...
Toolchain wrapper executing:
CCACHE_BASEDIR='/home/ymorin/dev/buildroot/O/master/host'
'/home/ymorin/dev/buildroot/O/master/host/opt/ext-toolchain/bin/arm-linux-gcc.br_real'
...
So as you can see, before, CCACHE_BASEDIR was pointing to BASE_DIR, but
now it points to HOST_DIR. This is one-level too deep, as it will not
match the path where packages are actually built, which is
BASE_DIR/build, and hapenned to be CCACHE_BASEDIR/build.
Even though I had the debug code path fixed, the second issue was not
trivial enough for me to fix when applying, so I amrked the patch as
changes requested.
Regards,
Yann E. MORIN.
> perror(__FILE__ ": Failed to set CCACHE_BASEDIR");
> return 3;
> }
> diff --git a/toolchain/toolchain-wrapper.mk b/toolchain/toolchain-wrapper.mk
> index cbf46f15fa..c87120f0f7 100644
> --- a/toolchain/toolchain-wrapper.mk
> +++ b/toolchain/toolchain-wrapper.mk
> @@ -70,7 +70,7 @@ endif
> endif
>
> ifeq ($(BR2_CCACHE_USE_BASEDIR),y)
> -TOOLCHAIN_WRAPPER_ARGS += -DBR_CCACHE_BASEDIR='"$(BASE_DIR)"'
> +TOOLCHAIN_WRAPPER_ARGS += -DBR_USE_CCACHE_BASEDIR
> endif
>
> ifeq ($(BR2_PIC_PIE),y)
> --
> 2.37.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
next prev parent reply other threads:[~2022-07-30 12:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-27 18:48 [Buildroot] [PATCH 1/3] docs/manual/ccache-support.txt: expand explanation about ccache cache location Thomas Petazzoni via buildroot
2022-07-27 18:48 ` [Buildroot] [PATCH 2/3] docs/manual/ccache-support.txt: document the new BR2_USE_CCACHE variable Thomas Petazzoni via buildroot
2022-07-30 12:03 ` Yann E. MORIN
2022-07-27 18:48 ` [Buildroot] [PATCH 3/3] toolchain/toolchain-wrapper: don't hardcode CCACHE_BASEDIR Thomas Petazzoni via buildroot
2022-07-30 12:11 ` Yann E. MORIN [this message]
2022-08-06 19:59 ` Thomas Petazzoni via buildroot
2022-07-30 12:02 ` [Buildroot] [PATCH 1/3] docs/manual/ccache-support.txt: expand explanation about ccache cache location Yann E. MORIN
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=20220730121103.GR3168@scaer \
--to=yann.morin.1998@free.fr \
--cc=buildroot@buildroot.org \
--cc=giulio.benetti@benettiengineering.com \
--cc=romain.naour@gmail.com \
--cc=thomas.de_schampheleire@nokia.com \
--cc=thomas.petazzoni@bootlin.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox