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/* 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