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 D7ED1A0C45 for ; Tue, 26 Oct 2021 21:33:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C36F5410EE; Tue, 26 Oct 2021 21:33:07 +0200 (CEST) Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) by mails.dpdk.org (Postfix) with ESMTP id DA71A407FF; Tue, 26 Oct 2021 21:33:05 +0200 (CEST) Received: by mail-lf1-f50.google.com with SMTP id c28so978821lfv.13; Tue, 26 Oct 2021 12:33:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=RFjCfG7sqGpipOLsEOb4ZyFHsHSy7s8UpTGv1RSNbho=; b=WT2aUoyHCPCRg/4nDi+W77shhbpQXyAJrGqhld5pCVGXBz8Xb0ULNqgL26u04/TsMv 4j4dTfKH5ZW5EST7HCNQnKne0qcfYO17WzQdxj0NF3yItS+wEumy15l0o7FqmFhzZRQP P+c5VLLdvV6e6RxBUyCV8f97h+Yk+k4FeuZleCBngHQOLiwsjWfdlzY7ZPDPnt5DDb0L 6CyzivwsR06XxEsmRtS3pz3qHBfqPKWz6hncQ+S59syydnQGC9SEHnr75vU8PDotKiuR Ukxw2YOGFi1YahQBW0niHBAOF0WQIoQ3dmYPwh4VesUnJw+2Z9RQQubD1l5USUE++m6j Z0mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=RFjCfG7sqGpipOLsEOb4ZyFHsHSy7s8UpTGv1RSNbho=; b=e+f2bByZQ4ddy3SRZJI3GlcVr98iN0CW68XC9zA8GwnsUZUv4vYaaUciVLZVSnSooy HAhht3Cm2R4Kv1E3XtmhK7ibQ1R2bK0eMN5cbha9/E2vTh5kkXWFaHO+QHPIORlIfpAb LimXLShn9k4xoeQ41AjUoDOCd1OzholIRJa240R/EwaPqYbovhIYUGmuNLeC3DOBFLty Y20tfNc1O+QMQbydOulVO95CMUKC4yGGosp9K9BHkKWJFbUtiZQi91OUSLix/XhGG3Q0 kF4ZYlriOrlXER3Eh+RBXn6rwkJ+jq126K7PBJYA+yp7VBm4BhVoQOt684dUZD0nqklj lkSQ== X-Gm-Message-State: AOAM532yL4RGvhA7SEicYMcnXWwNTlQcArB/lXqn+3IBtPqW6UxhSB6a iAsjW1XDoJwvD97NI4JittipbozecaA= X-Google-Smtp-Source: ABdhPJw2W1zS2gNnAGt8AYxNnGQW5+yZ1u+Lu9GSSuZ4PvH8yZfOAVw2vb+Dd0JJGAvpR+ApU9+OYA== X-Received: by 2002:ac2:4bc2:: with SMTP id o2mr5497188lfq.191.1635276785298; Tue, 26 Oct 2021 12:33:05 -0700 (PDT) Received: from sovereign.. (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id t3sm2009923lfc.216.2021.10.26.12.33.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Oct 2021 12:33:05 -0700 (PDT) From: Dmitry Kozlyuk To: dev@dpdk.org Cc: Bruce Richardson , Dmitry Kozlyuk , stable@dpdk.org, Michal Berger , Neil Horman Date: Tue, 26 Oct 2021 22:32:39 +0300 Message-Id: <20211026193239.113745-1-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.29.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH] buildtools: fix build with meson 0.60 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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(-) diff --git a/buildtools/gen-pmdinfo-cfile.py b/buildtools/gen-pmdinfo-cfile.py index 58fe3ad152..3453e5b4b9 100644 --- a/buildtools/gen-pmdinfo-cfile.py +++ b/buildtools/gen-pmdinfo-cfile.py @@ -8,13 +8,18 @@ import tempfile _, 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] +archive = os.path.abspath(archive) +names = subprocess.run([ar, "t", archive], + stdout=subprocess.PIPE, check=True).stdout.decode().splitlines() +with open(archive, "rb") as f: + is_thin = f.read(7) == b"!" +if is_thin: + # Thin archive needs no unpacking, just use the paths within. + paths = [os.path.join(archive, name) for name in names] subprocess.run(pmdinfogen + paths + [output], check=True) +else: + with tempfile.TemporaryDirectory(dir=tmp_root) as temp: + # Don't use "ar p", because its output is corrupted on Windows. + paths = [os.path.join(temp, name) for name in names] + subprocess.run([ar, "x", archive], check=True, cwd=temp) + subprocess.run(pmdinfogen + paths + [output], check=True) -- 2.29.3