From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id F3EBDA0C57; Mon, 1 Nov 2021 17:54:40 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DC43940E28; Mon, 1 Nov 2021 17:54:40 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id B075240DF6; Mon, 1 Nov 2021 17:54:38 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10154"; a="218248627" X-IronPort-AV: E=Sophos;i="5.87,200,1631602800"; d="scan'208";a="218248627" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Nov 2021 09:54:36 -0700 X-IronPort-AV: E=Sophos;i="5.87,200,1631602800"; d="scan'208";a="488719020" Received: from bricha3-mobl.ger.corp.intel.com ([10.252.16.121]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 01 Nov 2021 09:54:34 -0700 Date: Mon, 1 Nov 2021 16:54:31 +0000 From: Bruce Richardson To: Dmitry Kozlyuk Cc: dev@dpdk.org, stable@dpdk.org, Michal Berger , thomas@monjalon.net Message-ID: References: <20211026193239.113745-1-dmitry.kozliuk@gmail.com> <20211027194528.51329515@sovereign> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211027194528.51329515@sovereign> Subject: Re: [dpdk-dev] [PATCH] buildtools: fix build with meson 0.60 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, Oct 27, 2021 at 07:45:28PM +0300, Dmitry Kozlyuk wrote: > 2021-10-27 17:16 (UTC+0100), Bruce Richardson: > > On Tue, Oct 26, 2021 at 10:32:39PM +0300, Dmitry Kozlyuk wrote: > > > Meson 0.60 switched the format of uninstalled static libraries > > > to thin archives, that is, they contain only paths to object files, > > > not the files themselves. Files cannot be extracted in this case, > > > resulting in build errors: > > > > > > ar: `x' cannot be used on thin archives. > > > > > > Handle thin archives when invoking pmdinfogen > > > by directly using the files referenced in the archive. > > > > > > Bugzilla ID: 836 > > > Fixes: e6e9730c7066 ("buildtools: support object file extraction for Windows") > > > Cc: stable@dpdk.org > > > > > > Reported-by: Michal Berger > > > Signed-off-by: Dmitry Kozlyuk > > > --- > > > buildtools/gen-pmdinfo-cfile.py | 23 ++++++++++++++--------- > > > 1 file changed, 14 insertions(+), 9 deletions(-) > > > > > > > Here is an alternative fix that works in my testing, based on my earlier > > suggestion: > > > > Regards, > > /Bruce > > > > diff --git a/buildtools/gen-pmdinfo-cfile.py b/buildtools/gen-pmdinfo-cfile.py > > index 58fe3ad152..5fbd51658a 100644 > > --- a/buildtools/gen-pmdinfo-cfile.py > > +++ b/buildtools/gen-pmdinfo-cfile.py > > @@ -9,12 +9,13 @@ > > > > _, tmp_root, ar, archive, output, *pmdinfogen = sys.argv > > with tempfile.TemporaryDirectory(dir=tmp_root) as temp: > > - run_ar = lambda command: subprocess.run( > > - [ar, command, os.path.abspath(archive)], > > - stdout=subprocess.PIPE, check=True, cwd=temp > > - ) > > - # Don't use "ar p", because its output is corrupted on Windows. > > - run_ar("x") > > - names = run_ar("t").stdout.decode().splitlines() > > - paths = [os.path.join(temp, name) for name in names] > > + paths = [] > > + for name in subprocess.run([ar, "t", archive], stdout=subprocess.PIPE, > > + check=True).stdout.decode().splitlines(): > > + if os.path.exists(name): > > + paths.append(name) > > + else: > > + subprocess.run([ar, "x", os.path.abspath(archive), name], > > + check=True, cwd=temp) > > + paths.append(os.path.join(temp, name)) > > subprocess.run(pmdinfogen + paths + [output], check=True) > > > > It buys with simplicity. > I hoped to avoid creating temporary directories in vain > when all archives are thin, but maybe it's not that important. Since the temp directory is contained within the build directory, I don't think it matters. If you don't mind then, I'll do up a v2 patch with my alternative fix and submit that to the list. Regards, /Bruce