From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4Zjy0v4hrYz3360 for ; Thu, 24 Apr 2025 13:45:51 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature RSA-PSS (4096 bits)) (Client CN "mail01.haj.ipfire.org", Issuer "R10" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4Zjy0r0XQJz3352 for ; Thu, 24 Apr 2025 13:45:48 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4Zjy0q3QVQz2kd; Thu, 24 Apr 2025 13:45:47 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1745502347; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uF002/hjukUU/Z91pTKmIpvPiSlDwiScmOcajKON5tU=; b=udewE//de1v0A0Jem+zG12Hjrh8++PIkuhfs52DbB3SqAFcCUuto15I3UoO7W0MonO5un/ 8gRLPsWNlET8caBw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1745502347; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uF002/hjukUU/Z91pTKmIpvPiSlDwiScmOcajKON5tU=; b=kaN2JR4UggSRQranRo8fak9PiAFquYDUQqByvQIck791JEKB/7BkLjo2lFyyNFACFsURIO sKz8yebw4Pfut0hMek3lOVcx9JBvbil7HXmClXhx4nd2qzxkcfsZM5j7RE6oSrhjeVm2Nz vXFYHujKyhPbJUXb4f2/HMx7m9ClIYd2ivhBddQp3a0s4ks/Ean6CGF0HguL5mBFhLRScy SfLzKdMM0chL1dQvA+NJgOlVjTm2s7VTBtOsZlWiA/ZoZmUHOaaISHnLsqqYq33iy9l49x LZrm74cwagcTlbCPLDrd7PoYbwHJWEOZUOaCDMwU3pSfl72JQjh8H5hTEz8VjA== From: Adolf Belka To: development@lists.ipfire.org Cc: Adolf Belka Subject: [PATCH 2/2] protobuf-c: Update to version 1.5.2 Date: Thu, 24 Apr 2025 15:45:44 +0200 Message-ID: <20250424134544.3440340-2-adolf.belka@ipfire.org> In-Reply-To: <20250424134544.3440340-1-adolf.belka@ipfire.org> References: <20250424134544.3440340-1-adolf.belka@ipfire.org> Precedence: list List-Id: List-Subscribe: , List-Unsubscribe: , List-Post: List-Help: Sender: Mail-Followup-To: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit - Update from version 1.5.0 to 1.5.2 - Update of rootfile not required - The update to protobuf caused a breaking change for the build of protobuf-c. Version 1.5.2 has the fix for that issue in it. - The changes to protobuf-c are such that the code has been significantly changed and the previous patch file for version 1.5.0 is no longer needed. - Changelog 1.5.2 * Chase compatibility issues with Google protobuf 30.0-rc1 by @edmonds in https://github.com/protobuf-c/protobuf-c/pull/762 * protoc-gen-c: Explicitly construct strings where needed for protobuf 30.x by @edmonds in https://github.com/protobuf-c/protobuf-c/pull/768 1.5.1 * CMakeList.txt: Remove double hyphens by @AlessandroBono in https://github.com/protobuf-c/protobuf-c/pull/699 * Makefile.am: Distribute missing Config.cmake.in by @AlessandroBono in https://github.com/protobuf-c/protobuf-c/pull/700 * protobuf_c_message_unpack(): Fix memory corruption by initializing unknown_fields pointer by @smuellerDD in https://github.com/protobuf-c/protobuf-c/pull/703 * Fix CI issues with CMake by @clementperon in https://github.com/protobuf-c/protobuf-c/pull/714 * build.yml: Install libtool on OS X by @edmonds in https://github.com/protobuf-c/protobuf-c/pull/717 * build.yml: Set "fail-fast: false" so we can tell which jobs are failing by @edmonds in https://github.com/protobuf-c/protobuf-c/pull/718 * Update actions by @AndrewQuijano in https://github.com/protobuf-c/protobuf-c/pull/740 * Miscellaneous CI updates by @edmonds in https://github.com/protobuf-c/protobuf-c/pull/747 * build.yml: Build on more pull request activity types by @edmonds in https://github.com/protobuf-c/protobuf-c/pull/751 * Chase compatibility issues with Google protobuf >= 26.0 by @edmonds in https://github.com/protobuf-c/protobuf-c/pull/711 * Clean CMake by @clementperon in https://github.com/protobuf-c/protobuf-c/pull/719 * build.yml: Update Windows dependencies (abseil, protobuf) by @edmonds in https://github.com/protobuf-c/protobuf-c/pull/753 * build.yml: Ubuntu: Add 22.04, 24.04 by @edmonds in https://github.com/protobuf-c/protobuf-c/pull/754 * Order oneof union members from largest to smallest by @edmonds in https://github.com/protobuf-c/protobuf-c/pull/755 * More renaming of `protoc-c` to `protoc-gen-c` by @edmonds in https://github.com/protobuf-c/protobuf-c/pull/756 * cmake: Fix build when using ninja and protobuf-c already installed by @edmonds in https://github.com/protobuf-c/protobuf-c/pull/757 * protoc-gen-c: Log a deprecation warning when invoked as `protoc-c` by @edmonds in https://github.com/protobuf-c/protobuf-c/pull/758 * build.yml: Try running multiarch builds on Debian bookworm by @edmonds in https://github.com/protobuf-c/protobuf-c/pull/759 Signed-off-by: Adolf Belka --- lfs/protobuf-c | 7 +- .../protobuf-c_1.5.0_protobuf-26.patch | 118 ------------------ 2 files changed, 3 insertions(+), 122 deletions(-) delete mode 100644 src/patches/protobuf-c_1.5.0_protobuf-26.patch diff --git a/lfs/protobuf-c b/lfs/protobuf-c index 679977872..7ed7b9346 100644 --- a/lfs/protobuf-c +++ b/lfs/protobuf-c @@ -1,7 +1,7 @@ ############################################################################### # # # IPFire.org - A linux based firewall # -# Copyright (C) 2007-2024 IPFire Team # +# Copyright (C) 2007-2025 IPFire Team # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # @@ -24,7 +24,7 @@ include Config -VER = 1.5.0 +VER = 1.5.2 THISAPP = protobuf-c-$(VER) DL_FILE = $(THISAPP).tar.gz @@ -40,7 +40,7 @@ objects = $(DL_FILE) $(DL_FILE) = $(DL_FROM)/$(DL_FILE) -$(DL_FILE)_BLAKE2 = 7b428655901f4fd74b67b75419552e7c02065a5291aed4dcc1d55b98c986caa9ccf846eb5e98e0954420c3e5bea559b0078843e00daa7b5c63465eec21e28204 +$(DL_FILE)_BLAKE2 = f6815319bad26095fe462b7a3da295594a853b131b565c7bc27d2d9ba1e51722ce8fefb408e37bc41b953de8ba51d4340b87a57fbb7163ce444e5aa2b99c9721 install : $(TARGET) @@ -70,7 +70,6 @@ $(subst %,%_BLAKE2,$(objects)) : $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) @$(PREBUILD) @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE) - cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/protobuf-c_1.5.0_protobuf-26.patch cd $(DIR_APP) && ./configure \ --prefix=/usr cd $(DIR_APP) && make $(MAKETUNING) diff --git a/src/patches/protobuf-c_1.5.0_protobuf-26.patch b/src/patches/protobuf-c_1.5.0_protobuf-26.patch deleted file mode 100644 index 40c9e64d0..000000000 --- a/src/patches/protobuf-c_1.5.0_protobuf-26.patch +++ /dev/null @@ -1,118 +0,0 @@ -From a6cf1aa386067e26d582cc1d1e327787595c9f13 Mon Sep 17 00:00:00 2001 -From: Robert Edmonds -Date: Wed, 20 Mar 2024 21:48:10 -0400 -Subject: [PATCH 1/3] FileGenerator::GenerateHeader(): Set `min_header_version` - unconditionally - -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. ---- - protoc-c/c_file.cc | 9 +-------- - 1 file changed, 1 insertion(+), 8 deletions(-) - -diff --git a/protoc-c/c_file.cc b/protoc-c/c_file.cc -index ca0ad34e..c6d8a240 100644 ---- a/protoc-c/c_file.cc -+++ b/protoc-c/c_file.cc -@@ -117,14 +117,7 @@ FileGenerator::~FileGenerator() {} - void FileGenerator::GenerateHeader(io::Printer* printer) { - std::string filename_identifier = FilenameIdentifier(file_->name()); - -- int min_header_version = 1000000; --#if GOOGLE_PROTOBUF_VERSION >= 4023000 -- if (FileDescriptorLegacy(file_).syntax() == FileDescriptorLegacy::SYNTAX_PROTO3) { --#else -- if (file_->syntax() == FileDescriptor::SYNTAX_PROTO3) { --#endif -- min_header_version = 1003000; -- } -+ const int min_header_version = 1003000; - - // Generate top of header. - printer->Print( - -From ee3d9e5423c93ee6b828fdda8e7fef13a77634eb Mon Sep 17 00:00:00 2001 -From: Robert Edmonds -Date: Wed, 20 Mar 2024 22:25:54 -0400 -Subject: [PATCH 2/3] Reimplement FieldSyntax() to maximize compatibility - across protobuf versions - -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 ---- - protoc-c/c_helpers.h | 24 ++++++++++++++---------- - 1 file changed, 14 insertions(+), 10 deletions(-) - -diff --git a/protoc-c/c_helpers.h b/protoc-c/c_helpers.h -index 062d330b..be28b601 100644 ---- a/protoc-c/c_helpers.h -+++ b/protoc-c/c_helpers.h -@@ -70,10 +70,6 @@ - #include - #include - --#if GOOGLE_PROTOBUF_VERSION >= 4023000 --# include --#endif -- - namespace google { - namespace protobuf { - namespace compiler { -@@ -173,13 +169,21 @@ struct NameIndex - int compare_name_indices_by_name(const void*, const void*); - - // Return the syntax version of the file containing the field. --// This wrapper is needed to be able to compile against protobuf2. - inline int FieldSyntax(const FieldDescriptor* field) { --#if GOOGLE_PROTOBUF_VERSION >= 4023000 -- return FileDescriptorLegacy(field->file()).syntax() == FileDescriptorLegacy::SYNTAX_PROTO3 ? 3 : 2; --#else -- return field->file()->syntax() == FileDescriptor::SYNTAX_PROTO3 ? 3 : 2; --#endif -+ auto proto = FileDescriptorProto(); -+ field->file()->CopyTo(&proto); -+ -+ if (proto.has_syntax()) { -+ auto syntax = proto.syntax(); -+ assert(syntax == "proto2" || syntax == "proto3"); -+ if (syntax == "proto2") { -+ return 2; -+ } else if (syntax == "proto3") { -+ return 3; -+ } -+ } -+ -+ return 2; - } - - // Work around changes in protobuf >= 22.x without breaking compilation against - -- 2.49.0