frr: fix bundled build on AlmaLinux 9 - #727
hcaldicott wants to merge 1 commit into
Conversation
Bound the bundled FRR build through the JOBS environment variable instead of launching unlimited compiler processes. Load FRR common configuration before plugin headers and include the Linux route table definitions explicitly. This exposes FRR fallback declarations required with the older glibc shipped by AlmaLinux 9. Signed-off-by: Harrison Caldicott <harrison@itsfubar.com.au>
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can add REVIEW.md to your repo root and Qodo follows it on every PR |
hcaldicott
left a comment
There was a problem hiding this comment.
A little more context below.
| build_stamp = '.build-stamp' | ||
| install_cmd = 'make install && sh -x ' + srcdir + '/frr_install.sh ' + srcdir + ' ' + prefix + ' && ' | ||
| build_cmd = 'cd "' + builddir + '" && make -j && ' + install_cmd + 'touch "' + build_stamp + '"' | ||
| build_cmd = 'cd "' + builddir + '" && make -j${JOBS:-1} && ' + install_cmd + 'touch "' + build_stamp + '"' |
There was a problem hiding this comment.
make -j with no number means "spawn a job for every ready target simultaneously, with no cap."
For a codebase FRR's size that can mean hundreds of concurrent compiler processes, each holding maybe 100–300MB. A 64GB workstation absorbs that, but I noticed massive issues when running this in docker/open build server.
Arguably this can be ommitted, and I am open to feedback, but I wonder if allowing some control here is useful?
There was a problem hiding this comment.
I have no objections to this.
| // Copyright (c) 2025 Maxime Leroy, Free Mobile | ||
|
|
||
| #include <lib/zebra.h> | ||
| #include <linux/rtnetlink.h> |
There was a problem hiding this comment.
zebra_dplane_grout.c uses RT_TABLE_* constants and had been getting them transitively; with the include order changed it needs to say so explicitly.
There was a problem hiding this comment.
frr/if_grout.c:4:1: error: code should be clang-formatted [-Wclang-format-violations]
#include <lib/zebra.h>
^
You'll need to add // clang-format off/on comments. There are other places where you can take examples.
|
Oops - I've opened a can of worms with the CI here. Defining That part should be fixed in Grout regardless: marker injection, lookup and cleanup should consistently use the default VRF’s effective table ID rather than There is also a separate system-FRR packaging issue. Installed Given that
The compatibility header only supplies declarations; the implementation still comes from glibc where available or Thoughts? |
I guess we should do this yes. But that raises a concern about how FRR headers are shipped. If Maybe something could be fixed in FRR upstream? |
The bundled FRR dplane plugin does not compile on AlmaLinux 9: the
glibc shipped with el9 has no
strlcpy()/strlcat(), and FRR's ownfallback declarations stay hidden because the plugin sources were built
without
HAVE_CONFIG_H, so every use fails with an implicit functiondeclaration error. Define
HAVE_CONFIG_Hin the plugin compile args andinclude
lib/zebra.hfirst in each plugin source so FRR's configurationand compat layer is loaded before any other header.
zebra_dplane_grout.calso gains an explicitlinux/rtnetlink.hinclude for the
RT_TABLE_*definitions it relies on.The bundled FRR build also invoked
make -jwith no job limit, whichstarts one compiler per translation unit and OOMs memory-constrained
builders such as RPM build chroots and small VMs. The job count now
comes from the
JOBSenvironment variable, defaulting to 1; set e.g.JOBS=$(nproc)to keep the previous parallelism on machines that canafford it.
Found while packaging grout for AlmaLinux 9 as part of the EVPN
multihoming work (#698).
Testing
mainon AlmaLinux 9,-Dfrr=enabled): theplugin fails to compile with implicit declarations of
strlcpy/strlcat.dplane_grout.sosucceeds inthe same environment (AlmaLinux 9 container, arm64), and the unit
suites still pass.
Related: #698