From 24b549c264abbc4b81a36c4bc4d1ff2afe44b4e1 Mon Sep 17 00:00:00 2001 From: Yi Lai Date: Mon, 14 Sep 2026 23:19:42 -0400 Subject: [PATCH 1/2] BM/ras: adapt rasdaemon build to meson/ninja rasdaemon replaced its autotools build with meson/ninja (upstream commit "switch from autotools to meson"). Bump the submodule to f9ce171 and update the RAS Makefile accordingly. Document the Python >= 3.10 requirement and the legacy-meson (< 1.0) distutils caveat in README.md, including the meson upgrade that removes the Python 3.12+ upper bound. Signed-off-by: Yi Lai (cherry picked from commit 6e765635a16b583e480e224a3ecc78f729db4b57) --- BM/ras/Makefile | 36 ++++++++++++++++++++++++------------ BM/ras/README.md | 19 +++++++++++++++++++ BM/ras/rasdaemon | 2 +- 3 files changed, 44 insertions(+), 13 deletions(-) diff --git a/BM/ras/Makefile b/BM/ras/Makefile index 90887971..8e1fbb65 100644 --- a/BM/ras/Makefile +++ b/BM/ras/Makefile @@ -19,6 +19,16 @@ endif # Filter out targets with custom build rules GENERIC_SUBDIRS := $(filter-out rasdaemon,$(SUBDIRS)) +# rasdaemon switched from autotools to meson/ninja. Its build runs ras-mc-ctl, +# which requires Python >= 3.10. Override PYTHON to select the interpreter when +# the default python3 is too old. See README.md ("Building rasdaemon") for the +# legacy-meson + Python 3.12 distutils caveat. +PYTHON ?= python3 + +# Feature flags equivalent to the previous ./configure options. +RASDAEMON_MESON_OPTS := -Dsqlite3=enabled -Dmce=enabled -Dextlog=enabled \ + -Dmemory-failure=enabled -Dmemory-ce-pfa=enabled + .PHONY: all all: $(SUBDIRS) @@ -28,15 +38,17 @@ $(GENERIC_SUBDIRS): .PHONY: rasdaemon rasdaemon: - cd rasdaemon && \ - if [ ! -x ./configure ]; then \ - autoreconf -i; \ - fi && \ - if [ ! -f ./Makefile ]; then \ - ./configure --enable-sqlite3 --enable-mce \ - --enable-extlog --enable-memory-failure --enable-memory-ce-pfa; \ - fi && \ - $(MAKE) + @set -e; \ + real=$$($(PYTHON) -c 'import sys; sys.exit("ERROR: rasdaemon needs Python >= 3.10; set PYTHON= (see README.md)") if sys.version_info[:2] < (3,10) else print(sys.executable)'); \ + tmpbin=$$(mktemp -d); trap 'rm -rf "$$tmpbin"' EXIT; \ + ln -sf "$$real" "$$tmpbin/python3"; \ + cd rasdaemon; \ + if [ -f build/build.ninja ]; then \ + PATH="$$tmpbin:$$PATH" meson setup build --reconfigure; \ + else \ + PATH="$$tmpbin:$$PATH" meson setup build $(RASDAEMON_MESON_OPTS); \ + fi; \ + PATH="$$tmpbin:$$PATH" ninja -C build .PHONY: install install: @@ -78,6 +90,6 @@ clean: for dir in $(GENERIC_SUBDIRS); do \ if [ -f $$dir/Makefile ]; then $(MAKE) -C $$dir clean; fi; \ done - @# Use distclean for rasdaemon to remove autotools-generated files - @# so that configure is re-run on the next build. - if [ -f rasdaemon/Makefile ]; then $(MAKE) -C rasdaemon distclean; fi + @# rasdaemon uses meson/ninja; remove its build dir so the next build + @# reconfigures cleanly (equivalent to the old autotools distclean). + rm -rf rasdaemon/build diff --git a/BM/ras/README.md b/BM/ras/README.md index e9840d51..c8751bd3 100644 --- a/BM/ras/README.md +++ b/BM/ras/README.md @@ -49,6 +49,25 @@ yum install rasdaemon # or: apt install rasdaemon ``` If neither is available from your distro, the Makefile will build from the submodule. +### Building rasdaemon from the submodule + +rasdaemon has switched from autotools to a **meson/ninja** build. Two requirements: + +- **Python >= 3.10** — the build runs `ras-mc-ctl` to generate its man page, and + that tool requires Python 3.10 or newer. If your default `python3` is older + (e.g. EL9 ships 3.9), point the build at a newer one: + ``` + make rasdaemon PYTHON=/path/to/python3.10 + ``` +- **`meson` and `ninja`** on `PATH`. + +Note with legacy meson: meson **< 1.0** (e.g. 0.63.x on EL9) introspects the +interpreter via `distutils`, which was **removed from Python in 3.12**. So with +old meson you must use Python **3.10 or 3.11** (not 3.12+). Upgrading meson +(`pip install --upgrade 'meson>=1.3'`) removes this upper bound, after which any +Python >= 3.10 works. Also avoid pointing `PYTHON` at a pyenv *shim* — pass a +real interpreter path; the Makefile resolves `sys.executable` to be safe. + 3. build the test suite (only builds submodules not already installed): ``` make diff --git a/BM/ras/rasdaemon b/BM/ras/rasdaemon index a4620eb3..f9ce1716 160000 --- a/BM/ras/rasdaemon +++ b/BM/ras/rasdaemon @@ -1 +1 @@ -Subproject commit a4620eb301c7bbef51bb831e859eb01e6f9c6ac0 +Subproject commit f9ce1716ef70b857aedbbcff4c5dec0ac1526ff5 From 41090f96a8d442bec28db093b45f44baa3e2dbb1 Mon Sep 17 00:00:00 2001 From: Yi Lai Date: Mon, 14 Sep 2026 23:37:10 -0400 Subject: [PATCH 2/2] BM/ras: fix CI build for meson-based rasdaemon The rasdaemon submodule moved from autotools to meson/ninja, but the CI build path still assumed autotools. Update the CI build environment and preconfigure step to match: - Dockerfile.build.ddt: replace autoconf/automake/libtool with meson and ninja-build (only rasdaemon needed autotools), and add libpci-dev, required by rasdaemon's AER support. - .github/scripts/build_check: replace the autoreconf/./configure preconfigure step with 'meson setup build'. Signed-off-by: Yi Lai (cherry picked from commit 79989425772dc64f81aa948ca2ca09f7dc25bf2a) --- .github/scripts/build_check | 13 ++++++------- BM/Dockerfile.build.ddt | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/scripts/build_check b/.github/scripts/build_check index edf456f3..21e30a38 100755 --- a/.github/scripts/build_check +++ b/.github/scripts/build_check @@ -73,13 +73,12 @@ docker run --rm \ set -e cd /src/ras/rasdaemon - if [ ! -x ./configure ]; then - autoreconf -i - fi - - if [ ! -f ./Makefile ]; then - ./configure --enable-sqlite3 --enable-mce \ - --enable-extlog --enable-memory-failure --enable-memory-ce-pfa + # rasdaemon uses meson/ninja; "meson setup" is the configure step. + if [ -f build/build.ninja ]; then + meson setup build --reconfigure + else + meson setup build -Dsqlite3=enabled -Dmce=enabled \ + -Dextlog=enabled -Dmemory-failure=enabled -Dmemory-ce-pfa=enabled fi ' diff --git a/BM/Dockerfile.build.ddt b/BM/Dockerfile.build.ddt index a9501078..eeb58e13 100644 --- a/BM/Dockerfile.build.ddt +++ b/BM/Dockerfile.build.ddt @@ -14,7 +14,7 @@ RUN dpkg --print-foreign-architectures RUN \ apt-get update && \ apt-get install gcc-14 g++-14 gcc-14-multilib g++-14-multilib make libelf1 gcc-multilib g++-multilib git cmake -y --no-install-recommends && \ - apt-get install bison flex autoconf automake libtool pkg-config libsqlite3-dev libtraceevent-dev python3 -y --no-install-recommends && \ + apt-get install bison flex meson ninja-build pkg-config libsqlite3-dev libtraceevent-dev libpci-dev python3 -y --no-install-recommends && \ update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100 --slave /usr/bin/g++ g++ /usr/bin/g++-14 && \ apt-get clean && \ rm -rf /var/lib/apt/lists/*