Skip to content

Bundle spatch in container to apply patches locally#220

Merged
WanzenBug merged 3 commits intopiraeusdatastore:masterfrom
ozontech-forks:feature/add-coccinelle
Sep 24, 2025
Merged

Bundle spatch in container to apply patches locally#220
WanzenBug merged 3 commits intopiraeusdatastore:masterfrom
ozontech-forks:feature/add-coccinelle

Conversation

@daskol
Copy link
Contributor

@daskol daskol commented Sep 23, 2025

Private clouds often lack direct Internet access. If the spatch binary is missing and Spatch-as-a-Service is unavailable, drbd-module-loader cannot patch the DRBD sources and build drbd.ko.

This pull request adds a step to the Dockerfiles to install spatch (provided by the coccinelle package). The coccinelle package is available on Debian-based distributions and on AlmaLinux 8 via EPEL 8.

Signed-off-by: Daniel Bershatsky <dbershatskiy@ozon.ru>
Signed-off-by: Daniel Bershatsky <dbershatskiy@ozon.ru>
@daskol daskol force-pushed the feature/add-coccinelle branch from 3d3f561 to ee3cd13 Compare September 23, 2025 11:35
@WanzenBug
Copy link
Member

Looks sensible. What about the other RHEL-clone versions (9 and 10)?

Note that not all of those coccinelle versions will actually work with DRBD, as it needs some rather new version for some patches. But it should still fall back to the old version in that case, so that should be fine.

This reverts commit ee3cd13.

Signed-off-by: Daniel Bershatsky <dbershatskiy@ozon.ru>
@daskol
Copy link
Contributor Author

daskol commented Sep 23, 2025

Unfortunately, coccinelle is missing in AlmaLinux 9 and 10, i.e. EPEL 9 and 10 (see pkgs.org for list of distros which provides coccinelle). Also, spatch version does not satisfy minimal version requirements >=1.1.1 according to DBRD's kernel module compatibility page. Thus, I've reverted the latest commit.

Also, Debian Bullseyes does not satisfy the spatch version requirements as well. I decided to keep it for consistency (all Debian containers has spatch) and vague terms (i.e. "but 1.1 is not good enough") leave a chance that this spatch version will work.

Distro spatch OCaml
almalinux8 1.0.7 4.07.0
almalinux9 N/A N/A
almalinux10 N/A N/A
bookworm 1.1.1 4.13.1
bullseye 1.1.0 4.11.1
jammy 1.1.1 4.13.1
noble 1.1.1 4.14.1
trixie 1.3.0 5.3.0

I also considered an option to use binary distribution for coccinelle without Python bindings (see the downloads page). However, it is dynamically linked against glibc 2.38 (August 2023). Thus, it will definitely will not work for all distribution except for trixie.

PS The issue #30 seems to be related.

@daskol
Copy link
Contributor Author

daskol commented Sep 24, 2025

Just a kind reminder.

@WanzenBug WanzenBug merged commit a237996 into piraeusdatastore:master Sep 24, 2025
2 checks passed
@WanzenBug
Copy link
Member

Thanks!

@daskol daskol deleted the feature/add-coccinelle branch September 24, 2025 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants