




























Thank you for maintaining this package! However, this package does not build components related to simple_switch_grpc. For this reason, I have created some patches and hope you can merge them!
First, I maintain a p4lang-pi package that provides P4Runtime links for bmv2. p4lang-bmv2 can directly depend on it.
Second, the main build program of version 1.15.0 does not include simple_switch_grpc, so I created an integrate-simple_switch_grpc.patch with the following content:
diff --git a/configure.ac b/configure.ac
index 670e65218..49017f009 100755
--- a/configure.ac
+++ b/configure.ac
@@ -305,6 +305,10 @@ AC_CONFIG_FILES([Makefile
pdfixed/include/Makefile
PI/Makefile])
+AS_IF([test "$want_pi" = yes], [
+ AC_CONFIG_SUBDIRS([targets/simple_switch_grpc])
+])
+
# Generate other files
AC_CONFIG_FILES([tests/utils.cpp
src/bm_sim/version.cpp
diff --git a/targets/Makefile.am b/targets/Makefile.am
index 9cf910630..45ead49ad 100644
--- a/targets/Makefile.am
+++ b/targets/Makefile.am
@@ -1,5 +1,11 @@
+MAYBE_SECONDARY_TARGETS =
+
if COND_THRIFT
-MAYBE_SECONDARY_TARGETS = simple_router l2_switch
+MAYBE_SECONDARY_TARGETS += simple_router l2_switch
+endif
+
+if COND_PI
+MAYBE_SECONDARY_TARGETS += simple_switch_grpc
endif
-SUBDIRS = $(MAYBE_SECONDARY_TARGETS) simple_switch psa_switch
+SUBDIRS = simple_switch psa_switch $(MAYBE_SECONDARY_TARGETS)
For details, please see Commit a9de3d9 .
Finally, I changed the configure command in the build instructions to ./configure --prefix=/usr --with-pi. For details, please refer to the simple_switch_grpc target build documentation .
Finally, the changes to the PKGBUILD are as follows:
diff --git a/PKGBUILD b/PKGBUILD
index 77a2938..b05aba8 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -12,6 +12,7 @@ depends=(
'libevent'
'libpcap'
'nanomsg'
+ 'p4lang-pi'
'python'
'python-thrift'
'thrift'
@@ -20,15 +21,17 @@ makedepends=('boost')
source=("$pkgname-$pkgver::$url/archive/refs/tags/$pkgver.tar.gz"
"$pkgname-fix-ipaddr-import.patch::https://github.com/p4lang/behavioral-model/commit/7a8843ffb87bab9eb0a44c993ae39a9fefca10cf.patch"
"$pkgname-add-cstdint-include.patch::https://github.com/p4lang/behavioral-model/commit/c0ff3aba77a78ed08dfcb8634f0875fa172e18ab.patch"
- "remove-boost-system.patch")
+ "remove-boost-system.patch"
+ "integrate-simple_switch_grpc.patch")
sha512sums=('b92f761338a8f60cfc3578d62848f2201b4f1d55a562680a0a9fe9e63cb764eb00f252f59b48020871fa65fe3d0468fab888affa5cfef00a7578d940dd7fc08b'
'9102f8a0d98fd9a7b2693f2b71f0677c33cbdf4260e031012febcb6cb8a2a645b3a6a1d274974067854100903b9ebb5bca8a1eef1bc01e99120df2969c764b3f'
'3f1dc85e9e761fd26ef25efdfb6b0cf13dcad59487ba25b22ec46c6d494531fb937d73567f6d4484e5f7117b732c4414eeb6f63183e728914c83c7223dd2dbd5'
- '8e6aa7c7f0a3aced64b2fb66c2ca48ecc063c007070970f150d80613226063363e39e557dfe0eac31127f2bca251a88fc9578d8c06e61edbc783a642db9b4012')
+ '8e6aa7c7f0a3aced64b2fb66c2ca48ecc063c007070970f150d80613226063363e39e557dfe0eac31127f2bca251a88fc9578d8c06e61edbc783a642db9b4012'
+ '2e97b22cf55927f4c4e8e91670cc38b33b172b9b08e031ed2e5027cca7bc5f185326a1eaf893b435cc8335027766d98b329ae504e17d589eaafb8ddb3ee98093')
prepare() {
cd "behavioral-model-$pkgver"
- for patch_file in "../$pkgname-fix-ipaddr-import.patch" "../$pkgname-add-cstdint-include.patch" "../remove-boost-system.patch"; do
+ for patch_file in "../$pkgname-fix-ipaddr-import.patch" "../$pkgname-add-cstdint-include.patch" "../remove-boost-system.patch" "../integrate-simple_switch_grpc.patch"; do
patch -Np1 -i "$patch_file"
done
}
@@ -36,8 +39,8 @@ prepare() {
build() {
cd "behavioral-model-$pkgver"
./autogen.sh
- ./configure --prefix=/usr
- make
+ ./configure --prefix=/usr --with-pi
+ make -j$(nproc)
}
check() {
Thank you again for maintaining this package. I hope you can improve it after seeing this message. I am extremely grateful.
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。
@insmtr Thank you very much for the detailed report and for providing the patch and necessary steps! I just changed the build steps for bmv2 as you suggested and pushed the changes. I wish they would just create a new release of bmv2, then we wouldn't need so many patches...