Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions .github/scripts/build_check
Original file line number Diff line number Diff line change
Expand Up @@ -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
'

Expand Down
2 changes: 1 addition & 1 deletion BM/Dockerfile.build.ddt
Original file line number Diff line number Diff line change
Expand Up @@ -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/*
Expand Down
36 changes: 24 additions & 12 deletions BM/ras/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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=<py3.10+> (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:
Expand Down Expand Up @@ -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
19 changes: 19 additions & 0 deletions BM/ras/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion BM/ras/rasdaemon
Submodule rasdaemon updated 277 files
Loading