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 29AB742CB3; Wed, 14 Jun 2023 16:48:04 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0D3A240E0F; Wed, 14 Jun 2023 16:48:04 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id C3A0940DDB for ; Wed, 14 Jun 2023 16:48:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686754082; x=1718290082; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=i/aaa9KwMob0GQWtTcMurG1Yac9XqeTXZdu1h+MOKek=; b=np9BpyaF1Nf0M/o4cG6YDNlE9J4HMpd82RoIm+SzyWaKc298gGHFDgro ho9c09YR4ZiNQhZQsi+K85s/QXpbOOenSwFAV326GxBM7Q4VMugzsPcrN e8YbL0Q0TgyFUdfinwVCPbM2cRNpi6Aqf30osS4OTCnk4RIr8rDi+Eegz yS8UUPARD3i78NJxRy6Fn0kB8PwS2r7gDivhXx29grCs9MN88GM1rcSNr FEgOiN6RjHOaQmUxpppJX2JwpqsNBh/0qNwdmHGqdrmw9EOjZGlMRx35V ddD2wSogykqWrfxyNIPc7NDt49rQRO59ltlQhg3f1X1N7hbx2UyZo5rkq A==; X-IronPort-AV: E=McAfee;i="6600,9927,10741"; a="343329764" X-IronPort-AV: E=Sophos;i="6.00,242,1681196400"; d="scan'208";a="343329764" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jun 2023 07:47:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10741"; a="715246302" X-IronPort-AV: E=Sophos;i="6.00,242,1681196400"; d="scan'208";a="715246302" Received: from silpixa00401385.ir.intel.com ([10.237.214.11]) by fmsmga007.fm.intel.com with ESMTP; 14 Jun 2023 07:47:33 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson Subject: [PATCH] buildtools: remove assumption about current work dir Date: Wed, 14 Jun 2023 15:47:28 +0100 Message-Id: <20230614144728.481566-1-bruce.richardson@intel.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 According to meson documentation, we should not make any assumptions as to what directory a script is called from[1]. The use of "relpath" when processing the output of directory globbing is therefore unsafe, as it was stripping off paths relative to the current directory - which just happened to be the same as the root directory we were processing. To improve safety, and support meson clones (like muon) which don't always run things from the currently processed path, we need to explicitly specify that the start parameter for relpath() should be "root" value. [1] https://mesonbuild.com/Reference-manual_functions.html#run_command Signed-off-by: Bruce Richardson --- buildtools/list-dir-globs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildtools/list-dir-globs.py b/buildtools/list-dir-globs.py index d824360d39..fb8619db64 100755 --- a/buildtools/list-dir-globs.py +++ b/buildtools/list-dir-globs.py @@ -17,4 +17,4 @@ if path: for p in iglob(os.path.join(root, path)): if os.path.isdir(p): - print(os.path.relpath(p).replace('\\', '/')) + print(os.path.relpath(p, start=root).replace('\\', '/')) -- 2.39.2