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 687A5A0C57; Mon, 1 Nov 2021 18:04:23 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 31DD740E28; Mon, 1 Nov 2021 18:04:23 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 5585C40DF6; Mon, 1 Nov 2021 18:04:22 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10154"; a="291898298" X-IronPort-AV: E=Sophos;i="5.87,200,1631602800"; d="scan'208";a="291898298" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Nov 2021 10:04:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,200,1631602800"; d="scan'208";a="467367257" Received: from silpixa00399126.ir.intel.com ([10.237.223.125]) by orsmga002.jf.intel.com with ESMTP; 01 Nov 2021 10:04:19 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , stable@dpdk.org, Michal Berger , Dmitry Kozlyuk Date: Mon, 1 Nov 2021 17:03:26 +0000 Message-Id: <20211101170326.373580-1-bruce.richardson@intel.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211026193239.113745-1-dmitry.kozliuk@gmail.com> References: <20211026193239.113745-1-dmitry.kozliuk@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2] 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" 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, when they already exist, and extracting them if not. 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 Signed-off-by: Bruce Richardson --- v2: Reworked to not check explicitly for thin archives by checking for specific bytes in the file, but instead by checking file by file if an object path from the .a file exists already. [Kept Dmitry's signoff since v2 re-uses some snippets and commit log messages from v1] --- buildtools/gen-pmdinfo-cfile.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) 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) -- 2.32.0