1. 18 Jan, 2025 12 commits
  2. 12 Jan, 2025 9 commits
    • Robert Edmonds's avatar
      Merge pull request #751 from protobuf-c/edmonds/ci/pull_request_types · 428b7297
      Robert Edmonds authored
      build.yml: Build on more pull request activity types
      428b7297
    • Robert Edmonds's avatar
      build.yml: Build on more pull request activity types · 7bfd815e
      Robert Edmonds authored
      The default is to build on pull request activity types opened, reopened,
      and synchronize. Also build on activity types edited, ready_for_review,
      and review_requested.
      7bfd815e
    • Robert Edmonds's avatar
      CGenerator: Do not claim to support editions · a4d04806
      Robert Edmonds authored
      As detailed in https://github.com/protobuf-c/protobuf-c/pull/711, the
      protobuf compiler apparently polices the values reported by a code
      generator's GetMinimumEdition() / GetMaximumEdition() methods, if
      GetSupportedFeatures() reports that it reports editions.
      
      Returning `FEATURE_SUPPORTS_EDITIONS` broke the legacy `protoc-c`
      command-line binary because that binary "registers" the protobuf-c code
      generator as a built-in code generator, whereas `protoc-gen-c` (aka
      `protoc --c_out=`) is a code generator plugin and the policing performed
      by protobuf's `CommandLineInterface::SetupFeatureResolution()` method
      apparently doesn't apply to plugins.
      
      This commit prevents our min/max editions from being policed when
      invoked as `protoc-c`.
      
      Tested with protobuf 29.3.
      a4d04806
    • Robert Edmonds's avatar
      CGenerator: Protect against being invoked against "edition" syntax .proto files · a181fcdc
      Robert Edmonds authored
      The Google protobuf project is currently experimenting with a new syntax
      for .proto files called "editions". Since protobuf-c is a proto2/proto3
      compiler, after the previous commit reimplementing `FieldSyntax()`, the
      protobuf compiler will abort like this if presented with an "editions"
      syntax .proto file due to the safety check in `FieldSyntax()`:
      
          $ protoc --experimental_editions --c_out=. test.proto
          protoc-gen-c: ./protoc-c/c_helpers.h:178: int google::protobuf::compiler::c::FieldSyntax(const google::protobuf::FieldDescriptor*): Assertion `syntax == "proto2" || syntax == "proto3"' failed.
          --c_out: protoc-gen-c: Plugin killed by signal 6.
      
      On protobuf 26, our `CodeGenerator` can implement certain methods to
      declare that we "support" editions, and then reject any other edition
      except proto2 and proto3, which have apparently been retroactively
      declared to be "editions". Of course this needs to be wrapped in a
      version guard.
      
      With this protection in place, the protobuf compiler cleanly exits with
      a nice error message like this:
      
          $ protoc --experimental_editions --c_out=. test.proto
          WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
          E0000 00:00:1710988958.296200   20022 descriptor.cc:4620] Invalid proto descriptor for file "test.proto":
          E0000 00:00:1710988958.296239   20022 descriptor.cc:4623]   test.proto: Edition 2023 is later than the maximum supported edition PROTO3
          --c_out: protoc-gen-c: Plugin failed with status code 1.
      a181fcdc
    • Robert Edmonds's avatar
      Reimplement FieldSyntax() to maximize compatibility across protobuf versions · a0841cca
      Robert Edmonds authored
      Recent versions of Google protobuf have broken the interfaces for
      determining the syntax version of a .proto file. The current protobuf-c
      1.5.0 release does not compile with Google protobuf 26.0 due to the most
      recentage breakage. There is a possible workaround involving the Google
      protobuf `FileDescriptorLegacy` class, which is documented as:
      
      // TODO Remove this deprecated API entirely.
      
      So we probably shouldn't rely on it.
      
      Instead, this commit obtains the `FileDescriptorProto` corresponding
      to the passed in `FieldDescriptor` and interrogates the `syntax` field
      directly. This is a single implementation with no version-specific
      workarounds. Hopefully this won't break in the next Google protobuf
      release.
      
      I tested the `FieldSyntax()` implementation in this commit across a
      number of different Google protobuf releases and found that it worked
      (`make && make check`) on all of them:
      
      - Google protobuf 3.6.1.3 (Ubuntu 20.04)
      - Google protobuf 3.12.4 (Ubuntu 22.04)
      - Google protobuf 3.21.12 (Debian 12 + Debian unstable)
      - Google protobuf 3.25.2 (Debian experimental)
      - Google protobuf 26.1-dev
      a0841cca
    • Robert Edmonds's avatar
      FileGenerator::GenerateHeader(): Set `min_header_version` unconditionally · 9e43a9e9
      Robert Edmonds authored
      Previously, we were conditionally trying to set `min_header_version` to
      the lowest possible value, and relying on a "legacy" Google interface to
      determine the file descriptor's syntax version as part of that
      determination.
      
      Instead, simply bump the minimum version to 1003000 (1.3.0). This
      release was almost 7 years ago. In practice protobuf-c users should not
      be shipping pre-compiled .pb-c.c/.pb-c.h files, anyway.
      9e43a9e9
    • Robert Edmonds's avatar
      Merge pull request #747 from protobuf-c/edmonds/ci/updates · 49cd5a83
      Robert Edmonds authored
      Miscellaneous CI updates
      49cd5a83
    • Robert Edmonds's avatar
    • Robert Edmonds's avatar
      build.yml: Run periodic builds on Friday · b33d42bd
      Robert Edmonds authored
      That gives us the entire weekend to investigate build failures.
      b33d42bd
  3. 11 Jan, 2025 1 commit
  4. 20 Oct, 2024 1 commit
  5. 28 Apr, 2024 16 commits
    • Clément Péron's avatar
      cmake: move to ctest · 33e1af96
      Clément Péron authored
      33e1af96
    • Clément Péron's avatar
      ci: simplify cmake steps so we don't depends on generator · 4cb63c20
      Clément Péron authored
      Simplify the CI steps command so in case we use another generator
      than Make for example ninja or nmake we could also support it.
      Signed-off-by: default avatarClément Péron <peron.clem@gmail.com>
      4cb63c20
    • Clément Péron's avatar
      cmake: rework include rules · 0fa220a5
      Clément Péron authored
      protoc-gen-c requires protobuf-c.
      
      Properly set protobuf-c BUILD_INTERFACE.
      To support both <protobuf-c/protobuf-c.h> and "protobuf-c.h"
      Signed-off-by: default avatarClément Péron <peron.clem@gmail.com>
      0fa220a5
    • Clément Péron's avatar
    • Clément Péron's avatar
      cmake: improve coherency leave endif() empty · e0e9ee16
      Clément Péron authored
      Some endif are set, some are not.
      
      Leave all the endif unset as it makes the code more readable.
      Signed-off-by: default avatarClément Péron <peron.clem@gmail.com>
      e0e9ee16
    • Clément Péron's avatar
      protoc-c: fix chmod · 2d865a64
      Clément Péron authored
      One file has executable right whereas it should be 644.
      Signed-off-by: default avatarClément Péron <peron.clem@gmail.com>
      2d865a64
    • Clément Péron's avatar
      cmake: library source should only contains files to compile · 31d012a0
      Clément Péron authored
      Some executable and library add header files as source.
      These should not be declared as source file, remove them.
      Signed-off-by: default avatarClément Péron <peron.clem@gmail.com>
      31d012a0
    • Clément Péron's avatar
      cmake: format with cmake-format · 3e7c1588
      Clément Péron authored
      CMake file is a bit a mess use:
      cmake-format -i CMakeLists.txt
      
      This will have a clean indent
      Signed-off-by: default avatarClément Péron <peron.clem@gmail.com>
      3e7c1588
    • Robert Edmonds's avatar
      CGenerator: Protect against being invoked against "edition" syntax .proto files · 2480f4d9
      Robert Edmonds authored
      The Google protobuf project is currently experimenting with a new syntax
      for .proto files called "editions". Since protobuf-c is a proto2/proto3
      compiler, after the previous commit reimplementing `FieldSyntax()`, the
      protobuf compiler will abort like this if presented with an "editions"
      syntax .proto file due to the safety check in `FieldSyntax()`:
      
          $ protoc --experimental_editions --c_out=. test.proto
          protoc-gen-c: ./protoc-c/c_helpers.h:178: int google::protobuf::compiler::c::FieldSyntax(const google::protobuf::FieldDescriptor*): Assertion `syntax == "proto2" || syntax == "proto3"' failed.
          --c_out: protoc-gen-c: Plugin killed by signal 6.
      
      On protobuf 26, our `CodeGenerator` can implement certain methods to
      declare that we "support" editions, and then reject any other edition
      except proto2 and proto3, which have apparently been retroactively
      declared to be "editions". Of course this needs to be wrapped in a
      version guard.
      
      With this protection in place, the protobuf compiler cleanly exits with
      a nice error message like this:
      
          $ protoc --experimental_editions --c_out=. test.proto
          WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
          E0000 00:00:1710988958.296200   20022 descriptor.cc:4620] Invalid proto descriptor for file "test.proto":
          E0000 00:00:1710988958.296239   20022 descriptor.cc:4623]   test.proto: Edition 2023 is later than the maximum supported edition PROTO3
          --c_out: protoc-gen-c: Plugin failed with status code 1.
      2480f4d9
    • Robert Edmonds's avatar
      Reimplement FieldSyntax() to maximize compatibility across protobuf versions · ee3d9e54
      Robert Edmonds authored
      Recent versions of Google protobuf have broken the interfaces for
      determining the syntax version of a .proto file. The current protobuf-c
      1.5.0 release does not compile with Google protobuf 26.0 due to the most
      recentage breakage. There is a possible workaround involving the Google
      protobuf `FileDescriptorLegacy` class, which is documented as:
      
      // TODO Remove this deprecated API entirely.
      
      So we probably shouldn't rely on it.
      
      Instead, this commit obtains the `FileDescriptorProto` corresponding
      to the passed in `FieldDescriptor` and interrogates the `syntax` field
      directly. This is a single implementation with no version-specific
      workarounds. Hopefully this won't break in the next Google protobuf
      release.
      
      I tested the `FieldSyntax()` implementation in this commit across a
      number of different Google protobuf releases and found that it worked
      (`make && make check`) on all of them:
      
      - Google protobuf 3.6.1.3 (Ubuntu 20.04)
      - Google protobuf 3.12.4 (Ubuntu 22.04)
      - Google protobuf 3.21.12 (Debian 12 + Debian unstable)
      - Google protobuf 3.25.2 (Debian experimental)
      - Google protobuf 26.1-dev
      ee3d9e54
    • Robert Edmonds's avatar
      FileGenerator::GenerateHeader(): Set `min_header_version` unconditionally · a6cf1aa3
      Robert Edmonds authored
      Previously, we were conditionally trying to set `min_header_version` to
      the lowest possible value, and relying on a "legacy" Google interface to
      determine the file descriptor's syntax version as part of that
      determination.
      
      Instead, simply bump the minimum version to 1003000 (1.3.0). This
      release was almost 7 years ago. In practice protobuf-c users should not
      be shipping pre-compiled .pb-c.c/.pb-c.h files, anyway.
      a6cf1aa3
    • Robert Edmonds's avatar
      Merge pull request #718 from protobuf-c/edmonds/ci/fail-fast-false · e05528c8
      Robert Edmonds authored
      build.yml: Set "fail-fast: false" so we can tell which jobs are failing
      e05528c8
    • Robert Edmonds's avatar
    • Robert Edmonds's avatar
      Merge pull request #717 from protobuf-c/edmonds/ci/macos-install-libtool · 8d36a9d0
      Robert Edmonds authored
      build.yml: Install libtool on OS X
      8d36a9d0
    • Robert Edmonds's avatar
      build.yml: Install libtool on OS X · c8258be9
      Robert Edmonds authored
      This might fix the new CI build failure:
      
          → Run ./autogen.sh
          autoreconf: export WARNINGS=
          autoreconf: Entering directory '.'
          autoreconf: configure.ac: not using Gettext
          autoreconf: running: aclocal --force -I m4 ${ACLOCAL_FLAGS}
          autoreconf: configure.ac: tracing
          autoreconf: configure.ac: creating directory build-aux
          autoreconf: configure.ac: not using Libtool
          autoreconf: configure.ac: not using Intltool
          autoreconf: configure.ac: not using Gtkdoc
          autoreconf: running: /opt/homebrew/Cellar/autoconf/2.72/bin/autoconf --force
          autoreconf: running: /opt/homebrew/Cellar/autoconf/2.72/bin/autoheader --force
          autoreconf: running: automake --add-missing --copy --force-missing
          configure.ac:14: installing 'build-aux/compile'
          configure.ac:13: installing 'build-aux/install-sh'
          configure.ac:13: installing 'build-aux/missing'
          Makefile.am:4: error: Libtool library used but 'LIBTOOL' is undefined
          Makefile.am:4:   The usual way to define 'LIBTOOL' is to add 'LT_INIT'
          Makefile.am:4:   to 'configure.ac' and run 'aclocal' and 'autoconf' again.
          Makefile.am:4:   If 'LT_INIT' is in 'configure.ac', make sure
          Makefile.am:4:   its definition is in aclocal's search path.
          Makefile.am: installing 'build-aux/depcomp'
          parallel-tests: installing 'build-aux/test-driver'
          autoreconf: error: automake failed with exit status: 1
      c8258be9
    • Robert Edmonds's avatar
      Merge pull request #714 from clementperon/fix_cmake · 0b629e68
      Robert Edmonds authored
      Fix CI issues with CMake
      0b629e68
  6. 22 Apr, 2024 1 commit