[23.07,2/2] build: explicitly track file paths in current directory

Message ID 20230310111138.92282-3-bruce.richardson@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series Minor meson build improvements |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/intel-Functional success Functional PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-abi-testing success Testing PASS

Commit Message

Bruce Richardson March 10, 2023, 11:11 a.m. UTC
  To ensure proper path tracking for files being used by the build, the
"files()" function should always be used. While meson currently assumes
that bare filenames passed to commands refer to paths in the current
directory, other reimplementations of meson, e.g. muon, require the
paths to be properly tracked. Therefore, for resiliency, ensure all
paths are specified using "files()".

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 app/test/meson.build              | 2 +-
 buildtools/pkg-config/meson.build | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

--
2.37.2
  

Comments

Tyler Retzlaff March 13, 2023, 11:50 p.m. UTC | #1
On Fri, Mar 10, 2023 at 11:11:38AM +0000, Bruce Richardson wrote:
> To ensure proper path tracking for files being used by the build, the
> "files()" function should always be used. While meson currently assumes
> that bare filenames passed to commands refer to paths in the current
> directory, other reimplementations of meson, e.g. muon, require the
> paths to be properly tracked. Therefore, for resiliency, ensure all
> paths are specified using "files()".
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

Reviewed-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
  

Patch

diff --git a/app/test/meson.build b/app/test/meson.build
index 2db5ccf4ff..94233fafca 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -470,7 +470,7 @@  dpdk_test = executable('dpdk-test',
              driver_install_path),
         install: true)

-has_hugepage = run_command(py3, 'has_hugepage.py', check: true).stdout().strip() != '0'
+has_hugepage = run_command(py3, files('has_hugepage.py'), check: true).stdout().strip() != '0'
 message('hugepage availability: @0@'.format(has_hugepage))

 # some perf tests (eg: memcpy perf autotest)take very long
diff --git a/buildtools/pkg-config/meson.build b/buildtools/pkg-config/meson.build
index 0412883c8f..b36add17e3 100644
--- a/buildtools/pkg-config/meson.build
+++ b/buildtools/pkg-config/meson.build
@@ -56,4 +56,4 @@  This is required for a number of static inline functions in the public headers.'

 # For static linking with dependencies as shared libraries,
 # the internal static libraries must be flagged explicitly.
-run_command(py3, 'set-static-linker-flags.py', check: true)
+run_command(py3, files('set-static-linker-flags.py'), check: true)