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 1988645AF3; Wed, 9 Oct 2024 17:24:31 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 09F7942831; Wed, 9 Oct 2024 17:24:31 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.18]) by mails.dpdk.org (Postfix) with ESMTP id 25157402A9 for ; Wed, 9 Oct 2024 17:24:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1728487470; x=1760023470; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=f64NglGoy1aJTape0/8QJsUfWtQ89JNSDdaTsxFb+Rg=; b=IwMRY8hKZ9ZM3LggSTKYLHAGd+EMtAzhhdBWNANmrPSygd9iBdmPCYHo K8di9spHRqJ68ligHWwMheVKR4FK/bO2pXNW/2f41LDSHnHdLRfJPbzdV lM8qjRxuMHRGa6bCMwuJAmqm85gFNqG8IWx/NBHrqqCrFxx9XAWwyGDDc +QFsqIUnICV0Pv/bGEGupURQmYyLt4blKXV2X2ncb8joU9+Kfkb0KD7+z AWC0al2kjOxx4+PONGZvCpAnqP7q+EFP/+V8mNdIKd1b1jGvQWlxfRs4y R/8eBN0neyv97i6jz0YIwq+h7BciIbtxUVk6/S9BtzwUPE+xo3/LrqXzz Q==; X-CSE-ConnectionGUID: KDZqbVXbQFSBC5BlzQf7fA== X-CSE-MsgGUID: nVBkxrOsT16Z4q1WisOkMw== X-IronPort-AV: E=McAfee;i="6700,10204,11220"; a="27926559" X-IronPort-AV: E=Sophos;i="6.11,190,1725346800"; d="scan'208";a="27926559" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Oct 2024 08:24:29 -0700 X-CSE-ConnectionGUID: Sdw+2YgoQg6owE9iIK34FQ== X-CSE-MsgGUID: sIIss3KfRD63zbt33P4oYw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,190,1725346800"; d="scan'208";a="75945337" Received: from unknown (HELO silpixa00401385.ir.intel.com) ([10.237.214.25]) by fmviesa007.fm.intel.com with ESMTP; 09 Oct 2024 08:24:28 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: david.marchand@redhat.com, probb@iol.unh.edu, Bruce Richardson Subject: [RFC PATCH] build: automatically report minimum meson version Date: Wed, 9 Oct 2024 16:24:01 +0100 Message-ID: <20241009152417.4028297-1-bruce.richardson@intel.com> X-Mailer: git-send-email 2.43.0 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 Add a script to buildtools to report the minimum meson version given in our meson.build file. Then use this script in two ways: 1. in the .ci/linux-setup.sh script, use the auto-determined minimum version to set up the CI, rather than hard-coding it. 2. in meson.build call the script to report the version. This serves as a sanity check to ensure that any changes to meson.build file do not break the script. Signed-off-by: Bruce Richardson --- .ci/linux-setup.sh | 6 +++++- buildtools/get-min-meson-version.py | 26 ++++++++++++++++++++++++++ buildtools/meson.build | 5 +++++ 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100755 buildtools/get-min-meson-version.py diff --git a/.ci/linux-setup.sh b/.ci/linux-setup.sh index 975bf32144..e025ca0243 100755 --- a/.ci/linux-setup.sh +++ b/.ci/linux-setup.sh @@ -3,8 +3,12 @@ # Builds are run as root in containers, no need for sudo [ "$(id -u)" != '0' ] || alias sudo= +# determine minimum meson version +ci_dir=$(dirname $(readlink -f $0)) +meson_ver=$(python3 $ci_dir/../buildtools/get-min-meson-version.py) + # need to install as 'root' since some of the unit tests won't run without it -sudo python3 -m pip install --upgrade 'meson==0.53.2' +sudo python3 -m pip install --upgrade "meson==$meson_ver" # setup hugepages. error ignored because having hugepage is not mandatory. cat /proc/meminfo diff --git a/buildtools/get-min-meson-version.py b/buildtools/get-min-meson-version.py new file mode 100755 index 0000000000..f0de8fdf2b --- /dev/null +++ b/buildtools/get-min-meson-version.py @@ -0,0 +1,26 @@ +#! /usr/bin/env python3 +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2024 Intel Corporation + +import os +import re +import sys +from os.path import dirname, realpath, join + +buildtools_path = dirname(realpath(__file__)) +basedir = dirname(buildtools_path) + +with open(join(basedir, "meson.build")) as f: + for ln in f.readlines(): + if "meson_version" not in ln: + continue + + ln = ln.strip() + ver_match = re.search(r"meson_version:\s*'>=\s*([0-9\.]+)'", ln) + if not ver_match: + print( + f"Meson version specifier not in recognised format: '{ln}'", + file=sys.stderr, + ) + sys.exit(1) + print(ver_match.group(1), end="") diff --git a/buildtools/meson.build b/buildtools/meson.build index 3adf34e1a8..8b20ac0dd0 100644 --- a/buildtools/meson.build +++ b/buildtools/meson.build @@ -24,6 +24,11 @@ get_numa_count_cmd = py3 + files('get-numa-count.py') get_test_suites_cmd = py3 + files('get-test-suites.py') has_hugepages_cmd = py3 + files('has-hugepages.py') cmdline_gen_cmd = py3 + files('dpdk-cmdline-gen.py') +get_min_meson_version_cmd = py3 + files('get-min-meson-version.py') + +# check that we can correctly report minimum meson version +min_ver = run_command(get_min_meson_version_cmd, check: true, capture: true) +message('Minimum meson required version is ' + min_ver.stdout()) # install any build tools that end-users might want also install_data([ -- 2.43.0