From patchwork Fri Jan 24 20:40:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1229040 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=h9pdxXEN; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4849yz3MQQz9sR1 for ; Sat, 25 Jan 2020 07:41:13 +1100 (AEDT) Received: from localhost ([::1]:47592 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iv5lP-0007xr-2x for incoming@patchwork.ozlabs.org; Fri, 24 Jan 2020 15:41:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42658) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iv5ko-0007wb-PV for qemu-devel@nongnu.org; Fri, 24 Jan 2020 15:40:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iv5kn-0005nD-Qq for qemu-devel@nongnu.org; Fri, 24 Jan 2020 15:40:34 -0500 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:50441) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iv5kn-0005lW-KD for qemu-devel@nongnu.org; Fri, 24 Jan 2020 15:40:33 -0500 Received: by mail-wm1-x341.google.com with SMTP id a5so735661wmb.0 for ; Fri, 24 Jan 2020 12:40:31 -0800 (PST) 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=h9pdxXENG7y50uVISzLTnObe532HLU5wgItqVak7A5tEm2uqR7ysHPmGY4mxqZ52hP BTUwcYDEfLg8WD3BeYKpZTLnFkkIh6GQoP6jk9UDIyDbNZaLssiMpz9EWbhd/1jL8CB/ 0ZAuheS9Ip0YDgJM0e3JOK7qUGamegINtLENztloRbnNn0IcSlHnwNFt/ApTUY6pUSdP BQ/iJJo8DIIqft06a+E4mqoEptHcPytrT81s4mcHDXq0xmOG+XGVajXwhdadRc1PHVPa I8I+Nl60b4DX/xd6f9WVttyIJMwAEda5882pctMQseTJyOaDLZ6jInJSu3YPx01FhTJG Gcjg== 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=pcwwgp6Qaqp7EQKzVphiGAUr80pI8pZJLph7wju3JuZGJoE2bH5xorB51JUuWIdl1r fhZhBUyz2vlkqvmDGlRRCDplVP6PlWVtA3Zp0Ol4aHvVFOWXiOOVv67He2CxBOCP319G gaJzV+F6LANUnJOSfvWRMtq0mfKLDDmyTkA6Ehbr+H0PVyOKBgbEAopojCZHjB0HgAvj zX7EA/P+mUqBAPga+lTtm+tvx/N2CYsG3XeHTGnn/clYt66lg27Ym1/xvLdEomZ6uOAf 2XpCDVWVuwRCvUgXkKSLGgIw6Rd7mfJ4LvSgqvC9Oq7TsJyO8igb3cIEyiq5IZwZu7Pc 6MXw== X-Gm-Message-State: APjAAAVZ+Ppp8vB2hvzGhsMGt07y9n9Wii0YdwvUzuzGNRxcbpCEK2ZK rhJyRCKPstZzSDTaDtaGT2Skdw== X-Google-Smtp-Source: APXvYqwLelqZrGseqeCL+awyAD46/2VWzrO3c4XFAou8BqfOcEs1+5L+EujXEcxfMxXJ4G6YGKgI9w== X-Received: by 2002:a1c:dfd6:: with SMTP id w205mr889923wmg.151.1579898431008; Fri, 24 Jan 2020 12:40:31 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id h17sm9497814wrs.18.2020.01.24.12.40.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2020 12:40:27 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 94B2F1FF8F; Fri, 24 Jan 2020 20:40:26 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 02/13] tests/docker: better handle symlinked libs Date: Fri, 24 Jan 2020 20:40:15 +0000 Message-Id: <20200124204026.2107-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200124204026.2107-1-alex.bennee@linaro.org> References: <20200124204026.2107-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::341 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_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , cota@braap.org, stefanha@redhat.com, marcandre.lureau@redhat.com, pbonzini@redhat.com, aurelien@aurel32.net Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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ée Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé --- 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.""" libs = [] - ldd_re = re.compile(r"(/.*/)(\S*)") + ldd_re = re.compile(r"(?:\S+ => )?(\S*) \(:?0x[0-9a-f]+\)") try: ldd_output = 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 = os.path.dirname(l) - _copy_with_mkdir(l, dest_dir, so_path) + real_l = os.path.realpath(l) + _copy_with_mkdir(real_l, dest_dir, so_path) def _check_binfmt_misc(executable):