Skip to contentSkip to conversation

package/ola: fix protoc version checking

PATCH Applied James Hilliard 2 participants 3 messages Feb 5, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/ola: fix protoc version checking

Backport patches fixing protoc version checking.

Fixes:
checking protoc version... expr: syntax error: unexpected argument '2'
configure: error: protoc version too old libprotoc 28.1 < 2.3.0

---
 ...-protoc-version-checking-since-v20.x.patch | 35 +++++++++++++++++++
 ...rectly-match-multi-digit-major-versi.patch | 28 +++++++++++++++
 2 files changed, 63 insertions(+)
 create mode 100644 package/ola/0002-Fix-protoc-version-checking-since-v20.x.patch
 create mode 100644 package/ola/0003-Protoc-check-correctly-match-multi-digit-major-versi.patch
package/ola/0002-Fix-protoc-version-checking-since-v20.x.patch new file +35 -0
new file mode 100644
index 0000000000..ee98c5569d
@@ -0,0 +1,35 @@
+From d4414feefd95adf9c91d7eaf1e94380296c35f7a Mon Sep 17 00:00:00 2001
+From: Peter Newman <[email protected]>
+Date: Fri, 7 Jul 2023 15:57:35 +0100
+Subject: [PATCH] Fix protoc version checking, since v20.x (cherry picked from
+ commit 2e55aa88756718d8ab4a4c8fde97d620542c2c98)
+
+Signed-off-by: James Hilliard <[email protected]>
+Upstream: https://github.com/OpenLightingProject/ola/commit/d4414feefd95adf9c91d7eaf1e94380296c35f7a
+---
+ config/ola.m4 | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/config/ola.m4 b/config/ola.m4
+index f838ab70a..51b6c825c 100644
+--- a/config/ola.m4
++++ b/config/ola.m4
+@@ -44,7 +44,14 @@ if test -z "$PROTOC" ; then
+   AC_MSG_ERROR([cannot find 'protoc' program]);
+ elif test -n "$1" ; then
+   AC_MSG_CHECKING([protoc version])
+-  [protoc_version=`$PROTOC --version 2>&1 | grep 'libprotoc' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`]
++  # Since v20.x we only get effectively the minor and patch versions out of protoc.
++  # Treat them as major and minor and everything should keep working indefinitely.
++  # See https://protobuf.dev/support/version-support/
++  # So we've got either of these:
++  # libprotoc 2.4.1
++  # libprotoc 23.3
++  # The first sed ensures all versions have major, minor, patch, by adding a .0 on the end of ones missing it
++  [protoc_version=`$PROTOC --version 2>&1 | grep 'libprotoc' | sed 's/\([^\.0-9][0-9][0-9]*\.[0-9][0-9]*\)$/\1\.0/g' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`]
+   [required=$1]
+   [required_major=`echo $required | sed 's/[^0-9].*//'`]
+   [required_minor=`echo $required | sed 's/[0-9][0-9]*\.\([0-9][0-9]*\)\.[0-9][0-9]*/\1/'`]
+-- 
+2.34.1
+
package/ola/0003-Protoc-check-correctly-match-multi-digit-major-versi.patch new file +28 -0
new file mode 100644
index 0000000000..cee2c7eb43
@@ -0,0 +1,28 @@
+From 546d9ee8d970c4e5b33d9d28b4acf6eb34f27a5d Mon Sep 17 00:00:00 2001
+From: Peter Newman <[email protected]>
+Date: Fri, 7 Jul 2023 16:14:21 +0100
+Subject: [PATCH] Protoc check - correctly match multi-digit major versions
+ (cherry picked from commit 69a2946622cdfce54cb6ed7f2210df2be0ec5576)
+
+Signed-off-by: James Hilliard <[email protected]>
+Upstream: https://github.com/OpenLightingProject/ola/commit/546d9ee8d970c4e5b33d9d28b4acf6eb34f27a5d
+---
+ config/ola.m4 | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/config/ola.m4 b/config/ola.m4
+index 51b6c825c..eacee5d94 100644
+--- a/config/ola.m4
++++ b/config/ola.m4
+@@ -51,7 +51,7 @@ elif test -n "$1" ; then
+   # libprotoc 2.4.1
+   # libprotoc 23.3
+   # The first sed ensures all versions have major, minor, patch, by adding a .0 on the end of ones missing it
+-  [protoc_version=`$PROTOC --version 2>&1 | grep 'libprotoc' | sed 's/\([^\.0-9][0-9][0-9]*\.[0-9][0-9]*\)$/\1\.0/g' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`]
++  [protoc_version=`$PROTOC --version 2>&1 | grep 'libprotoc' | sed 's/\([^\.0-9][0-9][0-9]*\.[0-9][0-9]*\)$/\1\.0/g' | sed 's/[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`]
+   [required=$1]
+   [required_major=`echo $required | sed 's/[^0-9].*//'`]
+   [required_minor=`echo $required | sed 's/[0-9][0-9]*\.\([0-9][0-9]*\)\.[0-9][0-9]*/\1/'`]
+-- 
+2.34.1
+
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 7 lines · James Hilliard

Backport patches fixing protoc version checking.

Fixes:
checking protoc version... expr: syntax error: unexpected argument '2'
configure: error: protoc version too old libprotoc 28.1 < 2.3.0

Applied to master, thanks.

Regards,
Arnout

Quoted 72 lines
---
  ...-protoc-version-checking-since-v20.x.patch | 35 +++++++++++++++++++
  ...rectly-match-multi-digit-major-versi.patch | 28 +++++++++++++++
  2 files changed, 63 insertions(+)

create mode 100644 package/ola/0002-Fix-protoc-version-checking-since-v20.x.patch create mode 100644 package/ola/0003-Protoc-check-correctly-match-multi-digit-major-versi.patch

package/ola/0002-Fix-protoc-version-checking-since-v20.x.patch new file +35 -0
new file mode 100644
index 0000000000..ee98c5569d
@@ -0,0 +1,35 @@
+From d4414feefd95adf9c91d7eaf1e94380296c35f7a Mon Sep 17 00:00:00 2001
+From: Peter Newman <[email protected]>
+Date: Fri, 7 Jul 2023 15:57:35 +0100
+Subject: [PATCH] Fix protoc version checking, since v20.x (cherry picked from
+ commit 2e55aa88756718d8ab4a4c8fde97d620542c2c98)
+
+Signed-off-by: James Hilliard <[email protected]>
+Upstream: https://github.com/OpenLightingProject/ola/commit/d4414feefd95adf9c91d7eaf1e94380296c35f7a
+---
+ config/ola.m4 | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/config/ola.m4 b/config/ola.m4
+index f838ab70a..51b6c825c 100644
+--- a/config/ola.m4
++++ b/config/ola.m4
+@@ -44,7 +44,14 @@ if test -z "$PROTOC" ; then
+   AC_MSG_ERROR([cannot find 'protoc' program]);
+ elif test -n "$1" ; then
+   AC_MSG_CHECKING([protoc version])
+-  [protoc_version=`$PROTOC --version 2>&1 | grep 'libprotoc' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`]
++  # Since v20.x we only get effectively the minor and patch versions out of protoc.
++  # Treat them as major and minor and everything should keep working indefinitely.
++  # See https://protobuf.dev/support/version-support/
++  # So we've got either of these:
++  # libprotoc 2.4.1
++  # libprotoc 23.3
++  # The first sed ensures all versions have major, minor, patch, by adding a .0 on the end of ones missing it
++  [protoc_version=`$PROTOC --version 2>&1 | grep 'libprotoc' | sed 's/\([^\.0-9][0-9][0-9]*\.[0-9][0-9]*\)$/\1\.0/g' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`]
+   [required=$1]
+   [required_major=`echo $required | sed 's/[^0-9].*//'`]
+   [required_minor=`echo $required | sed 's/[0-9][0-9]*\.\([0-9][0-9]*\)\.[0-9][0-9]*/\1/'`]
+--
+2.34.1
+
package/ola/0003-Protoc-check-correctly-match-multi-digit-major-versi.patch new file +18 -0
new file mode 100644
index 0000000000..cee2c7eb43
@@ -0,0 +1,28 @@
+From 546d9ee8d970c4e5b33d9d28b4acf6eb34f27a5d Mon Sep 17 00:00:00 2001
+From: Peter Newman <[email protected]>
+Date: Fri, 7 Jul 2023 16:14:21 +0100
+Subject: [PATCH] Protoc check - correctly match multi-digit major versions
+ (cherry picked from commit 69a2946622cdfce54cb6ed7f2210df2be0ec5576)
+
+Signed-off-by: James Hilliard <[email protected]>
+Upstream: https://github.com/OpenLightingProject/ola/commit/546d9ee8d970c4e5b33d9d28b4acf6eb34f27a5d
+---
+ config/ola.m4 | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/config/ola.m4 b/config/ola.m4
+index 51b6c825c..eacee5d94 100644
+--- a/config/ola.m4
++++ b/config/ola.m4
+@@ -51,7 +51,7 @@ elif test -n "$1" ; then
+   # libprotoc 2.4.1

package/ola/0003-Protoc-check-correctly-match-multi-digit-major-versi.patch line 28

Quoted 10 lines
package/ola/0003-Protoc-check-correctly-match-multi-digit-major-versi.patch new file +10 -0
+   # libprotoc 23.3
+   # The first sed ensures all versions have major, minor, patch, by adding a .0 on the end of ones missing it
+-  [protoc_version=`$PROTOC --version 2>&1 | grep 'libprotoc' | sed 's/\([^\.0-9][0-9][0-9]*\.[0-9][0-9]*\)$/\1\.0/g' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`]
++  [protoc_version=`$PROTOC --version 2>&1 | grep 'libprotoc' | sed 's/\([^\.0-9][0-9][0-9]*\.[0-9][0-9]*\)$/\1\.0/g' | sed 's/[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`]
+   [required=$1]
+   [required_major=`echo $required | sed 's/[^0-9].*//'`]
+   [required_minor=`echo $required | sed 's/[0-9][0-9]*\.\([0-9][0-9]*\)\.[0-9][0-9]*/\1/'`]
+--
+2.34.1
+

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#2 lore raw
Quoted 5 lines · Arnout Vandecappelle
Quoted 2 lines · James Hilliard

Backport patches fixing protoc version checking.

Quoted 7 lines
Quoted 5 lines

Fixes:
checking protoc version... expr: syntax error: unexpected argument '2'
configure: error: protoc version too old libprotoc 28.1 < 2.3.0

 Applied to master, thanks.

 Still applied - however, have you tested this? libabseil requires C++14, and ola adds -std=gnu++11, so it is still broken...

 Regards,
 Arnout

Quoted 90 lines

 Regards,
 Arnout

Quoted 86 lines

---
  ...-protoc-version-checking-since-v20.x.patch | 35 +++++++++++++++++++ ...rectly-match-multi-digit-major-versi.patch | 28 +++++++++++++++

  2 files changed, 63 insertions(+)

  create mode 100644 package/ola/0002-Fix-protoc-version-checking-since-v20.x.patch create mode 100644 package/ola/0003-Protoc-check-correctly-match-multi-digit-major-versi.patch

package/ola/0002-Fix-protoc-version-checking-since-v20.x.patch new file +8 -0
new file mode 100644
index 0000000000..ee98c5569d
@@ -0,0 +1,35 @@
+From d4414feefd95adf9c91d7eaf1e94380296c35f7a Mon Sep 17 00:00:00 2001
+From: Peter Newman <[email protected]>
+Date: Fri, 7 Jul 2023 15:57:35 +0100
+Subject: [PATCH] Fix protoc version checking, since v20.x (cherry picked from
+ commit 2e55aa88756718d8ab4a4c8fde97d620542c2c98)
+
+Signed-off-by: James Hilliard <[email protected]>
+Upstream: 

https://github.com/OpenLightingProject/ola/commit/d4414feefd95adf9c91d7eaf1e94380296c35f7a

+---
+ config/ola.m4 | 9 ++++++++-

+ 1 file changed, 8 insertions(+), 1 deletion(-)

package/ola/0002-Fix-protoc-version-checking-since-v20.x.patch new file +10 -0
+
+diff --git a/config/ola.m4 b/config/ola.m4
+index f838ab70a..51b6c825c 100644
+--- a/config/ola.m4
++++ b/config/ola.m4
+@@ -44,7 +44,14 @@ if test -z "$PROTOC" ; then
+   AC_MSG_ERROR([cannot find 'protoc' program]);
+ elif test -n "$1" ; then
+   AC_MSG_CHECKING([protoc version])
+-  [protoc_version=`$PROTOC --version 2>&1 | grep 'libprotoc' | sed 

's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`]
++  # Since v20.x we only get effectively the minor and patch versions out of
protoc.
++  # Treat them as major and minor and everything should keep working
indefinitely.
++  # See https://protobuf.dev/support/version-support/
++  # So we've got either of these:
++  # libprotoc 2.4.1
++  # libprotoc 23.3
++  # The first sed ensures all versions have major, minor, patch, by adding
a .0 on the end of ones missing it
++  [protoc_version=$PROTOC --version 2>&1 | grep 'libprotoc' | sed 's/\([^\.0-9][0-9][0-9]*\.[0-9][0-9]*\)$/\1\.0/g' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'] +   [required=$1]
+   [required_major=echo $required | sed 's/[^0-9].*//']
+   [required_minor=`echo $required | sed
's/[0-9][0-9]*\.\([0-9][0-9]*\)\.[0-9][0-9]*/\1/'`]
+--
+2.34.1

package/ola/0002-Fix-protoc-version-checking-since-v20.x.patch new file +1 -0
+
package/ola/0003-Protoc-check-correctly-match-multi-digit-major-versi.patch new file +8 -0
new file mode 100644
index 0000000000..cee2c7eb43
@@ -0,0 +1,28 @@
+From 546d9ee8d970c4e5b33d9d28b4acf6eb34f27a5d Mon Sep 17 00:00:00 2001
+From: Peter Newman <[email protected]>
+Date: Fri, 7 Jul 2023 16:14:21 +0100
+Subject: [PATCH] Protoc check - correctly match multi-digit major versions
+ (cherry picked from commit 69a2946622cdfce54cb6ed7f2210df2be0ec5576)
+
+Signed-off-by: James Hilliard <[email protected]>
+Upstream: 

https://github.com/OpenLightingProject/ola/commit/546d9ee8d970c4e5b33d9d28b4acf6eb34f27a5d

+---
+ config/ola.m4 | 2 +-

+ 1 file changed, 1 insertion(+), 1 deletion(-)

package/ola/0003-Protoc-check-correctly-match-multi-digit-major-versi.patch new file +9 -0
+
+diff --git a/config/ola.m4 b/config/ola.m4
+index 51b6c825c..eacee5d94 100644
+--- a/config/ola.m4
++++ b/config/ola.m4
+@@ -51,7 +51,7 @@ elif test -n "$1" ; then
+   # libprotoc 2.4.1
+   # libprotoc 23.3
+   # The first sed ensures all versions have major, minor, patch, by adding 

a .0 on the end of ones missing it

+-  [protoc_version=`$PROTOC --version 2>&1 | grep 'libprotoc' | sed 
's/\([^\.0-9][0-9][0-9]*\.[0-9][0-9]*\)$/\1\.0/g' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`]
++  [protoc_version=`$PROTOC --version 2>&1 | grep 'libprotoc' | sed 
Quoted 9 lines
Quoted 8 lines

's/\([^\.0-9][0-9][0-9]*\.[0-9][0-9]*\)$/\1\.0/g' | sed 's/[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`] +   [required=$1]
+   [required_major=echo $required | sed 's/[^0-9].*//']
+   [required_minor=`echo $required | sed
's/[0-9][0-9]*\.\([0-9][0-9]*\)\.[0-9][0-9]*/\1/'`]
+--
+2.34.1
+

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot