diff options
author | Celeste <20312-Celeste@users.gitlab.alpinelinux.org> | 2023-09-30 02:30:54 +0000 |
---|---|---|
committer | J0WI <1715-J0WI@users.gitlab.alpinelinux.org> | 2023-10-06 14:21:52 +0000 |
commit | 64f60ec31df65d125664fa14602074e12f20821a (patch) | |
tree | ae0422899cbc968d501b845b9e50c712a4a7fcea | |
parent | 20dad330c23721e39079a29f4c2d522b9a6f7dd3 (diff) |
community/avro: upgrade to 1.11.3
-rw-r--r-- | community/avro/APKBUILD | 12 | ||||
-rw-r--r-- | community/avro/c++-fixinstall.patch | 649 | ||||
-rw-r--r-- | community/avro/no-werror-for-c++.patch | 11 |
3 files changed, 17 insertions, 655 deletions
diff --git a/community/avro/APKBUILD b/community/avro/APKBUILD index 23092ea203b..6c13fcf7c2f 100644 --- a/community/avro/APKBUILD +++ b/community/avro/APKBUILD @@ -1,8 +1,8 @@ # Contributor: nu <llnu@protonmail.ch> # Maintainer: nu <llnu@protonmail.ch> pkgname=avro -pkgver=1.11.1 -pkgrel=6 +pkgver=1.11.3 +pkgrel=0 pkgdesc="Avro, a data serialization system" url="https://avro.apache.org/docs/current/api/c/index.html" # 32-bit: fails tests @@ -26,16 +26,16 @@ subpackages=" libavrocpp " source="https://archive.apache.org/dist/avro/avro-$pkgver/avro-src-$pkgver.tar.gz - c++-fixinstall.patch nostatic.patch pkgconf.patch version-bash.patch + no-werror-for-c++.patch " builddir="$srcdir"/avro-src-$pkgver/lang build() { export CFLAGS="$CFLAGS -O2 -DNDEBUG -flto=auto" - export CXXFLAGS="$CXXFLAGS -O2 -DNDEBUG -flto=auto" + export CXXFLAGS="$CXXFLAGS -O2 -DNDEBUG -flto=auto -Wno-cpp" cmake -B build-c -G Ninja -S c \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_BUILD_TYPE=None \ @@ -71,9 +71,9 @@ libavrocpp() { } sha512sums=" -721a94cd148067282636ba9784088dc9d43f26165d66b065e365eec420ba7cd108df9c0b0ac29beef3c37ac0034f356158769b4a7a3c4c0b1634b893e2dd2bb8 avro-src-1.11.1.tar.gz -bfc478bb6a2f89b120586ffeb4ce308cab01b3738d119e32afc34722bc97e48b4231fdb221b99299080835b1a2d70078e281b5e6b6602ba42f1a88d8f30b074c c++-fixinstall.patch +c2233a16618dab10253b17f71ab169a242b0b2328d1daceb2d0c0ae64417c81c618100da3518203cc63fa801a514697e7c32ce71926a08d2003a4c12da67a5bd avro-src-1.11.3.tar.gz e875a3726507326dd80b59906623015aaab685400e9f9fb30f10a8e7e5713b02804b1b38da41649c1b79586b1db8856f1c659280d951c4e616e707fb970a3726 nostatic.patch cbd23242847c6e4e299165157205c74e8473be523ad739397a52d47ca2e3f699525e4dc96511f0ce8f13f98b8a2eeaa44a921a9986c6ffe57e3a3828e1376bdf pkgconf.patch 71153a9a0f8607e48b7cf6fa5e0d70bb11162ec0f1f721dbee7b753f237dbfad1df57c4cd8917a7dd1ef19750bf07e12b04fbfe3fc9cc8bc91a6ef875a7cc778 version-bash.patch +3fe8feaecf5cb43a7153ca6583756bd853454868266bf23cf11316f52dda0a03ae78d0ef8c79799f78df3c5e029806fd5459c58ae7524fdde9ffba4eea8ba088 no-werror-for-c++.patch " diff --git a/community/avro/c++-fixinstall.patch b/community/avro/c++-fixinstall.patch deleted file mode 100644 index 7e25f063dde..00000000000 --- a/community/avro/c++-fixinstall.patch +++ /dev/null @@ -1,649 +0,0 @@ -From 864774b473202d11544cb869e9323de01c5ffe5c Mon Sep 17 00:00:00 2001 -From: Martin Grigorov <martin-g@users.noreply.github.com> -Date: Thu, 11 Aug 2022 17:00:54 +0300 -Subject: [PATCH] AVRO-3601: C++ API header contains breaking include (#1821) - -* AVRO-3601: C++ API header contains breaking include - -Rename CustomFields to CustomAttributes. -Rework CustomAttributes to keep a map of string name with a string -value. The user application may parse the string to JSON if needed. -Add a new step to the CI workflow to prevent problems like this in the -future - -Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org> - -* AVRO-3601: Do not try to install - -Just build in Release mode - -Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org> - -Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org> ---- - .github/workflows/test-lang-c++.yml | 6 +++ - lang/c++/CMakeLists.txt | 2 +- - lang/c++/api/CustomAttributes.hh | 55 +++++++++++++++++++++++++++ - lang/c++/api/CustomFields.hh | 55 --------------------------- - lang/c++/api/Node.hh | 6 +-- - lang/c++/api/NodeImpl.hh | 10 ++--- - lang/c++/api/Schema.hh | 4 +- - lang/c++/impl/Compiler.cc | 16 ++++---- - lang/c++/impl/CustomAttributes.cc | 51 +++++++++++++++++++++++++ - lang/c++/impl/CustomFields.cc | 59 ----------------------------- - lang/c++/impl/NodeImpl.cc | 12 +++--- - lang/c++/impl/Schema.cc | 8 ++-- - lang/c++/test/unittest.cc | 56 +++++++++++++-------------- - 13 files changed, 169 insertions(+), 171 deletions(-) - create mode 100644 lang/c++/api/CustomAttributes.hh - delete mode 100644 lang/c++/api/CustomFields.hh - create mode 100644 lang/c++/impl/CustomAttributes.cc - delete mode 100644 lang/c++/impl/CustomFields.cc - -diff --git a/lang/c++/CMakeLists.txt b/lang/c++/CMakeLists.txt -index 6098613edc3..c901437e68b 100644 ---- a/c++/CMakeLists.txt -+++ b/c++/CMakeLists.txt -@@ -111,7 +111,7 @@ set (AVRO_SOURCE_FILES - impl/json/JsonIO.cc - impl/json/JsonDom.cc - impl/Resolver.cc impl/Validator.cc -- impl/CustomFields.cc -+ impl/CustomAttributes.cc - ) - - add_library (avrocpp SHARED ${AVRO_SOURCE_FILES}) ---- /dev/null -+++ b/c++/api/CustomAttributes.hh -@@ -0,0 +1,55 @@ -+/* -+ * Licensed to the Apache Software Foundation (ASF) under one -+ * or more contributor license agreements. See the NOTICE file -+ * distributed with this work for additional information -+ * regarding copyright ownership. The ASF licenses this file -+ * to you under the Apache License, Version 2.0 (the -+ * "License"); you may not use this file except in compliance -+ * with the License. You may obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ */ -+ -+#ifndef avro_CustomAttributes_hh__ -+#define avro_CustomAttributes_hh__ -+ -+#include <iostream> -+#include <map> -+#include <string> -+#include "Config.hh" -+ -+namespace avro { -+ -+// CustomAttributes class stores avro custom attributes. -+// Each attribute is represented by a unique name and value. -+// User is supposed to create CustomAttributes object and then add it to Schema. -+class AVRO_DECL CustomAttributes { -+ public: -+ // Retrieves the custom attribute json entity for that attributeName, returns an -+ // null if the attribute doesn't exist. -+ std::string getAttribute(const std::string &name) const; -+ -+ // Adds a custom attribute. If the attribute already exists, throw an exception. -+ void addAttribute(const std::string &name, const std::string &value); -+ -+ // Provides a way to iterate over the custom attributes or check attribute size. -+ const std::map<std::string, std::string> &attributes() const { -+ return attributes_; -+ } -+ -+ // Prints the attribute value for the specific attribute. -+ void printJson(std::ostream& os, const std::string &name) const; -+ -+ private: -+ std::map<std::string, std::string> attributes_; -+}; -+ -+} // namespace avro -+ -+#endif -diff --git a/lang/c++/api/CustomFields.hh b/lang/c++/api/CustomFields.hh -deleted file mode 100644 -index 01468ff4a0b..00000000000 ---- a/c++/api/CustomFields.hh -+++ /dev/null -@@ -1,55 +0,0 @@ --/* -- * Licensed to the Apache Software Foundation (ASF) under one -- * or more contributor license agreements. See the NOTICE file -- * distributed with this work for additional information -- * regarding copyright ownership. The ASF licenses this file -- * to you under the Apache License, Version 2.0 (the -- * "License"); you may not use this file except in compliance -- * with the License. You may obtain a copy of the License at -- * -- * http://www.apache.org/licenses/LICENSE-2.0 -- * -- * Unless required by applicable law or agreed to in writing, software -- * distributed under the License is distributed on an "AS IS" BASIS, -- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- * See the License for the specific language governing permissions and -- * limitations under the License. -- */ -- --#ifndef avro_CustomFields_hh__ --#define avro_CustomFields_hh__ -- --#include <iostream> -- --#include "../impl/json/JsonDom.hh" -- --namespace avro { -- --// CustomFields class stores avro custom attributes. --// Each field is represented by a unique name and value. --// User is supposed to create CustomFields object and then add it to Schema. --class AVRO_DECL CustomFields { -- public: -- // Retrieves the custom field json entity for that fieldName, returns an -- // null Entity if the field doesn't exist. -- json::Entity getField(const std::string &fieldName) const; -- -- // Adds a custom field. If the field already exists, throw an exception. -- void addField(const std::string &fieldName, const json::Entity &fieldValue); -- void addField(const std::string &fieldName, const std::string &fieldValue); -- -- // Provides a way to iterate over the custom fields or check field size. -- const std::map<std::string, json::Entity> &fields() const { -- return fields_; -- } -- -- // Prints the json string for the specific field. -- void printJson(std::ostream& os, const std::string &fieldName) const; -- -- private: -- std::map<std::string, json::Entity> fields_; --}; -- --} // namespace avro -- --#endif -diff --git a/lang/c++/api/Node.hh b/lang/c++/api/Node.hh -index c9af126f1ac..3f5fe5b05da 100644 ---- a/c++/api/Node.hh -+++ b/c++/api/Node.hh -@@ -26,7 +26,7 @@ - #include <memory> - #include <utility> - --#include "CustomFields.hh" -+#include "CustomAttributes.hh" - #include "Exception.hh" - #include "LogicalType.hh" - #include "SchemaResolution.hh" -@@ -154,7 +154,7 @@ public: - } - virtual size_t fixedSize() const = 0; - -- void addCustomAttributesForField(const CustomFields& customAttributes) { -+ void addCustomAttributesForField(const CustomAttributes& customAttributes) { - checkLock(); - doAddCustomAttribute(customAttributes); - } -@@ -191,7 +191,7 @@ protected: - virtual void doAddLeaf(const NodePtr &newLeaf) = 0; - virtual void doAddName(const std::string &name) = 0; - virtual void doSetFixedSize(size_t size) = 0; -- virtual void doAddCustomAttribute(const CustomFields& customFields) = 0; -+ virtual void doAddCustomAttribute(const CustomAttributes& customAttributes) = 0; - - private: - const Type type_; -diff --git a/lang/c++/api/NodeImpl.hh b/lang/c++/api/NodeImpl.hh -index 62e62eb6536..bf0e3529b34 100644 ---- a/c++/api/NodeImpl.hh -+++ b/c++/api/NodeImpl.hh -@@ -32,7 +32,7 @@ - - #include "Node.hh" - #include "NodeConcepts.hh" --#include "CustomFields.hh" -+#include "CustomAttributes.hh" - - namespace avro { - -@@ -160,8 +160,8 @@ protected: - - void setLeafToSymbolic(size_t index, const NodePtr &node) override; - -- void doAddCustomAttribute(const CustomFields &customfields) override { -- customAttributes_.add(customfields); -+ void doAddCustomAttribute(const CustomAttributes &customAttributes) override { -+ customAttributes_.add(customAttributes); - } - - SchemaResolution furtherResolution(const Node &reader) const { -@@ -223,8 +223,8 @@ using MultiLeaves = concepts::MultiAttribute<NodePtr>; - - using NoLeafNames = concepts::NoAttribute<std::string>; - using LeafNames = concepts::MultiAttribute<std::string>; --using MultiAttributes = concepts::MultiAttribute<CustomFields>; --using NoAttributes = concepts::NoAttribute<CustomFields>; -+using MultiAttributes = concepts::MultiAttribute<CustomAttributes>; -+using NoAttributes = concepts::NoAttribute<CustomAttributes>; - - using NoSize = concepts::NoAttribute<int>; - using HasSize = concepts::SingleAttribute<int>; -diff --git a/lang/c++/api/Schema.hh b/lang/c++/api/Schema.hh -index fa504815ad2..163b50049ca 100644 ---- a/c++/api/Schema.hh -+++ b/c++/api/Schema.hh -@@ -21,7 +21,7 @@ - - #include "Config.hh" - #include "NodeImpl.hh" --#include "CustomFields.hh" -+#include "CustomAttributes.hh" - #include <string> - - /// \file -@@ -103,7 +103,7 @@ public: - void addField(const std::string &name, const Schema &fieldSchema); - // Add a field with custom attributes - void addField(const std::string &name, const Schema &fieldSchema, -- const CustomFields &customFields); -+ const CustomAttributes &customAttributes); - - std::string getDoc() const; - void setDoc(const std::string &); -diff --git a/lang/c++/impl/Compiler.cc b/lang/c++/impl/Compiler.cc -index 014229e11ac..383798c4d63 100644 ---- a/c++/impl/Compiler.cc -+++ b/c++/impl/Compiler.cc -@@ -21,7 +21,7 @@ - #include <utility> - - #include "Compiler.hh" --#include "CustomFields.hh" -+#include "CustomAttributes.hh" - #include "NodeConcepts.hh" - #include "Schema.hh" - #include "Stream.hh" -@@ -149,8 +149,8 @@ struct Field { - const string name; - const NodePtr schema; - const GenericDatum defaultValue; -- const CustomFields customFields; -- Field(string n, NodePtr v, GenericDatum dv, const CustomFields& cf) : name(std::move(n)), schema(std::move(v)), defaultValue(std::move(dv)), customFields(std::move(cf)) {} -+ const CustomAttributes customAttributes; -+ Field(string n, NodePtr v, GenericDatum dv, const CustomAttributes& ca) : name(std::move(n)), schema(std::move(v)), defaultValue(std::move(dv)), customAttributes(std::move(ca)) {} - }; - - static void assertType(const Entity &e, EntityType et) { -@@ -268,14 +268,14 @@ static const std::unordered_set<std::string>& getKnownFields() { - return kKnownFields; - } - --static void getCustomAttributes(const Object& m, CustomFields &customAttributes) -+static void getCustomAttributes(const Object& m, CustomAttributes &customAttributes) - { - // Don't add known fields on primitive type and fixed type into custom - // fields. - const std::unordered_set<std::string>& kKnownFields = getKnownFields(); - for (const auto &entry : m) { - if (kKnownFields.find(entry.first) == kKnownFields.end()) { -- customAttributes.addField(entry.first, entry.second); -+ customAttributes.addAttribute(entry.first, entry.second.stringValue()); - } - } - } -@@ -291,7 +291,7 @@ static Field makeField(const Entity &e, SymbolTable &st, const string &ns) { - } - GenericDatum d = (it2 == m.end()) ? GenericDatum() : makeGenericDatum(node, it2->second, st); - // Get custom attributes -- CustomFields customAttributes; -+ CustomAttributes customAttributes; - getCustomAttributes(m, customAttributes); - - return Field(n, node, d, customAttributes); -@@ -304,7 +304,7 @@ static NodePtr makeRecordNode(const Entity &e, const Name &name, - const Array &v = getArrayField(e, m, "fields"); - concepts::MultiAttribute<string> fieldNames; - concepts::MultiAttribute<NodePtr> fieldValues; -- concepts::MultiAttribute<CustomFields> customAttributes; -+ concepts::MultiAttribute<CustomAttributes> customAttributes; - vector<GenericDatum> defaultValues; - - for (const auto &it : v) { -@@ -312,7 +312,7 @@ static NodePtr makeRecordNode(const Entity &e, const Name &name, - fieldNames.add(f.name); - fieldValues.add(f.schema); - defaultValues.push_back(f.defaultValue); -- customAttributes.add(f.customFields); -+ customAttributes.add(f.customAttributes); - } - NodeRecord *node; - if (doc == nullptr) { -diff --git a/lang/c++/impl/CustomAttributes.cc b/lang/c++/impl/CustomAttributes.cc -new file mode 100644 -index 00000000000..bb564385697 ---- /dev/null -+++ b/c++/impl/CustomAttributes.cc -@@ -0,0 +1,51 @@ -+ -+/** -+ * Licensed to the Apache Software Foundation (ASF) under one -+ * or more contributor license agreements. See the NOTICE file -+ * distributed with this work for additional information -+ * regarding copyright ownership. The ASF licenses this file -+ * to you under the Apache License, Version 2.0 (the -+ * "License"); you may not use this file except in compliance -+ * with the License. You may obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ */ -+#include "CustomAttributes.hh" -+#include <map> -+#include <memory> -+#include "Exception.hh" -+ -+namespace avro { -+ -+std::string CustomAttributes::getAttribute(const std::string &name) const { -+ std::map<std::string, std::string>::const_iterator iter = -+ attributes_.find(name); -+ if (iter == attributes_.end()) { -+ return NULL; -+ } -+ return iter->second; -+} -+ -+void CustomAttributes::addAttribute(const std::string& name, -+ const std::string& value) { -+ auto iter_and_find = -+ attributes_.insert(std::pair<std::string, std::string>(name, value)); -+ if (!iter_and_find.second) { -+ throw Exception(name + " already exists and cannot be added"); -+ } -+} -+ -+void CustomAttributes::printJson(std::ostream& os, -+ const std::string& name) const { -+ if (attributes().find(name) == attributes().end()) { -+ throw Exception(name + " doesn't exist"); -+ } -+ os << "\"" << name << "\": \"" << attributes().at(name) << "\""; -+} -+} // namespace avro -diff --git a/lang/c++/impl/CustomFields.cc b/lang/c++/impl/CustomFields.cc -deleted file mode 100644 -index 04541daae50..00000000000 ---- a/c++/impl/CustomFields.cc -+++ /dev/null -@@ -1,59 +0,0 @@ -- --/** -- * Licensed to the Apache Software Foundation (ASF) under one -- * or more contributor license agreements. See the NOTICE file -- * distributed with this work for additional information -- * regarding copyright ownership. The ASF licenses this file -- * to you under the Apache License, Version 2.0 (the -- * "License"); you may not use this file except in compliance -- * with the License. You may obtain a copy of the License at -- * -- * http://www.apache.org/licenses/LICENSE-2.0 -- * -- * Unless required by applicable law or agreed to in writing, software -- * distributed under the License is distributed on an "AS IS" BASIS, -- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- * See the License for the specific language governing permissions and -- * limitations under the License. -- */ --#include "CustomFields.hh" --#include <map> --#include <memory> --#include "Exception.hh" -- --namespace avro { -- --using json::Entity; -- --Entity CustomFields::getField(const std::string &fieldName) const { -- std::map<std::string, Entity>::const_iterator iter = -- fields_.find(fieldName); -- if (iter == fields_.end()) { -- return Entity(); -- } -- return iter->second; --} -- --void CustomFields::addField(const std::string& fieldName, -- const std::string& fieldValue) { -- addField(fieldName, -- json::Entity(std::make_shared<std::string>(fieldValue))); --} -- --void CustomFields::addField(const std::string& fieldName, -- const Entity& fieldValue) { -- auto iter_and_find = -- fields_.insert(std::pair<std::string, Entity>(fieldName, fieldValue)); -- if (!iter_and_find.second) { -- throw Exception(fieldName + " already exists and cannot be added"); -- } --} -- --void CustomFields::printJson(std::ostream& os, -- const std::string& fieldName) const { -- if (fields_.find(fieldName) == fields_.end()) { -- throw Exception(fieldName + " doesn't exist"); -- } -- os << "\"" << fieldName << "\": " << fields_.at(fieldName).toString(); --} --} // namespace avro -diff --git a/lang/c++/impl/NodeImpl.cc b/lang/c++/impl/NodeImpl.cc -index 37c855505c0..5549c68fd48 100644 ---- a/c++/impl/NodeImpl.cc -+++ b/c++/impl/NodeImpl.cc -@@ -83,13 +83,13 @@ std::ostream &operator<<(std::ostream &os, indent x) { - return os; - } - --void printCustomFields(const CustomFields& customFields, int depth, -+void printCustomAttributes(const CustomAttributes& customAttributes, int depth, - std::ostream &os) { -- std::map<std::string, json::Entity>::const_iterator iter = -- customFields.fields().begin(); -- while (iter != customFields.fields().end()) { -+ std::map<std::string, std::string>::const_iterator iter = -+ customAttributes.attributes().begin(); -+ while (iter != customAttributes.attributes().end()) { - os << ",\n" << indent(depth); -- customFields.printJson(os, iter->first); -+ customAttributes.printJson(os, iter->first); - ++iter; - } - } -@@ -287,7 +287,7 @@ void NodeRecord::printJson(std::ostream &os, size_t depth) const { - } - } - if(customAttributes_.size() == fields) { -- printCustomFields(customAttributes_.get(i), depth, os); -+ printCustomAttributes(customAttributes_.get(i), depth, os); - } - os << '\n'; - os << indent(--depth) << '}'; -diff --git a/lang/c++/impl/Schema.cc b/lang/c++/impl/Schema.cc -index fa90d3422ce..3315f252583 100644 ---- a/c++/impl/Schema.cc -+++ b/c++/impl/Schema.cc -@@ -19,7 +19,7 @@ - #include <utility> - - #include "Schema.hh" --#include "CustomFields.hh" -+#include "CustomAttributes.hh" - - namespace avro { - -@@ -28,11 +28,11 @@ RecordSchema::RecordSchema(const std::string &name) : Schema(new NodeRecord) { - } - - void RecordSchema::addField(const std::string &name, const Schema &fieldSchema) { -- const CustomFields emptyCustomField; -- addField(name, fieldSchema, emptyCustomField); -+ const CustomAttributes emptyCustomAttribute; -+ addField(name, fieldSchema, emptyCustomAttribute); - } - --void RecordSchema::addField(const std::string &name, const Schema &fieldSchema, const CustomFields &customFields) { -+void RecordSchema::addField(const std::string &name, const Schema &fieldSchema, const CustomAttributes &customFields) { - // add the name first. it will throw if the name is a duplicate, preventing - // the leaf from being added - node_->addName(name); -diff --git a/lang/c++/test/unittest.cc b/lang/c++/test/unittest.cc -index df7b21b84e0..2a5c51786dc 100644 ---- a/c++/test/unittest.cc -+++ b/c++/test/unittest.cc -@@ -38,7 +38,7 @@ - #include "buffer/BufferStream.hh" - - #include "AvroSerialize.hh" --#include "CustomFields.hh" -+#include "CustomAttributes.hh" - #include "NodeConcepts.hh" - #include "NodeImpl.hh" - #include "Types.hh" -@@ -74,12 +74,12 @@ struct TestSchema { - void buildSchema() { - RecordSchema record("RootRecord"); - -- CustomFields customFieldLong; -- customFieldLong.addField("extra_info_mylong", std::string("it's a long field")); -+ CustomAttributes customAttributeLong; -+ customAttributeLong.addAttribute("extra_info_mylong", std::string("it's a long field")); - // Validate that adding a custom attribute with same name is not allowed - bool caught = false; - try { -- customFieldLong.addField("extra_info_mylong", std::string("duplicate")); -+ customAttributeLong.addAttribute("extra_info_mylong", std::string("duplicate")); - } - catch(Exception &e) { - std::cout << "(intentional) exception: " << e.what() << '\n'; -@@ -87,7 +87,7 @@ struct TestSchema { - } - BOOST_CHECK_EQUAL(caught, true); - // Add custom attribute for the field -- record.addField("mylong", LongSchema(), customFieldLong); -+ record.addField("mylong", LongSchema(), customAttributeLong); - - IntSchema intSchema; - avro::MapSchema map = MapSchema(IntSchema()); -@@ -141,12 +141,12 @@ struct TestSchema { - } - BOOST_CHECK_EQUAL(caught, true); - -- CustomFields customFieldLong2; -- customFieldLong2.addField("extra_info_mylong2", -+ CustomAttributes customAttributeLong2; -+ customAttributeLong2.addAttribute("extra_info_mylong2", - std::string("it's a long field")); -- customFieldLong2.addField("more_info_mylong2", -+ customAttributeLong2.addAttribute("more_info_mylong2", - std::string("it's still a long field")); -- record.addField("mylong2", LongSchema(), customFieldLong2); -+ record.addField("mylong2", LongSchema(), customAttributeLong2); - - record.addField("anotherint", intSchema); - -@@ -432,34 +432,34 @@ struct TestSchema { - - // Create NodeRecord with custom attributes at field level - // validate json serialization -- void checkNodeRecordWithCustomField() -+ void checkNodeRecordWithCustomAttribute() - { - Name recordName("Test"); - HasName nameConcept(recordName); - concepts::MultiAttribute<std::string> fieldNames; - concepts::MultiAttribute<NodePtr> fieldValues; - std::vector<GenericDatum> defaultValues; -- concepts::MultiAttribute<CustomFields> customFields; -+ concepts::MultiAttribute<CustomAttributes> customAttributes; - -- CustomFields cf; -- cf.addField("extra field", std::string("1")); -+ CustomAttributes cf; -+ cf.addAttribute("extra field", std::string("1")); - fieldNames.add("f1"); - fieldValues.add(NodePtr( new NodePrimitive(Type::AVRO_LONG))); -- customFields.add(cf); -+ customAttributes.add(cf); - -- NodeRecord nodeRecordWithCustomField(nameConcept, fieldValues, -+ NodeRecord nodeRecordWithCustomAttribute(nameConcept, fieldValues, - fieldNames, defaultValues, -- customFields); -- std::string expectedJsonWithCustomField = -+ customAttributes); -+ std::string expectedJsonWithCustomAttribute = - "{\"type\": \"record\", \"name\": \"Test\",\"fields\": " - "[{\"name\": \"f1\", \"type\": \"long\",\"extra field\": \"1\"}]}"; -- testNodeRecord(nodeRecordWithCustomField, -- expectedJsonWithCustomField); -+ testNodeRecord(nodeRecordWithCustomAttribute, -+ expectedJsonWithCustomAttribute); - } - - // Create NodeRecord without custom attributes at field level - // validate json serialization -- void checkNodeRecordWithoutCustomField() -+ void checkNodeRecordWithoutCustomAttribute() - { - Name recordName("Test"); - HasName nameConcept(recordName); -@@ -467,18 +467,18 @@ struct TestSchema { - concepts::MultiAttribute<NodePtr> fieldValues; - std::vector<GenericDatum> defaultValues; - -- CustomFields cf; -- cf.addField("extra field", std::string("1")); -+ CustomAttributes cf; -+ cf.addAttribute("extra field", std::string("1")); - fieldNames.add("f1"); - fieldValues.add(NodePtr( new NodePrimitive(Type::AVRO_LONG))); - -- NodeRecord nodeRecordWithoutCustomField(nameConcept, fieldValues, -+ NodeRecord nodeRecordWithoutCustomAttribute(nameConcept, fieldValues, - fieldNames, defaultValues); -- std::string expectedJsonWithoutCustomField = -+ std::string expectedJsonWithoutCustomAttribute = - "{\"type\": \"record\", \"name\": \"Test\",\"fields\": " - "[{\"name\": \"f1\", \"type\": \"long\"}]}"; -- testNodeRecord(nodeRecordWithoutCustomField, -- expectedJsonWithoutCustomField); -+ testNodeRecord(nodeRecordWithoutCustomAttribute, -+ expectedJsonWithoutCustomAttribute); - } - - void test() { -@@ -503,8 +503,8 @@ struct TestSchema { - - createExampleSchema(); - -- checkNodeRecordWithoutCustomField(); -- checkNodeRecordWithCustomField(); -+ checkNodeRecordWithoutCustomAttribute(); -+ checkNodeRecordWithCustomAttribute(); - } - - ValidSchema schema_; diff --git a/community/avro/no-werror-for-c++.patch b/community/avro/no-werror-for-c++.patch new file mode 100644 index 00000000000..cdc08954305 --- /dev/null +++ b/community/avro/no-werror-for-c++.patch @@ -0,0 +1,11 @@ +--- a/c++/CMakeLists.txt ++++ b/c++/CMakeLists.txt +@@ -64,7 +64,7 @@ + endif() + + if (CMAKE_COMPILER_IS_GNUCXX) +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Werror") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic") + if (AVRO_ADD_PROTECTOR_FLAGS) + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fstack-protector-all -D_GLIBCXX_DEBUG") + # Unset _GLIBCXX_DEBUG for avrogencpp.cc because using Boost Program Options |