All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andrew Jeffery <andrew@aj.id.au>
Cc: Bartosz Golaszewski <brgl@bgdev.pl>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Kent Gibson <warthog618@gmail.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	linux-gpio@vger.kernel.org
Subject: Re: [libgpiod][WIP PATCH 0/2] Convert the build from autotools to meson
Date: Wed, 7 Dec 2022 00:21:43 +0200	[thread overview]
Message-ID: <Y4/Ad7v1waTC4NJc@smile.fi.intel.com> (raw)
In-Reply-To: <7fc4db18-cebc-4894-b3d7-12c9470e6a93@app.fastmail.com>

On Wed, Dec 07, 2022 at 08:34:20AM +1030, Andrew Jeffery wrote:
> On Wed, 7 Dec 2022, at 01:24, Andy Shevchenko wrote:
> > On Mon, Dec 05, 2022 at 07:55:29PM +0100, Bartosz Golaszewski wrote:
> >> On Mon, Dec 5, 2022 at 2:22 PM Andrew Jeffery <andrew@aj.id.au> wrote:

...

> >> > Meson defaults to using ninja as its backend, and automatically exploits
> >> > ccache[2] when available to keep repeated builds speedy.
> >
> > ...which is a bad idea for a clean build.
> >
> >> It does show! Full rebuild with autotools:
> >> 
> >> real 0m43,902s
> >> user 2m40,010s
> >> sys 0m20,172s
> >> 
> >> Full rebuild with meson:
> >> 
> >> real 0m10,001s
> >> user 1m1,334s
> >> sys 0m12,205s
> >> 
> >> More than 4x faster now.
> >
> > And risk to have a badly formed binaries (yes, very little risk, but > 0).
> >
> >> > [2] https://ccache.dev/
> >
> > ccache has downside of its own use. If we have a common storage for ccache --
> > the collision is just matter of time (yes, have seen that in real life).
> >
> > OTOH requiring per-project ccache storage makes a little sense for the end user
> > as they quite likely won't rebuild it many times.
> 
> Valid points. However I think they're addressed by:
> 
> 1. Not installing ccache on the system, or
> 2. Overriding the auto-detection behaviour of `meson setup ...` 
> 
> Regarding 2, you can specify the CC and CXX environment variables to force its hand:
> 
> ```
> $ command -v ccache
> /usr/bin/ccache
> $ CC=cc CXX=c++ meson setup -Dbindings=cxx build
> The Meson build system
> Version: 0.63.0
> ...
> C compiler for the host machine: cc (gcc 12.2.0 "cc (Ubuntu 12.2.0-3ubuntu1) 12.2.0")
> ...
> C++ compiler for the host machine: c++ (gcc 12.2.0 "c++ (Ubuntu 12.2.0-3ubuntu1) 12.2.0")
> ...
> ```
> 
> Compared to the default behaviour:
> 
> ```
> $ meson setup -Dbindings=cxx build
> The Meson build system
> Version: 0.63.0
> ...
> C compiler for the host machine: ccache cc (gcc 12.2.0 "cc (Ubuntu 12.2.0-3ubuntu1) 12.2.0")
> ...
> C++ compiler for the host machine: ccache c++ (gcc 12.2.0 "c++ (Ubuntu 12.2.0-3ubuntu1) 12.2.0")
> ...
> ```
> 
> This use of the CC and CXX variables is covered in the documentation:
> 
> https://mesonbuild.com/Feature-autodetection.html#ccache

Right, my point that ccache should be opt-in and not opt-out.
For example, Buidroot project has ccache support (as opt-in).

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2022-12-06 22:21 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-05 13:22 [libgpiod][WIP PATCH 0/2] Convert the build from autotools to meson Andrew Jeffery
2022-12-05 13:22 ` [libgpiod][WIP PATCH 1/2] Introduce meson as a build system Andrew Jeffery
2022-12-05 13:22 ` [libgpiod][WIP PATCH 2/2] Remove autotools in favour of meson Andrew Jeffery
2022-12-05 18:55 ` [libgpiod][WIP PATCH 0/2] Convert the build from autotools to meson Bartosz Golaszewski
2022-12-05 23:42   ` Andrew Jeffery
2022-12-06  0:06   ` Viresh Kumar
2022-12-06  0:26     ` Andrew Jeffery
2022-12-06  3:40       ` Viresh Kumar
2022-12-06  3:54         ` Kent Gibson
2022-12-06 12:15           ` Miguel Ojeda
2022-12-06 14:54   ` Andy Shevchenko
2022-12-06 22:04     ` Andrew Jeffery
2022-12-06 22:21       ` Andy Shevchenko [this message]
2022-12-08  4:23   ` Andrew Jeffery
2022-12-08  9:27     ` Bartosz Golaszewski
2022-12-08 11:09       ` Andrew Jeffery
2022-12-08 18:48         ` Bartosz Golaszewski
2022-12-08 21:51           ` Andrew Jeffery

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=Y4/Ad7v1waTC4NJc@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=andrew@aj.id.au \
    --cc=brgl@bgdev.pl \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=viresh.kumar@linaro.org \
    --cc=warthog618@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.