Skip to content

New protoc versioning breaks configure #1867

Open

Description

@peternewman
checking for protoc... /usr/local/bin/protoc
+ test -z /usr/local/bin/protoc
+ test -n 2.3.0
+ printf '%s\n' 'configure:25925: checking protoc version'
+ printf %s 'checking protoc version... '
++ /usr/local/bin/protoc --version
++ grep libprotoc
++ sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'
+ protoc_version='libprotoc 23.3'
+ required=2.3.0
++ echo 2.3.0
++ sed 's/[^0-9].*//'
+ required_major=2
++ echo 2.3.0
++ sed 's/[0-9][0-9]*\.\([0-9][0-9]*\)\.[0-9][0-9]*/\1/'
+ required_minor=3
++ echo 2.3.0
++ sed 's/^.*[^0-9]//'
+ required_patch=0
++ echo libprotoc 23.3
++ sed 's/[^0-9].*//'
+ actual_major=
++ echo libprotoc 23.3
++ sed 's/[0-9][0-9]*\.\([0-9][0-9]*\)\.[0-9][0-9]*/\1/'
+ actual_minor='libprotoc 23.3'
++ echo libprotoc 23.3
++ sed 's/^.*[^0-9]//'
+ actual_patch=3
++ expr '>' 2 '|' = 2 '&' libprotoc 23.3 '>' 3 '|' = 2 '&' libprotoc 23.3 = 3 '&' 3 '>=' 0
expr: syntax error
+ protoc_version_proper=
+ test '' = 1
+ as_fn_error 1 'protoc version too old libprotoc 23.3 < 2.3.0' 25948 5
+ as_status=1
+ test 1 -eq 0
+ test 5
+ as_lineno=25948
+ as_lineno_stack=as_lineno_stack=
+ printf '%s\n' 'configure:25948: error: protoc version too old libprotoc 23.3 < 2.3.0'
+ printf '%s\n' 'configure: error: protoc version too old libprotoc 23.3 < 2.3.0'
configure: error: protoc version too old libprotoc 23.3 < 2.3.0

See https://github.com/OpenLightingProject/ola/actions/runs/5341378456/jobs/9682134019

https://protobuf.dev/support/version-support/

Activity

  1. added this to the 0.10.10 milestone on Jun 22, 2023
  2. yardenac commented on Jul 5, 2023

    @yardenac

    Is this version check even still necessary? 2.3.0 and 2.4.0 are both over 12 years old.

    Checking against both the old and new version schemes would lead to some unwieldy spaghetti logic, so it might be best to just get rid of the check.

  3. yardenac commented on Jul 5, 2023

    @yardenac

    Current check happens at https://github.com/OpenLightingProject/ola/blob/master/config/ola.m4#L50 and is called from https://github.com/OpenLightingProject/ola/blob/master/configure.ac#L851 - as you can see, the current code assumes a three-part version, while newer protoc returns a two-part one.

  4. peternewman commented on Jul 7, 2023

    @peternewman
    MemberAuthor

    Is this version check even still necessary? 2.3.0 and 2.4.0 are both over 12 years old.

    Checking against both the old and new version schemes would lead to some unwieldy spaghetti logic, so it might be best to just get rid of the check.

    While there may be vanishingly few people running that old version, given they've just done something as out there as breaking away from semver, there's no guarantee we won't need to support further special edge cases in future unfortunately.

    I didn't think it would be too hard to fix or workaround, and indeed it wasn't, a bit of poking of the sed massaging before the version check has resulted in this code which seems to work on both new and old versions:
    #1875

    Clearly there are other issues with my mac build, but I should be able to just cherry-pick that into a new branch to get it merged in.

  5. linked a pull request that will close this issueFix protoc version checking, since v20.x #1875on Jul 7, 2023
  6. SpotlightKid commented on Jul 11, 2023

    @SpotlightKid

    Additionally. unfortunately, protobuf also requires at least C++14 but the configure only set -std=gnu++11, making the compilation of the test programs, which check for the protobuf headers, fail.

    (This is after applying the fix for the protobuf version check in #1875.)

    configure:25968: checking for google/protobuf/compiler/command_line_interface.h
    configure:25968: g++ -c -g -O2 -std=gnu++11   conftest.cpp >&5
    In file included from /usr/include/absl/base/config.h:86,
                     from /usr/include/absl/base/attributes.h:37,
                     from /usr/include/absl/base/internal/raw_logging.h:24,
                     from /usr/include/absl/container/internal/btree.h:61,
                     from /usr/include/absl/container/btree_map.h:56,
                     from /usr/include/google/protobuf/compiler/command_line_interface.h:48,
                     from conftest.cpp:178:
    /usr/include/absl/base/policy_checks.h:79:2: error: #error "C++ versions less than C++14 are not supported."
       79 | #error "C++ versions less than C++14 are not supported."
          |  ^~~~~
    
  7. peternewman commented on Jul 11, 2023

    @peternewman
    MemberAuthor

    This says that protobuf supported C++11 until just before version 22.0:
    https://protobuf.dev/news/2022-08-03/
    Likewise this release of Abseil should work with C++11:
    https://github.com/abseil/abseil-cpp/tree/20220623.1

  8. SpotlightKid commented on Jul 11, 2023

    @SpotlightKid

    Alas, that doesn't help when compiling ola for packages of Linux distributions, which ship newer protobuf versions.

  9. peternewman commented on Jul 11, 2023

    @peternewman
    MemberAuthor

    You can also try this branch where I've made some very rudimentary attempts:
    https://github.com/peternewman/ola/tree/0.10-c14-compat

    More generally if someone can either do us a GitHub Action which compiles against Arch or can run a Buildbot or something we should catch these issues a lot sooner and be able to react to them better. Otherwise it's likely to be a case of pull requests welcome unfortunately...

  10. peternewman commented on Jul 13, 2023

    @peternewman
    MemberAuthor

    Okay, because we're getting lots of discussion about the same stuff in lots of different places, please continue any further discussion around issues with newer protoc that aren't our versioning tests in #1879 .

  11. kripton commented on Jan 1, 2025

    @kripton
    Member

    @peternewman : I'd close this one in favor of #1879 then?

  12. modified the milestones: 0.10.10, 0.12.0 on Apr 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions