From nobody Thu Nov 13 13:36:48 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1580384422873628.2593822368918; Thu, 30 Jan 2020 03:40:22 -0800 (PST) Received: from localhost ([::1]:59176 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ix8BJ-0002wm-Pc for importer@patchew.org; Thu, 30 Jan 2020 06:40:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36055) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ix89p-0001IU-MU for qemu-devel@nongnu.org; Thu, 30 Jan 2020 06:38:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ix89n-0008SZ-Sb for qemu-devel@nongnu.org; Thu, 30 Jan 2020 06:38:49 -0500 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:36135) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ix89n-0008Qy-M3 for qemu-devel@nongnu.org; Thu, 30 Jan 2020 06:38:47 -0500 Received: by mail-wr1-x442.google.com with SMTP id z3so3659662wru.3 for ; Thu, 30 Jan 2020 03:38:46 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id i2sm6275325wmb.28.2020.01.30.03.38.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jan 2020 03:38:43 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 610901FF8F; Thu, 30 Jan 2020 11:32:23 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=M9KSOTkD2gWoA2RLWk5PfVdgjpzXgtuWL43hbZNcZ5Q=; b=lwJIruzmDYfg3vjvfNBmnbGbxYzty8zs/v83Q8SinaJDm6mhushLklxoxbkVcicPT9 fObAPmErAgSEBtqg2rgjxfRXo2AafrsAwVnILKYEVEAGq5ri4pckcR+O2nVNyX+Kr4cz PZfzsC6eVszGiJie8GRgoU2KW5Q4xSFuQOrRftrVDz5OckT4tIQTVFI9PKLO4IDXkb6D WHbPdKHurn7mGBNGHq7+DdzmUH8Bf+rApiEEXGC3/8SOAMccvqz85Ppo5gb66vfM8OPJ xXMfODk9RsfYOcq+sbxSHLUBkbI/uM5mh/6G9NSmJBTzrNSe+4VGZwPmKkVezMOpK+LT dTjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=M9KSOTkD2gWoA2RLWk5PfVdgjpzXgtuWL43hbZNcZ5Q=; b=qNCWjJLBn7QG4G9g9ouTavGQA492gMb70zfUM3CLzTV4xr9hbzcZitO4pVqvlI8m/T +TQajaSsLhjITIuknSU5OAUS/ovNtX+4RwTkIzCib565BGd7Rm5vfiop2xKTC86vXmVv +z5TZttv432oiiPt0MSllm0C5jKEL3eWTk2kyy5jgD1jw7SFPPD0AajOKVZM4SPhByCg EmpKAQr0dgnhdkNidI/PvTp5g76ouDRT4Q36znEYOWQDtaDZKam7wxBRw2xH/9sosePi 1hE44fnQIEDQRGMEEz+rc+xRct8Wohfn2i/ng4+NB3Mta8ZXhWnb3Qt5ofA1NVreNryl BG1w== X-Gm-Message-State: APjAAAXa5BLxo+gt4sI9zrD+bkmQGMhX1JKDaiaisDetxyavKV7drhtZ 8OWTIbQR+g/BABJ9pI6o3dX7mMF1fa0= X-Google-Smtp-Source: APXvYqyCDuX9fba8FaR157Gxilrbq42vxKXCKm1yqjPne4roAkNgJrBA9nAK23dSqU/uVjUbEuYAEQ== X-Received: by 2002:adf:e5cf:: with SMTP id a15mr4926326wrn.140.1580384325785; Thu, 30 Jan 2020 03:38:45 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v2 02/12] tests/docker: better handle symlinked libs Date: Thu, 30 Jan 2020 11:32:13 +0000 Message-Id: <20200130113223.31046-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200130113223.31046-1-alex.bennee@linaro.org> References: <20200130113223.31046-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::442 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, berrange@redhat.com, stefanb@linux.vnet.ibm.com, =?UTF-8?q?Alex=20Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , cota@braap.org, stefanha@redhat.com, marcandre.lureau@redhat.com, pbonzini@redhat.com, aurelien@aurel32.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) When we are copying we want to ensure we grab the first resolution (the found in path section). However even that binary might be a symlink so lets make sure we chase the symlinks to copy the right binary to where it can be found. Signed-off-by: Alex Benn=C3=A9e --- tests/docker/docker.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/docker/docker.py b/tests/docker/docker.py index 31d8adf836..7dfca63fe4 100755 --- a/tests/docker/docker.py +++ b/tests/docker/docker.py @@ -109,7 +109,7 @@ def _get_so_libs(executable): ensure theright data is copied.""" =20 libs =3D [] - ldd_re =3D re.compile(r"(/.*/)(\S*)") + ldd_re =3D re.compile(r"(?:\S+ =3D> )?(\S*) \(:?0x[0-9a-f]+\)") try: ldd_output =3D subprocess.check_output(["ldd", executable]).decode= ('utf-8') for line in ldd_output.split("\n"): @@ -145,7 +145,8 @@ def _copy_binary_with_libs(src, bin_dest, dest_dir): if libs: for l in libs: so_path =3D os.path.dirname(l) - _copy_with_mkdir(l, dest_dir, so_path) + real_l =3D os.path.realpath(l) + _copy_with_mkdir(real_l, dest_dir, so_path) =20 =20 def _check_binfmt_misc(executable): --=20 2.20.1