From a2ac5daec20947ec3db3c44afb780c4a3ab541b7 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Wed, 20 May 2020 15:25:42 +0200 Subject: [PATCH 01/81] add open62541 recipe for v1.0 and v1.0.1 Signed-off-by: Dovydas Girdvainis --- recipes/open62541/all/CMakeLists.txt | 7 + recipes/open62541/all/conandata.yml | 14 + recipes/open62541/all/conanfile.py | 211 ++++++++ ..._conan_center_index_compliance_v_1_0.patch | 451 +++++++++++++++++ ...onan_center_index_compliance_v_1_0_1.patch | 477 ++++++++++++++++++ .../open62541/all/test_package/CMakeLists.txt | 8 + .../open62541/all/test_package/conanfile.py | 17 + .../open62541/all/test_package/example.cpp | 31 ++ recipes/open62541/config.yml | 5 + 9 files changed, 1221 insertions(+) create mode 100644 recipes/open62541/all/CMakeLists.txt create mode 100644 recipes/open62541/all/conandata.yml create mode 100644 recipes/open62541/all/conanfile.py create mode 100644 recipes/open62541/all/patches/add_conan_center_index_compliance_v_1_0.patch create mode 100644 recipes/open62541/all/patches/add_conan_center_index_compliance_v_1_0_1.patch create mode 100644 recipes/open62541/all/test_package/CMakeLists.txt create mode 100644 recipes/open62541/all/test_package/conanfile.py create mode 100644 recipes/open62541/all/test_package/example.cpp create mode 100644 recipes/open62541/config.yml diff --git a/recipes/open62541/all/CMakeLists.txt b/recipes/open62541/all/CMakeLists.txt new file mode 100644 index 0000000000000..361b35d4c17d9 --- /dev/null +++ b/recipes/open62541/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8.11) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory(source_subfolder) diff --git a/recipes/open62541/all/conandata.yml b/recipes/open62541/all/conandata.yml new file mode 100644 index 0000000000000..2b6b3a3589b0a --- /dev/null +++ b/recipes/open62541/all/conandata.yml @@ -0,0 +1,14 @@ +sources: + "1.0": + url: "https://github.com/open62541/open62541/archive/v1.0.tar.gz" + sha256: "9be66efefe2cdb07a7638aad91c301b5c6163f99c66995bc41cce31ec0ea207e" + "1.0.1": + url: "https://github.com/open62541/open62541/archive/v1.0.1.tar.gz" + sha256: "ae9fac217267bccdf360fe0f1788f4d65875b06028404cf2440600927d2b3ad3" +patches: + "1.0": + - patch_file: "patches/add_conan_center_index_compliance_v_1_0.patch" + base_path: "source_subfolder" + "1.0.1": + - patch_file: "patches/add_conan_center_index_compliance_v_1_0_1.patch" + base_path: "source_subfolder" diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py new file mode 100644 index 0000000000000..0c64d7bfbc9bf --- /dev/null +++ b/recipes/open62541/all/conanfile.py @@ -0,0 +1,211 @@ +import os +import sys +from conans import ConanFile, CMake, tools +from conans.tools import download, unzip +from conans.model.version import Version +from urllib.parse import urlparse +import shutil + + +class Open62541Conan(ConanFile): + name = "open62541" + license = "MPLv2" + exports_sources = [ + "CMakeLists.txt", + "patches/**" + ] + homepage = "https://open62541.org/" + url = "https://github.com/conan-io/conan-center-index" + description = "open62541 is an open source and free implementation of OPC UA (OPC Unified Architecture) written in the common subset of the C99 and C++98 languages. The library is usable with all major compilers and provides the necessary tools to implement dedicated OPC UA clients and servers, or to integrate OPC UA-based communication into existing applications. open62541 library is platform independent. All platform-specific functionality is implemented via exchangeable plugins. Plugin implementations are provided for the major operating systems." + requires = ("mbedtls/2.16.3-gpl") + topics = ( + "OPC UA", "open62541", "sdk", "server/client", "c", "iec-62541", + "industrial automation", "tsn", "time sensetive networks", "publish-subscirbe", "pubsub" + ) + settings = "os", "compiler", "build_type", "arch" + options = { + "fPIC": [True, False], + "shared": [True, False], + "historize": [True, False], + "logging_level": ["Fatal", "Error", "Warrning", "Info", "Debug", "Trace"], + "subscription": [True, False], + "subscription_events": [True, False], + "methods": [True, False], + "dynamic_nodes": [True, False], + "single_header": [True, False], + "multithreading": [True, False], + "imutable_nodes": [True, False], + "web_socket": [True, False], + "discovery": [True, False], + "discovery_semaphore": [True, False], + "discovery_multicast": [True, False], + "query": [True, False], + "encription": [True, False], + "json_support": [True, False], + "pub_sub": ["None", "Simple", "Ethernet", "Ethernet_XDP"], + "data_access": [True, False], + "compiled_nodeset_descriptions": [True, False], + "namescpae_zero": ["MINIMAL", "REDUCED", "FULL"], + "embedded_profile": [True, False], + "typenames": [True, False], + "hardening": [True, False], + "cpp_compatible": [True, False], + "readable_statuscodes": [True, False] + } + default_options = { + "fPIC": True, + "shared": True, + "historize": False, + "logging_level": "Trace", + "subscription": True, + "subscription_events": False, + "methods": True, + "dynamic_nodes": True, + "single_header": False, + "multithreading": False, + "imutable_nodes": False, + "web_socket": False, + "discovery": True, + "discovery_semaphore": True, + "discovery_multicast": False, + "query": False, + "encription": False, + "json_support": True, + "pub_sub": "None", + "data_access": False, + "compiled_nodeset_descriptions": True, + "namescpae_zero": "REDUCED", + "embedded_profile": False, + "typenames": True, + "hardening": False, + "cpp_compatible": False, + "readable_statuscodes": True + } + generators = "cmake", "cmake_find_package" + + @property + def _source_subfolder(self): + return "source_subfolder" + + def _download_deps(self, zip_link, dep_name): + zip_name = dep_name + ".zip" + download(zip_link, zip_name) + dep_path = self._source_subfolder + "/deps/" + dep_name + unzip(zip_name) + full_path = str(urlparse(zip_link).path).split("/") + dir_name = full_path[2] + "-" + full_path[4] + dir_name = dir_name[:-4] + files = os.listdir(dir_name) + for f in files: + shutil.move(os.path.join(dir_name, f), dep_path) + os.unlink(zip_name) + shutil.rmtree(dir_name) + + def _download_ua_nodes(self): + link = "" + if self.version == "1.0.0": + link = "https://github.com/OPCFoundation/UA-Nodeset/archive/0777abd1bc407b4dbd79abc515864f8c3ce6812b.zip" + elif self.version == "1.0.1": + link = "https://github.com/OPCFoundation/UA-Nodeset/archive/0777abd1bc407b4dbd79abc515864f8c3ce6812b.zip" + self._download_deps(zip_link=link, dep_name="ua-nodeset") + + def _download_mdnsd(self): + link = "" + if self.version == "1.0.0": + link = "https://github.com/Pro/mdnsd/archive/8fe3a7e7e9d0a9196b126c64f0d1905569b83d40.zip" + elif self.version == "1.0.1": + link = "https://github.com/Pro/mdnsd/archive/f7f0dd543f12fa7bbf2b667cceb287b9c8184b7d.zip" + self._download_deps(zip_link=link, dep_name="mdnsd") + + def _patch_sources(self): + for patch in self.conan_data["patches"][self.version]: + tools.patch(**patch) + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + folder_name = "%s-%s" % (self.name, self.version) + os.rename(folder_name, self._source_subfolder) + if Version(self.version) <= "1.0.1": + self._download_ua_nodes() + self._download_mdnsd() + self._patch_sources() + + def _configure_cmake(self): + cmake = CMake(self) + cmake.verbose = True + if self.settings.os != "Windows": + cmake.definitions["POSITION_INDEPENDENT_CODE"] = self.options.fPIC + cmake.definitions["BUILD_SHARED_LIBS"] = self.options.shared + cmake.definitions["UA_ENABLE_SUBSCRIPTIONS"] = self.options.subscription + cmake.definitions["UA_ENABLE_SUBSCRIPTIONS_EVENTS"] = self.options.subscription_events + cmake.definitions["UA_ENABLE_METHODCALLS"] = self.options.methods + cmake.definitions["UA_ENABLE_NODEMANAGEMENT"] = self.options.dynamic_nodes + cmake.definitions["UA_ENABLE_AMALGAMATION"] = self.options.single_header + cmake.definitions["UA_ENABLE_MULTITHREADING"] = self.options.multithreading + cmake.definitions["UA_ENABLE_IMMUTABLE_NODES"] = self.options.imutable_nodes + cmake.definitions["UA_ENABLE_WEBSOCKET_SERVER"] = self.options.web_socket + cmake.definitions["UA_ENABLE_HISTORIZING"] = self.options.historize + cmake.definitions["UA_ENABLE_DISCOVERY"] = self.options.discovery + cmake.definitions["UA_ENABLE_DISCOVERY_MULTICAST"] = self.options.discovery_multicast + cmake.definitions["UA_ENABLE_DISCOVERY_SEMAPHORE"] = self.options.discovery_semaphore + cmake.definitions["UA_ENABLE_QUERY"] = self.options.query + cmake.definitions["UA_ENABLE_ENCRYPTION"] = self.options.encription + cmake.definitions["UA_ENABLE_JSON_ENCODING"] = self.options.json_support + if self.options.pub_sub != "None": + cmake.definitions["UA_ENABLE_PUBSUB"] = True + if self.settings.os == "Linux" and self.options.pub_sub == "Ethernet": + cmake.definitions["UA_ENABLE_PUBSUB_ETH_UADP"] = True + elif self.settings.os == "Linux" and self.options.pub_sub == "Ethernet_XDP": + cmake.definitions["UA_ENABLE_PUBSUB_ETH_UADP_XDP"] = True + else: + print("PubSub over Ethernet is not supported for your OS!") + cmake.definitions["UA_ENABLE_DA"] = self.options.data_access + if self.options.compiled_nodeset_descriptions == True: + cmake.definitions["UA_ENABLE_NODESET_COMPILER_DESCRIPTIONS"] = self.options.compiled_nodeset_descriptions + cmake.definitions["UA_NAMESPACE_ZERO"] = "FULL" + else: + cmake.definitions["UA_NAMESPACE_ZERO"] = self.options.namescpae_zero + cmake.definitions["UA_ENABLE_MICRO_EMB_DEV_PROFILE"] = self.options.embedded_profile + cmake.definitions["UA_ENABLE_TYPENAMES"] = self.options.typenames + cmake.definitions["UA_ENABLE_STATUSCODE_DESCRIPTIONS"] = self.options.readable_statuscodes + cmake.definitions["UA_ENABLE_HARDENING"] = self.options.hardening + if self.settings.compiler == "Visual Studio" and self.options.shared == True: + cmake.definitions["UA_MSVC_FORCE_STATIC_CRT"] = True + if Version(self.version) > "1.0.1": + cmake.definitions["UA_COMPILE_AS_CXX"] = self.options.cpp_compatible + cmake.configure() + return cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + self.copy("LICENSE-CC0", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + + def package_info(self): + self.cpp_info.names["cmake_find_package"] = "open62541" + self.cpp_info.names["cmake_find_package_multi"] = "open62541" + self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.includedirs = [ + "include", + os.path.join("include", "plugin"), + os.path.join("include", "posix") + ] + self.cpp_info.builddirs = [ + "lib", + os.path.join("lib", "cmake"), + os.path.join("lib", "cmake", "open62541") + ] + if Version(self.version) > "1.0.1" and self.settings.build_type == "Debug" and self.settings.compiler == "clang": + self.cpp_info.cflags = ["-fsanitize=address"] + self.cpp_info.cflags.append('-fsanitize-address-use-after-scope') + self.cpp_info.cflags.append( + '-fsanitize-coverage=trace-pc-guard,trace-cmp') + self.cpp_info.cflags.append('-fsanitize=leak') + self.cpp_info.cflags.append('-fsanitize=undefined') + self.cpp_info.cxxflags = self.cpp_info.cflags + self.cpp_info.sharedlinkflags = ["-fsanitize=address"] diff --git a/recipes/open62541/all/patches/add_conan_center_index_compliance_v_1_0.patch b/recipes/open62541/all/patches/add_conan_center_index_compliance_v_1_0.patch new file mode 100644 index 0000000000000..8e13e9cadbe16 --- /dev/null +++ b/recipes/open62541/all/patches/add_conan_center_index_compliance_v_1_0.patch @@ -0,0 +1,451 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d426e1da..b8e0374c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -9,7 +9,6 @@ string(TOLOWER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_LOWER_CASE) + + set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/tools/cmake") + find_package(PythonInterp REQUIRED) +-find_package(Git) + include(AssignSourceGroup) + include(GNUInstallDirs) + +@@ -28,17 +27,6 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) + +-########### +-# Version # +-########### +- +-include(SetGitBasedVersion) +- +-# The version string will be automatically set based on the git describe output. +-# This will automate the version strings. Just create a new tag, and the version will be set correctly. +-set_open62541_version() +-MESSAGE(STATUS "open62541 Version: ${OPEN62541_VER_MAJOR}.${OPEN62541_VER_MINOR}.${OPEN62541_VER_PATCH}${OPEN62541_VER_LABEL}") +- + ################# + # Build Options # + ################# +@@ -514,7 +502,6 @@ endif() + + file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/src_generated") + configure_file(include/open62541/config.h.in ${PROJECT_BINARY_DIR}/src_generated/open62541/config.h) +-configure_file(open62541.pc.in ${PROJECT_BINARY_DIR}/src_generated/open62541.pc @ONLY) + + if(UA_ENABLE_DISCOVERY_MULTICAST) + set(MDNSD_LOGLEVEL 300 CACHE STRING "Level at which logs shall be reported" FORCE) +@@ -1102,8 +1089,6 @@ include(linting_target) + # Enable shared library with `-DBUILD_SHARED_LIBS=ON` + + set(cmake_configfile_install ${CMAKE_INSTALL_LIBDIR}/cmake/open62541) +-set(open62541_install_tools_dir share/open62541/tools) +-set(open62541_install_nodeset_dir share/open62541/tools/ua-nodeset) + + # This list of components allows to define a find_package requirement. + # E.g.: +@@ -1160,22 +1145,6 @@ if(UA_ENABLE_AMALGAMATION) + install(CODE "MESSAGE(WARNING \"Installation with UA_ENABLE_AMALGAMATION=ON is not recommended.\")") + endif() + +-include(CMakePackageConfigHelpers) +-configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/tools/cmake/open62541Config.cmake.in" +- "${CMAKE_CURRENT_BINARY_DIR}/open62541Config.cmake" +- INSTALL_DESTINATION "${cmake_configfile_install}" +- PATH_VARS open62541_install_tools_dir +- open62541_install_nodeset_dir +- open62541_enabled_components +- ) +- +-set(open62541_VERSION) +-get_target_property(open62541_VERSION open62541 VERSION) +- +-write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/open62541ConfigVersion.cmake" +- VERSION ${open62541_VERSION} +- COMPATIBILITY AnyNewerVersion) +- + install(EXPORT open62541Targets + FILE open62541Targets.cmake + DESTINATION "${cmake_configfile_install}" +@@ -1189,35 +1158,9 @@ export( + + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/tools/cmake/macros_public.cmake" "${CMAKE_CURRENT_BINARY_DIR}/open62541Macros.cmake" COPYONLY) + +-install(FILES "${CMAKE_CURRENT_BINARY_DIR}/open62541Config.cmake" +- "${CMAKE_CURRENT_BINARY_DIR}/open62541ConfigVersion.cmake" +- "${CMAKE_CURRENT_BINARY_DIR}/open62541Macros.cmake" ++install(FILES "${CMAKE_CURRENT_BINARY_DIR}/open62541Macros.cmake" + DESTINATION "${cmake_configfile_install}") + +-if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") +- install(FILES "${PROJECT_BINARY_DIR}/src_generated/open62541.pc" +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) +-endif() +- +-set(UA_install_tools_dirs "tools/certs" +- "tools/nodeset_compiler" +- "tools/schema" +- "deps/ua-nodeset") +- +-set(UA_install_tools_files "tools/generate_datatypes.py" +- "tools/generate_nodeid_header.py" +- "tools/generate_statuscode_descriptions.py") +- +-install(DIRECTORY ${UA_install_tools_dirs} +- DESTINATION ${open62541_install_tools_dir} +- USE_SOURCE_PERMISSIONS +- FILES_MATCHING +- PATTERN "*" +- PATTERN "*.pyc" EXCLUDE +- ) +- +-install(FILES ${UA_install_tools_files} DESTINATION ${open62541_install_tools_dir}) +- + if(NOT UA_ENABLE_AMALGAMATION) + # Recreate the include folder structure from the source also in /usr/lib/include/open62541 + +@@ -1251,8 +1194,6 @@ else() + install(FILES ${PROJECT_BINARY_DIR}/open62541.h DESTINATION include) + endif() + +-add_subdirectory(tools/packaging) +- + ################################## + # Visual studio solution folders # + ################################## +diff --git a/debian/libopen62541-dev.install-template b/debian/libopen62541-dev.install-template +deleted file mode 100644 +index fd018050..00000000 +--- a/debian/libopen62541-dev.install-template ++++ /dev/null +@@ -1,5 +0,0 @@ +-usr/include +-usr/lib/*/*.so +-usr/lib/*/cmake/open62541/* +-usr/lib/*/pkgconfig/open62541.pc +-usr/share/open62541/* +diff --git a/open62541.pc.in b/open62541.pc.in +deleted file mode 100644 +index 53d8e8ed..00000000 +--- a/open62541.pc.in ++++ /dev/null +@@ -1,15 +0,0 @@ +-/* This Source Code Form is subject to the terms of the Mozilla Public +- * License, v. 2.0. If a copy of the MPL was not distributed with this +- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +- +-prefix=@CMAKE_INSTALL_PREFIX@ +-exec_prefix=${prefix} +-libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ +-sharedlibdir=${libdir} +-includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ +- +-Name: open62541 +-Description: open62541 is an open source C (C99) implementation of OPC UA +-Version: @OPEN62541_VER_MAJOR@.@OPEN62541_VER_MINOR@.@OPEN62541_VER_PATCH@ +-Libs: -L${libdir} -lopen62541 +-Cflags: -I${includedir}/open62541 +diff --git a/open62541.spec b/open62541.spec +deleted file mode 100644 +index 046b2a41..00000000 +--- a/open62541.spec ++++ /dev/null +@@ -1,65 +0,0 @@ +-Name: open62541 +-Version: 0.3 +-Release: 1%{?dist} +-Summary: OPC UA implementation +-License: MPLv2.0 +-URL: http://open62541.org +-Source0: https://github.com/open62541/open62541/archive/%{name}-%{version}.tar.gz +- +-BuildRequires: cmake3, python +- +-%description +-open62541 is a C-based library (linking with C++ projects is possible) +-with all necessary tools to implement dedicated OPC UA clients and servers, +-or to integrate OPC UA-based communication into existing applications. +- +-%package devel +-Summary: Development files for %{name} +-Requires: %{name}%{?_isa} = %{version}-%{release} +- +-%description devel +-The %{name}-devel package contains libraries and header files for +-developing applications that use %{name}. +- +-%prep +-%setup -q -n %{name}-%{name}-%{version} # double-name prefix by GitHub +- +-%build +-%cmake3 -DUA_ENABLE_AMALGAMATION=ON . +-make +- +-%install +-%make_install +- +-# Remove this from the examples installation +-rm examples/CMakeLists.txt +- +-%post -p /sbin/ldconfig +- +-%postun -p /sbin/ldconfig +- +-%files +-%license LICENSE +-%doc AUTHORS CHANGELOG README.md +-%{_libdir}/libopen62541.so.* +- +-%files devel +-%license LICENSE LICENSE-CC0 +-%{_libdir}/libopen62541.so +-%{_libdir}/pkgconfig/open62541.pc +-%dir %{_includedir}/open62541 +-%{_includedir}/open62541/* +-%{_libdir}/cmake/open62541* +-%dir %{_exec_prefix}/share/open62541 +-%{_exec_prefix}/share/open62541/* +- +-%doc FEATURES.md +-%doc examples/ +- +-%changelog +-* Tue Sep 05 2017 Jens Reimann - 0.3-1 +-- New version of open62541 +-- Adapt for cmake3 +-* Thu Aug 31 2017 Jens Reimann - 0.2-1 +-- Initial version of the package +- +diff --git a/tools/cmake/SetGitBasedVersion.cmake b/tools/cmake/SetGitBasedVersion.cmake +deleted file mode 100644 +index 1816568e..00000000 +--- a/tools/cmake/SetGitBasedVersion.cmake ++++ /dev/null +@@ -1,85 +0,0 @@ +-get_filename_component(VERSION_SRC_DIR ${CMAKE_CURRENT_LIST_DIR} DIRECTORY) +-set(VERSION_SRC_DIR "${VERSION_SRC_DIR}/..") +- +-find_package(Git) +- +-function(set_open62541_version) +- +- # Generate a git-describe version string from Git repository tags +- if(GIT_EXECUTABLE AND NOT DEFINED OPEN62541_VERSION) +- execute_process( +- COMMAND ${GIT_EXECUTABLE} describe --tags --dirty --match "v*" +- WORKING_DIRECTORY "${VERSION_SRC_DIR}" +- OUTPUT_VARIABLE GIT_DESCRIBE_VERSION +- RESULT_VARIABLE GIT_DESCRIBE_ERROR_CODE +- OUTPUT_STRIP_TRAILING_WHITESPACE +- ) +- if(NOT GIT_DESCRIBE_ERROR_CODE) +- +- # Example values can be: +- # v1.2 +- # v1.2.3 +- # v1.2.3-rc1 +- # v1.2.3-rc1-dirty +- # v1.2.3-5-g4538abcd +- # v1.2.3-5-g4538abcd-dirty +- +- set(OPEN62541_VERSION ${GIT_DESCRIBE_VERSION}) +- endif() +- endif() +- +- if(OPEN62541_VERSION) +- STRING(REGEX REPLACE "^(v[0-9\\.]+)(.*)$" +- "\\1" +- GIT_VERSION_NUMBERS +- "${OPEN62541_VERSION}" ) +- STRING(REGEX REPLACE "^v([0-9\\.]+)(.*)$" +- "\\2" +- GIT_VERSION_LABEL +- "${OPEN62541_VERSION}" ) +- +- if("${GIT_VERSION_NUMBERS}" MATCHES "^v([0-9]+)(.*)$") +- STRING(REGEX REPLACE "^v([0-9]+)\\.?(.*)$" +- "\\1" +- GIT_VER_MAJOR +- "${GIT_VERSION_NUMBERS}" ) +- if("${GIT_VERSION_NUMBERS}" MATCHES "^v([0-9]+)\\.([0-9]+)(.*)$") +- STRING(REGEX REPLACE "^v([0-9]+)\\.([0-9]+)(.*)$" +- "\\2" +- GIT_VER_MINOR +- "${GIT_VERSION_NUMBERS}" ) +- if("${GIT_VERSION_NUMBERS}" MATCHES "^v([0-9]+)\\.([0-9]+)\\.([0-9]+)(.*)$") +- STRING(REGEX REPLACE "^v([0-9]+)\\.([0-9]+)\\.([0-9]+)(.*)$" +- "\\3" +- GIT_VER_PATCH +- "${GIT_VERSION_NUMBERS}" ) +- else() +- set(GIT_VER_PATCH 0) +- endif() +- else() +- set(GIT_VER_MINOR 0) +- set(GIT_VER_PATCH 0) +- endif() +- +- else() +- set(GIT_VER_MAJOR 0) +- set(GIT_VER_MINOR 0) +- set(GIT_VER_PATCH 0) +- endif() +- set(OPEN62541_VER_MAJOR ${GIT_VER_MAJOR} PARENT_SCOPE) +- set(OPEN62541_VER_MINOR ${GIT_VER_MINOR} PARENT_SCOPE) +- set(OPEN62541_VER_PATCH ${GIT_VER_PATCH} PARENT_SCOPE) +- set(OPEN62541_VER_LABEL "${GIT_VERSION_LABEL}" PARENT_SCOPE) +- set(OPEN62541_VER_COMMIT ${OPEN62541_VERSION} PARENT_SCOPE) +- else() +- # Final fallback: Just use a bogus version string that is semantically older +- # than anything else and spit out a warning to the developer. +- set(OPEN62541_VERSION "v0.0.0-unknown" PARENT_SCOPE) +- set(OPEN62541_VER_MAJOR 0 PARENT_SCOPE) +- set(OPEN62541_VER_MINOR 0 PARENT_SCOPE) +- set(OPEN62541_VER_PATCH 0 PARENT_SCOPE) +- set(OPEN62541_VER_LABEL "-unknown" PARENT_SCOPE) +- set(OPEN62541_VER_COMMIT "undefined" PARENT_SCOPE) +- message(WARNING "Failed to determine OPEN62541_VERSION from repository tags. Using default version \"${OPEN62541_VERSION}\".") +- endif() +-endfunction() +diff --git a/tools/packaging/CMakeLists.txt b/tools/packaging/CMakeLists.txt +deleted file mode 100644 +index 87fd02f5..00000000 +--- a/tools/packaging/CMakeLists.txt ++++ /dev/null +@@ -1,17 +0,0 @@ +-########################## +-# Packaging (DEB/RPM) # +-########################## +-# invoke via `make package` +- +-set(CPACK_GENERATOR "TGZ;DEB;RPM") +-set(CPACK_PACKAGE_VENDOR "open62541 team") +-set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "OPC UA implementation") +-set(CPACK_PACKAGE_DESCRIPTION "open62541 is a C-based library (linking with C++ projects is possible) with all necessary tools to implement dedicated OPC UA clients and servers, or to integrate OPC UA-based communication into existing applications.") +-set(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/README.md") +-set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE") +-set(CPACK_PACKAGE_VERSION_MAJOR "${OPEN62541_VER_MAJOR}") +-set(CPACK_PACKAGE_VERSION_MINOR "${OPEN62541_VER_MINOR}") +-set(CPACK_PACKAGE_VERSION_PATCH "${OPEN62541_VER_PATCH}${OPEN62541_VER_LABEL}") +-set(CPACK_DEBIAN_PACKAGE_MAINTAINER "open62541 team") #required +- +-include(CPack) +diff --git a/tools/packaging/tito/tito.props b/tools/packaging/tito/tito.props +deleted file mode 100644 +index eab3f190..00000000 +--- a/tools/packaging/tito/tito.props ++++ /dev/null +@@ -1,5 +0,0 @@ +-[buildconfig] +-builder = tito.builder.Builder +-tagger = tito.tagger.VersionTagger +-changelog_do_not_remove_cherrypick = 0 +-changelog_format = %s (%ae) +diff --git a/tools/prepare_packaging.py b/tools/prepare_packaging.py +deleted file mode 100644 +index c8b9f58c..00000000 +--- a/tools/prepare_packaging.py ++++ /dev/null +@@ -1,101 +0,0 @@ +-#!/usr/bin/env python +- +-# This Source Code Form is subject to the terms of the Mozilla Public +-# License, v. 2.0. If a copy of the MPL was not distributed with this +-# file, You can obtain one at http://mozilla.org/MPL/2.0/. +- +-import subprocess +-import os +-import re +-from email.utils import formatdate +- +- +-dirpath = os.path.join(os.path.dirname(os.path.realpath(__file__)),"..") +- +-git_describe_version = subprocess.check_output(["git", "describe", "--tags", "--dirty", "--match", "v*"]).decode('utf-8').strip() +- +-# v1.2 +-# v1.2.3 +-# v1.2.3-rc1 +-# v1.2.3-rc1-dirty +-# v1.2.3-5-g4538abcd +-# v1.2.3-5-g4538abcd-dirty +-# git_describe_version = "v1.2.3" +- +-m = re.match(r"^v([0-9]+)(\.[0-9]+)?(\.[0-9]+)?(-(.*)+)?$", git_describe_version) +-version_major = m.group(1) if m.group(1) is not None else "0" +-version_minor = m.group(2).replace(".", "") if m.group(2) is not None else "0" +-version_patch = m.group(3).replace(".", "") if m.group(3) is not None else "0" +-version_label = m.group(4) if m.group(4) is not None else "" +-#print("major {} minor {} patch {} label {}".format(version_major, version_minor, version_patch, version_label)) +- +-# We can not use unstable for now, because dpkg-buildpackage wants to sign them +-# It will fail with gpg: skipped "open62541 Team ": No secret key +-#debian_distribution = "unstable" +-#if version_label is not "": +-debian_distribution = "UNRELEASED" +- +-debian_path = os.path.join(dirpath, "debian") +-changelog_file = os.path.join(debian_path, "changelog") +- +-# remove leading 'v' +-changelog_version = git_describe_version[1:] if git_describe_version[0] == 'v' else git_describe_version +-# replace all '-' with '~' in version +-changelog_version = changelog_version.replace('-', '~') +- +-with open(changelog_file, 'r') as original: data = original.read() +-with open(changelog_file, 'w') as modified: +- new_entry = """open62541 ({version}) {distribution}; urgency=medium +- +- * Full changelog is available here: +- https://github.com/open62541/open62541/blob/master/CHANGELOG +- +- -- open62541 Team {time} +-""".format(version=changelog_version, time=formatdate(), distribution = debian_distribution) +- +- modified.write(new_entry + "\n" + data) +- +-# Create control file and replace template variables +-control_file_template = os.path.join(debian_path, "control-template") +-control_file = os.path.join(debian_path, "control") +-os.rename(control_file_template, control_file) +- +-with open(control_file, 'r+') as f: +- content = f.read() +- f.seek(0) +- f.truncate() +- f.write(content.replace('', "{}".format(version_major))) +- +- +-# rename the install template to match the soname +-install_file_template = os.path.join(debian_path, "libopen62541.install-template") +-install_file = os.path.join(debian_path, "libopen62541-{}.install".format(version_major)) +-os.rename(install_file_template, install_file) +- +-install_file_template = os.path.join(debian_path, "libopen62541-dev.install-template") +-install_file = os.path.join(debian_path, "libopen62541-{}-dev.install".format(version_major)) +-os.rename(install_file_template, install_file) +- +- +-# Create rule file and replace template variables +-rule_file_template = os.path.join(debian_path, "rules-template") +-rule_file = os.path.join(debian_path, "rules") +-os.rename(rule_file_template, rule_file) +- +-with open(rule_file, 'r+') as f: +- content = f.read() +- f.seek(0) +- f.truncate() +- content = content.replace('', "{}".format(version_major)) +- f.write(content) +- +-# Update CMakeLists.txt to include full version string +- +-with open(os.path.join(dirpath,"CMakeLists.txt"), 'r+') as f: +- lines = f.readlines() +- f.seek(0) +- f.truncate() +- for idx, line in enumerate(lines): +- if idx == 2: +- f.write('set(OPEN62541_VERSION "{}")\n'.format(git_describe_version)) +- f.write(line) diff --git a/recipes/open62541/all/patches/add_conan_center_index_compliance_v_1_0_1.patch b/recipes/open62541/all/patches/add_conan_center_index_compliance_v_1_0_1.patch new file mode 100644 index 0000000000000..0befb67f685ed --- /dev/null +++ b/recipes/open62541/all/patches/add_conan_center_index_compliance_v_1_0_1.patch @@ -0,0 +1,477 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6156c9b7..6590b4f2 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -9,7 +9,6 @@ string(TOLOWER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_LOWER_CASE) + + set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/tools/cmake") + find_package(PythonInterp REQUIRED) +-find_package(Git) + include(AssignSourceGroup) + include(GNUInstallDirs) + +@@ -28,17 +27,6 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) + +-########### +-# Version # +-########### +- +-include(SetGitBasedVersion) +- +-# The version string will be automatically set based on the git describe output. +-# This will automate the version strings. Just create a new tag, and the version will be set correctly. +-set_open62541_version() +-MESSAGE(STATUS "open62541 Version: ${OPEN62541_VER_MAJOR}.${OPEN62541_VER_MINOR}.${OPEN62541_VER_PATCH}${OPEN62541_VER_LABEL}") +- + ################# + # Build Options # + ################# +@@ -514,7 +502,6 @@ endif() + + file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/src_generated") + configure_file(include/open62541/config.h.in ${PROJECT_BINARY_DIR}/src_generated/open62541/config.h) +-configure_file(open62541.pc.in ${PROJECT_BINARY_DIR}/src_generated/open62541.pc @ONLY) + + if(UA_ENABLE_DISCOVERY_MULTICAST) + set(MDNSD_LOGLEVEL 300 CACHE STRING "Level at which logs shall be reported" FORCE) +@@ -1106,8 +1093,6 @@ include(linting_target) + # Enable shared library with `-DBUILD_SHARED_LIBS=ON` + + set(cmake_configfile_install ${CMAKE_INSTALL_LIBDIR}/cmake/open62541) +-set(open62541_install_tools_dir share/open62541/tools) +-set(open62541_install_nodeset_dir share/open62541/tools/ua-nodeset) + + # This list of components allows to define a find_package requirement. + # E.g.: +@@ -1169,22 +1154,6 @@ if(UA_ENABLE_AMALGAMATION) + install(CODE "MESSAGE(WARNING \"Installation with UA_ENABLE_AMALGAMATION=ON is not recommended.\")") + endif() + +-include(CMakePackageConfigHelpers) +-configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/tools/cmake/open62541Config.cmake.in" +- "${CMAKE_CURRENT_BINARY_DIR}/open62541Config.cmake" +- INSTALL_DESTINATION "${cmake_configfile_install}" +- PATH_VARS open62541_install_tools_dir +- open62541_install_nodeset_dir +- open62541_enabled_components +- ) +- +-set(open62541_VERSION) +-get_target_property(open62541_VERSION open62541 VERSION) +- +-write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/open62541ConfigVersion.cmake" +- VERSION ${open62541_VERSION} +- COMPATIBILITY AnyNewerVersion) +- + install(EXPORT open62541Targets + FILE open62541Targets.cmake + DESTINATION "${cmake_configfile_install}" +@@ -1198,35 +1167,9 @@ export( + + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/tools/cmake/macros_public.cmake" "${CMAKE_CURRENT_BINARY_DIR}/open62541Macros.cmake" COPYONLY) + +-install(FILES "${CMAKE_CURRENT_BINARY_DIR}/open62541Config.cmake" +- "${CMAKE_CURRENT_BINARY_DIR}/open62541ConfigVersion.cmake" +- "${CMAKE_CURRENT_BINARY_DIR}/open62541Macros.cmake" ++install(FILES "${CMAKE_CURRENT_BINARY_DIR}/open62541Macros.cmake" + DESTINATION "${cmake_configfile_install}") + +-if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") +- install(FILES "${PROJECT_BINARY_DIR}/src_generated/open62541.pc" +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) +-endif() +- +-set(UA_install_tools_dirs "tools/certs" +- "tools/nodeset_compiler" +- "tools/schema" +- "deps/ua-nodeset") +- +-set(UA_install_tools_files "tools/generate_datatypes.py" +- "tools/generate_nodeid_header.py" +- "tools/generate_statuscode_descriptions.py") +- +-install(DIRECTORY ${UA_install_tools_dirs} +- DESTINATION ${open62541_install_tools_dir} +- USE_SOURCE_PERMISSIONS +- FILES_MATCHING +- PATTERN "*" +- PATTERN "*.pyc" EXCLUDE +- ) +- +-install(FILES ${UA_install_tools_files} DESTINATION ${open62541_install_tools_dir}) +- + if (UA_PACK_DEBIAN) + set(UA_install_examples_dirs "examples/" + "examples/access_control" +@@ -1235,9 +1178,6 @@ if (UA_PACK_DEBIAN) + "examples/encryption" + "examples/nodeset" + "examples/pubsub") +- +- set(open62541_install_examples_dir share/open62541/examples) +- install(DIRECTORY ${UA_install_examples_dirs} COMPONENT examples DESTINATION ${open62541_install_examples_dir} USE_SOURCE_PERMISSIONS) + endif() + + if(NOT UA_ENABLE_AMALGAMATION) +@@ -1273,8 +1213,6 @@ else() + install(FILES ${PROJECT_BINARY_DIR}/open62541.h DESTINATION include) + endif() + +-add_subdirectory(tools/packaging) +- + ################################## + # Visual studio solution folders # + ################################## +diff --git a/debian/libopen62541-dev.install-template b/debian/libopen62541-dev.install-template +deleted file mode 100644 +index ff354feb..00000000 +--- a/debian/libopen62541-dev.install-template ++++ /dev/null +@@ -1,5 +0,0 @@ +-usr/include +-usr/lib/*/*.so +-usr/lib/*/*.a +-usr/lib/*/cmake/open62541/* +-usr/lib/*/pkgconfig/open62541.pc +diff --git a/open62541.pc.in b/open62541.pc.in +deleted file mode 100644 +index 53d8e8ed..00000000 +--- a/open62541.pc.in ++++ /dev/null +@@ -1,15 +0,0 @@ +-/* This Source Code Form is subject to the terms of the Mozilla Public +- * License, v. 2.0. If a copy of the MPL was not distributed with this +- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +- +-prefix=@CMAKE_INSTALL_PREFIX@ +-exec_prefix=${prefix} +-libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ +-sharedlibdir=${libdir} +-includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ +- +-Name: open62541 +-Description: open62541 is an open source C (C99) implementation of OPC UA +-Version: @OPEN62541_VER_MAJOR@.@OPEN62541_VER_MINOR@.@OPEN62541_VER_PATCH@ +-Libs: -L${libdir} -lopen62541 +-Cflags: -I${includedir}/open62541 +diff --git a/open62541.spec b/open62541.spec +deleted file mode 100644 +index 771e35a3..00000000 +--- a/open62541.spec ++++ /dev/null +@@ -1,65 +0,0 @@ +-Name: open62541 +-Version: 1.0.1 +-Release: 1%{?dist} +-Summary: OPC UA implementation +-License: MPLv2.0 +-URL: http://open62541.org +-Source0: https://github.com/open62541/open62541/archive/%{name}-%{version}.tar.gz +- +-BuildRequires: cmake3, python +- +-%description +-open62541 is a C-based library (linking with C++ projects is possible) +-with all necessary tools to implement dedicated OPC UA clients and servers, +-or to integrate OPC UA-based communication into existing applications. +- +-%package devel +-Summary: Development files for %{name} +-Requires: %{name}%{?_isa} = %{version}-%{release} +- +-%description devel +-The %{name}-devel package contains libraries and header files for +-developing applications that use %{name}. +- +-%prep +-%setup -q -n %{name}-%{name}-%{version} # double-name prefix by GitHub +- +-%build +-%cmake3 -DUA_ENABLE_AMALGAMATION=ON . +-make +- +-%install +-%make_install +- +-# Remove this from the examples installation +-rm examples/CMakeLists.txt +- +-%post -p /sbin/ldconfig +- +-%postun -p /sbin/ldconfig +- +-%files +-%license LICENSE +-%doc AUTHORS CHANGELOG README.md +-%{_libdir}/libopen62541.so.* +- +-%files devel +-%license LICENSE LICENSE-CC0 +-%{_libdir}/libopen62541.so +-%{_libdir}/pkgconfig/open62541.pc +-%dir %{_includedir}/open62541 +-%{_includedir}/open62541/* +-%{_libdir}/cmake/open62541* +-%dir %{_exec_prefix}/share/open62541 +-%{_exec_prefix}/share/open62541/* +- +-%doc FEATURES.md +-%doc examples/ +- +-%changelog +-* Tue Sep 05 2017 Jens Reimann - 0.3-1 +-- New version of open62541 +-- Adapt for cmake3 +-* Thu Aug 31 2017 Jens Reimann - 0.2-1 +-- Initial version of the package +- +diff --git a/tools/cmake/SetGitBasedVersion.cmake b/tools/cmake/SetGitBasedVersion.cmake +deleted file mode 100644 +index 1816568e..00000000 +--- a/tools/cmake/SetGitBasedVersion.cmake ++++ /dev/null +@@ -1,85 +0,0 @@ +-get_filename_component(VERSION_SRC_DIR ${CMAKE_CURRENT_LIST_DIR} DIRECTORY) +-set(VERSION_SRC_DIR "${VERSION_SRC_DIR}/..") +- +-find_package(Git) +- +-function(set_open62541_version) +- +- # Generate a git-describe version string from Git repository tags +- if(GIT_EXECUTABLE AND NOT DEFINED OPEN62541_VERSION) +- execute_process( +- COMMAND ${GIT_EXECUTABLE} describe --tags --dirty --match "v*" +- WORKING_DIRECTORY "${VERSION_SRC_DIR}" +- OUTPUT_VARIABLE GIT_DESCRIBE_VERSION +- RESULT_VARIABLE GIT_DESCRIBE_ERROR_CODE +- OUTPUT_STRIP_TRAILING_WHITESPACE +- ) +- if(NOT GIT_DESCRIBE_ERROR_CODE) +- +- # Example values can be: +- # v1.2 +- # v1.2.3 +- # v1.2.3-rc1 +- # v1.2.3-rc1-dirty +- # v1.2.3-5-g4538abcd +- # v1.2.3-5-g4538abcd-dirty +- +- set(OPEN62541_VERSION ${GIT_DESCRIBE_VERSION}) +- endif() +- endif() +- +- if(OPEN62541_VERSION) +- STRING(REGEX REPLACE "^(v[0-9\\.]+)(.*)$" +- "\\1" +- GIT_VERSION_NUMBERS +- "${OPEN62541_VERSION}" ) +- STRING(REGEX REPLACE "^v([0-9\\.]+)(.*)$" +- "\\2" +- GIT_VERSION_LABEL +- "${OPEN62541_VERSION}" ) +- +- if("${GIT_VERSION_NUMBERS}" MATCHES "^v([0-9]+)(.*)$") +- STRING(REGEX REPLACE "^v([0-9]+)\\.?(.*)$" +- "\\1" +- GIT_VER_MAJOR +- "${GIT_VERSION_NUMBERS}" ) +- if("${GIT_VERSION_NUMBERS}" MATCHES "^v([0-9]+)\\.([0-9]+)(.*)$") +- STRING(REGEX REPLACE "^v([0-9]+)\\.([0-9]+)(.*)$" +- "\\2" +- GIT_VER_MINOR +- "${GIT_VERSION_NUMBERS}" ) +- if("${GIT_VERSION_NUMBERS}" MATCHES "^v([0-9]+)\\.([0-9]+)\\.([0-9]+)(.*)$") +- STRING(REGEX REPLACE "^v([0-9]+)\\.([0-9]+)\\.([0-9]+)(.*)$" +- "\\3" +- GIT_VER_PATCH +- "${GIT_VERSION_NUMBERS}" ) +- else() +- set(GIT_VER_PATCH 0) +- endif() +- else() +- set(GIT_VER_MINOR 0) +- set(GIT_VER_PATCH 0) +- endif() +- +- else() +- set(GIT_VER_MAJOR 0) +- set(GIT_VER_MINOR 0) +- set(GIT_VER_PATCH 0) +- endif() +- set(OPEN62541_VER_MAJOR ${GIT_VER_MAJOR} PARENT_SCOPE) +- set(OPEN62541_VER_MINOR ${GIT_VER_MINOR} PARENT_SCOPE) +- set(OPEN62541_VER_PATCH ${GIT_VER_PATCH} PARENT_SCOPE) +- set(OPEN62541_VER_LABEL "${GIT_VERSION_LABEL}" PARENT_SCOPE) +- set(OPEN62541_VER_COMMIT ${OPEN62541_VERSION} PARENT_SCOPE) +- else() +- # Final fallback: Just use a bogus version string that is semantically older +- # than anything else and spit out a warning to the developer. +- set(OPEN62541_VERSION "v0.0.0-unknown" PARENT_SCOPE) +- set(OPEN62541_VER_MAJOR 0 PARENT_SCOPE) +- set(OPEN62541_VER_MINOR 0 PARENT_SCOPE) +- set(OPEN62541_VER_PATCH 0 PARENT_SCOPE) +- set(OPEN62541_VER_LABEL "-unknown" PARENT_SCOPE) +- set(OPEN62541_VER_COMMIT "undefined" PARENT_SCOPE) +- message(WARNING "Failed to determine OPEN62541_VERSION from repository tags. Using default version \"${OPEN62541_VERSION}\".") +- endif() +-endfunction() +diff --git a/tools/packaging/CMakeLists.txt b/tools/packaging/CMakeLists.txt +deleted file mode 100644 +index 87fd02f5..00000000 +--- a/tools/packaging/CMakeLists.txt ++++ /dev/null +@@ -1,17 +0,0 @@ +-########################## +-# Packaging (DEB/RPM) # +-########################## +-# invoke via `make package` +- +-set(CPACK_GENERATOR "TGZ;DEB;RPM") +-set(CPACK_PACKAGE_VENDOR "open62541 team") +-set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "OPC UA implementation") +-set(CPACK_PACKAGE_DESCRIPTION "open62541 is a C-based library (linking with C++ projects is possible) with all necessary tools to implement dedicated OPC UA clients and servers, or to integrate OPC UA-based communication into existing applications.") +-set(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/README.md") +-set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE") +-set(CPACK_PACKAGE_VERSION_MAJOR "${OPEN62541_VER_MAJOR}") +-set(CPACK_PACKAGE_VERSION_MINOR "${OPEN62541_VER_MINOR}") +-set(CPACK_PACKAGE_VERSION_PATCH "${OPEN62541_VER_PATCH}${OPEN62541_VER_LABEL}") +-set(CPACK_DEBIAN_PACKAGE_MAINTAINER "open62541 team") #required +- +-include(CPack) +diff --git a/tools/packaging/tito/tito.props b/tools/packaging/tito/tito.props +deleted file mode 100644 +index eab3f190..00000000 +--- a/tools/packaging/tito/tito.props ++++ /dev/null +@@ -1,5 +0,0 @@ +-[buildconfig] +-builder = tito.builder.Builder +-tagger = tito.tagger.VersionTagger +-changelog_do_not_remove_cherrypick = 0 +-changelog_format = %s (%ae) +diff --git a/tools/prepare_packaging.py b/tools/prepare_packaging.py +deleted file mode 100644 +index 6bcc033f..00000000 +--- a/tools/prepare_packaging.py ++++ /dev/null +@@ -1,117 +0,0 @@ +-#!/usr/bin/env python +- +-# This Source Code Form is subject to the terms of the Mozilla Public +-# License, v. 2.0. If a copy of the MPL was not distributed with this +-# file, You can obtain one at http://mozilla.org/MPL/2.0/. +- +-import subprocess +-import os +-import re +-from email.utils import formatdate +-import datetime +- +- +-dirpath = os.path.join(os.path.dirname(os.path.realpath(__file__)),"..") +- +-git_describe_version = subprocess.check_output(["git", "describe", "--tags", "--dirty", "--match", "v*"]).decode('utf-8').strip() +- +-# v1.2 +-# v1.2.3 +-# v1.2.3-rc1 +-# v1.2.3-rc1-dirty +-# v1.2.3-5-g4538abcd +-# v1.2.3-5-g4538abcd-dirty +-# git_describe_version = "v1.2.3" +- +-m = re.match(r"^v([0-9]+)(\.[0-9]+)?(\.[0-9]+)?(-(.*)+)?$", git_describe_version) +-version_major = m.group(1) if m.group(1) is not None else "0" +-version_minor = m.group(2).replace(".", "") if m.group(2) is not None else "0" +-version_patch = m.group(3).replace(".", "") if m.group(3) is not None else "0" +-version_label = m.group(4) if m.group(4) is not None else "" +-#print("major {} minor {} patch {} label {}".format(version_major, version_minor, version_patch, version_label)) +- +-# We can not use unstable for now, because dpkg-buildpackage wants to sign them +-# It will fail with gpg: skipped "open62541 Team ": No secret key +-#debian_distribution = "unstable" +-#if version_label is not "": +-debian_distribution = "UNRELEASED" +- +-debian_path = os.path.join(dirpath, "debian") +-changelog_file = os.path.join(debian_path, "changelog") +- +-# remove leading 'v' +-changelog_version = git_describe_version[1:] if git_describe_version[0] == 'v' else git_describe_version +-# replace all '-' with '~' in version +-changelog_version = changelog_version.replace('-', '~') +- +-# prefix the version string with the current ISO datetime to ensure correct version ordering. +-# See https://github.com/open62541/open62541/issues/3140 +-changelog_version = datetime.datetime.utcnow().replace(microsecond=0).isoformat().replace('-', '').replace(':', '') + '~' + changelog_version +- +-with open(changelog_file, 'r') as original: data = original.read() +-with open(changelog_file, 'w') as modified: +- new_entry = """open62541 ({version}) {distribution}; urgency=medium +- +- * Full changelog is available here: +- https://github.com/open62541/open62541/blob/master/CHANGELOG +- +- -- open62541 Team {time} +-""".format(version=changelog_version, time=formatdate(), distribution = debian_distribution) +- +- modified.write(new_entry + "\n" + data) +- +-# Create control file and replace template variables +-control_file_template = os.path.join(debian_path, "control-template") +-control_file = os.path.join(debian_path, "control") +-os.rename(control_file_template, control_file) +- +-with open(control_file, 'r+') as f: +- content = f.read() +- f.seek(0) +- f.truncate() +- f.write(content.replace('', "{}".format(version_major))) +- +- +-# rename the install template to match the soname +-install_file_template = os.path.join(debian_path, "libopen62541.install-template") +-install_file = os.path.join(debian_path, "libopen62541-{}.install".format(version_major)) +-os.rename(install_file_template, install_file) +- +-install_file_template = os.path.join(debian_path, "libopen62541-dev.install-template") +-install_file = os.path.join(debian_path, "libopen62541-{}-dev.install".format(version_major)) +-os.rename(install_file_template, install_file) +- +-install_file_template = os.path.join(debian_path, "libopen62541-tools.install-template") +-install_file = os.path.join(debian_path, "libopen62541-{}-tools.install".format(version_major)) +-os.rename(install_file_template, install_file) +- +-install_file_template = os.path.join(debian_path, "open62541-doc.doc-base-template") +-install_file = os.path.join(debian_path, "open62541-doc.doc-base") +-os.rename(install_file_template, install_file) +- +-install_file_template = os.path.join(debian_path, "open62541-doc.install-template") +-install_file = os.path.join(debian_path, "open62541-doc.install") +-os.rename(install_file_template, install_file) +- +-# Create rule file and replace template variables +-rule_file_template = os.path.join(debian_path, "rules-template") +-rule_file = os.path.join(debian_path, "rules") +-os.rename(rule_file_template, rule_file) +- +-with open(rule_file, 'r+') as f: +- content = f.read() +- f.seek(0) +- f.truncate() +- content = content.replace('', "{}".format(version_major)) +- f.write(content) +- +-# Update CMakeLists.txt to include full version string +- +-with open(os.path.join(dirpath,"CMakeLists.txt"), 'r+') as f: +- lines = f.readlines() +- f.seek(0) +- f.truncate() +- for idx, line in enumerate(lines): +- if idx == 2: +- f.write('set(OPEN62541_VERSION "{}")\n'.format(git_describe_version)) +- f.write(line) diff --git a/recipes/open62541/all/test_package/CMakeLists.txt b/recipes/open62541/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8199f276a0ddd --- /dev/null +++ b/recipes/open62541/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 2.8.12) +project(PackageTest CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(example example.cpp) +target_link_libraries(example ${CONAN_LIBS} pthread) diff --git a/recipes/open62541/all/test_package/conanfile.py b/recipes/open62541/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3719c670ef103 --- /dev/null +++ b/recipes/open62541/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class Open62541TestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + os.chdir("bin") + self.run(".%sexample" % os.sep) diff --git a/recipes/open62541/all/test_package/example.cpp b/recipes/open62541/all/test_package/example.cpp new file mode 100644 index 0000000000000..e0529c57f5429 --- /dev/null +++ b/recipes/open62541/all/test_package/example.cpp @@ -0,0 +1,31 @@ +#include +#include +#include + +#include +#include + +static volatile UA_Boolean running = true; + +void *run(void *arg) { + UA_Server *server = (UA_Server *)arg; + return (void *)UA_Server_run(server, &running); +} + +int main(void) { + + UA_Server *server = UA_Server_new(); + UA_ServerConfig_setDefault(UA_Server_getConfig(server)); + + pthread_t server_thread; + pthread_create(&server_thread, NULL, run, (void *)server); + + sleep(1); + running = false; + void *returnCode; + pthread_join(server_thread, &returnCode); + UA_StatusCode retval = *((unsigned int *)(&returnCode)); + + UA_Server_delete(server); + return retval == UA_STATUSCODE_GOOD ? EXIT_SUCCESS : EXIT_FAILURE; +} diff --git a/recipes/open62541/config.yml b/recipes/open62541/config.yml new file mode 100644 index 0000000000000..5e61e3082c4f0 --- /dev/null +++ b/recipes/open62541/config.yml @@ -0,0 +1,5 @@ +versions: + "1.0.0": + folder: all + "1.0.1": + folder: all From 98a1e391c84ed22070c7ea4af0cd543be8505f2c Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Wed, 20 May 2020 15:58:45 +0200 Subject: [PATCH 02/81] fix package versioning --- recipes/open62541/all/conandata.yml | 4 ++-- recipes/open62541/all/conanfile.py | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/recipes/open62541/all/conandata.yml b/recipes/open62541/all/conandata.yml index 2b6b3a3589b0a..cfffd972bf2f0 100644 --- a/recipes/open62541/all/conandata.yml +++ b/recipes/open62541/all/conandata.yml @@ -1,12 +1,12 @@ sources: - "1.0": + "1.0.0": url: "https://github.com/open62541/open62541/archive/v1.0.tar.gz" sha256: "9be66efefe2cdb07a7638aad91c301b5c6163f99c66995bc41cce31ec0ea207e" "1.0.1": url: "https://github.com/open62541/open62541/archive/v1.0.1.tar.gz" sha256: "ae9fac217267bccdf360fe0f1788f4d65875b06028404cf2440600927d2b3ad3" patches: - "1.0": + "1.0.0": - patch_file: "patches/add_conan_center_index_compliance_v_1_0.patch" base_path: "source_subfolder" "1.0.1": diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index 0c64d7bfbc9bf..220252e8499fa 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -123,7 +123,10 @@ def _patch_sources(self): def source(self): tools.get(**self.conan_data["sources"][self.version]) - folder_name = "%s-%s" % (self.name, self.version) + if Version(self.version) <= "1.0.0": + folder_name = "%s-%s" % (self.name, "1.0") + else: + folder_name = "%s-%s" % (self.name, self.version) os.rename(folder_name, self._source_subfolder) if Version(self.version) <= "1.0.1": self._download_ua_nodes() From 29f1e5d9de502d59e021f000a6579fee4392b6a6 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Wed, 20 May 2020 16:34:55 +0200 Subject: [PATCH 03/81] fix fPIC managment for Windows --- recipes/open62541/all/conanfile.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index 220252e8499fa..8591aaa964a23 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -121,6 +121,10 @@ def _patch_sources(self): for patch in self.conan_data["patches"][self.version]: tools.patch(**patch) + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + def source(self): tools.get(**self.conan_data["sources"][self.version]) if Version(self.version) <= "1.0.0": From a369bc611367b57cff3d7657617dfd2ab38627e7 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Wed, 20 May 2020 16:42:52 +0200 Subject: [PATCH 04/81] remove AddSan flags for Debug setup with Clang --- recipes/open62541/all/conanfile.py | 9 ----- ..._conan_center_index_compliance_v_1_0.patch | 31 +++++++++++++---- ...onan_center_index_compliance_v_1_0_1.patch | 33 +++++++++++++++---- 3 files changed, 51 insertions(+), 22 deletions(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index 8591aaa964a23..64effd1f00ff8 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -207,12 +207,3 @@ def package_info(self): os.path.join("lib", "cmake"), os.path.join("lib", "cmake", "open62541") ] - if Version(self.version) > "1.0.1" and self.settings.build_type == "Debug" and self.settings.compiler == "clang": - self.cpp_info.cflags = ["-fsanitize=address"] - self.cpp_info.cflags.append('-fsanitize-address-use-after-scope') - self.cpp_info.cflags.append( - '-fsanitize-coverage=trace-pc-guard,trace-cmp') - self.cpp_info.cflags.append('-fsanitize=leak') - self.cpp_info.cflags.append('-fsanitize=undefined') - self.cpp_info.cxxflags = self.cpp_info.cflags - self.cpp_info.sharedlinkflags = ["-fsanitize=address"] diff --git a/recipes/open62541/all/patches/add_conan_center_index_compliance_v_1_0.patch b/recipes/open62541/all/patches/add_conan_center_index_compliance_v_1_0.patch index 8e13e9cadbe16..21e8e0e532550 100644 --- a/recipes/open62541/all/patches/add_conan_center_index_compliance_v_1_0.patch +++ b/recipes/open62541/all/patches/add_conan_center_index_compliance_v_1_0.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index d426e1da..b8e0374c 100644 +index d426e1da..1f7ca494 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,6 @@ string(TOLOWER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_LOWER_CASE) @@ -28,7 +28,26 @@ index d426e1da..b8e0374c 100644 ################# # Build Options # ################# -@@ -514,7 +502,6 @@ endif() +@@ -440,18 +428,6 @@ if(NOT UA_COMPILE_AS_CXX AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID + # Linker + set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # cmake sets -rdynamic by default + +- # Debug +- if(BUILD_TYPE_LOWER_CASE STREQUAL "debug" AND UNIX) +- if("x${CMAKE_C_COMPILER_ID}" STREQUAL "xClang" AND NOT UA_ENABLE_UNIT_TESTS_MEMCHECK) +- # Add default sanitizer settings when using clang and Debug build. +- # This allows e.g. CLion to find memory locations for SegFaults +- message(STATUS "Sanitizer enabled") +- set(SANITIZER_FLAGS "-g -fno-omit-frame-pointer -gline-tables-only -fsanitize=address -fsanitize-address-use-after-scope -fsanitize-coverage=trace-pc-guard,trace-cmp -fsanitize=leak -fsanitize=undefined") +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SANITIZER_FLAGS}") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SANITIZER_FLAGS}") +- endif() +- endif() +- + if(UA_ENABLE_HARDENING AND ((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))) + check_cc_flag("-D_FORTIFY_SOURCE=2") # run-time buffer overflow detection (needs at least -O1) + endif() +@@ -514,7 +490,6 @@ endif() file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/src_generated") configure_file(include/open62541/config.h.in ${PROJECT_BINARY_DIR}/src_generated/open62541/config.h) @@ -36,7 +55,7 @@ index d426e1da..b8e0374c 100644 if(UA_ENABLE_DISCOVERY_MULTICAST) set(MDNSD_LOGLEVEL 300 CACHE STRING "Level at which logs shall be reported" FORCE) -@@ -1102,8 +1089,6 @@ include(linting_target) +@@ -1102,8 +1077,6 @@ include(linting_target) # Enable shared library with `-DBUILD_SHARED_LIBS=ON` set(cmake_configfile_install ${CMAKE_INSTALL_LIBDIR}/cmake/open62541) @@ -45,7 +64,7 @@ index d426e1da..b8e0374c 100644 # This list of components allows to define a find_package requirement. # E.g.: -@@ -1160,22 +1145,6 @@ if(UA_ENABLE_AMALGAMATION) +@@ -1160,22 +1133,6 @@ if(UA_ENABLE_AMALGAMATION) install(CODE "MESSAGE(WARNING \"Installation with UA_ENABLE_AMALGAMATION=ON is not recommended.\")") endif() @@ -68,7 +87,7 @@ index d426e1da..b8e0374c 100644 install(EXPORT open62541Targets FILE open62541Targets.cmake DESTINATION "${cmake_configfile_install}" -@@ -1189,35 +1158,9 @@ export( +@@ -1189,35 +1146,9 @@ export( configure_file("${CMAKE_CURRENT_SOURCE_DIR}/tools/cmake/macros_public.cmake" "${CMAKE_CURRENT_BINARY_DIR}/open62541Macros.cmake" COPYONLY) @@ -105,7 +124,7 @@ index d426e1da..b8e0374c 100644 if(NOT UA_ENABLE_AMALGAMATION) # Recreate the include folder structure from the source also in /usr/lib/include/open62541 -@@ -1251,8 +1194,6 @@ else() +@@ -1251,8 +1182,6 @@ else() install(FILES ${PROJECT_BINARY_DIR}/open62541.h DESTINATION include) endif() diff --git a/recipes/open62541/all/patches/add_conan_center_index_compliance_v_1_0_1.patch b/recipes/open62541/all/patches/add_conan_center_index_compliance_v_1_0_1.patch index 0befb67f685ed..1c18ebdbfc512 100644 --- a/recipes/open62541/all/patches/add_conan_center_index_compliance_v_1_0_1.patch +++ b/recipes/open62541/all/patches/add_conan_center_index_compliance_v_1_0_1.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6156c9b7..6590b4f2 100644 +index 6156c9b7..299aaf89 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,6 @@ string(TOLOWER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_LOWER_CASE) @@ -28,7 +28,26 @@ index 6156c9b7..6590b4f2 100644 ################# # Build Options # ################# -@@ -514,7 +502,6 @@ endif() +@@ -440,18 +428,6 @@ if(NOT UA_COMPILE_AS_CXX AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID + # Linker + set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # cmake sets -rdynamic by default + +- # Debug +- if(BUILD_TYPE_LOWER_CASE STREQUAL "debug" AND UNIX) +- if("x${CMAKE_C_COMPILER_ID}" STREQUAL "xClang" AND NOT UA_ENABLE_UNIT_TESTS_MEMCHECK) +- # Add default sanitizer settings when using clang and Debug build. +- # This allows e.g. CLion to find memory locations for SegFaults +- message(STATUS "Sanitizer enabled") +- set(SANITIZER_FLAGS "-g -fno-omit-frame-pointer -gline-tables-only -fsanitize=address -fsanitize-address-use-after-scope -fsanitize-coverage=trace-pc-guard,trace-cmp -fsanitize=leak -fsanitize=undefined") +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SANITIZER_FLAGS}") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SANITIZER_FLAGS}") +- endif() +- endif() +- + if(UA_ENABLE_HARDENING AND ((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))) + check_cc_flag("-D_FORTIFY_SOURCE=2") # run-time buffer overflow detection (needs at least -O1) + endif() +@@ -514,7 +490,6 @@ endif() file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/src_generated") configure_file(include/open62541/config.h.in ${PROJECT_BINARY_DIR}/src_generated/open62541/config.h) @@ -36,7 +55,7 @@ index 6156c9b7..6590b4f2 100644 if(UA_ENABLE_DISCOVERY_MULTICAST) set(MDNSD_LOGLEVEL 300 CACHE STRING "Level at which logs shall be reported" FORCE) -@@ -1106,8 +1093,6 @@ include(linting_target) +@@ -1106,8 +1081,6 @@ include(linting_target) # Enable shared library with `-DBUILD_SHARED_LIBS=ON` set(cmake_configfile_install ${CMAKE_INSTALL_LIBDIR}/cmake/open62541) @@ -45,7 +64,7 @@ index 6156c9b7..6590b4f2 100644 # This list of components allows to define a find_package requirement. # E.g.: -@@ -1169,22 +1154,6 @@ if(UA_ENABLE_AMALGAMATION) +@@ -1169,22 +1142,6 @@ if(UA_ENABLE_AMALGAMATION) install(CODE "MESSAGE(WARNING \"Installation with UA_ENABLE_AMALGAMATION=ON is not recommended.\")") endif() @@ -68,7 +87,7 @@ index 6156c9b7..6590b4f2 100644 install(EXPORT open62541Targets FILE open62541Targets.cmake DESTINATION "${cmake_configfile_install}" -@@ -1198,35 +1167,9 @@ export( +@@ -1198,35 +1155,9 @@ export( configure_file("${CMAKE_CURRENT_SOURCE_DIR}/tools/cmake/macros_public.cmake" "${CMAKE_CURRENT_BINARY_DIR}/open62541Macros.cmake" COPYONLY) @@ -105,7 +124,7 @@ index 6156c9b7..6590b4f2 100644 if (UA_PACK_DEBIAN) set(UA_install_examples_dirs "examples/" "examples/access_control" -@@ -1235,9 +1178,6 @@ if (UA_PACK_DEBIAN) +@@ -1235,9 +1166,6 @@ if (UA_PACK_DEBIAN) "examples/encryption" "examples/nodeset" "examples/pubsub") @@ -115,7 +134,7 @@ index 6156c9b7..6590b4f2 100644 endif() if(NOT UA_ENABLE_AMALGAMATION) -@@ -1273,8 +1213,6 @@ else() +@@ -1273,8 +1201,6 @@ else() install(FILES ${PROJECT_BINARY_DIR}/open62541.h DESTINATION include) endif() From 402ca72d35e27d8410c3cdce6dfc77791822e134 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Wed, 20 May 2020 17:26:40 +0200 Subject: [PATCH 05/81] change integration test to be more generic --- recipes/open62541/all/test_package/CMakeLists.txt | 4 ++-- recipes/open62541/all/test_package/conanfile.py | 6 +++--- .../all/test_package/{example.cpp => test_package.cpp} | 0 3 files changed, 5 insertions(+), 5 deletions(-) rename recipes/open62541/all/test_package/{example.cpp => test_package.cpp} (100%) diff --git a/recipes/open62541/all/test_package/CMakeLists.txt b/recipes/open62541/all/test_package/CMakeLists.txt index 8199f276a0ddd..bf5a0a295c431 100644 --- a/recipes/open62541/all/test_package/CMakeLists.txt +++ b/recipes/open62541/all/test_package/CMakeLists.txt @@ -4,5 +4,5 @@ project(PackageTest CXX) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup() -add_executable(example example.cpp) -target_link_libraries(example ${CONAN_LIBS} pthread) +add_executable(test_package test_package.cpp) +target_link_libraries(test_package ${CONAN_LIBS} pthread) diff --git a/recipes/open62541/all/test_package/conanfile.py b/recipes/open62541/all/test_package/conanfile.py index 3719c670ef103..bd7165a553cf4 100644 --- a/recipes/open62541/all/test_package/conanfile.py +++ b/recipes/open62541/all/test_package/conanfile.py @@ -2,7 +2,7 @@ import os -class Open62541TestConan(ConanFile): +class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" generators = "cmake" @@ -13,5 +13,5 @@ def build(self): def test(self): if not tools.cross_building(self.settings): - os.chdir("bin") - self.run(".%sexample" % os.sep) + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/open62541/all/test_package/example.cpp b/recipes/open62541/all/test_package/test_package.cpp similarity index 100% rename from recipes/open62541/all/test_package/example.cpp rename to recipes/open62541/all/test_package/test_package.cpp From de18a1ce6a097782a34126fe7ea9f0ea85ad8b7a Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Wed, 20 May 2020 17:59:38 +0200 Subject: [PATCH 06/81] remove stringify macro for default config plugin --- recipes/open62541/all/conandata.yml | 4 + .../patches/set_static_version_v_1_0.patch | 589 ++++++++++++++++++ .../patches/set_static_version_v_1_0_1.patch | 589 ++++++++++++++++++ 3 files changed, 1182 insertions(+) create mode 100644 recipes/open62541/all/patches/set_static_version_v_1_0.patch create mode 100644 recipes/open62541/all/patches/set_static_version_v_1_0_1.patch diff --git a/recipes/open62541/all/conandata.yml b/recipes/open62541/all/conandata.yml index cfffd972bf2f0..8412d9dc72163 100644 --- a/recipes/open62541/all/conandata.yml +++ b/recipes/open62541/all/conandata.yml @@ -9,6 +9,10 @@ patches: "1.0.0": - patch_file: "patches/add_conan_center_index_compliance_v_1_0.patch" base_path: "source_subfolder" + - patch_file: "patches/set_static_version_v_1_0.patch" + base_path: "source_subfolder" "1.0.1": - patch_file: "patches/add_conan_center_index_compliance_v_1_0_1.patch" base_path: "source_subfolder" + - patch_file: "patches/set_static_version_v_1_0_1.patch" + base_path: "source_subfolder" diff --git a/recipes/open62541/all/patches/set_static_version_v_1_0.patch b/recipes/open62541/all/patches/set_static_version_v_1_0.patch new file mode 100644 index 0000000000000..37fee8a79024b --- /dev/null +++ b/recipes/open62541/all/patches/set_static_version_v_1_0.patch @@ -0,0 +1,589 @@ +diff --git a/plugins/ua_config_default.c b/plugins/ua_config_default.c +index 9770b861..e7b550b5 100644 +--- a/plugins/ua_config_default.c ++++ b/plugins/ua_config_default.c +@@ -39,11 +39,11 @@ UA_DURATIONRANGE(UA_Duration min, UA_Duration max) { + /*******************************/ + + const UA_ConnectionConfig UA_ConnectionConfig_default = { +- 0, /* .protocolVersion */ ++ 0, /* .protocolVersion */ + 65535, /* .sendBufferSize, 64k per chunk */ + 65535, /* .recvBufferSize, 64k per chunk */ +- 0, /* .maxMessageSize, 0 -> unlimited */ +- 0 /* .maxChunkCount, 0 -> unlimited */ ++ 0, /* .maxMessageSize, 0 -> unlimited */ ++ 0 /* .maxChunkCount, 0 -> unlimited */ + }; + + /***************************/ +@@ -57,10 +57,6 @@ const UA_ConnectionConfig UA_ConnectionConfig_default = { + #define APPLICATION_URI "urn:unconfigured:application" + #define APPLICATION_URI_SERVER "urn:open62541.server.application" + +-#define STRINGIFY(arg) #arg +-#define VERSION(MAJOR, MINOR, PATCH, LABEL) \ +- STRINGIFY(MAJOR) "." STRINGIFY(MINOR) "." STRINGIFY(PATCH) LABEL +- + static UA_StatusCode + createEndpoint(UA_ServerConfig *conf, UA_EndpointDescription *endpoint, + const UA_SecurityPolicy *securityPolicy, +@@ -69,17 +65,16 @@ createEndpoint(UA_ServerConfig *conf, UA_EndpointDescription *endpoint, + + endpoint->securityMode = securityMode; + UA_String_copy(&securityPolicy->policyUri, &endpoint->securityPolicyUri); +- endpoint->transportProfileUri = +- UA_STRING_ALLOC("http://opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary"); ++ endpoint->transportProfileUri = UA_STRING_ALLOC( ++ "http://opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary"); + + /* Add security level value for the corresponding message security mode */ +- endpoint->securityLevel = (UA_Byte) securityMode; ++ endpoint->securityLevel = (UA_Byte)securityMode; + + /* Enable all login mechanisms from the access control plugin */ +- UA_StatusCode retval = UA_Array_copy(conf->accessControl.userTokenPolicies, +- conf->accessControl.userTokenPoliciesSize, +- (void **)&endpoint->userIdentityTokens, +- &UA_TYPES[UA_TYPES_USERTOKENPOLICY]); ++ UA_StatusCode retval = UA_Array_copy( ++ conf->accessControl.userTokenPolicies, conf->accessControl.userTokenPoliciesSize, ++ (void **)&endpoint->userIdentityTokens, &UA_TYPES[UA_TYPES_USERTOKENPOLICY]); + if(retval != UA_STATUSCODE_GOOD) + return retval; + endpoint->userIdentityTokensSize = conf->accessControl.userTokenPoliciesSize; +@@ -97,7 +92,7 @@ static UA_UsernamePasswordLogin usernamePasswords[2] = { + + static UA_StatusCode + setDefaultConfig(UA_ServerConfig *conf) { +- if (!conf) ++ if(!conf) + return UA_STATUSCODE_BADINVALIDARGUMENT; + + /* Zero out.. All members have a valid initial value */ +@@ -114,14 +109,12 @@ setDefaultConfig(UA_ServerConfig *conf) { + conf->buildInfo.productUri = UA_STRING_ALLOC(PRODUCT_URI); + conf->buildInfo.manufacturerName = UA_STRING_ALLOC(MANUFACTURER_NAME); + conf->buildInfo.productName = UA_STRING_ALLOC(PRODUCT_NAME); +- conf->buildInfo.softwareVersion = +- UA_STRING_ALLOC(VERSION(UA_OPEN62541_VER_MAJOR, UA_OPEN62541_VER_MINOR, +- UA_OPEN62541_VER_PATCH, UA_OPEN62541_VER_LABEL)); +- #ifdef UA_PACK_DEBIAN ++ conf->buildInfo.softwareVersion = UA_STRING_ALLOC("1.0.0"); ++#ifdef UA_PACK_DEBIAN + conf->buildInfo.buildNumber = UA_STRING_ALLOC("deb"); +- #else ++#else + conf->buildInfo.buildNumber = UA_STRING_ALLOC(__DATE__ " " __TIME__); +- #endif ++#endif + conf->buildInfo.buildDate = UA_DateTime_now(); + + conf->applicationDescription.applicationUri = UA_STRING_ALLOC(APPLICATION_URI_SERVER); +@@ -219,36 +212,37 @@ setDefaultConfig(UA_ServerConfig *conf) { + } + + UA_EXPORT UA_StatusCode +-UA_ServerConfig_setBasics(UA_ServerConfig* conf) { ++UA_ServerConfig_setBasics(UA_ServerConfig *conf) { + return setDefaultConfig(conf); + } + + static UA_StatusCode + addDefaultNetworkLayers(UA_ServerConfig *conf, UA_UInt16 portNumber, + UA_UInt32 sendBufferSize, UA_UInt32 recvBufferSize) { +- return UA_ServerConfig_addNetworkLayerTCP(conf, portNumber, sendBufferSize, recvBufferSize); ++ return UA_ServerConfig_addNetworkLayerTCP(conf, portNumber, sendBufferSize, ++ recvBufferSize); + } + +- + UA_EXPORT UA_StatusCode + UA_ServerConfig_addNetworkLayerTCP(UA_ServerConfig *conf, UA_UInt16 portNumber, + UA_UInt32 sendBufferSize, UA_UInt32 recvBufferSize) { + /* Add a network layer */ +- UA_ServerNetworkLayer *tmp = (UA_ServerNetworkLayer *) +- UA_realloc(conf->networkLayers, sizeof(UA_ServerNetworkLayer) * (1 + conf->networkLayersSize)); ++ UA_ServerNetworkLayer *tmp = (UA_ServerNetworkLayer *)UA_realloc( ++ conf->networkLayers, ++ sizeof(UA_ServerNetworkLayer) * (1 + conf->networkLayersSize)); + if(!tmp) + return UA_STATUSCODE_BADOUTOFMEMORY; + conf->networkLayers = tmp; + + UA_ConnectionConfig config = UA_ConnectionConfig_default; +- if (sendBufferSize > 0) ++ if(sendBufferSize > 0) + config.sendBufferSize = sendBufferSize; +- if (recvBufferSize > 0) ++ if(recvBufferSize > 0) + config.recvBufferSize = recvBufferSize; + + conf->networkLayers[conf->networkLayersSize] = + UA_ServerNetworkLayerTCP(config, portNumber, &conf->logger); +- if (!conf->networkLayers[conf->networkLayersSize].handle) ++ if(!conf->networkLayers[conf->networkLayersSize].handle) + return UA_STATUSCODE_BADOUTOFMEMORY; + conf->networkLayersSize++; + +@@ -256,23 +250,25 @@ UA_ServerConfig_addNetworkLayerTCP(UA_ServerConfig *conf, UA_UInt16 portNumber, + } + + UA_EXPORT UA_StatusCode +-UA_ServerConfig_addSecurityPolicyNone(UA_ServerConfig *config, ++UA_ServerConfig_addSecurityPolicyNone(UA_ServerConfig *config, + const UA_ByteString *certificate) { + UA_StatusCode retval; + + /* Allocate the SecurityPolicies */ +- UA_SecurityPolicy *tmp = (UA_SecurityPolicy *) +- UA_realloc(config->securityPolicies, sizeof(UA_SecurityPolicy) * (1 + config->securityPoliciesSize)); ++ UA_SecurityPolicy *tmp = (UA_SecurityPolicy *)UA_realloc( ++ config->securityPolicies, ++ sizeof(UA_SecurityPolicy) * (1 + config->securityPoliciesSize)); + if(!tmp) + return UA_STATUSCODE_BADOUTOFMEMORY; + config->securityPolicies = tmp; +- ++ + /* Populate the SecurityPolicies */ + UA_ByteString localCertificate = UA_BYTESTRING_NULL; + if(certificate) + localCertificate = *certificate; +- retval = UA_SecurityPolicy_None(&config->securityPolicies[config->securityPoliciesSize], NULL, +- localCertificate, &config->logger); ++ retval = ++ UA_SecurityPolicy_None(&config->securityPolicies[config->securityPoliciesSize], ++ NULL, localCertificate, &config->logger); + if(retval != UA_STATUSCODE_GOOD) + return retval; + config->securityPoliciesSize++; +@@ -281,14 +277,13 @@ UA_ServerConfig_addSecurityPolicyNone(UA_ServerConfig *config, + } + + UA_EXPORT UA_StatusCode +-UA_ServerConfig_addEndpoint(UA_ServerConfig *config, const UA_String securityPolicyUri, +- UA_MessageSecurityMode securityMode) +-{ ++UA_ServerConfig_addEndpoint(UA_ServerConfig *config, const UA_String securityPolicyUri, ++ UA_MessageSecurityMode securityMode) { + UA_StatusCode retval; + + /* Allocate the endpoint */ +- UA_EndpointDescription * tmp = (UA_EndpointDescription *) +- UA_realloc(config->endpoints, sizeof(UA_EndpointDescription) * (1 + config->endpointsSize)); ++ UA_EndpointDescription *tmp = (UA_EndpointDescription *)UA_realloc( ++ config->endpoints, sizeof(UA_EndpointDescription) * (1 + config->endpointsSize)); + if(!tmp) { + return UA_STATUSCODE_BADOUTOFMEMORY; + } +@@ -296,18 +291,18 @@ UA_ServerConfig_addEndpoint(UA_ServerConfig *config, const UA_String securityPol + + /* Lookup the security policy */ + const UA_SecurityPolicy *policy = NULL; +- for (size_t i = 0; i < config->securityPoliciesSize; ++i) { +- if (UA_String_equal(&securityPolicyUri, &config->securityPolicies[i].policyUri)) { ++ for(size_t i = 0; i < config->securityPoliciesSize; ++i) { ++ if(UA_String_equal(&securityPolicyUri, &config->securityPolicies[i].policyUri)) { + policy = &config->securityPolicies[i]; + break; + } + } +- if (!policy) ++ if(!policy) + return UA_STATUSCODE_BADINVALIDARGUMENT; + + /* Populate the endpoint */ +- retval = createEndpoint(config, &config->endpoints[config->endpointsSize], +- policy, securityMode); ++ retval = createEndpoint(config, &config->endpoints[config->endpointsSize], policy, ++ securityMode); + if(retval != UA_STATUSCODE_GOOD) + return retval; + config->endpointsSize++; +@@ -320,30 +315,36 @@ UA_ServerConfig_addAllEndpoints(UA_ServerConfig *config) { + UA_StatusCode retval; + + /* Allocate the endpoints */ +- UA_EndpointDescription * tmp = (UA_EndpointDescription *) +- UA_realloc(config->endpoints, sizeof(UA_EndpointDescription) * (2 * config->securityPoliciesSize + config->endpointsSize)); ++ UA_EndpointDescription *tmp = (UA_EndpointDescription *)UA_realloc( ++ config->endpoints, ++ sizeof(UA_EndpointDescription) * ++ (2 * config->securityPoliciesSize + config->endpointsSize)); + if(!tmp) { + return UA_STATUSCODE_BADOUTOFMEMORY; + } + config->endpoints = tmp; + + /* Populate the endpoints */ +- for (size_t i = 0; i < config->securityPoliciesSize; ++i) { +- if (UA_String_equal(&UA_SECURITY_POLICY_NONE_URI, &config->securityPolicies[i].policyUri)) { +- retval = createEndpoint(config, &config->endpoints[config->endpointsSize], +- &config->securityPolicies[i], UA_MESSAGESECURITYMODE_NONE); ++ for(size_t i = 0; i < config->securityPoliciesSize; ++i) { ++ if(UA_String_equal(&UA_SECURITY_POLICY_NONE_URI, ++ &config->securityPolicies[i].policyUri)) { ++ retval = ++ createEndpoint(config, &config->endpoints[config->endpointsSize], ++ &config->securityPolicies[i], UA_MESSAGESECURITYMODE_NONE); + if(retval != UA_STATUSCODE_GOOD) + return retval; + config->endpointsSize++; + } else { +- retval = createEndpoint(config, &config->endpoints[config->endpointsSize], +- &config->securityPolicies[i], UA_MESSAGESECURITYMODE_SIGN); ++ retval = ++ createEndpoint(config, &config->endpoints[config->endpointsSize], ++ &config->securityPolicies[i], UA_MESSAGESECURITYMODE_SIGN); + if(retval != UA_STATUSCODE_GOOD) + return retval; + config->endpointsSize++; + + retval = createEndpoint(config, &config->endpoints[config->endpointsSize], +- &config->securityPolicies[i], UA_MESSAGESECURITYMODE_SIGNANDENCRYPT); ++ &config->securityPolicies[i], ++ UA_MESSAGESECURITYMODE_SIGNANDENCRYPT); + if(retval != UA_STATUSCODE_GOOD) + return retval; + config->endpointsSize++; +@@ -358,7 +359,7 @@ UA_ServerConfig_setMinimalCustomBuffer(UA_ServerConfig *config, UA_UInt16 portNu + const UA_ByteString *certificate, + UA_UInt32 sendBufferSize, + UA_UInt32 recvBufferSize) { +- if (!config) ++ if(!config) + return UA_STATUSCODE_BADINVALIDARGUMENT; + + UA_StatusCode retval = setDefaultConfig(config); +@@ -381,16 +382,18 @@ UA_ServerConfig_setMinimalCustomBuffer(UA_ServerConfig *config, UA_UInt16 portNu + } + + /* Initialize the Access Control plugin */ +- retval = UA_AccessControl_default(config, true, +- &config->securityPolicies[config->securityPoliciesSize-1].policyUri, +- usernamePasswordsSize, usernamePasswords); ++ retval = UA_AccessControl_default( ++ config, true, ++ &config->securityPolicies[config->securityPoliciesSize - 1].policyUri, ++ usernamePasswordsSize, usernamePasswords); + if(retval != UA_STATUSCODE_GOOD) { + UA_ServerConfig_clean(config); + return retval; + } + + /* Allocate the endpoint */ +- retval = UA_ServerConfig_addEndpoint(config, UA_SECURITY_POLICY_NONE_URI, UA_MESSAGESECURITYMODE_NONE); ++ retval = UA_ServerConfig_addEndpoint(config, UA_SECURITY_POLICY_NONE_URI, ++ UA_MESSAGESECURITYMODE_NONE); + if(retval != UA_STATUSCODE_GOOD) { + UA_ServerConfig_clean(config); + return retval; +@@ -402,28 +405,30 @@ UA_ServerConfig_setMinimalCustomBuffer(UA_ServerConfig *config, UA_UInt16 portNu + #ifdef UA_ENABLE_ENCRYPTION + + UA_EXPORT UA_StatusCode +-UA_ServerConfig_addSecurityPolicyBasic128Rsa15(UA_ServerConfig *config, ++UA_ServerConfig_addSecurityPolicyBasic128Rsa15(UA_ServerConfig *config, + const UA_ByteString *certificate, + const UA_ByteString *privateKey) { + UA_StatusCode retval; + + /* Allocate the SecurityPolicies */ +- UA_SecurityPolicy *tmp = (UA_SecurityPolicy *) +- UA_realloc(config->securityPolicies, sizeof(UA_SecurityPolicy) * (1 + config->securityPoliciesSize)); ++ UA_SecurityPolicy *tmp = (UA_SecurityPolicy *)UA_realloc( ++ config->securityPolicies, ++ sizeof(UA_SecurityPolicy) * (1 + config->securityPoliciesSize)); + if(!tmp) + return UA_STATUSCODE_BADOUTOFMEMORY; + config->securityPolicies = tmp; +- ++ + /* Populate the SecurityPolicies */ + UA_ByteString localCertificate = UA_BYTESTRING_NULL; +- UA_ByteString localPrivateKey = UA_BYTESTRING_NULL; ++ UA_ByteString localPrivateKey = UA_BYTESTRING_NULL; + if(certificate) + localCertificate = *certificate; + if(privateKey) +- localPrivateKey = *privateKey; +- retval = UA_SecurityPolicy_Basic128Rsa15(&config->securityPolicies[config->securityPoliciesSize], +- &config->certificateVerification, +- localCertificate, localPrivateKey, &config->logger); ++ localPrivateKey = *privateKey; ++ retval = UA_SecurityPolicy_Basic128Rsa15( ++ &config->securityPolicies[config->securityPoliciesSize], ++ &config->certificateVerification, localCertificate, localPrivateKey, ++ &config->logger); + if(retval != UA_STATUSCODE_GOOD) + return retval; + config->securityPoliciesSize++; +@@ -432,28 +437,30 @@ UA_ServerConfig_addSecurityPolicyBasic128Rsa15(UA_ServerConfig *config, + } + + UA_EXPORT UA_StatusCode +-UA_ServerConfig_addSecurityPolicyBasic256(UA_ServerConfig *config, ++UA_ServerConfig_addSecurityPolicyBasic256(UA_ServerConfig *config, + const UA_ByteString *certificate, + const UA_ByteString *privateKey) { + UA_StatusCode retval; + + /* Allocate the SecurityPolicies */ +- UA_SecurityPolicy *tmp = (UA_SecurityPolicy *) +- UA_realloc(config->securityPolicies, sizeof(UA_SecurityPolicy) * (1 + config->securityPoliciesSize)); ++ UA_SecurityPolicy *tmp = (UA_SecurityPolicy *)UA_realloc( ++ config->securityPolicies, ++ sizeof(UA_SecurityPolicy) * (1 + config->securityPoliciesSize)); + if(!tmp) + return UA_STATUSCODE_BADOUTOFMEMORY; + config->securityPolicies = tmp; +- ++ + /* Populate the SecurityPolicies */ + UA_ByteString localCertificate = UA_BYTESTRING_NULL; +- UA_ByteString localPrivateKey = UA_BYTESTRING_NULL; ++ UA_ByteString localPrivateKey = UA_BYTESTRING_NULL; + if(certificate) + localCertificate = *certificate; + if(privateKey) +- localPrivateKey = *privateKey; +- retval = UA_SecurityPolicy_Basic256(&config->securityPolicies[config->securityPoliciesSize], +- &config->certificateVerification, +- localCertificate, localPrivateKey, &config->logger); ++ localPrivateKey = *privateKey; ++ retval = UA_SecurityPolicy_Basic256( ++ &config->securityPolicies[config->securityPoliciesSize], ++ &config->certificateVerification, localCertificate, localPrivateKey, ++ &config->logger); + if(retval != UA_STATUSCODE_GOOD) + return retval; + config->securityPoliciesSize++; +@@ -462,28 +469,30 @@ UA_ServerConfig_addSecurityPolicyBasic256(UA_ServerConfig *config, + } + + UA_EXPORT UA_StatusCode +-UA_ServerConfig_addSecurityPolicyBasic256Sha256(UA_ServerConfig *config, ++UA_ServerConfig_addSecurityPolicyBasic256Sha256(UA_ServerConfig *config, + const UA_ByteString *certificate, + const UA_ByteString *privateKey) { + UA_StatusCode retval; + + /* Allocate the SecurityPolicies */ +- UA_SecurityPolicy *tmp = (UA_SecurityPolicy *) +- UA_realloc(config->securityPolicies, sizeof(UA_SecurityPolicy) * (1 + config->securityPoliciesSize)); ++ UA_SecurityPolicy *tmp = (UA_SecurityPolicy *)UA_realloc( ++ config->securityPolicies, ++ sizeof(UA_SecurityPolicy) * (1 + config->securityPoliciesSize)); + if(!tmp) + return UA_STATUSCODE_BADOUTOFMEMORY; + config->securityPolicies = tmp; +- ++ + /* Populate the SecurityPolicies */ + UA_ByteString localCertificate = UA_BYTESTRING_NULL; +- UA_ByteString localPrivateKey = UA_BYTESTRING_NULL; ++ UA_ByteString localPrivateKey = UA_BYTESTRING_NULL; + if(certificate) + localCertificate = *certificate; + if(privateKey) +- localPrivateKey = *privateKey; +- retval = UA_SecurityPolicy_Basic256Sha256(&config->securityPolicies[config->securityPoliciesSize], +- &config->certificateVerification, +- localCertificate, localPrivateKey, &config->logger); ++ localPrivateKey = *privateKey; ++ retval = UA_SecurityPolicy_Basic256Sha256( ++ &config->securityPolicies[config->securityPoliciesSize], ++ &config->certificateVerification, localCertificate, localPrivateKey, ++ &config->logger); + if(retval != UA_STATUSCODE_GOOD) + return retval; + config->securityPoliciesSize++; +@@ -498,43 +507,48 @@ UA_ServerConfig_addAllSecurityPolicies(UA_ServerConfig *config, + UA_StatusCode retval; + + /* Allocate the SecurityPolicies */ +- UA_SecurityPolicy *tmp = (UA_SecurityPolicy *) +- UA_realloc(config->securityPolicies, sizeof(UA_SecurityPolicy) * (4 + config->securityPoliciesSize)); ++ UA_SecurityPolicy *tmp = (UA_SecurityPolicy *)UA_realloc( ++ config->securityPolicies, ++ sizeof(UA_SecurityPolicy) * (4 + config->securityPoliciesSize)); + if(!tmp) + return UA_STATUSCODE_BADOUTOFMEMORY; + config->securityPolicies = tmp; +- ++ + /* Populate the SecurityPolicies */ + UA_ByteString localCertificate = UA_BYTESTRING_NULL; +- UA_ByteString localPrivateKey = UA_BYTESTRING_NULL; ++ UA_ByteString localPrivateKey = UA_BYTESTRING_NULL; + if(certificate) + localCertificate = *certificate; + if(privateKey) +- localPrivateKey = *privateKey; ++ localPrivateKey = *privateKey; + +- retval = UA_SecurityPolicy_None(&config->securityPolicies[config->securityPoliciesSize], NULL, +- localCertificate, &config->logger); ++ retval = ++ UA_SecurityPolicy_None(&config->securityPolicies[config->securityPoliciesSize], ++ NULL, localCertificate, &config->logger); + if(retval != UA_STATUSCODE_GOOD) + return retval; + config->securityPoliciesSize++; + +- retval = UA_SecurityPolicy_Basic128Rsa15(&config->securityPolicies[config->securityPoliciesSize], +- &config->certificateVerification, +- localCertificate, localPrivateKey, &config->logger); ++ retval = UA_SecurityPolicy_Basic128Rsa15( ++ &config->securityPolicies[config->securityPoliciesSize], ++ &config->certificateVerification, localCertificate, localPrivateKey, ++ &config->logger); + if(retval != UA_STATUSCODE_GOOD) + return retval; + config->securityPoliciesSize++; + +- retval = UA_SecurityPolicy_Basic256(&config->securityPolicies[config->securityPoliciesSize], +- &config->certificateVerification, +- localCertificate, localPrivateKey, &config->logger); ++ retval = UA_SecurityPolicy_Basic256( ++ &config->securityPolicies[config->securityPoliciesSize], ++ &config->certificateVerification, localCertificate, localPrivateKey, ++ &config->logger); + if(retval != UA_STATUSCODE_GOOD) + return retval; + config->securityPoliciesSize++; + +- retval = UA_SecurityPolicy_Basic256Sha256(&config->securityPolicies[config->securityPoliciesSize], +- &config->certificateVerification, +- localCertificate, localPrivateKey, &config->logger); ++ retval = UA_SecurityPolicy_Basic256Sha256( ++ &config->securityPolicies[config->securityPoliciesSize], ++ &config->certificateVerification, localCertificate, localPrivateKey, ++ &config->logger); + if(retval != UA_STATUSCODE_GOOD) + return retval; + config->securityPoliciesSize++; +@@ -543,27 +557,21 @@ UA_ServerConfig_addAllSecurityPolicies(UA_ServerConfig *config, + } + + UA_EXPORT UA_StatusCode +-UA_ServerConfig_setDefaultWithSecurityPolicies(UA_ServerConfig *conf, +- UA_UInt16 portNumber, +- const UA_ByteString *certificate, +- const UA_ByteString *privateKey, +- const UA_ByteString *trustList, +- size_t trustListSize, +- const UA_ByteString *issuerList, +- size_t issuerListSize, +- const UA_ByteString *revocationList, +- size_t revocationListSize) { ++UA_ServerConfig_setDefaultWithSecurityPolicies( ++ UA_ServerConfig *conf, UA_UInt16 portNumber, const UA_ByteString *certificate, ++ const UA_ByteString *privateKey, const UA_ByteString *trustList, size_t trustListSize, ++ const UA_ByteString *issuerList, size_t issuerListSize, ++ const UA_ByteString *revocationList, size_t revocationListSize) { + UA_StatusCode retval = setDefaultConfig(conf); + if(retval != UA_STATUSCODE_GOOD) { + UA_ServerConfig_clean(conf); + return retval; + } + +- retval = UA_CertificateVerification_Trustlist(&conf->certificateVerification, +- trustList, trustListSize, +- issuerList, issuerListSize, +- revocationList, revocationListSize); +- if (retval != UA_STATUSCODE_GOOD) ++ retval = UA_CertificateVerification_Trustlist( ++ &conf->certificateVerification, trustList, trustListSize, issuerList, ++ issuerListSize, revocationList, revocationListSize); ++ if(retval != UA_STATUSCODE_GOOD) + return retval; + + if(trustListSize == 0) +@@ -583,9 +591,9 @@ UA_ServerConfig_setDefaultWithSecurityPolicies(UA_ServerConfig *conf, + return retval; + } + +- retval = UA_AccessControl_default(conf, true, +- &conf->securityPolicies[conf->securityPoliciesSize-1].policyUri, +- usernamePasswordsSize, usernamePasswords); ++ retval = UA_AccessControl_default( ++ conf, true, &conf->securityPolicies[conf->securityPoliciesSize - 1].policyUri, ++ usernamePasswordsSize, usernamePasswords); + if(retval != UA_STATUSCODE_GOOD) { + UA_ServerConfig_clean(conf); + return retval; +@@ -637,7 +645,7 @@ UA_ClientConfig_setDefault(UA_ClientConfig *config) { + return UA_STATUSCODE_BADINTERNALERROR; + } + +- config->securityPolicies = (UA_SecurityPolicy*)UA_malloc(sizeof(UA_SecurityPolicy)); ++ config->securityPolicies = (UA_SecurityPolicy *)UA_malloc(sizeof(UA_SecurityPolicy)); + if(!config->securityPolicies) + return UA_STATUSCODE_BADOUTOFMEMORY; + UA_StatusCode retval = UA_SecurityPolicy_None(config->securityPolicies, NULL, +@@ -651,7 +659,8 @@ UA_ClientConfig_setDefault(UA_ClientConfig *config) { + + config->connectionFunc = UA_ClientConnectionTCP; + config->initConnectionFunc = UA_ClientConnectionTCP_init; /* for async client */ +- config->pollConnectionFunc = UA_ClientConnectionTCP_poll_callback; /* for async connection */ ++ config->pollConnectionFunc = ++ UA_ClientConnectionTCP_poll_callback; /* for async connection */ + + config->customDataTypes = NULL; + config->stateCallback = NULL; +@@ -673,30 +682,31 @@ UA_ClientConfig_setDefault(UA_ClientConfig *config) { + #ifdef UA_ENABLE_ENCRYPTION + UA_StatusCode + UA_ClientConfig_setDefaultEncryption(UA_ClientConfig *config, +- UA_ByteString localCertificate, UA_ByteString privateKey, ++ UA_ByteString localCertificate, ++ UA_ByteString privateKey, + const UA_ByteString *trustList, size_t trustListSize, +- const UA_ByteString *revocationList, size_t revocationListSize) { ++ const UA_ByteString *revocationList, ++ size_t revocationListSize) { + UA_StatusCode retval = UA_ClientConfig_setDefault(config); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + retval = UA_CertificateVerification_Trustlist(&config->certificateVerification, +- trustList, trustListSize, +- NULL, 0, ++ trustList, trustListSize, NULL, 0, + revocationList, revocationListSize); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + /* Populate SecurityPolicies */ +- UA_SecurityPolicy *sp = (UA_SecurityPolicy*) +- UA_realloc(config->securityPolicies, sizeof(UA_SecurityPolicy) * 4); ++ UA_SecurityPolicy *sp = (UA_SecurityPolicy *)UA_realloc( ++ config->securityPolicies, sizeof(UA_SecurityPolicy) * 4); + if(!sp) + return UA_STATUSCODE_BADOUTOFMEMORY; + config->securityPolicies = sp; + +- retval = UA_SecurityPolicy_Basic128Rsa15(&config->securityPolicies[1], +- &config->certificateVerification, +- localCertificate, privateKey, &config->logger); ++ retval = UA_SecurityPolicy_Basic128Rsa15( ++ &config->securityPolicies[1], &config->certificateVerification, localCertificate, ++ privateKey, &config->logger); + if(retval != UA_STATUSCODE_GOOD) + return retval; + ++config->securityPoliciesSize; +@@ -708,9 +718,9 @@ UA_ClientConfig_setDefaultEncryption(UA_ClientConfig *config, + return retval; + ++config->securityPoliciesSize; + +- retval = UA_SecurityPolicy_Basic256Sha256(&config->securityPolicies[3], +- &config->certificateVerification, +- localCertificate, privateKey, &config->logger); ++ retval = UA_SecurityPolicy_Basic256Sha256( ++ &config->securityPolicies[3], &config->certificateVerification, localCertificate, ++ privateKey, &config->logger); + if(retval != UA_STATUSCODE_GOOD) + return retval; + ++config->securityPoliciesSize; diff --git a/recipes/open62541/all/patches/set_static_version_v_1_0_1.patch b/recipes/open62541/all/patches/set_static_version_v_1_0_1.patch new file mode 100644 index 0000000000000..df9cc65cba88a --- /dev/null +++ b/recipes/open62541/all/patches/set_static_version_v_1_0_1.patch @@ -0,0 +1,589 @@ +diff --git a/plugins/ua_config_default.c b/plugins/ua_config_default.c +index 9770b861..7c70e22c 100644 +--- a/plugins/ua_config_default.c ++++ b/plugins/ua_config_default.c +@@ -39,11 +39,11 @@ UA_DURATIONRANGE(UA_Duration min, UA_Duration max) { + /*******************************/ + + const UA_ConnectionConfig UA_ConnectionConfig_default = { +- 0, /* .protocolVersion */ ++ 0, /* .protocolVersion */ + 65535, /* .sendBufferSize, 64k per chunk */ + 65535, /* .recvBufferSize, 64k per chunk */ +- 0, /* .maxMessageSize, 0 -> unlimited */ +- 0 /* .maxChunkCount, 0 -> unlimited */ ++ 0, /* .maxMessageSize, 0 -> unlimited */ ++ 0 /* .maxChunkCount, 0 -> unlimited */ + }; + + /***************************/ +@@ -57,10 +57,6 @@ const UA_ConnectionConfig UA_ConnectionConfig_default = { + #define APPLICATION_URI "urn:unconfigured:application" + #define APPLICATION_URI_SERVER "urn:open62541.server.application" + +-#define STRINGIFY(arg) #arg +-#define VERSION(MAJOR, MINOR, PATCH, LABEL) \ +- STRINGIFY(MAJOR) "." STRINGIFY(MINOR) "." STRINGIFY(PATCH) LABEL +- + static UA_StatusCode + createEndpoint(UA_ServerConfig *conf, UA_EndpointDescription *endpoint, + const UA_SecurityPolicy *securityPolicy, +@@ -69,17 +65,16 @@ createEndpoint(UA_ServerConfig *conf, UA_EndpointDescription *endpoint, + + endpoint->securityMode = securityMode; + UA_String_copy(&securityPolicy->policyUri, &endpoint->securityPolicyUri); +- endpoint->transportProfileUri = +- UA_STRING_ALLOC("http://opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary"); ++ endpoint->transportProfileUri = UA_STRING_ALLOC( ++ "http://opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary"); + + /* Add security level value for the corresponding message security mode */ +- endpoint->securityLevel = (UA_Byte) securityMode; ++ endpoint->securityLevel = (UA_Byte)securityMode; + + /* Enable all login mechanisms from the access control plugin */ +- UA_StatusCode retval = UA_Array_copy(conf->accessControl.userTokenPolicies, +- conf->accessControl.userTokenPoliciesSize, +- (void **)&endpoint->userIdentityTokens, +- &UA_TYPES[UA_TYPES_USERTOKENPOLICY]); ++ UA_StatusCode retval = UA_Array_copy( ++ conf->accessControl.userTokenPolicies, conf->accessControl.userTokenPoliciesSize, ++ (void **)&endpoint->userIdentityTokens, &UA_TYPES[UA_TYPES_USERTOKENPOLICY]); + if(retval != UA_STATUSCODE_GOOD) + return retval; + endpoint->userIdentityTokensSize = conf->accessControl.userTokenPoliciesSize; +@@ -97,7 +92,7 @@ static UA_UsernamePasswordLogin usernamePasswords[2] = { + + static UA_StatusCode + setDefaultConfig(UA_ServerConfig *conf) { +- if (!conf) ++ if(!conf) + return UA_STATUSCODE_BADINVALIDARGUMENT; + + /* Zero out.. All members have a valid initial value */ +@@ -114,14 +109,12 @@ setDefaultConfig(UA_ServerConfig *conf) { + conf->buildInfo.productUri = UA_STRING_ALLOC(PRODUCT_URI); + conf->buildInfo.manufacturerName = UA_STRING_ALLOC(MANUFACTURER_NAME); + conf->buildInfo.productName = UA_STRING_ALLOC(PRODUCT_NAME); +- conf->buildInfo.softwareVersion = +- UA_STRING_ALLOC(VERSION(UA_OPEN62541_VER_MAJOR, UA_OPEN62541_VER_MINOR, +- UA_OPEN62541_VER_PATCH, UA_OPEN62541_VER_LABEL)); +- #ifdef UA_PACK_DEBIAN ++ conf->buildInfo.softwareVersion = UA_STRING_ALLOC("1.0.1"); ++#ifdef UA_PACK_DEBIAN + conf->buildInfo.buildNumber = UA_STRING_ALLOC("deb"); +- #else ++#else + conf->buildInfo.buildNumber = UA_STRING_ALLOC(__DATE__ " " __TIME__); +- #endif ++#endif + conf->buildInfo.buildDate = UA_DateTime_now(); + + conf->applicationDescription.applicationUri = UA_STRING_ALLOC(APPLICATION_URI_SERVER); +@@ -219,36 +212,37 @@ setDefaultConfig(UA_ServerConfig *conf) { + } + + UA_EXPORT UA_StatusCode +-UA_ServerConfig_setBasics(UA_ServerConfig* conf) { ++UA_ServerConfig_setBasics(UA_ServerConfig *conf) { + return setDefaultConfig(conf); + } + + static UA_StatusCode + addDefaultNetworkLayers(UA_ServerConfig *conf, UA_UInt16 portNumber, + UA_UInt32 sendBufferSize, UA_UInt32 recvBufferSize) { +- return UA_ServerConfig_addNetworkLayerTCP(conf, portNumber, sendBufferSize, recvBufferSize); ++ return UA_ServerConfig_addNetworkLayerTCP(conf, portNumber, sendBufferSize, ++ recvBufferSize); + } + +- + UA_EXPORT UA_StatusCode + UA_ServerConfig_addNetworkLayerTCP(UA_ServerConfig *conf, UA_UInt16 portNumber, + UA_UInt32 sendBufferSize, UA_UInt32 recvBufferSize) { + /* Add a network layer */ +- UA_ServerNetworkLayer *tmp = (UA_ServerNetworkLayer *) +- UA_realloc(conf->networkLayers, sizeof(UA_ServerNetworkLayer) * (1 + conf->networkLayersSize)); ++ UA_ServerNetworkLayer *tmp = (UA_ServerNetworkLayer *)UA_realloc( ++ conf->networkLayers, ++ sizeof(UA_ServerNetworkLayer) * (1 + conf->networkLayersSize)); + if(!tmp) + return UA_STATUSCODE_BADOUTOFMEMORY; + conf->networkLayers = tmp; + + UA_ConnectionConfig config = UA_ConnectionConfig_default; +- if (sendBufferSize > 0) ++ if(sendBufferSize > 0) + config.sendBufferSize = sendBufferSize; +- if (recvBufferSize > 0) ++ if(recvBufferSize > 0) + config.recvBufferSize = recvBufferSize; + + conf->networkLayers[conf->networkLayersSize] = + UA_ServerNetworkLayerTCP(config, portNumber, &conf->logger); +- if (!conf->networkLayers[conf->networkLayersSize].handle) ++ if(!conf->networkLayers[conf->networkLayersSize].handle) + return UA_STATUSCODE_BADOUTOFMEMORY; + conf->networkLayersSize++; + +@@ -256,23 +250,25 @@ UA_ServerConfig_addNetworkLayerTCP(UA_ServerConfig *conf, UA_UInt16 portNumber, + } + + UA_EXPORT UA_StatusCode +-UA_ServerConfig_addSecurityPolicyNone(UA_ServerConfig *config, ++UA_ServerConfig_addSecurityPolicyNone(UA_ServerConfig *config, + const UA_ByteString *certificate) { + UA_StatusCode retval; + + /* Allocate the SecurityPolicies */ +- UA_SecurityPolicy *tmp = (UA_SecurityPolicy *) +- UA_realloc(config->securityPolicies, sizeof(UA_SecurityPolicy) * (1 + config->securityPoliciesSize)); ++ UA_SecurityPolicy *tmp = (UA_SecurityPolicy *)UA_realloc( ++ config->securityPolicies, ++ sizeof(UA_SecurityPolicy) * (1 + config->securityPoliciesSize)); + if(!tmp) + return UA_STATUSCODE_BADOUTOFMEMORY; + config->securityPolicies = tmp; +- ++ + /* Populate the SecurityPolicies */ + UA_ByteString localCertificate = UA_BYTESTRING_NULL; + if(certificate) + localCertificate = *certificate; +- retval = UA_SecurityPolicy_None(&config->securityPolicies[config->securityPoliciesSize], NULL, +- localCertificate, &config->logger); ++ retval = ++ UA_SecurityPolicy_None(&config->securityPolicies[config->securityPoliciesSize], ++ NULL, localCertificate, &config->logger); + if(retval != UA_STATUSCODE_GOOD) + return retval; + config->securityPoliciesSize++; +@@ -281,14 +277,13 @@ UA_ServerConfig_addSecurityPolicyNone(UA_ServerConfig *config, + } + + UA_EXPORT UA_StatusCode +-UA_ServerConfig_addEndpoint(UA_ServerConfig *config, const UA_String securityPolicyUri, +- UA_MessageSecurityMode securityMode) +-{ ++UA_ServerConfig_addEndpoint(UA_ServerConfig *config, const UA_String securityPolicyUri, ++ UA_MessageSecurityMode securityMode) { + UA_StatusCode retval; + + /* Allocate the endpoint */ +- UA_EndpointDescription * tmp = (UA_EndpointDescription *) +- UA_realloc(config->endpoints, sizeof(UA_EndpointDescription) * (1 + config->endpointsSize)); ++ UA_EndpointDescription *tmp = (UA_EndpointDescription *)UA_realloc( ++ config->endpoints, sizeof(UA_EndpointDescription) * (1 + config->endpointsSize)); + if(!tmp) { + return UA_STATUSCODE_BADOUTOFMEMORY; + } +@@ -296,18 +291,18 @@ UA_ServerConfig_addEndpoint(UA_ServerConfig *config, const UA_String securityPol + + /* Lookup the security policy */ + const UA_SecurityPolicy *policy = NULL; +- for (size_t i = 0; i < config->securityPoliciesSize; ++i) { +- if (UA_String_equal(&securityPolicyUri, &config->securityPolicies[i].policyUri)) { ++ for(size_t i = 0; i < config->securityPoliciesSize; ++i) { ++ if(UA_String_equal(&securityPolicyUri, &config->securityPolicies[i].policyUri)) { + policy = &config->securityPolicies[i]; + break; + } + } +- if (!policy) ++ if(!policy) + return UA_STATUSCODE_BADINVALIDARGUMENT; + + /* Populate the endpoint */ +- retval = createEndpoint(config, &config->endpoints[config->endpointsSize], +- policy, securityMode); ++ retval = createEndpoint(config, &config->endpoints[config->endpointsSize], policy, ++ securityMode); + if(retval != UA_STATUSCODE_GOOD) + return retval; + config->endpointsSize++; +@@ -320,30 +315,36 @@ UA_ServerConfig_addAllEndpoints(UA_ServerConfig *config) { + UA_StatusCode retval; + + /* Allocate the endpoints */ +- UA_EndpointDescription * tmp = (UA_EndpointDescription *) +- UA_realloc(config->endpoints, sizeof(UA_EndpointDescription) * (2 * config->securityPoliciesSize + config->endpointsSize)); ++ UA_EndpointDescription *tmp = (UA_EndpointDescription *)UA_realloc( ++ config->endpoints, ++ sizeof(UA_EndpointDescription) * ++ (2 * config->securityPoliciesSize + config->endpointsSize)); + if(!tmp) { + return UA_STATUSCODE_BADOUTOFMEMORY; + } + config->endpoints = tmp; + + /* Populate the endpoints */ +- for (size_t i = 0; i < config->securityPoliciesSize; ++i) { +- if (UA_String_equal(&UA_SECURITY_POLICY_NONE_URI, &config->securityPolicies[i].policyUri)) { +- retval = createEndpoint(config, &config->endpoints[config->endpointsSize], +- &config->securityPolicies[i], UA_MESSAGESECURITYMODE_NONE); ++ for(size_t i = 0; i < config->securityPoliciesSize; ++i) { ++ if(UA_String_equal(&UA_SECURITY_POLICY_NONE_URI, ++ &config->securityPolicies[i].policyUri)) { ++ retval = ++ createEndpoint(config, &config->endpoints[config->endpointsSize], ++ &config->securityPolicies[i], UA_MESSAGESECURITYMODE_NONE); + if(retval != UA_STATUSCODE_GOOD) + return retval; + config->endpointsSize++; + } else { +- retval = createEndpoint(config, &config->endpoints[config->endpointsSize], +- &config->securityPolicies[i], UA_MESSAGESECURITYMODE_SIGN); ++ retval = ++ createEndpoint(config, &config->endpoints[config->endpointsSize], ++ &config->securityPolicies[i], UA_MESSAGESECURITYMODE_SIGN); + if(retval != UA_STATUSCODE_GOOD) + return retval; + config->endpointsSize++; + + retval = createEndpoint(config, &config->endpoints[config->endpointsSize], +- &config->securityPolicies[i], UA_MESSAGESECURITYMODE_SIGNANDENCRYPT); ++ &config->securityPolicies[i], ++ UA_MESSAGESECURITYMODE_SIGNANDENCRYPT); + if(retval != UA_STATUSCODE_GOOD) + return retval; + config->endpointsSize++; +@@ -358,7 +359,7 @@ UA_ServerConfig_setMinimalCustomBuffer(UA_ServerConfig *config, UA_UInt16 portNu + const UA_ByteString *certificate, + UA_UInt32 sendBufferSize, + UA_UInt32 recvBufferSize) { +- if (!config) ++ if(!config) + return UA_STATUSCODE_BADINVALIDARGUMENT; + + UA_StatusCode retval = setDefaultConfig(config); +@@ -381,16 +382,18 @@ UA_ServerConfig_setMinimalCustomBuffer(UA_ServerConfig *config, UA_UInt16 portNu + } + + /* Initialize the Access Control plugin */ +- retval = UA_AccessControl_default(config, true, +- &config->securityPolicies[config->securityPoliciesSize-1].policyUri, +- usernamePasswordsSize, usernamePasswords); ++ retval = UA_AccessControl_default( ++ config, true, ++ &config->securityPolicies[config->securityPoliciesSize - 1].policyUri, ++ usernamePasswordsSize, usernamePasswords); + if(retval != UA_STATUSCODE_GOOD) { + UA_ServerConfig_clean(config); + return retval; + } + + /* Allocate the endpoint */ +- retval = UA_ServerConfig_addEndpoint(config, UA_SECURITY_POLICY_NONE_URI, UA_MESSAGESECURITYMODE_NONE); ++ retval = UA_ServerConfig_addEndpoint(config, UA_SECURITY_POLICY_NONE_URI, ++ UA_MESSAGESECURITYMODE_NONE); + if(retval != UA_STATUSCODE_GOOD) { + UA_ServerConfig_clean(config); + return retval; +@@ -402,28 +405,30 @@ UA_ServerConfig_setMinimalCustomBuffer(UA_ServerConfig *config, UA_UInt16 portNu + #ifdef UA_ENABLE_ENCRYPTION + + UA_EXPORT UA_StatusCode +-UA_ServerConfig_addSecurityPolicyBasic128Rsa15(UA_ServerConfig *config, ++UA_ServerConfig_addSecurityPolicyBasic128Rsa15(UA_ServerConfig *config, + const UA_ByteString *certificate, + const UA_ByteString *privateKey) { + UA_StatusCode retval; + + /* Allocate the SecurityPolicies */ +- UA_SecurityPolicy *tmp = (UA_SecurityPolicy *) +- UA_realloc(config->securityPolicies, sizeof(UA_SecurityPolicy) * (1 + config->securityPoliciesSize)); ++ UA_SecurityPolicy *tmp = (UA_SecurityPolicy *)UA_realloc( ++ config->securityPolicies, ++ sizeof(UA_SecurityPolicy) * (1 + config->securityPoliciesSize)); + if(!tmp) + return UA_STATUSCODE_BADOUTOFMEMORY; + config->securityPolicies = tmp; +- ++ + /* Populate the SecurityPolicies */ + UA_ByteString localCertificate = UA_BYTESTRING_NULL; +- UA_ByteString localPrivateKey = UA_BYTESTRING_NULL; ++ UA_ByteString localPrivateKey = UA_BYTESTRING_NULL; + if(certificate) + localCertificate = *certificate; + if(privateKey) +- localPrivateKey = *privateKey; +- retval = UA_SecurityPolicy_Basic128Rsa15(&config->securityPolicies[config->securityPoliciesSize], +- &config->certificateVerification, +- localCertificate, localPrivateKey, &config->logger); ++ localPrivateKey = *privateKey; ++ retval = UA_SecurityPolicy_Basic128Rsa15( ++ &config->securityPolicies[config->securityPoliciesSize], ++ &config->certificateVerification, localCertificate, localPrivateKey, ++ &config->logger); + if(retval != UA_STATUSCODE_GOOD) + return retval; + config->securityPoliciesSize++; +@@ -432,28 +437,30 @@ UA_ServerConfig_addSecurityPolicyBasic128Rsa15(UA_ServerConfig *config, + } + + UA_EXPORT UA_StatusCode +-UA_ServerConfig_addSecurityPolicyBasic256(UA_ServerConfig *config, ++UA_ServerConfig_addSecurityPolicyBasic256(UA_ServerConfig *config, + const UA_ByteString *certificate, + const UA_ByteString *privateKey) { + UA_StatusCode retval; + + /* Allocate the SecurityPolicies */ +- UA_SecurityPolicy *tmp = (UA_SecurityPolicy *) +- UA_realloc(config->securityPolicies, sizeof(UA_SecurityPolicy) * (1 + config->securityPoliciesSize)); ++ UA_SecurityPolicy *tmp = (UA_SecurityPolicy *)UA_realloc( ++ config->securityPolicies, ++ sizeof(UA_SecurityPolicy) * (1 + config->securityPoliciesSize)); + if(!tmp) + return UA_STATUSCODE_BADOUTOFMEMORY; + config->securityPolicies = tmp; +- ++ + /* Populate the SecurityPolicies */ + UA_ByteString localCertificate = UA_BYTESTRING_NULL; +- UA_ByteString localPrivateKey = UA_BYTESTRING_NULL; ++ UA_ByteString localPrivateKey = UA_BYTESTRING_NULL; + if(certificate) + localCertificate = *certificate; + if(privateKey) +- localPrivateKey = *privateKey; +- retval = UA_SecurityPolicy_Basic256(&config->securityPolicies[config->securityPoliciesSize], +- &config->certificateVerification, +- localCertificate, localPrivateKey, &config->logger); ++ localPrivateKey = *privateKey; ++ retval = UA_SecurityPolicy_Basic256( ++ &config->securityPolicies[config->securityPoliciesSize], ++ &config->certificateVerification, localCertificate, localPrivateKey, ++ &config->logger); + if(retval != UA_STATUSCODE_GOOD) + return retval; + config->securityPoliciesSize++; +@@ -462,28 +469,30 @@ UA_ServerConfig_addSecurityPolicyBasic256(UA_ServerConfig *config, + } + + UA_EXPORT UA_StatusCode +-UA_ServerConfig_addSecurityPolicyBasic256Sha256(UA_ServerConfig *config, ++UA_ServerConfig_addSecurityPolicyBasic256Sha256(UA_ServerConfig *config, + const UA_ByteString *certificate, + const UA_ByteString *privateKey) { + UA_StatusCode retval; + + /* Allocate the SecurityPolicies */ +- UA_SecurityPolicy *tmp = (UA_SecurityPolicy *) +- UA_realloc(config->securityPolicies, sizeof(UA_SecurityPolicy) * (1 + config->securityPoliciesSize)); ++ UA_SecurityPolicy *tmp = (UA_SecurityPolicy *)UA_realloc( ++ config->securityPolicies, ++ sizeof(UA_SecurityPolicy) * (1 + config->securityPoliciesSize)); + if(!tmp) + return UA_STATUSCODE_BADOUTOFMEMORY; + config->securityPolicies = tmp; +- ++ + /* Populate the SecurityPolicies */ + UA_ByteString localCertificate = UA_BYTESTRING_NULL; +- UA_ByteString localPrivateKey = UA_BYTESTRING_NULL; ++ UA_ByteString localPrivateKey = UA_BYTESTRING_NULL; + if(certificate) + localCertificate = *certificate; + if(privateKey) +- localPrivateKey = *privateKey; +- retval = UA_SecurityPolicy_Basic256Sha256(&config->securityPolicies[config->securityPoliciesSize], +- &config->certificateVerification, +- localCertificate, localPrivateKey, &config->logger); ++ localPrivateKey = *privateKey; ++ retval = UA_SecurityPolicy_Basic256Sha256( ++ &config->securityPolicies[config->securityPoliciesSize], ++ &config->certificateVerification, localCertificate, localPrivateKey, ++ &config->logger); + if(retval != UA_STATUSCODE_GOOD) + return retval; + config->securityPoliciesSize++; +@@ -498,43 +507,48 @@ UA_ServerConfig_addAllSecurityPolicies(UA_ServerConfig *config, + UA_StatusCode retval; + + /* Allocate the SecurityPolicies */ +- UA_SecurityPolicy *tmp = (UA_SecurityPolicy *) +- UA_realloc(config->securityPolicies, sizeof(UA_SecurityPolicy) * (4 + config->securityPoliciesSize)); ++ UA_SecurityPolicy *tmp = (UA_SecurityPolicy *)UA_realloc( ++ config->securityPolicies, ++ sizeof(UA_SecurityPolicy) * (4 + config->securityPoliciesSize)); + if(!tmp) + return UA_STATUSCODE_BADOUTOFMEMORY; + config->securityPolicies = tmp; +- ++ + /* Populate the SecurityPolicies */ + UA_ByteString localCertificate = UA_BYTESTRING_NULL; +- UA_ByteString localPrivateKey = UA_BYTESTRING_NULL; ++ UA_ByteString localPrivateKey = UA_BYTESTRING_NULL; + if(certificate) + localCertificate = *certificate; + if(privateKey) +- localPrivateKey = *privateKey; ++ localPrivateKey = *privateKey; + +- retval = UA_SecurityPolicy_None(&config->securityPolicies[config->securityPoliciesSize], NULL, +- localCertificate, &config->logger); ++ retval = ++ UA_SecurityPolicy_None(&config->securityPolicies[config->securityPoliciesSize], ++ NULL, localCertificate, &config->logger); + if(retval != UA_STATUSCODE_GOOD) + return retval; + config->securityPoliciesSize++; + +- retval = UA_SecurityPolicy_Basic128Rsa15(&config->securityPolicies[config->securityPoliciesSize], +- &config->certificateVerification, +- localCertificate, localPrivateKey, &config->logger); ++ retval = UA_SecurityPolicy_Basic128Rsa15( ++ &config->securityPolicies[config->securityPoliciesSize], ++ &config->certificateVerification, localCertificate, localPrivateKey, ++ &config->logger); + if(retval != UA_STATUSCODE_GOOD) + return retval; + config->securityPoliciesSize++; + +- retval = UA_SecurityPolicy_Basic256(&config->securityPolicies[config->securityPoliciesSize], +- &config->certificateVerification, +- localCertificate, localPrivateKey, &config->logger); ++ retval = UA_SecurityPolicy_Basic256( ++ &config->securityPolicies[config->securityPoliciesSize], ++ &config->certificateVerification, localCertificate, localPrivateKey, ++ &config->logger); + if(retval != UA_STATUSCODE_GOOD) + return retval; + config->securityPoliciesSize++; + +- retval = UA_SecurityPolicy_Basic256Sha256(&config->securityPolicies[config->securityPoliciesSize], +- &config->certificateVerification, +- localCertificate, localPrivateKey, &config->logger); ++ retval = UA_SecurityPolicy_Basic256Sha256( ++ &config->securityPolicies[config->securityPoliciesSize], ++ &config->certificateVerification, localCertificate, localPrivateKey, ++ &config->logger); + if(retval != UA_STATUSCODE_GOOD) + return retval; + config->securityPoliciesSize++; +@@ -543,27 +557,21 @@ UA_ServerConfig_addAllSecurityPolicies(UA_ServerConfig *config, + } + + UA_EXPORT UA_StatusCode +-UA_ServerConfig_setDefaultWithSecurityPolicies(UA_ServerConfig *conf, +- UA_UInt16 portNumber, +- const UA_ByteString *certificate, +- const UA_ByteString *privateKey, +- const UA_ByteString *trustList, +- size_t trustListSize, +- const UA_ByteString *issuerList, +- size_t issuerListSize, +- const UA_ByteString *revocationList, +- size_t revocationListSize) { ++UA_ServerConfig_setDefaultWithSecurityPolicies( ++ UA_ServerConfig *conf, UA_UInt16 portNumber, const UA_ByteString *certificate, ++ const UA_ByteString *privateKey, const UA_ByteString *trustList, size_t trustListSize, ++ const UA_ByteString *issuerList, size_t issuerListSize, ++ const UA_ByteString *revocationList, size_t revocationListSize) { + UA_StatusCode retval = setDefaultConfig(conf); + if(retval != UA_STATUSCODE_GOOD) { + UA_ServerConfig_clean(conf); + return retval; + } + +- retval = UA_CertificateVerification_Trustlist(&conf->certificateVerification, +- trustList, trustListSize, +- issuerList, issuerListSize, +- revocationList, revocationListSize); +- if (retval != UA_STATUSCODE_GOOD) ++ retval = UA_CertificateVerification_Trustlist( ++ &conf->certificateVerification, trustList, trustListSize, issuerList, ++ issuerListSize, revocationList, revocationListSize); ++ if(retval != UA_STATUSCODE_GOOD) + return retval; + + if(trustListSize == 0) +@@ -583,9 +591,9 @@ UA_ServerConfig_setDefaultWithSecurityPolicies(UA_ServerConfig *conf, + return retval; + } + +- retval = UA_AccessControl_default(conf, true, +- &conf->securityPolicies[conf->securityPoliciesSize-1].policyUri, +- usernamePasswordsSize, usernamePasswords); ++ retval = UA_AccessControl_default( ++ conf, true, &conf->securityPolicies[conf->securityPoliciesSize - 1].policyUri, ++ usernamePasswordsSize, usernamePasswords); + if(retval != UA_STATUSCODE_GOOD) { + UA_ServerConfig_clean(conf); + return retval; +@@ -637,7 +645,7 @@ UA_ClientConfig_setDefault(UA_ClientConfig *config) { + return UA_STATUSCODE_BADINTERNALERROR; + } + +- config->securityPolicies = (UA_SecurityPolicy*)UA_malloc(sizeof(UA_SecurityPolicy)); ++ config->securityPolicies = (UA_SecurityPolicy *)UA_malloc(sizeof(UA_SecurityPolicy)); + if(!config->securityPolicies) + return UA_STATUSCODE_BADOUTOFMEMORY; + UA_StatusCode retval = UA_SecurityPolicy_None(config->securityPolicies, NULL, +@@ -651,7 +659,8 @@ UA_ClientConfig_setDefault(UA_ClientConfig *config) { + + config->connectionFunc = UA_ClientConnectionTCP; + config->initConnectionFunc = UA_ClientConnectionTCP_init; /* for async client */ +- config->pollConnectionFunc = UA_ClientConnectionTCP_poll_callback; /* for async connection */ ++ config->pollConnectionFunc = ++ UA_ClientConnectionTCP_poll_callback; /* for async connection */ + + config->customDataTypes = NULL; + config->stateCallback = NULL; +@@ -673,30 +682,31 @@ UA_ClientConfig_setDefault(UA_ClientConfig *config) { + #ifdef UA_ENABLE_ENCRYPTION + UA_StatusCode + UA_ClientConfig_setDefaultEncryption(UA_ClientConfig *config, +- UA_ByteString localCertificate, UA_ByteString privateKey, ++ UA_ByteString localCertificate, ++ UA_ByteString privateKey, + const UA_ByteString *trustList, size_t trustListSize, +- const UA_ByteString *revocationList, size_t revocationListSize) { ++ const UA_ByteString *revocationList, ++ size_t revocationListSize) { + UA_StatusCode retval = UA_ClientConfig_setDefault(config); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + retval = UA_CertificateVerification_Trustlist(&config->certificateVerification, +- trustList, trustListSize, +- NULL, 0, ++ trustList, trustListSize, NULL, 0, + revocationList, revocationListSize); + if(retval != UA_STATUSCODE_GOOD) + return retval; + + /* Populate SecurityPolicies */ +- UA_SecurityPolicy *sp = (UA_SecurityPolicy*) +- UA_realloc(config->securityPolicies, sizeof(UA_SecurityPolicy) * 4); ++ UA_SecurityPolicy *sp = (UA_SecurityPolicy *)UA_realloc( ++ config->securityPolicies, sizeof(UA_SecurityPolicy) * 4); + if(!sp) + return UA_STATUSCODE_BADOUTOFMEMORY; + config->securityPolicies = sp; + +- retval = UA_SecurityPolicy_Basic128Rsa15(&config->securityPolicies[1], +- &config->certificateVerification, +- localCertificate, privateKey, &config->logger); ++ retval = UA_SecurityPolicy_Basic128Rsa15( ++ &config->securityPolicies[1], &config->certificateVerification, localCertificate, ++ privateKey, &config->logger); + if(retval != UA_STATUSCODE_GOOD) + return retval; + ++config->securityPoliciesSize; +@@ -708,9 +718,9 @@ UA_ClientConfig_setDefaultEncryption(UA_ClientConfig *config, + return retval; + ++config->securityPoliciesSize; + +- retval = UA_SecurityPolicy_Basic256Sha256(&config->securityPolicies[3], +- &config->certificateVerification, +- localCertificate, privateKey, &config->logger); ++ retval = UA_SecurityPolicy_Basic256Sha256( ++ &config->securityPolicies[3], &config->certificateVerification, localCertificate, ++ privateKey, &config->logger); + if(retval != UA_STATUSCODE_GOOD) + return retval; + ++config->securityPoliciesSize; From 85ffd2132bd5fc2bec4d3177f91516c4df921b2b Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Wed, 20 May 2020 18:34:23 +0200 Subject: [PATCH 07/81] remove pthread from test_package CMakeLitsts.txt Signed-off-by: Dovydas Girdvainis --- recipes/open62541/all/test_package/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/open62541/all/test_package/CMakeLists.txt b/recipes/open62541/all/test_package/CMakeLists.txt index bf5a0a295c431..d650e5b0a26f1 100644 --- a/recipes/open62541/all/test_package/CMakeLists.txt +++ b/recipes/open62541/all/test_package/CMakeLists.txt @@ -5,4 +5,4 @@ include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup() add_executable(test_package test_package.cpp) -target_link_libraries(test_package ${CONAN_LIBS} pthread) +target_link_libraries(test_package ${CONAN_LIBS}) From 4e13af7643806a7f31b959fedd0d454e26d0337d Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Wed, 20 May 2020 18:50:08 +0200 Subject: [PATCH 08/81] merge set_static_version v1.0 and v1.0.1 into one patch Signed-off-by: Dovydas Girdvainis --- recipes/open62541/all/conandata.yml | 4 +- ...n_v_1_0.patch => set_static_version.patch} | 0 .../patches/set_static_version_v_1_0_1.patch | 589 ------------------ 3 files changed, 2 insertions(+), 591 deletions(-) rename recipes/open62541/all/patches/{set_static_version_v_1_0.patch => set_static_version.patch} (100%) delete mode 100644 recipes/open62541/all/patches/set_static_version_v_1_0_1.patch diff --git a/recipes/open62541/all/conandata.yml b/recipes/open62541/all/conandata.yml index 8412d9dc72163..8c0e07e62fc4b 100644 --- a/recipes/open62541/all/conandata.yml +++ b/recipes/open62541/all/conandata.yml @@ -9,10 +9,10 @@ patches: "1.0.0": - patch_file: "patches/add_conan_center_index_compliance_v_1_0.patch" base_path: "source_subfolder" - - patch_file: "patches/set_static_version_v_1_0.patch" + - patch_file: "patches/set_static_version.patch" base_path: "source_subfolder" "1.0.1": - patch_file: "patches/add_conan_center_index_compliance_v_1_0_1.patch" base_path: "source_subfolder" - - patch_file: "patches/set_static_version_v_1_0_1.patch" + - patch_file: "patches/set_static_version.patch" base_path: "source_subfolder" diff --git a/recipes/open62541/all/patches/set_static_version_v_1_0.patch b/recipes/open62541/all/patches/set_static_version.patch similarity index 100% rename from recipes/open62541/all/patches/set_static_version_v_1_0.patch rename to recipes/open62541/all/patches/set_static_version.patch diff --git a/recipes/open62541/all/patches/set_static_version_v_1_0_1.patch b/recipes/open62541/all/patches/set_static_version_v_1_0_1.patch deleted file mode 100644 index df9cc65cba88a..0000000000000 --- a/recipes/open62541/all/patches/set_static_version_v_1_0_1.patch +++ /dev/null @@ -1,589 +0,0 @@ -diff --git a/plugins/ua_config_default.c b/plugins/ua_config_default.c -index 9770b861..7c70e22c 100644 ---- a/plugins/ua_config_default.c -+++ b/plugins/ua_config_default.c -@@ -39,11 +39,11 @@ UA_DURATIONRANGE(UA_Duration min, UA_Duration max) { - /*******************************/ - - const UA_ConnectionConfig UA_ConnectionConfig_default = { -- 0, /* .protocolVersion */ -+ 0, /* .protocolVersion */ - 65535, /* .sendBufferSize, 64k per chunk */ - 65535, /* .recvBufferSize, 64k per chunk */ -- 0, /* .maxMessageSize, 0 -> unlimited */ -- 0 /* .maxChunkCount, 0 -> unlimited */ -+ 0, /* .maxMessageSize, 0 -> unlimited */ -+ 0 /* .maxChunkCount, 0 -> unlimited */ - }; - - /***************************/ -@@ -57,10 +57,6 @@ const UA_ConnectionConfig UA_ConnectionConfig_default = { - #define APPLICATION_URI "urn:unconfigured:application" - #define APPLICATION_URI_SERVER "urn:open62541.server.application" - --#define STRINGIFY(arg) #arg --#define VERSION(MAJOR, MINOR, PATCH, LABEL) \ -- STRINGIFY(MAJOR) "." STRINGIFY(MINOR) "." STRINGIFY(PATCH) LABEL -- - static UA_StatusCode - createEndpoint(UA_ServerConfig *conf, UA_EndpointDescription *endpoint, - const UA_SecurityPolicy *securityPolicy, -@@ -69,17 +65,16 @@ createEndpoint(UA_ServerConfig *conf, UA_EndpointDescription *endpoint, - - endpoint->securityMode = securityMode; - UA_String_copy(&securityPolicy->policyUri, &endpoint->securityPolicyUri); -- endpoint->transportProfileUri = -- UA_STRING_ALLOC("http://opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary"); -+ endpoint->transportProfileUri = UA_STRING_ALLOC( -+ "http://opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary"); - - /* Add security level value for the corresponding message security mode */ -- endpoint->securityLevel = (UA_Byte) securityMode; -+ endpoint->securityLevel = (UA_Byte)securityMode; - - /* Enable all login mechanisms from the access control plugin */ -- UA_StatusCode retval = UA_Array_copy(conf->accessControl.userTokenPolicies, -- conf->accessControl.userTokenPoliciesSize, -- (void **)&endpoint->userIdentityTokens, -- &UA_TYPES[UA_TYPES_USERTOKENPOLICY]); -+ UA_StatusCode retval = UA_Array_copy( -+ conf->accessControl.userTokenPolicies, conf->accessControl.userTokenPoliciesSize, -+ (void **)&endpoint->userIdentityTokens, &UA_TYPES[UA_TYPES_USERTOKENPOLICY]); - if(retval != UA_STATUSCODE_GOOD) - return retval; - endpoint->userIdentityTokensSize = conf->accessControl.userTokenPoliciesSize; -@@ -97,7 +92,7 @@ static UA_UsernamePasswordLogin usernamePasswords[2] = { - - static UA_StatusCode - setDefaultConfig(UA_ServerConfig *conf) { -- if (!conf) -+ if(!conf) - return UA_STATUSCODE_BADINVALIDARGUMENT; - - /* Zero out.. All members have a valid initial value */ -@@ -114,14 +109,12 @@ setDefaultConfig(UA_ServerConfig *conf) { - conf->buildInfo.productUri = UA_STRING_ALLOC(PRODUCT_URI); - conf->buildInfo.manufacturerName = UA_STRING_ALLOC(MANUFACTURER_NAME); - conf->buildInfo.productName = UA_STRING_ALLOC(PRODUCT_NAME); -- conf->buildInfo.softwareVersion = -- UA_STRING_ALLOC(VERSION(UA_OPEN62541_VER_MAJOR, UA_OPEN62541_VER_MINOR, -- UA_OPEN62541_VER_PATCH, UA_OPEN62541_VER_LABEL)); -- #ifdef UA_PACK_DEBIAN -+ conf->buildInfo.softwareVersion = UA_STRING_ALLOC("1.0.1"); -+#ifdef UA_PACK_DEBIAN - conf->buildInfo.buildNumber = UA_STRING_ALLOC("deb"); -- #else -+#else - conf->buildInfo.buildNumber = UA_STRING_ALLOC(__DATE__ " " __TIME__); -- #endif -+#endif - conf->buildInfo.buildDate = UA_DateTime_now(); - - conf->applicationDescription.applicationUri = UA_STRING_ALLOC(APPLICATION_URI_SERVER); -@@ -219,36 +212,37 @@ setDefaultConfig(UA_ServerConfig *conf) { - } - - UA_EXPORT UA_StatusCode --UA_ServerConfig_setBasics(UA_ServerConfig* conf) { -+UA_ServerConfig_setBasics(UA_ServerConfig *conf) { - return setDefaultConfig(conf); - } - - static UA_StatusCode - addDefaultNetworkLayers(UA_ServerConfig *conf, UA_UInt16 portNumber, - UA_UInt32 sendBufferSize, UA_UInt32 recvBufferSize) { -- return UA_ServerConfig_addNetworkLayerTCP(conf, portNumber, sendBufferSize, recvBufferSize); -+ return UA_ServerConfig_addNetworkLayerTCP(conf, portNumber, sendBufferSize, -+ recvBufferSize); - } - -- - UA_EXPORT UA_StatusCode - UA_ServerConfig_addNetworkLayerTCP(UA_ServerConfig *conf, UA_UInt16 portNumber, - UA_UInt32 sendBufferSize, UA_UInt32 recvBufferSize) { - /* Add a network layer */ -- UA_ServerNetworkLayer *tmp = (UA_ServerNetworkLayer *) -- UA_realloc(conf->networkLayers, sizeof(UA_ServerNetworkLayer) * (1 + conf->networkLayersSize)); -+ UA_ServerNetworkLayer *tmp = (UA_ServerNetworkLayer *)UA_realloc( -+ conf->networkLayers, -+ sizeof(UA_ServerNetworkLayer) * (1 + conf->networkLayersSize)); - if(!tmp) - return UA_STATUSCODE_BADOUTOFMEMORY; - conf->networkLayers = tmp; - - UA_ConnectionConfig config = UA_ConnectionConfig_default; -- if (sendBufferSize > 0) -+ if(sendBufferSize > 0) - config.sendBufferSize = sendBufferSize; -- if (recvBufferSize > 0) -+ if(recvBufferSize > 0) - config.recvBufferSize = recvBufferSize; - - conf->networkLayers[conf->networkLayersSize] = - UA_ServerNetworkLayerTCP(config, portNumber, &conf->logger); -- if (!conf->networkLayers[conf->networkLayersSize].handle) -+ if(!conf->networkLayers[conf->networkLayersSize].handle) - return UA_STATUSCODE_BADOUTOFMEMORY; - conf->networkLayersSize++; - -@@ -256,23 +250,25 @@ UA_ServerConfig_addNetworkLayerTCP(UA_ServerConfig *conf, UA_UInt16 portNumber, - } - - UA_EXPORT UA_StatusCode --UA_ServerConfig_addSecurityPolicyNone(UA_ServerConfig *config, -+UA_ServerConfig_addSecurityPolicyNone(UA_ServerConfig *config, - const UA_ByteString *certificate) { - UA_StatusCode retval; - - /* Allocate the SecurityPolicies */ -- UA_SecurityPolicy *tmp = (UA_SecurityPolicy *) -- UA_realloc(config->securityPolicies, sizeof(UA_SecurityPolicy) * (1 + config->securityPoliciesSize)); -+ UA_SecurityPolicy *tmp = (UA_SecurityPolicy *)UA_realloc( -+ config->securityPolicies, -+ sizeof(UA_SecurityPolicy) * (1 + config->securityPoliciesSize)); - if(!tmp) - return UA_STATUSCODE_BADOUTOFMEMORY; - config->securityPolicies = tmp; -- -+ - /* Populate the SecurityPolicies */ - UA_ByteString localCertificate = UA_BYTESTRING_NULL; - if(certificate) - localCertificate = *certificate; -- retval = UA_SecurityPolicy_None(&config->securityPolicies[config->securityPoliciesSize], NULL, -- localCertificate, &config->logger); -+ retval = -+ UA_SecurityPolicy_None(&config->securityPolicies[config->securityPoliciesSize], -+ NULL, localCertificate, &config->logger); - if(retval != UA_STATUSCODE_GOOD) - return retval; - config->securityPoliciesSize++; -@@ -281,14 +277,13 @@ UA_ServerConfig_addSecurityPolicyNone(UA_ServerConfig *config, - } - - UA_EXPORT UA_StatusCode --UA_ServerConfig_addEndpoint(UA_ServerConfig *config, const UA_String securityPolicyUri, -- UA_MessageSecurityMode securityMode) --{ -+UA_ServerConfig_addEndpoint(UA_ServerConfig *config, const UA_String securityPolicyUri, -+ UA_MessageSecurityMode securityMode) { - UA_StatusCode retval; - - /* Allocate the endpoint */ -- UA_EndpointDescription * tmp = (UA_EndpointDescription *) -- UA_realloc(config->endpoints, sizeof(UA_EndpointDescription) * (1 + config->endpointsSize)); -+ UA_EndpointDescription *tmp = (UA_EndpointDescription *)UA_realloc( -+ config->endpoints, sizeof(UA_EndpointDescription) * (1 + config->endpointsSize)); - if(!tmp) { - return UA_STATUSCODE_BADOUTOFMEMORY; - } -@@ -296,18 +291,18 @@ UA_ServerConfig_addEndpoint(UA_ServerConfig *config, const UA_String securityPol - - /* Lookup the security policy */ - const UA_SecurityPolicy *policy = NULL; -- for (size_t i = 0; i < config->securityPoliciesSize; ++i) { -- if (UA_String_equal(&securityPolicyUri, &config->securityPolicies[i].policyUri)) { -+ for(size_t i = 0; i < config->securityPoliciesSize; ++i) { -+ if(UA_String_equal(&securityPolicyUri, &config->securityPolicies[i].policyUri)) { - policy = &config->securityPolicies[i]; - break; - } - } -- if (!policy) -+ if(!policy) - return UA_STATUSCODE_BADINVALIDARGUMENT; - - /* Populate the endpoint */ -- retval = createEndpoint(config, &config->endpoints[config->endpointsSize], -- policy, securityMode); -+ retval = createEndpoint(config, &config->endpoints[config->endpointsSize], policy, -+ securityMode); - if(retval != UA_STATUSCODE_GOOD) - return retval; - config->endpointsSize++; -@@ -320,30 +315,36 @@ UA_ServerConfig_addAllEndpoints(UA_ServerConfig *config) { - UA_StatusCode retval; - - /* Allocate the endpoints */ -- UA_EndpointDescription * tmp = (UA_EndpointDescription *) -- UA_realloc(config->endpoints, sizeof(UA_EndpointDescription) * (2 * config->securityPoliciesSize + config->endpointsSize)); -+ UA_EndpointDescription *tmp = (UA_EndpointDescription *)UA_realloc( -+ config->endpoints, -+ sizeof(UA_EndpointDescription) * -+ (2 * config->securityPoliciesSize + config->endpointsSize)); - if(!tmp) { - return UA_STATUSCODE_BADOUTOFMEMORY; - } - config->endpoints = tmp; - - /* Populate the endpoints */ -- for (size_t i = 0; i < config->securityPoliciesSize; ++i) { -- if (UA_String_equal(&UA_SECURITY_POLICY_NONE_URI, &config->securityPolicies[i].policyUri)) { -- retval = createEndpoint(config, &config->endpoints[config->endpointsSize], -- &config->securityPolicies[i], UA_MESSAGESECURITYMODE_NONE); -+ for(size_t i = 0; i < config->securityPoliciesSize; ++i) { -+ if(UA_String_equal(&UA_SECURITY_POLICY_NONE_URI, -+ &config->securityPolicies[i].policyUri)) { -+ retval = -+ createEndpoint(config, &config->endpoints[config->endpointsSize], -+ &config->securityPolicies[i], UA_MESSAGESECURITYMODE_NONE); - if(retval != UA_STATUSCODE_GOOD) - return retval; - config->endpointsSize++; - } else { -- retval = createEndpoint(config, &config->endpoints[config->endpointsSize], -- &config->securityPolicies[i], UA_MESSAGESECURITYMODE_SIGN); -+ retval = -+ createEndpoint(config, &config->endpoints[config->endpointsSize], -+ &config->securityPolicies[i], UA_MESSAGESECURITYMODE_SIGN); - if(retval != UA_STATUSCODE_GOOD) - return retval; - config->endpointsSize++; - - retval = createEndpoint(config, &config->endpoints[config->endpointsSize], -- &config->securityPolicies[i], UA_MESSAGESECURITYMODE_SIGNANDENCRYPT); -+ &config->securityPolicies[i], -+ UA_MESSAGESECURITYMODE_SIGNANDENCRYPT); - if(retval != UA_STATUSCODE_GOOD) - return retval; - config->endpointsSize++; -@@ -358,7 +359,7 @@ UA_ServerConfig_setMinimalCustomBuffer(UA_ServerConfig *config, UA_UInt16 portNu - const UA_ByteString *certificate, - UA_UInt32 sendBufferSize, - UA_UInt32 recvBufferSize) { -- if (!config) -+ if(!config) - return UA_STATUSCODE_BADINVALIDARGUMENT; - - UA_StatusCode retval = setDefaultConfig(config); -@@ -381,16 +382,18 @@ UA_ServerConfig_setMinimalCustomBuffer(UA_ServerConfig *config, UA_UInt16 portNu - } - - /* Initialize the Access Control plugin */ -- retval = UA_AccessControl_default(config, true, -- &config->securityPolicies[config->securityPoliciesSize-1].policyUri, -- usernamePasswordsSize, usernamePasswords); -+ retval = UA_AccessControl_default( -+ config, true, -+ &config->securityPolicies[config->securityPoliciesSize - 1].policyUri, -+ usernamePasswordsSize, usernamePasswords); - if(retval != UA_STATUSCODE_GOOD) { - UA_ServerConfig_clean(config); - return retval; - } - - /* Allocate the endpoint */ -- retval = UA_ServerConfig_addEndpoint(config, UA_SECURITY_POLICY_NONE_URI, UA_MESSAGESECURITYMODE_NONE); -+ retval = UA_ServerConfig_addEndpoint(config, UA_SECURITY_POLICY_NONE_URI, -+ UA_MESSAGESECURITYMODE_NONE); - if(retval != UA_STATUSCODE_GOOD) { - UA_ServerConfig_clean(config); - return retval; -@@ -402,28 +405,30 @@ UA_ServerConfig_setMinimalCustomBuffer(UA_ServerConfig *config, UA_UInt16 portNu - #ifdef UA_ENABLE_ENCRYPTION - - UA_EXPORT UA_StatusCode --UA_ServerConfig_addSecurityPolicyBasic128Rsa15(UA_ServerConfig *config, -+UA_ServerConfig_addSecurityPolicyBasic128Rsa15(UA_ServerConfig *config, - const UA_ByteString *certificate, - const UA_ByteString *privateKey) { - UA_StatusCode retval; - - /* Allocate the SecurityPolicies */ -- UA_SecurityPolicy *tmp = (UA_SecurityPolicy *) -- UA_realloc(config->securityPolicies, sizeof(UA_SecurityPolicy) * (1 + config->securityPoliciesSize)); -+ UA_SecurityPolicy *tmp = (UA_SecurityPolicy *)UA_realloc( -+ config->securityPolicies, -+ sizeof(UA_SecurityPolicy) * (1 + config->securityPoliciesSize)); - if(!tmp) - return UA_STATUSCODE_BADOUTOFMEMORY; - config->securityPolicies = tmp; -- -+ - /* Populate the SecurityPolicies */ - UA_ByteString localCertificate = UA_BYTESTRING_NULL; -- UA_ByteString localPrivateKey = UA_BYTESTRING_NULL; -+ UA_ByteString localPrivateKey = UA_BYTESTRING_NULL; - if(certificate) - localCertificate = *certificate; - if(privateKey) -- localPrivateKey = *privateKey; -- retval = UA_SecurityPolicy_Basic128Rsa15(&config->securityPolicies[config->securityPoliciesSize], -- &config->certificateVerification, -- localCertificate, localPrivateKey, &config->logger); -+ localPrivateKey = *privateKey; -+ retval = UA_SecurityPolicy_Basic128Rsa15( -+ &config->securityPolicies[config->securityPoliciesSize], -+ &config->certificateVerification, localCertificate, localPrivateKey, -+ &config->logger); - if(retval != UA_STATUSCODE_GOOD) - return retval; - config->securityPoliciesSize++; -@@ -432,28 +437,30 @@ UA_ServerConfig_addSecurityPolicyBasic128Rsa15(UA_ServerConfig *config, - } - - UA_EXPORT UA_StatusCode --UA_ServerConfig_addSecurityPolicyBasic256(UA_ServerConfig *config, -+UA_ServerConfig_addSecurityPolicyBasic256(UA_ServerConfig *config, - const UA_ByteString *certificate, - const UA_ByteString *privateKey) { - UA_StatusCode retval; - - /* Allocate the SecurityPolicies */ -- UA_SecurityPolicy *tmp = (UA_SecurityPolicy *) -- UA_realloc(config->securityPolicies, sizeof(UA_SecurityPolicy) * (1 + config->securityPoliciesSize)); -+ UA_SecurityPolicy *tmp = (UA_SecurityPolicy *)UA_realloc( -+ config->securityPolicies, -+ sizeof(UA_SecurityPolicy) * (1 + config->securityPoliciesSize)); - if(!tmp) - return UA_STATUSCODE_BADOUTOFMEMORY; - config->securityPolicies = tmp; -- -+ - /* Populate the SecurityPolicies */ - UA_ByteString localCertificate = UA_BYTESTRING_NULL; -- UA_ByteString localPrivateKey = UA_BYTESTRING_NULL; -+ UA_ByteString localPrivateKey = UA_BYTESTRING_NULL; - if(certificate) - localCertificate = *certificate; - if(privateKey) -- localPrivateKey = *privateKey; -- retval = UA_SecurityPolicy_Basic256(&config->securityPolicies[config->securityPoliciesSize], -- &config->certificateVerification, -- localCertificate, localPrivateKey, &config->logger); -+ localPrivateKey = *privateKey; -+ retval = UA_SecurityPolicy_Basic256( -+ &config->securityPolicies[config->securityPoliciesSize], -+ &config->certificateVerification, localCertificate, localPrivateKey, -+ &config->logger); - if(retval != UA_STATUSCODE_GOOD) - return retval; - config->securityPoliciesSize++; -@@ -462,28 +469,30 @@ UA_ServerConfig_addSecurityPolicyBasic256(UA_ServerConfig *config, - } - - UA_EXPORT UA_StatusCode --UA_ServerConfig_addSecurityPolicyBasic256Sha256(UA_ServerConfig *config, -+UA_ServerConfig_addSecurityPolicyBasic256Sha256(UA_ServerConfig *config, - const UA_ByteString *certificate, - const UA_ByteString *privateKey) { - UA_StatusCode retval; - - /* Allocate the SecurityPolicies */ -- UA_SecurityPolicy *tmp = (UA_SecurityPolicy *) -- UA_realloc(config->securityPolicies, sizeof(UA_SecurityPolicy) * (1 + config->securityPoliciesSize)); -+ UA_SecurityPolicy *tmp = (UA_SecurityPolicy *)UA_realloc( -+ config->securityPolicies, -+ sizeof(UA_SecurityPolicy) * (1 + config->securityPoliciesSize)); - if(!tmp) - return UA_STATUSCODE_BADOUTOFMEMORY; - config->securityPolicies = tmp; -- -+ - /* Populate the SecurityPolicies */ - UA_ByteString localCertificate = UA_BYTESTRING_NULL; -- UA_ByteString localPrivateKey = UA_BYTESTRING_NULL; -+ UA_ByteString localPrivateKey = UA_BYTESTRING_NULL; - if(certificate) - localCertificate = *certificate; - if(privateKey) -- localPrivateKey = *privateKey; -- retval = UA_SecurityPolicy_Basic256Sha256(&config->securityPolicies[config->securityPoliciesSize], -- &config->certificateVerification, -- localCertificate, localPrivateKey, &config->logger); -+ localPrivateKey = *privateKey; -+ retval = UA_SecurityPolicy_Basic256Sha256( -+ &config->securityPolicies[config->securityPoliciesSize], -+ &config->certificateVerification, localCertificate, localPrivateKey, -+ &config->logger); - if(retval != UA_STATUSCODE_GOOD) - return retval; - config->securityPoliciesSize++; -@@ -498,43 +507,48 @@ UA_ServerConfig_addAllSecurityPolicies(UA_ServerConfig *config, - UA_StatusCode retval; - - /* Allocate the SecurityPolicies */ -- UA_SecurityPolicy *tmp = (UA_SecurityPolicy *) -- UA_realloc(config->securityPolicies, sizeof(UA_SecurityPolicy) * (4 + config->securityPoliciesSize)); -+ UA_SecurityPolicy *tmp = (UA_SecurityPolicy *)UA_realloc( -+ config->securityPolicies, -+ sizeof(UA_SecurityPolicy) * (4 + config->securityPoliciesSize)); - if(!tmp) - return UA_STATUSCODE_BADOUTOFMEMORY; - config->securityPolicies = tmp; -- -+ - /* Populate the SecurityPolicies */ - UA_ByteString localCertificate = UA_BYTESTRING_NULL; -- UA_ByteString localPrivateKey = UA_BYTESTRING_NULL; -+ UA_ByteString localPrivateKey = UA_BYTESTRING_NULL; - if(certificate) - localCertificate = *certificate; - if(privateKey) -- localPrivateKey = *privateKey; -+ localPrivateKey = *privateKey; - -- retval = UA_SecurityPolicy_None(&config->securityPolicies[config->securityPoliciesSize], NULL, -- localCertificate, &config->logger); -+ retval = -+ UA_SecurityPolicy_None(&config->securityPolicies[config->securityPoliciesSize], -+ NULL, localCertificate, &config->logger); - if(retval != UA_STATUSCODE_GOOD) - return retval; - config->securityPoliciesSize++; - -- retval = UA_SecurityPolicy_Basic128Rsa15(&config->securityPolicies[config->securityPoliciesSize], -- &config->certificateVerification, -- localCertificate, localPrivateKey, &config->logger); -+ retval = UA_SecurityPolicy_Basic128Rsa15( -+ &config->securityPolicies[config->securityPoliciesSize], -+ &config->certificateVerification, localCertificate, localPrivateKey, -+ &config->logger); - if(retval != UA_STATUSCODE_GOOD) - return retval; - config->securityPoliciesSize++; - -- retval = UA_SecurityPolicy_Basic256(&config->securityPolicies[config->securityPoliciesSize], -- &config->certificateVerification, -- localCertificate, localPrivateKey, &config->logger); -+ retval = UA_SecurityPolicy_Basic256( -+ &config->securityPolicies[config->securityPoliciesSize], -+ &config->certificateVerification, localCertificate, localPrivateKey, -+ &config->logger); - if(retval != UA_STATUSCODE_GOOD) - return retval; - config->securityPoliciesSize++; - -- retval = UA_SecurityPolicy_Basic256Sha256(&config->securityPolicies[config->securityPoliciesSize], -- &config->certificateVerification, -- localCertificate, localPrivateKey, &config->logger); -+ retval = UA_SecurityPolicy_Basic256Sha256( -+ &config->securityPolicies[config->securityPoliciesSize], -+ &config->certificateVerification, localCertificate, localPrivateKey, -+ &config->logger); - if(retval != UA_STATUSCODE_GOOD) - return retval; - config->securityPoliciesSize++; -@@ -543,27 +557,21 @@ UA_ServerConfig_addAllSecurityPolicies(UA_ServerConfig *config, - } - - UA_EXPORT UA_StatusCode --UA_ServerConfig_setDefaultWithSecurityPolicies(UA_ServerConfig *conf, -- UA_UInt16 portNumber, -- const UA_ByteString *certificate, -- const UA_ByteString *privateKey, -- const UA_ByteString *trustList, -- size_t trustListSize, -- const UA_ByteString *issuerList, -- size_t issuerListSize, -- const UA_ByteString *revocationList, -- size_t revocationListSize) { -+UA_ServerConfig_setDefaultWithSecurityPolicies( -+ UA_ServerConfig *conf, UA_UInt16 portNumber, const UA_ByteString *certificate, -+ const UA_ByteString *privateKey, const UA_ByteString *trustList, size_t trustListSize, -+ const UA_ByteString *issuerList, size_t issuerListSize, -+ const UA_ByteString *revocationList, size_t revocationListSize) { - UA_StatusCode retval = setDefaultConfig(conf); - if(retval != UA_STATUSCODE_GOOD) { - UA_ServerConfig_clean(conf); - return retval; - } - -- retval = UA_CertificateVerification_Trustlist(&conf->certificateVerification, -- trustList, trustListSize, -- issuerList, issuerListSize, -- revocationList, revocationListSize); -- if (retval != UA_STATUSCODE_GOOD) -+ retval = UA_CertificateVerification_Trustlist( -+ &conf->certificateVerification, trustList, trustListSize, issuerList, -+ issuerListSize, revocationList, revocationListSize); -+ if(retval != UA_STATUSCODE_GOOD) - return retval; - - if(trustListSize == 0) -@@ -583,9 +591,9 @@ UA_ServerConfig_setDefaultWithSecurityPolicies(UA_ServerConfig *conf, - return retval; - } - -- retval = UA_AccessControl_default(conf, true, -- &conf->securityPolicies[conf->securityPoliciesSize-1].policyUri, -- usernamePasswordsSize, usernamePasswords); -+ retval = UA_AccessControl_default( -+ conf, true, &conf->securityPolicies[conf->securityPoliciesSize - 1].policyUri, -+ usernamePasswordsSize, usernamePasswords); - if(retval != UA_STATUSCODE_GOOD) { - UA_ServerConfig_clean(conf); - return retval; -@@ -637,7 +645,7 @@ UA_ClientConfig_setDefault(UA_ClientConfig *config) { - return UA_STATUSCODE_BADINTERNALERROR; - } - -- config->securityPolicies = (UA_SecurityPolicy*)UA_malloc(sizeof(UA_SecurityPolicy)); -+ config->securityPolicies = (UA_SecurityPolicy *)UA_malloc(sizeof(UA_SecurityPolicy)); - if(!config->securityPolicies) - return UA_STATUSCODE_BADOUTOFMEMORY; - UA_StatusCode retval = UA_SecurityPolicy_None(config->securityPolicies, NULL, -@@ -651,7 +659,8 @@ UA_ClientConfig_setDefault(UA_ClientConfig *config) { - - config->connectionFunc = UA_ClientConnectionTCP; - config->initConnectionFunc = UA_ClientConnectionTCP_init; /* for async client */ -- config->pollConnectionFunc = UA_ClientConnectionTCP_poll_callback; /* for async connection */ -+ config->pollConnectionFunc = -+ UA_ClientConnectionTCP_poll_callback; /* for async connection */ - - config->customDataTypes = NULL; - config->stateCallback = NULL; -@@ -673,30 +682,31 @@ UA_ClientConfig_setDefault(UA_ClientConfig *config) { - #ifdef UA_ENABLE_ENCRYPTION - UA_StatusCode - UA_ClientConfig_setDefaultEncryption(UA_ClientConfig *config, -- UA_ByteString localCertificate, UA_ByteString privateKey, -+ UA_ByteString localCertificate, -+ UA_ByteString privateKey, - const UA_ByteString *trustList, size_t trustListSize, -- const UA_ByteString *revocationList, size_t revocationListSize) { -+ const UA_ByteString *revocationList, -+ size_t revocationListSize) { - UA_StatusCode retval = UA_ClientConfig_setDefault(config); - if(retval != UA_STATUSCODE_GOOD) - return retval; - - retval = UA_CertificateVerification_Trustlist(&config->certificateVerification, -- trustList, trustListSize, -- NULL, 0, -+ trustList, trustListSize, NULL, 0, - revocationList, revocationListSize); - if(retval != UA_STATUSCODE_GOOD) - return retval; - - /* Populate SecurityPolicies */ -- UA_SecurityPolicy *sp = (UA_SecurityPolicy*) -- UA_realloc(config->securityPolicies, sizeof(UA_SecurityPolicy) * 4); -+ UA_SecurityPolicy *sp = (UA_SecurityPolicy *)UA_realloc( -+ config->securityPolicies, sizeof(UA_SecurityPolicy) * 4); - if(!sp) - return UA_STATUSCODE_BADOUTOFMEMORY; - config->securityPolicies = sp; - -- retval = UA_SecurityPolicy_Basic128Rsa15(&config->securityPolicies[1], -- &config->certificateVerification, -- localCertificate, privateKey, &config->logger); -+ retval = UA_SecurityPolicy_Basic128Rsa15( -+ &config->securityPolicies[1], &config->certificateVerification, localCertificate, -+ privateKey, &config->logger); - if(retval != UA_STATUSCODE_GOOD) - return retval; - ++config->securityPoliciesSize; -@@ -708,9 +718,9 @@ UA_ClientConfig_setDefaultEncryption(UA_ClientConfig *config, - return retval; - ++config->securityPoliciesSize; - -- retval = UA_SecurityPolicy_Basic256Sha256(&config->securityPolicies[3], -- &config->certificateVerification, -- localCertificate, privateKey, &config->logger); -+ retval = UA_SecurityPolicy_Basic256Sha256( -+ &config->securityPolicies[3], &config->certificateVerification, localCertificate, -+ privateKey, &config->logger); - if(retval != UA_STATUSCODE_GOOD) - return retval; - ++config->securityPoliciesSize; From e686498e78fccd53e5d4f47712ca94acffc36638 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Fri, 22 May 2020 15:33:34 +0200 Subject: [PATCH 09/81] set project version from recipe --- recipes/open62541/all/conanfile.py | 6 +- .../all/patches/set_static_version.patch | 601 +----------------- 2 files changed, 19 insertions(+), 588 deletions(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index 64effd1f00ff8..0060590572dd7 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -140,6 +140,10 @@ def source(self): def _configure_cmake(self): cmake = CMake(self) cmake.verbose = True + version = Version(self.version) + cmake.definitions["OPEN62541_VER_MAJOR"] = version.major(fill=False) + cmake.definitions["OPEN62541_VER_MINOR"] = version.minor(fill=False) + cmake.definitions["OPEN62541_VER_PATCH"] = version.patch() if self.settings.os != "Windows": cmake.definitions["POSITION_INDEPENDENT_CODE"] = self.options.fPIC cmake.definitions["BUILD_SHARED_LIBS"] = self.options.shared @@ -178,7 +182,7 @@ def _configure_cmake(self): cmake.definitions["UA_ENABLE_HARDENING"] = self.options.hardening if self.settings.compiler == "Visual Studio" and self.options.shared == True: cmake.definitions["UA_MSVC_FORCE_STATIC_CRT"] = True - if Version(self.version) > "1.0.1": + if version > "1.0.1": cmake.definitions["UA_COMPILE_AS_CXX"] = self.options.cpp_compatible cmake.configure() return cmake diff --git a/recipes/open62541/all/patches/set_static_version.patch b/recipes/open62541/all/patches/set_static_version.patch index 37fee8a79024b..f3c9935c11bc7 100644 --- a/recipes/open62541/all/patches/set_static_version.patch +++ b/recipes/open62541/all/patches/set_static_version.patch @@ -1,589 +1,16 @@ -diff --git a/plugins/ua_config_default.c b/plugins/ua_config_default.c -index 9770b861..e7b550b5 100644 ---- a/plugins/ua_config_default.c -+++ b/plugins/ua_config_default.c -@@ -39,11 +39,11 @@ UA_DURATIONRANGE(UA_Duration min, UA_Duration max) { - /*******************************/ - - const UA_ConnectionConfig UA_ConnectionConfig_default = { -- 0, /* .protocolVersion */ -+ 0, /* .protocolVersion */ - 65535, /* .sendBufferSize, 64k per chunk */ - 65535, /* .recvBufferSize, 64k per chunk */ -- 0, /* .maxMessageSize, 0 -> unlimited */ -- 0 /* .maxChunkCount, 0 -> unlimited */ -+ 0, /* .maxMessageSize, 0 -> unlimited */ -+ 0 /* .maxChunkCount, 0 -> unlimited */ - }; - - /***************************/ -@@ -57,10 +57,6 @@ const UA_ConnectionConfig UA_ConnectionConfig_default = { - #define APPLICATION_URI "urn:unconfigured:application" - #define APPLICATION_URI_SERVER "urn:open62541.server.application" - --#define STRINGIFY(arg) #arg --#define VERSION(MAJOR, MINOR, PATCH, LABEL) \ -- STRINGIFY(MAJOR) "." STRINGIFY(MINOR) "." STRINGIFY(PATCH) LABEL -- - static UA_StatusCode - createEndpoint(UA_ServerConfig *conf, UA_EndpointDescription *endpoint, - const UA_SecurityPolicy *securityPolicy, -@@ -69,17 +65,16 @@ createEndpoint(UA_ServerConfig *conf, UA_EndpointDescription *endpoint, - - endpoint->securityMode = securityMode; - UA_String_copy(&securityPolicy->policyUri, &endpoint->securityPolicyUri); -- endpoint->transportProfileUri = -- UA_STRING_ALLOC("http://opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary"); -+ endpoint->transportProfileUri = UA_STRING_ALLOC( -+ "http://opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary"); - - /* Add security level value for the corresponding message security mode */ -- endpoint->securityLevel = (UA_Byte) securityMode; -+ endpoint->securityLevel = (UA_Byte)securityMode; - - /* Enable all login mechanisms from the access control plugin */ -- UA_StatusCode retval = UA_Array_copy(conf->accessControl.userTokenPolicies, -- conf->accessControl.userTokenPoliciesSize, -- (void **)&endpoint->userIdentityTokens, -- &UA_TYPES[UA_TYPES_USERTOKENPOLICY]); -+ UA_StatusCode retval = UA_Array_copy( -+ conf->accessControl.userTokenPolicies, conf->accessControl.userTokenPoliciesSize, -+ (void **)&endpoint->userIdentityTokens, &UA_TYPES[UA_TYPES_USERTOKENPOLICY]); - if(retval != UA_STATUSCODE_GOOD) - return retval; - endpoint->userIdentityTokensSize = conf->accessControl.userTokenPoliciesSize; -@@ -97,7 +92,7 @@ static UA_UsernamePasswordLogin usernamePasswords[2] = { - - static UA_StatusCode - setDefaultConfig(UA_ServerConfig *conf) { -- if (!conf) -+ if(!conf) - return UA_STATUSCODE_BADINVALIDARGUMENT; - - /* Zero out.. All members have a valid initial value */ -@@ -114,14 +109,12 @@ setDefaultConfig(UA_ServerConfig *conf) { - conf->buildInfo.productUri = UA_STRING_ALLOC(PRODUCT_URI); - conf->buildInfo.manufacturerName = UA_STRING_ALLOC(MANUFACTURER_NAME); - conf->buildInfo.productName = UA_STRING_ALLOC(PRODUCT_NAME); -- conf->buildInfo.softwareVersion = -- UA_STRING_ALLOC(VERSION(UA_OPEN62541_VER_MAJOR, UA_OPEN62541_VER_MINOR, -- UA_OPEN62541_VER_PATCH, UA_OPEN62541_VER_LABEL)); -- #ifdef UA_PACK_DEBIAN -+ conf->buildInfo.softwareVersion = UA_STRING_ALLOC("1.0.0"); -+#ifdef UA_PACK_DEBIAN - conf->buildInfo.buildNumber = UA_STRING_ALLOC("deb"); -- #else -+#else - conf->buildInfo.buildNumber = UA_STRING_ALLOC(__DATE__ " " __TIME__); -- #endif -+#endif - conf->buildInfo.buildDate = UA_DateTime_now(); - - conf->applicationDescription.applicationUri = UA_STRING_ALLOC(APPLICATION_URI_SERVER); -@@ -219,36 +212,37 @@ setDefaultConfig(UA_ServerConfig *conf) { - } - - UA_EXPORT UA_StatusCode --UA_ServerConfig_setBasics(UA_ServerConfig* conf) { -+UA_ServerConfig_setBasics(UA_ServerConfig *conf) { - return setDefaultConfig(conf); - } - - static UA_StatusCode - addDefaultNetworkLayers(UA_ServerConfig *conf, UA_UInt16 portNumber, - UA_UInt32 sendBufferSize, UA_UInt32 recvBufferSize) { -- return UA_ServerConfig_addNetworkLayerTCP(conf, portNumber, sendBufferSize, recvBufferSize); -+ return UA_ServerConfig_addNetworkLayerTCP(conf, portNumber, sendBufferSize, -+ recvBufferSize); - } - -- - UA_EXPORT UA_StatusCode - UA_ServerConfig_addNetworkLayerTCP(UA_ServerConfig *conf, UA_UInt16 portNumber, - UA_UInt32 sendBufferSize, UA_UInt32 recvBufferSize) { - /* Add a network layer */ -- UA_ServerNetworkLayer *tmp = (UA_ServerNetworkLayer *) -- UA_realloc(conf->networkLayers, sizeof(UA_ServerNetworkLayer) * (1 + conf->networkLayersSize)); -+ UA_ServerNetworkLayer *tmp = (UA_ServerNetworkLayer *)UA_realloc( -+ conf->networkLayers, -+ sizeof(UA_ServerNetworkLayer) * (1 + conf->networkLayersSize)); - if(!tmp) - return UA_STATUSCODE_BADOUTOFMEMORY; - conf->networkLayers = tmp; - - UA_ConnectionConfig config = UA_ConnectionConfig_default; -- if (sendBufferSize > 0) -+ if(sendBufferSize > 0) - config.sendBufferSize = sendBufferSize; -- if (recvBufferSize > 0) -+ if(recvBufferSize > 0) - config.recvBufferSize = recvBufferSize; - - conf->networkLayers[conf->networkLayersSize] = - UA_ServerNetworkLayerTCP(config, portNumber, &conf->logger); -- if (!conf->networkLayers[conf->networkLayersSize].handle) -+ if(!conf->networkLayers[conf->networkLayersSize].handle) - return UA_STATUSCODE_BADOUTOFMEMORY; - conf->networkLayersSize++; - -@@ -256,23 +250,25 @@ UA_ServerConfig_addNetworkLayerTCP(UA_ServerConfig *conf, UA_UInt16 portNumber, - } - - UA_EXPORT UA_StatusCode --UA_ServerConfig_addSecurityPolicyNone(UA_ServerConfig *config, -+UA_ServerConfig_addSecurityPolicyNone(UA_ServerConfig *config, - const UA_ByteString *certificate) { - UA_StatusCode retval; - - /* Allocate the SecurityPolicies */ -- UA_SecurityPolicy *tmp = (UA_SecurityPolicy *) -- UA_realloc(config->securityPolicies, sizeof(UA_SecurityPolicy) * (1 + config->securityPoliciesSize)); -+ UA_SecurityPolicy *tmp = (UA_SecurityPolicy *)UA_realloc( -+ config->securityPolicies, -+ sizeof(UA_SecurityPolicy) * (1 + config->securityPoliciesSize)); - if(!tmp) - return UA_STATUSCODE_BADOUTOFMEMORY; - config->securityPolicies = tmp; -- -+ - /* Populate the SecurityPolicies */ - UA_ByteString localCertificate = UA_BYTESTRING_NULL; - if(certificate) - localCertificate = *certificate; -- retval = UA_SecurityPolicy_None(&config->securityPolicies[config->securityPoliciesSize], NULL, -- localCertificate, &config->logger); -+ retval = -+ UA_SecurityPolicy_None(&config->securityPolicies[config->securityPoliciesSize], -+ NULL, localCertificate, &config->logger); - if(retval != UA_STATUSCODE_GOOD) - return retval; - config->securityPoliciesSize++; -@@ -281,14 +277,13 @@ UA_ServerConfig_addSecurityPolicyNone(UA_ServerConfig *config, - } - - UA_EXPORT UA_StatusCode --UA_ServerConfig_addEndpoint(UA_ServerConfig *config, const UA_String securityPolicyUri, -- UA_MessageSecurityMode securityMode) --{ -+UA_ServerConfig_addEndpoint(UA_ServerConfig *config, const UA_String securityPolicyUri, -+ UA_MessageSecurityMode securityMode) { - UA_StatusCode retval; - - /* Allocate the endpoint */ -- UA_EndpointDescription * tmp = (UA_EndpointDescription *) -- UA_realloc(config->endpoints, sizeof(UA_EndpointDescription) * (1 + config->endpointsSize)); -+ UA_EndpointDescription *tmp = (UA_EndpointDescription *)UA_realloc( -+ config->endpoints, sizeof(UA_EndpointDescription) * (1 + config->endpointsSize)); - if(!tmp) { - return UA_STATUSCODE_BADOUTOFMEMORY; - } -@@ -296,18 +291,18 @@ UA_ServerConfig_addEndpoint(UA_ServerConfig *config, const UA_String securityPol - - /* Lookup the security policy */ - const UA_SecurityPolicy *policy = NULL; -- for (size_t i = 0; i < config->securityPoliciesSize; ++i) { -- if (UA_String_equal(&securityPolicyUri, &config->securityPolicies[i].policyUri)) { -+ for(size_t i = 0; i < config->securityPoliciesSize; ++i) { -+ if(UA_String_equal(&securityPolicyUri, &config->securityPolicies[i].policyUri)) { - policy = &config->securityPolicies[i]; - break; - } - } -- if (!policy) -+ if(!policy) - return UA_STATUSCODE_BADINVALIDARGUMENT; - - /* Populate the endpoint */ -- retval = createEndpoint(config, &config->endpoints[config->endpointsSize], -- policy, securityMode); -+ retval = createEndpoint(config, &config->endpoints[config->endpointsSize], policy, -+ securityMode); - if(retval != UA_STATUSCODE_GOOD) - return retval; - config->endpointsSize++; -@@ -320,30 +315,36 @@ UA_ServerConfig_addAllEndpoints(UA_ServerConfig *config) { - UA_StatusCode retval; - - /* Allocate the endpoints */ -- UA_EndpointDescription * tmp = (UA_EndpointDescription *) -- UA_realloc(config->endpoints, sizeof(UA_EndpointDescription) * (2 * config->securityPoliciesSize + config->endpointsSize)); -+ UA_EndpointDescription *tmp = (UA_EndpointDescription *)UA_realloc( -+ config->endpoints, -+ sizeof(UA_EndpointDescription) * -+ (2 * config->securityPoliciesSize + config->endpointsSize)); - if(!tmp) { - return UA_STATUSCODE_BADOUTOFMEMORY; - } - config->endpoints = tmp; - - /* Populate the endpoints */ -- for (size_t i = 0; i < config->securityPoliciesSize; ++i) { -- if (UA_String_equal(&UA_SECURITY_POLICY_NONE_URI, &config->securityPolicies[i].policyUri)) { -- retval = createEndpoint(config, &config->endpoints[config->endpointsSize], -- &config->securityPolicies[i], UA_MESSAGESECURITYMODE_NONE); -+ for(size_t i = 0; i < config->securityPoliciesSize; ++i) { -+ if(UA_String_equal(&UA_SECURITY_POLICY_NONE_URI, -+ &config->securityPolicies[i].policyUri)) { -+ retval = -+ createEndpoint(config, &config->endpoints[config->endpointsSize], -+ &config->securityPolicies[i], UA_MESSAGESECURITYMODE_NONE); - if(retval != UA_STATUSCODE_GOOD) - return retval; - config->endpointsSize++; - } else { -- retval = createEndpoint(config, &config->endpoints[config->endpointsSize], -- &config->securityPolicies[i], UA_MESSAGESECURITYMODE_SIGN); -+ retval = -+ createEndpoint(config, &config->endpoints[config->endpointsSize], -+ &config->securityPolicies[i], UA_MESSAGESECURITYMODE_SIGN); - if(retval != UA_STATUSCODE_GOOD) - return retval; - config->endpointsSize++; - - retval = createEndpoint(config, &config->endpoints[config->endpointsSize], -- &config->securityPolicies[i], UA_MESSAGESECURITYMODE_SIGNANDENCRYPT); -+ &config->securityPolicies[i], -+ UA_MESSAGESECURITYMODE_SIGNANDENCRYPT); - if(retval != UA_STATUSCODE_GOOD) - return retval; - config->endpointsSize++; -@@ -358,7 +359,7 @@ UA_ServerConfig_setMinimalCustomBuffer(UA_ServerConfig *config, UA_UInt16 portNu - const UA_ByteString *certificate, - UA_UInt32 sendBufferSize, - UA_UInt32 recvBufferSize) { -- if (!config) -+ if(!config) - return UA_STATUSCODE_BADINVALIDARGUMENT; - - UA_StatusCode retval = setDefaultConfig(config); -@@ -381,16 +382,18 @@ UA_ServerConfig_setMinimalCustomBuffer(UA_ServerConfig *config, UA_UInt16 portNu - } - - /* Initialize the Access Control plugin */ -- retval = UA_AccessControl_default(config, true, -- &config->securityPolicies[config->securityPoliciesSize-1].policyUri, -- usernamePasswordsSize, usernamePasswords); -+ retval = UA_AccessControl_default( -+ config, true, -+ &config->securityPolicies[config->securityPoliciesSize - 1].policyUri, -+ usernamePasswordsSize, usernamePasswords); - if(retval != UA_STATUSCODE_GOOD) { - UA_ServerConfig_clean(config); - return retval; - } - - /* Allocate the endpoint */ -- retval = UA_ServerConfig_addEndpoint(config, UA_SECURITY_POLICY_NONE_URI, UA_MESSAGESECURITYMODE_NONE); -+ retval = UA_ServerConfig_addEndpoint(config, UA_SECURITY_POLICY_NONE_URI, -+ UA_MESSAGESECURITYMODE_NONE); - if(retval != UA_STATUSCODE_GOOD) { - UA_ServerConfig_clean(config); - return retval; -@@ -402,28 +405,30 @@ UA_ServerConfig_setMinimalCustomBuffer(UA_ServerConfig *config, UA_UInt16 portNu - #ifdef UA_ENABLE_ENCRYPTION - - UA_EXPORT UA_StatusCode --UA_ServerConfig_addSecurityPolicyBasic128Rsa15(UA_ServerConfig *config, -+UA_ServerConfig_addSecurityPolicyBasic128Rsa15(UA_ServerConfig *config, - const UA_ByteString *certificate, - const UA_ByteString *privateKey) { - UA_StatusCode retval; - - /* Allocate the SecurityPolicies */ -- UA_SecurityPolicy *tmp = (UA_SecurityPolicy *) -- UA_realloc(config->securityPolicies, sizeof(UA_SecurityPolicy) * (1 + config->securityPoliciesSize)); -+ UA_SecurityPolicy *tmp = (UA_SecurityPolicy *)UA_realloc( -+ config->securityPolicies, -+ sizeof(UA_SecurityPolicy) * (1 + config->securityPoliciesSize)); - if(!tmp) - return UA_STATUSCODE_BADOUTOFMEMORY; - config->securityPolicies = tmp; -- -+ - /* Populate the SecurityPolicies */ - UA_ByteString localCertificate = UA_BYTESTRING_NULL; -- UA_ByteString localPrivateKey = UA_BYTESTRING_NULL; -+ UA_ByteString localPrivateKey = UA_BYTESTRING_NULL; - if(certificate) - localCertificate = *certificate; - if(privateKey) -- localPrivateKey = *privateKey; -- retval = UA_SecurityPolicy_Basic128Rsa15(&config->securityPolicies[config->securityPoliciesSize], -- &config->certificateVerification, -- localCertificate, localPrivateKey, &config->logger); -+ localPrivateKey = *privateKey; -+ retval = UA_SecurityPolicy_Basic128Rsa15( -+ &config->securityPolicies[config->securityPoliciesSize], -+ &config->certificateVerification, localCertificate, localPrivateKey, -+ &config->logger); - if(retval != UA_STATUSCODE_GOOD) - return retval; - config->securityPoliciesSize++; -@@ -432,28 +437,30 @@ UA_ServerConfig_addSecurityPolicyBasic128Rsa15(UA_ServerConfig *config, - } - - UA_EXPORT UA_StatusCode --UA_ServerConfig_addSecurityPolicyBasic256(UA_ServerConfig *config, -+UA_ServerConfig_addSecurityPolicyBasic256(UA_ServerConfig *config, - const UA_ByteString *certificate, - const UA_ByteString *privateKey) { - UA_StatusCode retval; - - /* Allocate the SecurityPolicies */ -- UA_SecurityPolicy *tmp = (UA_SecurityPolicy *) -- UA_realloc(config->securityPolicies, sizeof(UA_SecurityPolicy) * (1 + config->securityPoliciesSize)); -+ UA_SecurityPolicy *tmp = (UA_SecurityPolicy *)UA_realloc( -+ config->securityPolicies, -+ sizeof(UA_SecurityPolicy) * (1 + config->securityPoliciesSize)); - if(!tmp) - return UA_STATUSCODE_BADOUTOFMEMORY; - config->securityPolicies = tmp; -- +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d426e1da..0fcf8177 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -5,6 +5,11 @@ if(${CMAKE_VERSION} VERSION_LESS 3.12) + cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}) + endif() + ++set(OPEN62541_VER_MINOR "0" CACHE STRING "Set the major version. Used by conan") ++set(OPEN62541_VER_MAJOR "0" CACHE STRING "Set the minor version. Used by conan") ++set(OPEN62541_VER_PATCH "0" CACHE STRING "Set the patch version. Used by conan") ++set(OPEN62541_VER_LABEL "") + - /* Populate the SecurityPolicies */ - UA_ByteString localCertificate = UA_BYTESTRING_NULL; -- UA_ByteString localPrivateKey = UA_BYTESTRING_NULL; -+ UA_ByteString localPrivateKey = UA_BYTESTRING_NULL; - if(certificate) - localCertificate = *certificate; - if(privateKey) -- localPrivateKey = *privateKey; -- retval = UA_SecurityPolicy_Basic256(&config->securityPolicies[config->securityPoliciesSize], -- &config->certificateVerification, -- localCertificate, localPrivateKey, &config->logger); -+ localPrivateKey = *privateKey; -+ retval = UA_SecurityPolicy_Basic256( -+ &config->securityPolicies[config->securityPoliciesSize], -+ &config->certificateVerification, localCertificate, localPrivateKey, -+ &config->logger); - if(retval != UA_STATUSCODE_GOOD) - return retval; - config->securityPoliciesSize++; -@@ -462,28 +469,30 @@ UA_ServerConfig_addSecurityPolicyBasic256(UA_ServerConfig *config, - } - - UA_EXPORT UA_StatusCode --UA_ServerConfig_addSecurityPolicyBasic256Sha256(UA_ServerConfig *config, -+UA_ServerConfig_addSecurityPolicyBasic256Sha256(UA_ServerConfig *config, - const UA_ByteString *certificate, - const UA_ByteString *privateKey) { - UA_StatusCode retval; - - /* Allocate the SecurityPolicies */ -- UA_SecurityPolicy *tmp = (UA_SecurityPolicy *) -- UA_realloc(config->securityPolicies, sizeof(UA_SecurityPolicy) * (1 + config->securityPoliciesSize)); -+ UA_SecurityPolicy *tmp = (UA_SecurityPolicy *)UA_realloc( -+ config->securityPolicies, -+ sizeof(UA_SecurityPolicy) * (1 + config->securityPoliciesSize)); - if(!tmp) - return UA_STATUSCODE_BADOUTOFMEMORY; - config->securityPolicies = tmp; -- -+ - /* Populate the SecurityPolicies */ - UA_ByteString localCertificate = UA_BYTESTRING_NULL; -- UA_ByteString localPrivateKey = UA_BYTESTRING_NULL; -+ UA_ByteString localPrivateKey = UA_BYTESTRING_NULL; - if(certificate) - localCertificate = *certificate; - if(privateKey) -- localPrivateKey = *privateKey; -- retval = UA_SecurityPolicy_Basic256Sha256(&config->securityPolicies[config->securityPoliciesSize], -- &config->certificateVerification, -- localCertificate, localPrivateKey, &config->logger); -+ localPrivateKey = *privateKey; -+ retval = UA_SecurityPolicy_Basic256Sha256( -+ &config->securityPolicies[config->securityPoliciesSize], -+ &config->certificateVerification, localCertificate, localPrivateKey, -+ &config->logger); - if(retval != UA_STATUSCODE_GOOD) - return retval; - config->securityPoliciesSize++; -@@ -498,43 +507,48 @@ UA_ServerConfig_addAllSecurityPolicies(UA_ServerConfig *config, - UA_StatusCode retval; - - /* Allocate the SecurityPolicies */ -- UA_SecurityPolicy *tmp = (UA_SecurityPolicy *) -- UA_realloc(config->securityPolicies, sizeof(UA_SecurityPolicy) * (4 + config->securityPoliciesSize)); -+ UA_SecurityPolicy *tmp = (UA_SecurityPolicy *)UA_realloc( -+ config->securityPolicies, -+ sizeof(UA_SecurityPolicy) * (4 + config->securityPoliciesSize)); - if(!tmp) - return UA_STATUSCODE_BADOUTOFMEMORY; - config->securityPolicies = tmp; -- -+ - /* Populate the SecurityPolicies */ - UA_ByteString localCertificate = UA_BYTESTRING_NULL; -- UA_ByteString localPrivateKey = UA_BYTESTRING_NULL; -+ UA_ByteString localPrivateKey = UA_BYTESTRING_NULL; - if(certificate) - localCertificate = *certificate; - if(privateKey) -- localPrivateKey = *privateKey; -+ localPrivateKey = *privateKey; - -- retval = UA_SecurityPolicy_None(&config->securityPolicies[config->securityPoliciesSize], NULL, -- localCertificate, &config->logger); -+ retval = -+ UA_SecurityPolicy_None(&config->securityPolicies[config->securityPoliciesSize], -+ NULL, localCertificate, &config->logger); - if(retval != UA_STATUSCODE_GOOD) - return retval; - config->securityPoliciesSize++; - -- retval = UA_SecurityPolicy_Basic128Rsa15(&config->securityPolicies[config->securityPoliciesSize], -- &config->certificateVerification, -- localCertificate, localPrivateKey, &config->logger); -+ retval = UA_SecurityPolicy_Basic128Rsa15( -+ &config->securityPolicies[config->securityPoliciesSize], -+ &config->certificateVerification, localCertificate, localPrivateKey, -+ &config->logger); - if(retval != UA_STATUSCODE_GOOD) - return retval; - config->securityPoliciesSize++; - -- retval = UA_SecurityPolicy_Basic256(&config->securityPolicies[config->securityPoliciesSize], -- &config->certificateVerification, -- localCertificate, localPrivateKey, &config->logger); -+ retval = UA_SecurityPolicy_Basic256( -+ &config->securityPolicies[config->securityPoliciesSize], -+ &config->certificateVerification, localCertificate, localPrivateKey, -+ &config->logger); - if(retval != UA_STATUSCODE_GOOD) - return retval; - config->securityPoliciesSize++; - -- retval = UA_SecurityPolicy_Basic256Sha256(&config->securityPolicies[config->securityPoliciesSize], -- &config->certificateVerification, -- localCertificate, localPrivateKey, &config->logger); -+ retval = UA_SecurityPolicy_Basic256Sha256( -+ &config->securityPolicies[config->securityPoliciesSize], -+ &config->certificateVerification, localCertificate, localPrivateKey, -+ &config->logger); - if(retval != UA_STATUSCODE_GOOD) - return retval; - config->securityPoliciesSize++; -@@ -543,27 +557,21 @@ UA_ServerConfig_addAllSecurityPolicies(UA_ServerConfig *config, - } - - UA_EXPORT UA_StatusCode --UA_ServerConfig_setDefaultWithSecurityPolicies(UA_ServerConfig *conf, -- UA_UInt16 portNumber, -- const UA_ByteString *certificate, -- const UA_ByteString *privateKey, -- const UA_ByteString *trustList, -- size_t trustListSize, -- const UA_ByteString *issuerList, -- size_t issuerListSize, -- const UA_ByteString *revocationList, -- size_t revocationListSize) { -+UA_ServerConfig_setDefaultWithSecurityPolicies( -+ UA_ServerConfig *conf, UA_UInt16 portNumber, const UA_ByteString *certificate, -+ const UA_ByteString *privateKey, const UA_ByteString *trustList, size_t trustListSize, -+ const UA_ByteString *issuerList, size_t issuerListSize, -+ const UA_ByteString *revocationList, size_t revocationListSize) { - UA_StatusCode retval = setDefaultConfig(conf); - if(retval != UA_STATUSCODE_GOOD) { - UA_ServerConfig_clean(conf); - return retval; - } - -- retval = UA_CertificateVerification_Trustlist(&conf->certificateVerification, -- trustList, trustListSize, -- issuerList, issuerListSize, -- revocationList, revocationListSize); -- if (retval != UA_STATUSCODE_GOOD) -+ retval = UA_CertificateVerification_Trustlist( -+ &conf->certificateVerification, trustList, trustListSize, issuerList, -+ issuerListSize, revocationList, revocationListSize); -+ if(retval != UA_STATUSCODE_GOOD) - return retval; - - if(trustListSize == 0) -@@ -583,9 +591,9 @@ UA_ServerConfig_setDefaultWithSecurityPolicies(UA_ServerConfig *conf, - return retval; - } - -- retval = UA_AccessControl_default(conf, true, -- &conf->securityPolicies[conf->securityPoliciesSize-1].policyUri, -- usernamePasswordsSize, usernamePasswords); -+ retval = UA_AccessControl_default( -+ conf, true, &conf->securityPolicies[conf->securityPoliciesSize - 1].policyUri, -+ usernamePasswordsSize, usernamePasswords); - if(retval != UA_STATUSCODE_GOOD) { - UA_ServerConfig_clean(conf); - return retval; -@@ -637,7 +645,7 @@ UA_ClientConfig_setDefault(UA_ClientConfig *config) { - return UA_STATUSCODE_BADINTERNALERROR; - } - -- config->securityPolicies = (UA_SecurityPolicy*)UA_malloc(sizeof(UA_SecurityPolicy)); -+ config->securityPolicies = (UA_SecurityPolicy *)UA_malloc(sizeof(UA_SecurityPolicy)); - if(!config->securityPolicies) - return UA_STATUSCODE_BADOUTOFMEMORY; - UA_StatusCode retval = UA_SecurityPolicy_None(config->securityPolicies, NULL, -@@ -651,7 +659,8 @@ UA_ClientConfig_setDefault(UA_ClientConfig *config) { - - config->connectionFunc = UA_ClientConnectionTCP; - config->initConnectionFunc = UA_ClientConnectionTCP_init; /* for async client */ -- config->pollConnectionFunc = UA_ClientConnectionTCP_poll_callback; /* for async connection */ -+ config->pollConnectionFunc = -+ UA_ClientConnectionTCP_poll_callback; /* for async connection */ - - config->customDataTypes = NULL; - config->stateCallback = NULL; -@@ -673,30 +682,31 @@ UA_ClientConfig_setDefault(UA_ClientConfig *config) { - #ifdef UA_ENABLE_ENCRYPTION - UA_StatusCode - UA_ClientConfig_setDefaultEncryption(UA_ClientConfig *config, -- UA_ByteString localCertificate, UA_ByteString privateKey, -+ UA_ByteString localCertificate, -+ UA_ByteString privateKey, - const UA_ByteString *trustList, size_t trustListSize, -- const UA_ByteString *revocationList, size_t revocationListSize) { -+ const UA_ByteString *revocationList, -+ size_t revocationListSize) { - UA_StatusCode retval = UA_ClientConfig_setDefault(config); - if(retval != UA_STATUSCODE_GOOD) - return retval; - - retval = UA_CertificateVerification_Trustlist(&config->certificateVerification, -- trustList, trustListSize, -- NULL, 0, -+ trustList, trustListSize, NULL, 0, - revocationList, revocationListSize); - if(retval != UA_STATUSCODE_GOOD) - return retval; - - /* Populate SecurityPolicies */ -- UA_SecurityPolicy *sp = (UA_SecurityPolicy*) -- UA_realloc(config->securityPolicies, sizeof(UA_SecurityPolicy) * 4); -+ UA_SecurityPolicy *sp = (UA_SecurityPolicy *)UA_realloc( -+ config->securityPolicies, sizeof(UA_SecurityPolicy) * 4); - if(!sp) - return UA_STATUSCODE_BADOUTOFMEMORY; - config->securityPolicies = sp; - -- retval = UA_SecurityPolicy_Basic128Rsa15(&config->securityPolicies[1], -- &config->certificateVerification, -- localCertificate, privateKey, &config->logger); -+ retval = UA_SecurityPolicy_Basic128Rsa15( -+ &config->securityPolicies[1], &config->certificateVerification, localCertificate, -+ privateKey, &config->logger); - if(retval != UA_STATUSCODE_GOOD) - return retval; - ++config->securityPoliciesSize; -@@ -708,9 +718,9 @@ UA_ClientConfig_setDefaultEncryption(UA_ClientConfig *config, - return retval; - ++config->securityPoliciesSize; + string(TOLOWER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_LOWER_CASE) -- retval = UA_SecurityPolicy_Basic256Sha256(&config->securityPolicies[3], -- &config->certificateVerification, -- localCertificate, privateKey, &config->logger); -+ retval = UA_SecurityPolicy_Basic256Sha256( -+ &config->securityPolicies[3], &config->certificateVerification, localCertificate, -+ privateKey, &config->logger); - if(retval != UA_STATUSCODE_GOOD) - return retval; - ++config->securityPoliciesSize; + set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/tools/cmake") From 54f9f60dbb38ef51d6877bb93be0b20a3cf2becf Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Fri, 22 May 2020 15:33:57 +0200 Subject: [PATCH 10/81] rework integration test to use cpp threads --- .../open62541/all/test_package/CMakeLists.txt | 4 +++- .../all/test_package/test_package.cpp | 24 +++++++------------ 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/recipes/open62541/all/test_package/CMakeLists.txt b/recipes/open62541/all/test_package/CMakeLists.txt index d650e5b0a26f1..74dbbfb526d58 100644 --- a/recipes/open62541/all/test_package/CMakeLists.txt +++ b/recipes/open62541/all/test_package/CMakeLists.txt @@ -4,5 +4,7 @@ project(PackageTest CXX) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup() +find_package(Threads) + add_executable(test_package test_package.cpp) -target_link_libraries(test_package ${CONAN_LIBS}) +target_link_libraries(test_package ${CONAN_LIBS} Threads::Threads) diff --git a/recipes/open62541/all/test_package/test_package.cpp b/recipes/open62541/all/test_package/test_package.cpp index e0529c57f5429..a30319a0f5cdf 100644 --- a/recipes/open62541/all/test_package/test_package.cpp +++ b/recipes/open62541/all/test_package/test_package.cpp @@ -2,30 +2,24 @@ #include #include -#include #include - -static volatile UA_Boolean running = true; - -void *run(void *arg) { - UA_Server *server = (UA_Server *)arg; - return (void *)UA_Server_run(server, &running); -} +#include int main(void) { UA_Server *server = UA_Server_new(); UA_ServerConfig_setDefault(UA_Server_getConfig(server)); + UA_Boolean running = true; + UA_StatusCode return_code; - pthread_t server_thread; - pthread_create(&server_thread, NULL, run, (void *)server); + std::thread server_thread( + [&]() { return_code = UA_Server_run(server, &running); }); - sleep(1); + std::this_thread::sleep_for(std::chrono::seconds(1)); running = false; - void *returnCode; - pthread_join(server_thread, &returnCode); - UA_StatusCode retval = *((unsigned int *)(&returnCode)); + server_thread.join(); UA_Server_delete(server); - return retval == UA_STATUSCODE_GOOD ? EXIT_SUCCESS : EXIT_FAILURE; + + return return_code == UA_STATUSCODE_GOOD ? EXIT_SUCCESS : EXIT_FAILURE; } From 71459784aef99410f7823628c9bddf82efdf49e5 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Fri, 22 May 2020 16:28:26 +0200 Subject: [PATCH 11/81] add cpp11 flag for test_package Signed-off-by: Dovydas Girdvainis --- recipes/open62541/all/test_package/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/recipes/open62541/all/test_package/CMakeLists.txt b/recipes/open62541/all/test_package/CMakeLists.txt index 74dbbfb526d58..b06dea2ce95e6 100644 --- a/recipes/open62541/all/test_package/CMakeLists.txt +++ b/recipes/open62541/all/test_package/CMakeLists.txt @@ -8,3 +8,6 @@ find_package(Threads) add_executable(test_package test_package.cpp) target_link_libraries(test_package ${CONAN_LIBS} Threads::Threads) +set_target_properties(test_package PROPERTIES + CXX_STANDARD 11 +) From 648317ec688d32747e4efa3e26c189f3b4e7954a Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Fri, 22 May 2020 17:40:46 +0200 Subject: [PATCH 12/81] add win32 includes and links --- recipes/open62541/all/conanfile.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index 0060590572dd7..8e4336449277c 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -203,9 +203,13 @@ def package_info(self): self.cpp_info.libs = tools.collect_libs(self) self.cpp_info.includedirs = [ "include", - os.path.join("include", "plugin"), - os.path.join("include", "posix") + os.path.join("include", "plugin") ] + if self.settings.os == "Windows": + self.cpp_info.libs.append("ws2_32") + self.cpp_info.includedirs.append(os.path.join("include", "win32")) + else: + self.cpp_info.includedirs.append(os.path.join("include", "posix")) self.cpp_info.builddirs = [ "lib", os.path.join("lib", "cmake"), From 64026333f64e44051dbc9ebc2b18e8d2723f7a9a Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Fri, 22 May 2020 18:40:45 +0200 Subject: [PATCH 13/81] add copy open62541.dll into lib directory step for windows shared configs Signed-off-by: Dovydas Girdvainis --- recipes/open62541/all/conanfile.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index 8e4336449277c..54ad29f8bff7d 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -196,6 +196,8 @@ def package(self): self.copy("LICENSE-CC0", dst="licenses", src=self._source_subfolder) cmake = self._configure_cmake() cmake.install() + if self.settings.os == "Windows": + self.copy("*.dll", dst="lib", src="", keep_path=False) def package_info(self): self.cpp_info.names["cmake_find_package"] = "open62541" From 82831a68d1eadfa63613661cced3e16c486df712 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Fri, 22 May 2020 19:57:47 +0200 Subject: [PATCH 14/81] fixed cmake install for windows systems --- recipes/open62541/all/conanfile.py | 2 -- .../add_conan_center_index_compliance_v_1_0.patch | 15 +++++++++++++-- ...dd_conan_center_index_compliance_v_1_0_1.patch | 11 ++++++++++- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index 54ad29f8bff7d..8e4336449277c 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -196,8 +196,6 @@ def package(self): self.copy("LICENSE-CC0", dst="licenses", src=self._source_subfolder) cmake = self._configure_cmake() cmake.install() - if self.settings.os == "Windows": - self.copy("*.dll", dst="lib", src="", keep_path=False) def package_info(self): self.cpp_info.names["cmake_find_package"] = "open62541" diff --git a/recipes/open62541/all/patches/add_conan_center_index_compliance_v_1_0.patch b/recipes/open62541/all/patches/add_conan_center_index_compliance_v_1_0.patch index 21e8e0e532550..52f36f4ce6fc0 100644 --- a/recipes/open62541/all/patches/add_conan_center_index_compliance_v_1_0.patch +++ b/recipes/open62541/all/patches/add_conan_center_index_compliance_v_1_0.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index d426e1da..1f7ca494 100644 +index d426e1da..54e7713d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,6 @@ string(TOLOWER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_LOWER_CASE) @@ -64,7 +64,18 @@ index d426e1da..1f7ca494 100644 # This list of components allows to define a find_package requirement. # E.g.: -@@ -1160,22 +1133,6 @@ if(UA_ENABLE_AMALGAMATION) +@@ -1151,31 +1124,15 @@ install(TARGETS open62541 + EXPORT open62541Targets + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +- RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} + INCLUDES DESTINATION include) +- ++ + if(UA_ENABLE_AMALGAMATION) + # Our default way of installation is the non-amalgamated version. + # See also https://github.com/open62541/open62541/pull/2292#discussion_r241106424 install(CODE "MESSAGE(WARNING \"Installation with UA_ENABLE_AMALGAMATION=ON is not recommended.\")") endif() diff --git a/recipes/open62541/all/patches/add_conan_center_index_compliance_v_1_0_1.patch b/recipes/open62541/all/patches/add_conan_center_index_compliance_v_1_0_1.patch index 1c18ebdbfc512..fe24bc07d0060 100644 --- a/recipes/open62541/all/patches/add_conan_center_index_compliance_v_1_0_1.patch +++ b/recipes/open62541/all/patches/add_conan_center_index_compliance_v_1_0_1.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6156c9b7..299aaf89 100644 +index 6156c9b7..20976e0e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,6 @@ string(TOLOWER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_LOWER_CASE) @@ -64,6 +64,15 @@ index 6156c9b7..299aaf89 100644 # This list of components allows to define a find_package requirement. # E.g.: +@@ -1160,7 +1133,7 @@ install(TARGETS open62541 ${EXTRATARGETS} + EXPORT open62541Targets + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +- RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} + INCLUDES DESTINATION include) + + if(UA_ENABLE_AMALGAMATION) @@ -1169,22 +1142,6 @@ if(UA_ENABLE_AMALGAMATION) install(CODE "MESSAGE(WARNING \"Installation with UA_ENABLE_AMALGAMATION=ON is not recommended.\")") endif() From 28a7f3374f36ca31f6b104e5a727ba31927bf78f Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Tue, 2 Jun 2020 08:27:14 +0200 Subject: [PATCH 15/81] remove license exporting --- recipes/open62541/all/conanfile.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index 8e4336449277c..6707e9a13690f 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -192,8 +192,6 @@ def build(self): cmake.build() def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - self.copy("LICENSE-CC0", dst="licenses", src=self._source_subfolder) cmake = self._configure_cmake() cmake.install() From 47f830e7f9ab201c25625c3137bbc3170b2c9f87 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Tue, 2 Jun 2020 08:54:29 +0200 Subject: [PATCH 16/81] revert license removal from package --- recipes/open62541/all/conanfile.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index 6707e9a13690f..8e4336449277c 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -192,6 +192,8 @@ def build(self): cmake.build() def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + self.copy("LICENSE-CC0", dst="licenses", src=self._source_subfolder) cmake = self._configure_cmake() cmake.install() From 589b881d304f8f0b48ab8157a97e1bfc6a3ff012 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Tue, 2 Jun 2020 09:46:39 +0200 Subject: [PATCH 17/81] add loging level selection --- recipes/open62541/all/conanfile.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index 8e4336449277c..497517b4fa356 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -56,7 +56,7 @@ class Open62541Conan(ConanFile): "fPIC": True, "shared": True, "historize": False, - "logging_level": "Trace", + "logging_level": "Info", "subscription": True, "subscription_events": False, "methods": True, @@ -137,6 +137,17 @@ def source(self): self._download_mdnsd() self._patch_sources() + def _get_log_level(self): + return { + "Fatal": "600", + "Error": "500", + "Warrning": "400", + "Info": "300", + "Debug": "200", + "Trace": "100", + "PackageOption": "300" + }.get(str(self.options.logging_level), "300") + def _configure_cmake(self): cmake = CMake(self) cmake.verbose = True @@ -147,6 +158,7 @@ def _configure_cmake(self): if self.settings.os != "Windows": cmake.definitions["POSITION_INDEPENDENT_CODE"] = self.options.fPIC cmake.definitions["BUILD_SHARED_LIBS"] = self.options.shared + cmake.definitions["UA_LOGLEVEL"] = self._get_log_level() cmake.definitions["UA_ENABLE_SUBSCRIPTIONS"] = self.options.subscription cmake.definitions["UA_ENABLE_SUBSCRIPTIONS_EVENTS"] = self.options.subscription_events cmake.definitions["UA_ENABLE_METHODCALLS"] = self.options.methods From bc268f5af40db8279b8f93863d3b34a96c105717 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Tue, 2 Jun 2020 09:48:40 +0200 Subject: [PATCH 18/81] change .dll packaging location from lib/ to bin/ --- .../all/patches/add_conan_center_index_compliance_v_1_0.patch | 2 +- .../all/patches/add_conan_center_index_compliance_v_1_0_1.patch | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/open62541/all/patches/add_conan_center_index_compliance_v_1_0.patch b/recipes/open62541/all/patches/add_conan_center_index_compliance_v_1_0.patch index 52f36f4ce6fc0..b0fb748d147b0 100644 --- a/recipes/open62541/all/patches/add_conan_center_index_compliance_v_1_0.patch +++ b/recipes/open62541/all/patches/add_conan_center_index_compliance_v_1_0.patch @@ -69,7 +69,7 @@ index d426e1da..54e7713d 100644 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} INCLUDES DESTINATION include) - + diff --git a/recipes/open62541/all/patches/add_conan_center_index_compliance_v_1_0_1.patch b/recipes/open62541/all/patches/add_conan_center_index_compliance_v_1_0_1.patch index fe24bc07d0060..7d7bd695f1033 100644 --- a/recipes/open62541/all/patches/add_conan_center_index_compliance_v_1_0_1.patch +++ b/recipes/open62541/all/patches/add_conan_center_index_compliance_v_1_0_1.patch @@ -69,7 +69,7 @@ index 6156c9b7..20976e0e 100644 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} INCLUDES DESTINATION include) if(UA_ENABLE_AMALGAMATION) From 126d2aa9e679535eca98e3424442647aad1953a8 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Tue, 2 Jun 2020 10:25:44 +0200 Subject: [PATCH 19/81] change json_support default value to False --- recipes/open62541/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index 497517b4fa356..8336032b7a0a0 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -70,7 +70,7 @@ class Open62541Conan(ConanFile): "discovery_multicast": False, "query": False, "encription": False, - "json_support": True, + "json_support": False, "pub_sub": "None", "data_access": False, "compiled_nodeset_descriptions": True, From 50837e81c57e8b9477ea8cae94c304b47163aebd Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Tue, 2 Jun 2020 10:26:16 +0200 Subject: [PATCH 20/81] change namescpae_zero defautl value to FULL --- recipes/open62541/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index 8336032b7a0a0..9a90601ab0c4e 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -74,7 +74,7 @@ class Open62541Conan(ConanFile): "pub_sub": "None", "data_access": False, "compiled_nodeset_descriptions": True, - "namescpae_zero": "REDUCED", + "namescpae_zero": "FULL", "embedded_profile": False, "typenames": True, "hardening": False, From 30ffa799eb7da0d80d9f76ce0226611c31684bbf Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Wed, 10 Jun 2020 16:39:32 +0200 Subject: [PATCH 21/81] fix alogging level typo --- recipes/open62541/all/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index 9a90601ab0c4e..e097dde981810 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -27,7 +27,7 @@ class Open62541Conan(ConanFile): "fPIC": [True, False], "shared": [True, False], "historize": [True, False], - "logging_level": ["Fatal", "Error", "Warrning", "Info", "Debug", "Trace"], + "logging_level": ["Fatal", "Error", "Warning", "Info", "Debug", "Trace"], "subscription": [True, False], "subscription_events": [True, False], "methods": [True, False], @@ -141,7 +141,7 @@ def _get_log_level(self): return { "Fatal": "600", "Error": "500", - "Warrning": "400", + "Warning": "400", "Info": "300", "Debug": "200", "Trace": "100", From 85d8ba5bbb5f9c3d3377e484800cdd27089e7298 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Wed, 10 Jun 2020 16:40:13 +0200 Subject: [PATCH 22/81] add conditional requirement --- recipes/open62541/all/conanfile.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index e097dde981810..c2e9085e171ec 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -17,7 +17,6 @@ class Open62541Conan(ConanFile): homepage = "https://open62541.org/" url = "https://github.com/conan-io/conan-center-index" description = "open62541 is an open source and free implementation of OPC UA (OPC Unified Architecture) written in the common subset of the C99 and C++98 languages. The library is usable with all major compilers and provides the necessary tools to implement dedicated OPC UA clients and servers, or to integrate OPC UA-based communication into existing applications. open62541 library is platform independent. All platform-specific functionality is implemented via exchangeable plugins. Plugin implementations are provided for the major operating systems." - requires = ("mbedtls/2.16.3-gpl") topics = ( "OPC UA", "open62541", "sdk", "server/client", "c", "iec-62541", "industrial automation", "tsn", "time sensetive networks", "publish-subscirbe", "pubsub" @@ -83,6 +82,10 @@ class Open62541Conan(ConanFile): } generators = "cmake", "cmake_find_package" + def requirements(self): + if self.options.encription: + self.requires("mbedtls/2.16.3-gpl") + @property def _source_subfolder(self): return "source_subfolder" From 2172859f7e8f67cf72b1f584150ca4d0cb0effa4 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Wed, 10 Jun 2020 16:42:55 +0200 Subject: [PATCH 23/81] add shared lib condition to set fPIC option --- recipes/open62541/all/conanfile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index c2e9085e171ec..e0e8db879e459 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -158,7 +158,8 @@ def _configure_cmake(self): cmake.definitions["OPEN62541_VER_MAJOR"] = version.major(fill=False) cmake.definitions["OPEN62541_VER_MINOR"] = version.minor(fill=False) cmake.definitions["OPEN62541_VER_PATCH"] = version.patch() - if self.settings.os != "Windows": + cmake.definitions["BUILD_SHARED_LIBS"] = self.options.shared + if self.settings.os != "Windows" and self.options.shared: cmake.definitions["POSITION_INDEPENDENT_CODE"] = self.options.fPIC cmake.definitions["BUILD_SHARED_LIBS"] = self.options.shared cmake.definitions["UA_LOGLEVEL"] = self._get_log_level() From ca5fa53c565bfc4c6157d9d5cad6ba66b00ccfb9 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Wed, 10 Jun 2020 16:44:06 +0200 Subject: [PATCH 24/81] remove support for static clang configurations --- recipes/open62541/all/conanfile.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index e0e8db879e459..f5a6cdf3b0cee 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -3,6 +3,7 @@ from conans import ConanFile, CMake, tools from conans.tools import download, unzip from conans.model.version import Version +from conans.errors import ConanInvalidConfiguration from urllib.parse import urlparse import shutil @@ -152,6 +153,10 @@ def _get_log_level(self): }.get(str(self.options.logging_level), "300") def _configure_cmake(self): + if self.settings.compiler == "clang" and not self.options.shared: + raise ConanInvalidConfiguration( + "Clang compiler can not be used to build a static library") + cmake = CMake(self) cmake.verbose = True version = Version(self.version) From 4146aa1ff4194929eb644fe602b9ab9f05d68ca4 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Wed, 10 Jun 2020 17:49:10 +0200 Subject: [PATCH 25/81] remove setting BUILD_SHARED_LIBS and POSITION_INDEPENDENT_CODE cmake options Signed-off-by: Dovydas Girdvainis --- recipes/open62541/all/conanfile.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index f5a6cdf3b0cee..b82d96e2a4f6f 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -163,10 +163,6 @@ def _configure_cmake(self): cmake.definitions["OPEN62541_VER_MAJOR"] = version.major(fill=False) cmake.definitions["OPEN62541_VER_MINOR"] = version.minor(fill=False) cmake.definitions["OPEN62541_VER_PATCH"] = version.patch() - cmake.definitions["BUILD_SHARED_LIBS"] = self.options.shared - if self.settings.os != "Windows" and self.options.shared: - cmake.definitions["POSITION_INDEPENDENT_CODE"] = self.options.fPIC - cmake.definitions["BUILD_SHARED_LIBS"] = self.options.shared cmake.definitions["UA_LOGLEVEL"] = self._get_log_level() cmake.definitions["UA_ENABLE_SUBSCRIPTIONS"] = self.options.subscription cmake.definitions["UA_ENABLE_SUBSCRIPTIONS_EVENTS"] = self.options.subscription_events From 449e5755f58e312f04ad36f919d07331960da60f Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Fri, 12 Jun 2020 13:44:32 +0200 Subject: [PATCH 26/81] fix singe_header option Signed-off-by: Dovydas Girdvainis --- recipes/open62541/all/conanfile.py | 2 ++ recipes/open62541/all/patches/set_static_version.patch | 5 +++-- recipes/open62541/all/test_package/test_package.cpp | 4 ++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index b82d96e2a4f6f..d738d6ac1928b 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -222,6 +222,8 @@ def package_info(self): "include", os.path.join("include", "plugin") ] + if self.options.single_header: + self.cpp_info.defines.append("UA_ENABLE_AMALGAMATION") if self.settings.os == "Windows": self.cpp_info.libs.append("ws2_32") self.cpp_info.includedirs.append(os.path.join("include", "win32")) diff --git a/recipes/open62541/all/patches/set_static_version.patch b/recipes/open62541/all/patches/set_static_version.patch index f3c9935c11bc7..3570ea5fbcad5 100644 --- a/recipes/open62541/all/patches/set_static_version.patch +++ b/recipes/open62541/all/patches/set_static_version.patch @@ -1,8 +1,8 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index d426e1da..0fcf8177 100644 +index d426e1da..93031735 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -5,6 +5,11 @@ if(${CMAKE_VERSION} VERSION_LESS 3.12) +@@ -5,6 +5,12 @@ if(${CMAKE_VERSION} VERSION_LESS 3.12) cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}) endif() @@ -10,6 +10,7 @@ index d426e1da..0fcf8177 100644 +set(OPEN62541_VER_MAJOR "0" CACHE STRING "Set the minor version. Used by conan") +set(OPEN62541_VER_PATCH "0" CACHE STRING "Set the patch version. Used by conan") +set(OPEN62541_VER_LABEL "") ++set(OPEN62541_VER_COMMIT "${OPEN62541_VER_MAJOR}.${OPEN62541_VER_MINOR}.${OPEN62541_VER_PATCH}") + string(TOLOWER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_LOWER_CASE) diff --git a/recipes/open62541/all/test_package/test_package.cpp b/recipes/open62541/all/test_package/test_package.cpp index a30319a0f5cdf..c6548b5ad36e4 100644 --- a/recipes/open62541/all/test_package/test_package.cpp +++ b/recipes/open62541/all/test_package/test_package.cpp @@ -1,6 +1,10 @@ +#ifdef UA_ENABLE_AMALGAMATION +#include +#else #include #include #include +#endif #include #include From fbc0f9826aca5e190dcde307488479628da697f6 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Fri, 12 Jun 2020 14:47:45 +0200 Subject: [PATCH 27/81] remove multithreading support for v1.0.0 --- recipes/open62541/all/conanfile.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index d738d6ac1928b..cc8d3800bfad1 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -169,7 +169,9 @@ def _configure_cmake(self): cmake.definitions["UA_ENABLE_METHODCALLS"] = self.options.methods cmake.definitions["UA_ENABLE_NODEMANAGEMENT"] = self.options.dynamic_nodes cmake.definitions["UA_ENABLE_AMALGAMATION"] = self.options.single_header - cmake.definitions["UA_ENABLE_MULTITHREADING"] = self.options.multithreading + if self.options.multithreading and Version(self.version) >= "1.0.1": + print("Multithreading is an expermental feature that can cause segmentation faults. Use it at your own risk!") + cmake.definitions["UA_ENABLE_MULTITHREADING"] = self.options.multithreading cmake.definitions["UA_ENABLE_IMMUTABLE_NODES"] = self.options.imutable_nodes cmake.definitions["UA_ENABLE_WEBSOCKET_SERVER"] = self.options.web_socket cmake.definitions["UA_ENABLE_HISTORIZING"] = self.options.historize @@ -224,6 +226,8 @@ def package_info(self): ] if self.options.single_header: self.cpp_info.defines.append("UA_ENABLE_AMALGAMATION") + if self.options.multithreading: + self.cpp_info.defines.append("UA_ENABLE_MULTITHREADING") if self.settings.os == "Windows": self.cpp_info.libs.append("ws2_32") self.cpp_info.includedirs.append(os.path.join("include", "win32")) From fdd029a0892f4a02e5ad483291d18074a70f8703 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Fri, 12 Jun 2020 16:09:32 +0200 Subject: [PATCH 28/81] change default value for data access to true --- recipes/open62541/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index cc8d3800bfad1..87668b6a1fe31 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -72,7 +72,7 @@ class Open62541Conan(ConanFile): "encription": False, "json_support": False, "pub_sub": "None", - "data_access": False, + "data_access": True, "compiled_nodeset_descriptions": True, "namescpae_zero": "FULL", "embedded_profile": False, From cbe5809d848670a4a6be7e698bb11d7639015ef9 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Fri, 12 Jun 2020 16:38:19 +0200 Subject: [PATCH 29/81] remove exporting multithreading definition --- recipes/open62541/all/conanfile.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index 87668b6a1fe31..b9e2b4bc4fbfb 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -226,8 +226,6 @@ def package_info(self): ] if self.options.single_header: self.cpp_info.defines.append("UA_ENABLE_AMALGAMATION") - if self.options.multithreading: - self.cpp_info.defines.append("UA_ENABLE_MULTITHREADING") if self.settings.os == "Windows": self.cpp_info.libs.append("ws2_32") self.cpp_info.includedirs.append(os.path.join("include", "win32")) From 7706bd9e5d7a1e33ab55d2cbb9e9cbcf958a70f2 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Mon, 22 Jun 2020 12:18:34 +0200 Subject: [PATCH 30/81] fix option typos --- recipes/open62541/all/conanfile.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index b9e2b4bc4fbfb..134129c317e3f 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -40,12 +40,12 @@ class Open62541Conan(ConanFile): "discovery_semaphore": [True, False], "discovery_multicast": [True, False], "query": [True, False], - "encription": [True, False], + "encryption": [True, False], "json_support": [True, False], "pub_sub": ["None", "Simple", "Ethernet", "Ethernet_XDP"], "data_access": [True, False], "compiled_nodeset_descriptions": [True, False], - "namescpae_zero": ["MINIMAL", "REDUCED", "FULL"], + "namespace_zero ": ["MINIMAL", "REDUCED", "FULL"], "embedded_profile": [True, False], "typenames": [True, False], "hardening": [True, False], @@ -69,12 +69,12 @@ class Open62541Conan(ConanFile): "discovery_semaphore": True, "discovery_multicast": False, "query": False, - "encription": False, + "encryption": False, "json_support": False, "pub_sub": "None", "data_access": True, "compiled_nodeset_descriptions": True, - "namescpae_zero": "FULL", + "namespace_zero ": "FULL", "embedded_profile": False, "typenames": True, "hardening": False, @@ -84,7 +84,7 @@ class Open62541Conan(ConanFile): generators = "cmake", "cmake_find_package" def requirements(self): - if self.options.encription: + if self.options.encryption: self.requires("mbedtls/2.16.3-gpl") @property @@ -179,7 +179,7 @@ def _configure_cmake(self): cmake.definitions["UA_ENABLE_DISCOVERY_MULTICAST"] = self.options.discovery_multicast cmake.definitions["UA_ENABLE_DISCOVERY_SEMAPHORE"] = self.options.discovery_semaphore cmake.definitions["UA_ENABLE_QUERY"] = self.options.query - cmake.definitions["UA_ENABLE_ENCRYPTION"] = self.options.encription + cmake.definitions["UA_ENABLE_ENCRYPTION"] = self.options.encryption cmake.definitions["UA_ENABLE_JSON_ENCODING"] = self.options.json_support if self.options.pub_sub != "None": cmake.definitions["UA_ENABLE_PUBSUB"] = True @@ -194,7 +194,7 @@ def _configure_cmake(self): cmake.definitions["UA_ENABLE_NODESET_COMPILER_DESCRIPTIONS"] = self.options.compiled_nodeset_descriptions cmake.definitions["UA_NAMESPACE_ZERO"] = "FULL" else: - cmake.definitions["UA_NAMESPACE_ZERO"] = self.options.namescpae_zero + cmake.definitions["UA_NAMESPACE_ZERO"] = self.options.namespace_zero cmake.definitions["UA_ENABLE_MICRO_EMB_DEV_PROFILE"] = self.options.embedded_profile cmake.definitions["UA_ENABLE_TYPENAMES"] = self.options.typenames cmake.definitions["UA_ENABLE_STATUSCODE_DESCRIPTIONS"] = self.options.readable_statuscodes From befa913700b29b4fd3a23a9eabec8b0fa4a62798 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Mon, 22 Jun 2020 12:22:35 +0200 Subject: [PATCH 31/81] move patching to build method --- recipes/open62541/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index 134129c317e3f..92d96fc712682 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -139,7 +139,6 @@ def source(self): if Version(self.version) <= "1.0.1": self._download_ua_nodes() self._download_mdnsd() - self._patch_sources() def _get_log_level(self): return { @@ -207,6 +206,7 @@ def _configure_cmake(self): return cmake def build(self): + self._patch_sources() cmake = self._configure_cmake() cmake.build() From 6b676aa8852fcccffb5e018b8291d7378e54f54f Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Mon, 22 Jun 2020 12:23:58 +0200 Subject: [PATCH 32/81] change libs to system_libs for pkg info Windows system dependencies Signed-off-by: Dovydas Girdvainis --- recipes/open62541/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index 92d96fc712682..3d0c9b3eeb921 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -227,7 +227,7 @@ def package_info(self): if self.options.single_header: self.cpp_info.defines.append("UA_ENABLE_AMALGAMATION") if self.settings.os == "Windows": - self.cpp_info.libs.append("ws2_32") + self.cpp_info.system_libs.append("ws2_32") self.cpp_info.includedirs.append(os.path.join("include", "win32")) else: self.cpp_info.includedirs.append(os.path.join("include", "posix")) From 470908e1a262bea318ff7244f26addb3af2bbfd9 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Mon, 22 Jun 2020 13:23:25 +0200 Subject: [PATCH 33/81] fix regex typo for namespace, add cmake caching --- recipes/open62541/all/conanfile.py | 83 ++++++++++++++++-------------- 1 file changed, 45 insertions(+), 38 deletions(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index 3d0c9b3eeb921..45e63277738bc 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -45,7 +45,7 @@ class Open62541Conan(ConanFile): "pub_sub": ["None", "Simple", "Ethernet", "Ethernet_XDP"], "data_access": [True, False], "compiled_nodeset_descriptions": [True, False], - "namespace_zero ": ["MINIMAL", "REDUCED", "FULL"], + "namespace_zero": ["MINIMAL", "REDUCED", "FULL"], "embedded_profile": [True, False], "typenames": [True, False], "hardening": [True, False], @@ -74,7 +74,7 @@ class Open62541Conan(ConanFile): "pub_sub": "None", "data_access": True, "compiled_nodeset_descriptions": True, - "namespace_zero ": "FULL", + "namespace_zero": "FULL", "embedded_profile": False, "typenames": True, "hardening": False, @@ -83,6 +83,8 @@ class Open62541Conan(ConanFile): } generators = "cmake", "cmake_find_package" + _cmake = None + def requirements(self): if self.options.encryption: self.requires("mbedtls/2.16.3-gpl") @@ -152,58 +154,63 @@ def _get_log_level(self): }.get(str(self.options.logging_level), "300") def _configure_cmake(self): + if self._cmake: + return self._cmake + if self.settings.compiler == "clang" and not self.options.shared: raise ConanInvalidConfiguration( "Clang compiler can not be used to build a static library") - cmake = CMake(self) - cmake.verbose = True + self._cmake = CMake(self) + self._cmake.verbose = True version = Version(self.version) - cmake.definitions["OPEN62541_VER_MAJOR"] = version.major(fill=False) - cmake.definitions["OPEN62541_VER_MINOR"] = version.minor(fill=False) - cmake.definitions["OPEN62541_VER_PATCH"] = version.patch() - cmake.definitions["UA_LOGLEVEL"] = self._get_log_level() - cmake.definitions["UA_ENABLE_SUBSCRIPTIONS"] = self.options.subscription - cmake.definitions["UA_ENABLE_SUBSCRIPTIONS_EVENTS"] = self.options.subscription_events - cmake.definitions["UA_ENABLE_METHODCALLS"] = self.options.methods - cmake.definitions["UA_ENABLE_NODEMANAGEMENT"] = self.options.dynamic_nodes - cmake.definitions["UA_ENABLE_AMALGAMATION"] = self.options.single_header + self._cmake.definitions["OPEN62541_VER_MAJOR"] = version.major( + fill=False) + self._cmake.definitions["OPEN62541_VER_MINOR"] = version.minor( + fill=False) + self._cmake.definitions["OPEN62541_VER_PATCH"] = version.patch() + self._cmake.definitions["UA_LOGLEVEL"] = self._get_log_level() + self._cmake.definitions["UA_ENABLE_SUBSCRIPTIONS"] = self.options.subscription + self._cmake.definitions["UA_ENABLE_SUBSCRIPTIONS_EVENTS"] = self.options.subscription_events + self._cmake.definitions["UA_ENABLE_METHODCALLS"] = self.options.methods + self._cmake.definitions["UA_ENABLE_NODEMANAGEMENT"] = self.options.dynamic_nodes + self._cmake.definitions["UA_ENABLE_AMALGAMATION"] = self.options.single_header if self.options.multithreading and Version(self.version) >= "1.0.1": print("Multithreading is an expermental feature that can cause segmentation faults. Use it at your own risk!") - cmake.definitions["UA_ENABLE_MULTITHREADING"] = self.options.multithreading - cmake.definitions["UA_ENABLE_IMMUTABLE_NODES"] = self.options.imutable_nodes - cmake.definitions["UA_ENABLE_WEBSOCKET_SERVER"] = self.options.web_socket - cmake.definitions["UA_ENABLE_HISTORIZING"] = self.options.historize - cmake.definitions["UA_ENABLE_DISCOVERY"] = self.options.discovery - cmake.definitions["UA_ENABLE_DISCOVERY_MULTICAST"] = self.options.discovery_multicast - cmake.definitions["UA_ENABLE_DISCOVERY_SEMAPHORE"] = self.options.discovery_semaphore - cmake.definitions["UA_ENABLE_QUERY"] = self.options.query - cmake.definitions["UA_ENABLE_ENCRYPTION"] = self.options.encryption - cmake.definitions["UA_ENABLE_JSON_ENCODING"] = self.options.json_support + self._cmake.definitions["UA_ENABLE_MULTITHREADING"] = self.options.multithreading + self._cmake.definitions["UA_ENABLE_IMMUTABLE_NODES"] = self.options.imutable_nodes + self._cmake.definitions["UA_ENABLE_WEBSOCKET_SERVER"] = self.options.web_socket + self._cmake.definitions["UA_ENABLE_HISTORIZING"] = self.options.historize + self._cmake.definitions["UA_ENABLE_DISCOVERY"] = self.options.discovery + self._cmake.definitions["UA_ENABLE_DISCOVERY_MULTICAST"] = self.options.discovery_multicast + self._cmake.definitions["UA_ENABLE_DISCOVERY_SEMAPHORE"] = self.options.discovery_semaphore + self._cmake.definitions["UA_ENABLE_QUERY"] = self.options.query + self._cmake.definitions["UA_ENABLE_ENCRYPTION"] = self.options.encryption + self._cmake.definitions["UA_ENABLE_JSON_ENCODING"] = self.options.json_support if self.options.pub_sub != "None": - cmake.definitions["UA_ENABLE_PUBSUB"] = True + self._cmake.definitions["UA_ENABLE_PUBSUB"] = True if self.settings.os == "Linux" and self.options.pub_sub == "Ethernet": - cmake.definitions["UA_ENABLE_PUBSUB_ETH_UADP"] = True + self._cmake.definitions["UA_ENABLE_PUBSUB_ETH_UADP"] = True elif self.settings.os == "Linux" and self.options.pub_sub == "Ethernet_XDP": - cmake.definitions["UA_ENABLE_PUBSUB_ETH_UADP_XDP"] = True + self._cmake.definitions["UA_ENABLE_PUBSUB_ETH_UADP_XDP"] = True else: print("PubSub over Ethernet is not supported for your OS!") - cmake.definitions["UA_ENABLE_DA"] = self.options.data_access + self._cmake.definitions["UA_ENABLE_DA"] = self.options.data_access if self.options.compiled_nodeset_descriptions == True: - cmake.definitions["UA_ENABLE_NODESET_COMPILER_DESCRIPTIONS"] = self.options.compiled_nodeset_descriptions - cmake.definitions["UA_NAMESPACE_ZERO"] = "FULL" + self._cmake.definitions["UA_ENABLE_NODESET_COMPILER_DESCRIPTIONS"] = self.options.compiled_nodeset_descriptions + self._cmake.definitions["UA_NAMESPACE_ZERO"] = "FULL" else: - cmake.definitions["UA_NAMESPACE_ZERO"] = self.options.namespace_zero - cmake.definitions["UA_ENABLE_MICRO_EMB_DEV_PROFILE"] = self.options.embedded_profile - cmake.definitions["UA_ENABLE_TYPENAMES"] = self.options.typenames - cmake.definitions["UA_ENABLE_STATUSCODE_DESCRIPTIONS"] = self.options.readable_statuscodes - cmake.definitions["UA_ENABLE_HARDENING"] = self.options.hardening + self._cmake.definitions["UA_NAMESPACE_ZERO"] = self.options.namespace_zero + self._cmake.definitions["UA_ENABLE_MICRO_EMB_DEV_PROFILE"] = self.options.embedded_profile + self._cmake.definitions["UA_ENABLE_TYPENAMES"] = self.options.typenames + self._cmake.definitions["UA_ENABLE_STATUSCODE_DESCRIPTIONS"] = self.options.readable_statuscodes + self._cmake.definitions["UA_ENABLE_HARDENING"] = self.options.hardening if self.settings.compiler == "Visual Studio" and self.options.shared == True: - cmake.definitions["UA_MSVC_FORCE_STATIC_CRT"] = True + self._cmake.definitions["UA_MSVC_FORCE_STATIC_CRT"] = True if version > "1.0.1": - cmake.definitions["UA_COMPILE_AS_CXX"] = self.options.cpp_compatible - cmake.configure() - return cmake + self._cmake.definitions["UA_COMPILE_AS_CXX"] = self.options.cpp_compatible + self._cmake.configure() + return self._cmake def build(self): self._patch_sources() From 98791c5aa945915bdf18c51f9651e4de7a3e338b Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Mon, 22 Jun 2020 16:10:49 +0200 Subject: [PATCH 34/81] change gpl to apache licensing --- recipes/open62541/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index 45e63277738bc..64b02904cf616 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -87,7 +87,7 @@ class Open62541Conan(ConanFile): def requirements(self): if self.options.encryption: - self.requires("mbedtls/2.16.3-gpl") + self.requires("mbedtls/2.16.3-apache") @property def _source_subfolder(self): From 7d086f8fcc3238089097f70cd70942017102b9ec Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Tue, 25 Aug 2020 10:25:58 +0200 Subject: [PATCH 35/81] fix KB-H048 hookup error Co-authored-by: SSE4 --- recipes/open62541/all/test_package/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/open62541/all/test_package/CMakeLists.txt b/recipes/open62541/all/test_package/CMakeLists.txt index b06dea2ce95e6..90a14b01969e9 100644 --- a/recipes/open62541/all/test_package/CMakeLists.txt +++ b/recipes/open62541/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.1) project(PackageTest CXX) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) From b2cfc555ca1519ef2afc30d1165f0ea96e032a84 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Thu, 3 Dec 2020 13:22:29 +0100 Subject: [PATCH 36/81] refactor patches --- ..._conan_center_index_compliance_v_1_0.patch | 481 ----------------- ...onan_center_index_compliance_v_1_0_1.patch | 505 ------------------ .../remove_clang_sanitizer_1_0_3.patch | 32 ++ .../remove_clang_sanitizer_1_1_3.patch | 32 ++ ..._pro_mdsnd_as_conan_dependency_1_0_3.patch | 93 ++++ ..._pro_mdsnd_as_conan_dependency_1_1_3.patch | 93 ++++ .../all/patches/set_static_version.patch | 27 +- 7 files changed, 270 insertions(+), 993 deletions(-) delete mode 100644 recipes/open62541/all/patches/add_conan_center_index_compliance_v_1_0.patch delete mode 100644 recipes/open62541/all/patches/add_conan_center_index_compliance_v_1_0_1.patch create mode 100644 recipes/open62541/all/patches/remove_clang_sanitizer_1_0_3.patch create mode 100644 recipes/open62541/all/patches/remove_clang_sanitizer_1_1_3.patch create mode 100644 recipes/open62541/all/patches/rework_pro_mdsnd_as_conan_dependency_1_0_3.patch create mode 100644 recipes/open62541/all/patches/rework_pro_mdsnd_as_conan_dependency_1_1_3.patch diff --git a/recipes/open62541/all/patches/add_conan_center_index_compliance_v_1_0.patch b/recipes/open62541/all/patches/add_conan_center_index_compliance_v_1_0.patch deleted file mode 100644 index b0fb748d147b0..0000000000000 --- a/recipes/open62541/all/patches/add_conan_center_index_compliance_v_1_0.patch +++ /dev/null @@ -1,481 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index d426e1da..54e7713d 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -9,7 +9,6 @@ string(TOLOWER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_LOWER_CASE) - - set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/tools/cmake") - find_package(PythonInterp REQUIRED) --find_package(Git) - include(AssignSourceGroup) - include(GNUInstallDirs) - -@@ -28,17 +27,6 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) - set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) - --########### --# Version # --########### -- --include(SetGitBasedVersion) -- --# The version string will be automatically set based on the git describe output. --# This will automate the version strings. Just create a new tag, and the version will be set correctly. --set_open62541_version() --MESSAGE(STATUS "open62541 Version: ${OPEN62541_VER_MAJOR}.${OPEN62541_VER_MINOR}.${OPEN62541_VER_PATCH}${OPEN62541_VER_LABEL}") -- - ################# - # Build Options # - ################# -@@ -440,18 +428,6 @@ if(NOT UA_COMPILE_AS_CXX AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID - # Linker - set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # cmake sets -rdynamic by default - -- # Debug -- if(BUILD_TYPE_LOWER_CASE STREQUAL "debug" AND UNIX) -- if("x${CMAKE_C_COMPILER_ID}" STREQUAL "xClang" AND NOT UA_ENABLE_UNIT_TESTS_MEMCHECK) -- # Add default sanitizer settings when using clang and Debug build. -- # This allows e.g. CLion to find memory locations for SegFaults -- message(STATUS "Sanitizer enabled") -- set(SANITIZER_FLAGS "-g -fno-omit-frame-pointer -gline-tables-only -fsanitize=address -fsanitize-address-use-after-scope -fsanitize-coverage=trace-pc-guard,trace-cmp -fsanitize=leak -fsanitize=undefined") -- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SANITIZER_FLAGS}") -- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SANITIZER_FLAGS}") -- endif() -- endif() -- - if(UA_ENABLE_HARDENING AND ((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))) - check_cc_flag("-D_FORTIFY_SOURCE=2") # run-time buffer overflow detection (needs at least -O1) - endif() -@@ -514,7 +490,6 @@ endif() - - file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/src_generated") - configure_file(include/open62541/config.h.in ${PROJECT_BINARY_DIR}/src_generated/open62541/config.h) --configure_file(open62541.pc.in ${PROJECT_BINARY_DIR}/src_generated/open62541.pc @ONLY) - - if(UA_ENABLE_DISCOVERY_MULTICAST) - set(MDNSD_LOGLEVEL 300 CACHE STRING "Level at which logs shall be reported" FORCE) -@@ -1102,8 +1077,6 @@ include(linting_target) - # Enable shared library with `-DBUILD_SHARED_LIBS=ON` - - set(cmake_configfile_install ${CMAKE_INSTALL_LIBDIR}/cmake/open62541) --set(open62541_install_tools_dir share/open62541/tools) --set(open62541_install_nodeset_dir share/open62541/tools/ua-nodeset) - - # This list of components allows to define a find_package requirement. - # E.g.: -@@ -1151,31 +1124,15 @@ install(TARGETS open62541 - EXPORT open62541Targets - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -- RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - INCLUDES DESTINATION include) -- -+ - if(UA_ENABLE_AMALGAMATION) - # Our default way of installation is the non-amalgamated version. - # See also https://github.com/open62541/open62541/pull/2292#discussion_r241106424 - install(CODE "MESSAGE(WARNING \"Installation with UA_ENABLE_AMALGAMATION=ON is not recommended.\")") - endif() - --include(CMakePackageConfigHelpers) --configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/tools/cmake/open62541Config.cmake.in" -- "${CMAKE_CURRENT_BINARY_DIR}/open62541Config.cmake" -- INSTALL_DESTINATION "${cmake_configfile_install}" -- PATH_VARS open62541_install_tools_dir -- open62541_install_nodeset_dir -- open62541_enabled_components -- ) -- --set(open62541_VERSION) --get_target_property(open62541_VERSION open62541 VERSION) -- --write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/open62541ConfigVersion.cmake" -- VERSION ${open62541_VERSION} -- COMPATIBILITY AnyNewerVersion) -- - install(EXPORT open62541Targets - FILE open62541Targets.cmake - DESTINATION "${cmake_configfile_install}" -@@ -1189,35 +1146,9 @@ export( - - configure_file("${CMAKE_CURRENT_SOURCE_DIR}/tools/cmake/macros_public.cmake" "${CMAKE_CURRENT_BINARY_DIR}/open62541Macros.cmake" COPYONLY) - --install(FILES "${CMAKE_CURRENT_BINARY_DIR}/open62541Config.cmake" -- "${CMAKE_CURRENT_BINARY_DIR}/open62541ConfigVersion.cmake" -- "${CMAKE_CURRENT_BINARY_DIR}/open62541Macros.cmake" -+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/open62541Macros.cmake" - DESTINATION "${cmake_configfile_install}") - --if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") -- install(FILES "${PROJECT_BINARY_DIR}/src_generated/open62541.pc" -- DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) --endif() -- --set(UA_install_tools_dirs "tools/certs" -- "tools/nodeset_compiler" -- "tools/schema" -- "deps/ua-nodeset") -- --set(UA_install_tools_files "tools/generate_datatypes.py" -- "tools/generate_nodeid_header.py" -- "tools/generate_statuscode_descriptions.py") -- --install(DIRECTORY ${UA_install_tools_dirs} -- DESTINATION ${open62541_install_tools_dir} -- USE_SOURCE_PERMISSIONS -- FILES_MATCHING -- PATTERN "*" -- PATTERN "*.pyc" EXCLUDE -- ) -- --install(FILES ${UA_install_tools_files} DESTINATION ${open62541_install_tools_dir}) -- - if(NOT UA_ENABLE_AMALGAMATION) - # Recreate the include folder structure from the source also in /usr/lib/include/open62541 - -@@ -1251,8 +1182,6 @@ else() - install(FILES ${PROJECT_BINARY_DIR}/open62541.h DESTINATION include) - endif() - --add_subdirectory(tools/packaging) -- - ################################## - # Visual studio solution folders # - ################################## -diff --git a/debian/libopen62541-dev.install-template b/debian/libopen62541-dev.install-template -deleted file mode 100644 -index fd018050..00000000 ---- a/debian/libopen62541-dev.install-template -+++ /dev/null -@@ -1,5 +0,0 @@ --usr/include --usr/lib/*/*.so --usr/lib/*/cmake/open62541/* --usr/lib/*/pkgconfig/open62541.pc --usr/share/open62541/* -diff --git a/open62541.pc.in b/open62541.pc.in -deleted file mode 100644 -index 53d8e8ed..00000000 ---- a/open62541.pc.in -+++ /dev/null -@@ -1,15 +0,0 @@ --/* This Source Code Form is subject to the terms of the Mozilla Public -- * License, v. 2.0. If a copy of the MPL was not distributed with this -- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -- --prefix=@CMAKE_INSTALL_PREFIX@ --exec_prefix=${prefix} --libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ --sharedlibdir=${libdir} --includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ -- --Name: open62541 --Description: open62541 is an open source C (C99) implementation of OPC UA --Version: @OPEN62541_VER_MAJOR@.@OPEN62541_VER_MINOR@.@OPEN62541_VER_PATCH@ --Libs: -L${libdir} -lopen62541 --Cflags: -I${includedir}/open62541 -diff --git a/open62541.spec b/open62541.spec -deleted file mode 100644 -index 046b2a41..00000000 ---- a/open62541.spec -+++ /dev/null -@@ -1,65 +0,0 @@ --Name: open62541 --Version: 0.3 --Release: 1%{?dist} --Summary: OPC UA implementation --License: MPLv2.0 --URL: http://open62541.org --Source0: https://github.com/open62541/open62541/archive/%{name}-%{version}.tar.gz -- --BuildRequires: cmake3, python -- --%description --open62541 is a C-based library (linking with C++ projects is possible) --with all necessary tools to implement dedicated OPC UA clients and servers, --or to integrate OPC UA-based communication into existing applications. -- --%package devel --Summary: Development files for %{name} --Requires: %{name}%{?_isa} = %{version}-%{release} -- --%description devel --The %{name}-devel package contains libraries and header files for --developing applications that use %{name}. -- --%prep --%setup -q -n %{name}-%{name}-%{version} # double-name prefix by GitHub -- --%build --%cmake3 -DUA_ENABLE_AMALGAMATION=ON . --make -- --%install --%make_install -- --# Remove this from the examples installation --rm examples/CMakeLists.txt -- --%post -p /sbin/ldconfig -- --%postun -p /sbin/ldconfig -- --%files --%license LICENSE --%doc AUTHORS CHANGELOG README.md --%{_libdir}/libopen62541.so.* -- --%files devel --%license LICENSE LICENSE-CC0 --%{_libdir}/libopen62541.so --%{_libdir}/pkgconfig/open62541.pc --%dir %{_includedir}/open62541 --%{_includedir}/open62541/* --%{_libdir}/cmake/open62541* --%dir %{_exec_prefix}/share/open62541 --%{_exec_prefix}/share/open62541/* -- --%doc FEATURES.md --%doc examples/ -- --%changelog --* Tue Sep 05 2017 Jens Reimann - 0.3-1 --- New version of open62541 --- Adapt for cmake3 --* Thu Aug 31 2017 Jens Reimann - 0.2-1 --- Initial version of the package -- -diff --git a/tools/cmake/SetGitBasedVersion.cmake b/tools/cmake/SetGitBasedVersion.cmake -deleted file mode 100644 -index 1816568e..00000000 ---- a/tools/cmake/SetGitBasedVersion.cmake -+++ /dev/null -@@ -1,85 +0,0 @@ --get_filename_component(VERSION_SRC_DIR ${CMAKE_CURRENT_LIST_DIR} DIRECTORY) --set(VERSION_SRC_DIR "${VERSION_SRC_DIR}/..") -- --find_package(Git) -- --function(set_open62541_version) -- -- # Generate a git-describe version string from Git repository tags -- if(GIT_EXECUTABLE AND NOT DEFINED OPEN62541_VERSION) -- execute_process( -- COMMAND ${GIT_EXECUTABLE} describe --tags --dirty --match "v*" -- WORKING_DIRECTORY "${VERSION_SRC_DIR}" -- OUTPUT_VARIABLE GIT_DESCRIBE_VERSION -- RESULT_VARIABLE GIT_DESCRIBE_ERROR_CODE -- OUTPUT_STRIP_TRAILING_WHITESPACE -- ) -- if(NOT GIT_DESCRIBE_ERROR_CODE) -- -- # Example values can be: -- # v1.2 -- # v1.2.3 -- # v1.2.3-rc1 -- # v1.2.3-rc1-dirty -- # v1.2.3-5-g4538abcd -- # v1.2.3-5-g4538abcd-dirty -- -- set(OPEN62541_VERSION ${GIT_DESCRIBE_VERSION}) -- endif() -- endif() -- -- if(OPEN62541_VERSION) -- STRING(REGEX REPLACE "^(v[0-9\\.]+)(.*)$" -- "\\1" -- GIT_VERSION_NUMBERS -- "${OPEN62541_VERSION}" ) -- STRING(REGEX REPLACE "^v([0-9\\.]+)(.*)$" -- "\\2" -- GIT_VERSION_LABEL -- "${OPEN62541_VERSION}" ) -- -- if("${GIT_VERSION_NUMBERS}" MATCHES "^v([0-9]+)(.*)$") -- STRING(REGEX REPLACE "^v([0-9]+)\\.?(.*)$" -- "\\1" -- GIT_VER_MAJOR -- "${GIT_VERSION_NUMBERS}" ) -- if("${GIT_VERSION_NUMBERS}" MATCHES "^v([0-9]+)\\.([0-9]+)(.*)$") -- STRING(REGEX REPLACE "^v([0-9]+)\\.([0-9]+)(.*)$" -- "\\2" -- GIT_VER_MINOR -- "${GIT_VERSION_NUMBERS}" ) -- if("${GIT_VERSION_NUMBERS}" MATCHES "^v([0-9]+)\\.([0-9]+)\\.([0-9]+)(.*)$") -- STRING(REGEX REPLACE "^v([0-9]+)\\.([0-9]+)\\.([0-9]+)(.*)$" -- "\\3" -- GIT_VER_PATCH -- "${GIT_VERSION_NUMBERS}" ) -- else() -- set(GIT_VER_PATCH 0) -- endif() -- else() -- set(GIT_VER_MINOR 0) -- set(GIT_VER_PATCH 0) -- endif() -- -- else() -- set(GIT_VER_MAJOR 0) -- set(GIT_VER_MINOR 0) -- set(GIT_VER_PATCH 0) -- endif() -- set(OPEN62541_VER_MAJOR ${GIT_VER_MAJOR} PARENT_SCOPE) -- set(OPEN62541_VER_MINOR ${GIT_VER_MINOR} PARENT_SCOPE) -- set(OPEN62541_VER_PATCH ${GIT_VER_PATCH} PARENT_SCOPE) -- set(OPEN62541_VER_LABEL "${GIT_VERSION_LABEL}" PARENT_SCOPE) -- set(OPEN62541_VER_COMMIT ${OPEN62541_VERSION} PARENT_SCOPE) -- else() -- # Final fallback: Just use a bogus version string that is semantically older -- # than anything else and spit out a warning to the developer. -- set(OPEN62541_VERSION "v0.0.0-unknown" PARENT_SCOPE) -- set(OPEN62541_VER_MAJOR 0 PARENT_SCOPE) -- set(OPEN62541_VER_MINOR 0 PARENT_SCOPE) -- set(OPEN62541_VER_PATCH 0 PARENT_SCOPE) -- set(OPEN62541_VER_LABEL "-unknown" PARENT_SCOPE) -- set(OPEN62541_VER_COMMIT "undefined" PARENT_SCOPE) -- message(WARNING "Failed to determine OPEN62541_VERSION from repository tags. Using default version \"${OPEN62541_VERSION}\".") -- endif() --endfunction() -diff --git a/tools/packaging/CMakeLists.txt b/tools/packaging/CMakeLists.txt -deleted file mode 100644 -index 87fd02f5..00000000 ---- a/tools/packaging/CMakeLists.txt -+++ /dev/null -@@ -1,17 +0,0 @@ --########################## --# Packaging (DEB/RPM) # --########################## --# invoke via `make package` -- --set(CPACK_GENERATOR "TGZ;DEB;RPM") --set(CPACK_PACKAGE_VENDOR "open62541 team") --set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "OPC UA implementation") --set(CPACK_PACKAGE_DESCRIPTION "open62541 is a C-based library (linking with C++ projects is possible) with all necessary tools to implement dedicated OPC UA clients and servers, or to integrate OPC UA-based communication into existing applications.") --set(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/README.md") --set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE") --set(CPACK_PACKAGE_VERSION_MAJOR "${OPEN62541_VER_MAJOR}") --set(CPACK_PACKAGE_VERSION_MINOR "${OPEN62541_VER_MINOR}") --set(CPACK_PACKAGE_VERSION_PATCH "${OPEN62541_VER_PATCH}${OPEN62541_VER_LABEL}") --set(CPACK_DEBIAN_PACKAGE_MAINTAINER "open62541 team") #required -- --include(CPack) -diff --git a/tools/packaging/tito/tito.props b/tools/packaging/tito/tito.props -deleted file mode 100644 -index eab3f190..00000000 ---- a/tools/packaging/tito/tito.props -+++ /dev/null -@@ -1,5 +0,0 @@ --[buildconfig] --builder = tito.builder.Builder --tagger = tito.tagger.VersionTagger --changelog_do_not_remove_cherrypick = 0 --changelog_format = %s (%ae) -diff --git a/tools/prepare_packaging.py b/tools/prepare_packaging.py -deleted file mode 100644 -index c8b9f58c..00000000 ---- a/tools/prepare_packaging.py -+++ /dev/null -@@ -1,101 +0,0 @@ --#!/usr/bin/env python -- --# This Source Code Form is subject to the terms of the Mozilla Public --# License, v. 2.0. If a copy of the MPL was not distributed with this --# file, You can obtain one at http://mozilla.org/MPL/2.0/. -- --import subprocess --import os --import re --from email.utils import formatdate -- -- --dirpath = os.path.join(os.path.dirname(os.path.realpath(__file__)),"..") -- --git_describe_version = subprocess.check_output(["git", "describe", "--tags", "--dirty", "--match", "v*"]).decode('utf-8').strip() -- --# v1.2 --# v1.2.3 --# v1.2.3-rc1 --# v1.2.3-rc1-dirty --# v1.2.3-5-g4538abcd --# v1.2.3-5-g4538abcd-dirty --# git_describe_version = "v1.2.3" -- --m = re.match(r"^v([0-9]+)(\.[0-9]+)?(\.[0-9]+)?(-(.*)+)?$", git_describe_version) --version_major = m.group(1) if m.group(1) is not None else "0" --version_minor = m.group(2).replace(".", "") if m.group(2) is not None else "0" --version_patch = m.group(3).replace(".", "") if m.group(3) is not None else "0" --version_label = m.group(4) if m.group(4) is not None else "" --#print("major {} minor {} patch {} label {}".format(version_major, version_minor, version_patch, version_label)) -- --# We can not use unstable for now, because dpkg-buildpackage wants to sign them --# It will fail with gpg: skipped "open62541 Team ": No secret key --#debian_distribution = "unstable" --#if version_label is not "": --debian_distribution = "UNRELEASED" -- --debian_path = os.path.join(dirpath, "debian") --changelog_file = os.path.join(debian_path, "changelog") -- --# remove leading 'v' --changelog_version = git_describe_version[1:] if git_describe_version[0] == 'v' else git_describe_version --# replace all '-' with '~' in version --changelog_version = changelog_version.replace('-', '~') -- --with open(changelog_file, 'r') as original: data = original.read() --with open(changelog_file, 'w') as modified: -- new_entry = """open62541 ({version}) {distribution}; urgency=medium -- -- * Full changelog is available here: -- https://github.com/open62541/open62541/blob/master/CHANGELOG -- -- -- open62541 Team {time} --""".format(version=changelog_version, time=formatdate(), distribution = debian_distribution) -- -- modified.write(new_entry + "\n" + data) -- --# Create control file and replace template variables --control_file_template = os.path.join(debian_path, "control-template") --control_file = os.path.join(debian_path, "control") --os.rename(control_file_template, control_file) -- --with open(control_file, 'r+') as f: -- content = f.read() -- f.seek(0) -- f.truncate() -- f.write(content.replace('', "{}".format(version_major))) -- -- --# rename the install template to match the soname --install_file_template = os.path.join(debian_path, "libopen62541.install-template") --install_file = os.path.join(debian_path, "libopen62541-{}.install".format(version_major)) --os.rename(install_file_template, install_file) -- --install_file_template = os.path.join(debian_path, "libopen62541-dev.install-template") --install_file = os.path.join(debian_path, "libopen62541-{}-dev.install".format(version_major)) --os.rename(install_file_template, install_file) -- -- --# Create rule file and replace template variables --rule_file_template = os.path.join(debian_path, "rules-template") --rule_file = os.path.join(debian_path, "rules") --os.rename(rule_file_template, rule_file) -- --with open(rule_file, 'r+') as f: -- content = f.read() -- f.seek(0) -- f.truncate() -- content = content.replace('', "{}".format(version_major)) -- f.write(content) -- --# Update CMakeLists.txt to include full version string -- --with open(os.path.join(dirpath,"CMakeLists.txt"), 'r+') as f: -- lines = f.readlines() -- f.seek(0) -- f.truncate() -- for idx, line in enumerate(lines): -- if idx == 2: -- f.write('set(OPEN62541_VERSION "{}")\n'.format(git_describe_version)) -- f.write(line) diff --git a/recipes/open62541/all/patches/add_conan_center_index_compliance_v_1_0_1.patch b/recipes/open62541/all/patches/add_conan_center_index_compliance_v_1_0_1.patch deleted file mode 100644 index 7d7bd695f1033..0000000000000 --- a/recipes/open62541/all/patches/add_conan_center_index_compliance_v_1_0_1.patch +++ /dev/null @@ -1,505 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6156c9b7..20976e0e 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -9,7 +9,6 @@ string(TOLOWER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_LOWER_CASE) - - set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/tools/cmake") - find_package(PythonInterp REQUIRED) --find_package(Git) - include(AssignSourceGroup) - include(GNUInstallDirs) - -@@ -28,17 +27,6 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) - set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) - --########### --# Version # --########### -- --include(SetGitBasedVersion) -- --# The version string will be automatically set based on the git describe output. --# This will automate the version strings. Just create a new tag, and the version will be set correctly. --set_open62541_version() --MESSAGE(STATUS "open62541 Version: ${OPEN62541_VER_MAJOR}.${OPEN62541_VER_MINOR}.${OPEN62541_VER_PATCH}${OPEN62541_VER_LABEL}") -- - ################# - # Build Options # - ################# -@@ -440,18 +428,6 @@ if(NOT UA_COMPILE_AS_CXX AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID - # Linker - set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # cmake sets -rdynamic by default - -- # Debug -- if(BUILD_TYPE_LOWER_CASE STREQUAL "debug" AND UNIX) -- if("x${CMAKE_C_COMPILER_ID}" STREQUAL "xClang" AND NOT UA_ENABLE_UNIT_TESTS_MEMCHECK) -- # Add default sanitizer settings when using clang and Debug build. -- # This allows e.g. CLion to find memory locations for SegFaults -- message(STATUS "Sanitizer enabled") -- set(SANITIZER_FLAGS "-g -fno-omit-frame-pointer -gline-tables-only -fsanitize=address -fsanitize-address-use-after-scope -fsanitize-coverage=trace-pc-guard,trace-cmp -fsanitize=leak -fsanitize=undefined") -- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SANITIZER_FLAGS}") -- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SANITIZER_FLAGS}") -- endif() -- endif() -- - if(UA_ENABLE_HARDENING AND ((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))) - check_cc_flag("-D_FORTIFY_SOURCE=2") # run-time buffer overflow detection (needs at least -O1) - endif() -@@ -514,7 +490,6 @@ endif() - - file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/src_generated") - configure_file(include/open62541/config.h.in ${PROJECT_BINARY_DIR}/src_generated/open62541/config.h) --configure_file(open62541.pc.in ${PROJECT_BINARY_DIR}/src_generated/open62541.pc @ONLY) - - if(UA_ENABLE_DISCOVERY_MULTICAST) - set(MDNSD_LOGLEVEL 300 CACHE STRING "Level at which logs shall be reported" FORCE) -@@ -1106,8 +1081,6 @@ include(linting_target) - # Enable shared library with `-DBUILD_SHARED_LIBS=ON` - - set(cmake_configfile_install ${CMAKE_INSTALL_LIBDIR}/cmake/open62541) --set(open62541_install_tools_dir share/open62541/tools) --set(open62541_install_nodeset_dir share/open62541/tools/ua-nodeset) - - # This list of components allows to define a find_package requirement. - # E.g.: -@@ -1160,7 +1133,7 @@ install(TARGETS open62541 ${EXTRATARGETS} - EXPORT open62541Targets - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -- RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - INCLUDES DESTINATION include) - - if(UA_ENABLE_AMALGAMATION) -@@ -1169,22 +1142,6 @@ if(UA_ENABLE_AMALGAMATION) - install(CODE "MESSAGE(WARNING \"Installation with UA_ENABLE_AMALGAMATION=ON is not recommended.\")") - endif() - --include(CMakePackageConfigHelpers) --configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/tools/cmake/open62541Config.cmake.in" -- "${CMAKE_CURRENT_BINARY_DIR}/open62541Config.cmake" -- INSTALL_DESTINATION "${cmake_configfile_install}" -- PATH_VARS open62541_install_tools_dir -- open62541_install_nodeset_dir -- open62541_enabled_components -- ) -- --set(open62541_VERSION) --get_target_property(open62541_VERSION open62541 VERSION) -- --write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/open62541ConfigVersion.cmake" -- VERSION ${open62541_VERSION} -- COMPATIBILITY AnyNewerVersion) -- - install(EXPORT open62541Targets - FILE open62541Targets.cmake - DESTINATION "${cmake_configfile_install}" -@@ -1198,35 +1155,9 @@ export( - - configure_file("${CMAKE_CURRENT_SOURCE_DIR}/tools/cmake/macros_public.cmake" "${CMAKE_CURRENT_BINARY_DIR}/open62541Macros.cmake" COPYONLY) - --install(FILES "${CMAKE_CURRENT_BINARY_DIR}/open62541Config.cmake" -- "${CMAKE_CURRENT_BINARY_DIR}/open62541ConfigVersion.cmake" -- "${CMAKE_CURRENT_BINARY_DIR}/open62541Macros.cmake" -+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/open62541Macros.cmake" - DESTINATION "${cmake_configfile_install}") - --if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") -- install(FILES "${PROJECT_BINARY_DIR}/src_generated/open62541.pc" -- DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) --endif() -- --set(UA_install_tools_dirs "tools/certs" -- "tools/nodeset_compiler" -- "tools/schema" -- "deps/ua-nodeset") -- --set(UA_install_tools_files "tools/generate_datatypes.py" -- "tools/generate_nodeid_header.py" -- "tools/generate_statuscode_descriptions.py") -- --install(DIRECTORY ${UA_install_tools_dirs} -- DESTINATION ${open62541_install_tools_dir} -- USE_SOURCE_PERMISSIONS -- FILES_MATCHING -- PATTERN "*" -- PATTERN "*.pyc" EXCLUDE -- ) -- --install(FILES ${UA_install_tools_files} DESTINATION ${open62541_install_tools_dir}) -- - if (UA_PACK_DEBIAN) - set(UA_install_examples_dirs "examples/" - "examples/access_control" -@@ -1235,9 +1166,6 @@ if (UA_PACK_DEBIAN) - "examples/encryption" - "examples/nodeset" - "examples/pubsub") -- -- set(open62541_install_examples_dir share/open62541/examples) -- install(DIRECTORY ${UA_install_examples_dirs} COMPONENT examples DESTINATION ${open62541_install_examples_dir} USE_SOURCE_PERMISSIONS) - endif() - - if(NOT UA_ENABLE_AMALGAMATION) -@@ -1273,8 +1201,6 @@ else() - install(FILES ${PROJECT_BINARY_DIR}/open62541.h DESTINATION include) - endif() - --add_subdirectory(tools/packaging) -- - ################################## - # Visual studio solution folders # - ################################## -diff --git a/debian/libopen62541-dev.install-template b/debian/libopen62541-dev.install-template -deleted file mode 100644 -index ff354feb..00000000 ---- a/debian/libopen62541-dev.install-template -+++ /dev/null -@@ -1,5 +0,0 @@ --usr/include --usr/lib/*/*.so --usr/lib/*/*.a --usr/lib/*/cmake/open62541/* --usr/lib/*/pkgconfig/open62541.pc -diff --git a/open62541.pc.in b/open62541.pc.in -deleted file mode 100644 -index 53d8e8ed..00000000 ---- a/open62541.pc.in -+++ /dev/null -@@ -1,15 +0,0 @@ --/* This Source Code Form is subject to the terms of the Mozilla Public -- * License, v. 2.0. If a copy of the MPL was not distributed with this -- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -- --prefix=@CMAKE_INSTALL_PREFIX@ --exec_prefix=${prefix} --libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ --sharedlibdir=${libdir} --includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ -- --Name: open62541 --Description: open62541 is an open source C (C99) implementation of OPC UA --Version: @OPEN62541_VER_MAJOR@.@OPEN62541_VER_MINOR@.@OPEN62541_VER_PATCH@ --Libs: -L${libdir} -lopen62541 --Cflags: -I${includedir}/open62541 -diff --git a/open62541.spec b/open62541.spec -deleted file mode 100644 -index 771e35a3..00000000 ---- a/open62541.spec -+++ /dev/null -@@ -1,65 +0,0 @@ --Name: open62541 --Version: 1.0.1 --Release: 1%{?dist} --Summary: OPC UA implementation --License: MPLv2.0 --URL: http://open62541.org --Source0: https://github.com/open62541/open62541/archive/%{name}-%{version}.tar.gz -- --BuildRequires: cmake3, python -- --%description --open62541 is a C-based library (linking with C++ projects is possible) --with all necessary tools to implement dedicated OPC UA clients and servers, --or to integrate OPC UA-based communication into existing applications. -- --%package devel --Summary: Development files for %{name} --Requires: %{name}%{?_isa} = %{version}-%{release} -- --%description devel --The %{name}-devel package contains libraries and header files for --developing applications that use %{name}. -- --%prep --%setup -q -n %{name}-%{name}-%{version} # double-name prefix by GitHub -- --%build --%cmake3 -DUA_ENABLE_AMALGAMATION=ON . --make -- --%install --%make_install -- --# Remove this from the examples installation --rm examples/CMakeLists.txt -- --%post -p /sbin/ldconfig -- --%postun -p /sbin/ldconfig -- --%files --%license LICENSE --%doc AUTHORS CHANGELOG README.md --%{_libdir}/libopen62541.so.* -- --%files devel --%license LICENSE LICENSE-CC0 --%{_libdir}/libopen62541.so --%{_libdir}/pkgconfig/open62541.pc --%dir %{_includedir}/open62541 --%{_includedir}/open62541/* --%{_libdir}/cmake/open62541* --%dir %{_exec_prefix}/share/open62541 --%{_exec_prefix}/share/open62541/* -- --%doc FEATURES.md --%doc examples/ -- --%changelog --* Tue Sep 05 2017 Jens Reimann - 0.3-1 --- New version of open62541 --- Adapt for cmake3 --* Thu Aug 31 2017 Jens Reimann - 0.2-1 --- Initial version of the package -- -diff --git a/tools/cmake/SetGitBasedVersion.cmake b/tools/cmake/SetGitBasedVersion.cmake -deleted file mode 100644 -index 1816568e..00000000 ---- a/tools/cmake/SetGitBasedVersion.cmake -+++ /dev/null -@@ -1,85 +0,0 @@ --get_filename_component(VERSION_SRC_DIR ${CMAKE_CURRENT_LIST_DIR} DIRECTORY) --set(VERSION_SRC_DIR "${VERSION_SRC_DIR}/..") -- --find_package(Git) -- --function(set_open62541_version) -- -- # Generate a git-describe version string from Git repository tags -- if(GIT_EXECUTABLE AND NOT DEFINED OPEN62541_VERSION) -- execute_process( -- COMMAND ${GIT_EXECUTABLE} describe --tags --dirty --match "v*" -- WORKING_DIRECTORY "${VERSION_SRC_DIR}" -- OUTPUT_VARIABLE GIT_DESCRIBE_VERSION -- RESULT_VARIABLE GIT_DESCRIBE_ERROR_CODE -- OUTPUT_STRIP_TRAILING_WHITESPACE -- ) -- if(NOT GIT_DESCRIBE_ERROR_CODE) -- -- # Example values can be: -- # v1.2 -- # v1.2.3 -- # v1.2.3-rc1 -- # v1.2.3-rc1-dirty -- # v1.2.3-5-g4538abcd -- # v1.2.3-5-g4538abcd-dirty -- -- set(OPEN62541_VERSION ${GIT_DESCRIBE_VERSION}) -- endif() -- endif() -- -- if(OPEN62541_VERSION) -- STRING(REGEX REPLACE "^(v[0-9\\.]+)(.*)$" -- "\\1" -- GIT_VERSION_NUMBERS -- "${OPEN62541_VERSION}" ) -- STRING(REGEX REPLACE "^v([0-9\\.]+)(.*)$" -- "\\2" -- GIT_VERSION_LABEL -- "${OPEN62541_VERSION}" ) -- -- if("${GIT_VERSION_NUMBERS}" MATCHES "^v([0-9]+)(.*)$") -- STRING(REGEX REPLACE "^v([0-9]+)\\.?(.*)$" -- "\\1" -- GIT_VER_MAJOR -- "${GIT_VERSION_NUMBERS}" ) -- if("${GIT_VERSION_NUMBERS}" MATCHES "^v([0-9]+)\\.([0-9]+)(.*)$") -- STRING(REGEX REPLACE "^v([0-9]+)\\.([0-9]+)(.*)$" -- "\\2" -- GIT_VER_MINOR -- "${GIT_VERSION_NUMBERS}" ) -- if("${GIT_VERSION_NUMBERS}" MATCHES "^v([0-9]+)\\.([0-9]+)\\.([0-9]+)(.*)$") -- STRING(REGEX REPLACE "^v([0-9]+)\\.([0-9]+)\\.([0-9]+)(.*)$" -- "\\3" -- GIT_VER_PATCH -- "${GIT_VERSION_NUMBERS}" ) -- else() -- set(GIT_VER_PATCH 0) -- endif() -- else() -- set(GIT_VER_MINOR 0) -- set(GIT_VER_PATCH 0) -- endif() -- -- else() -- set(GIT_VER_MAJOR 0) -- set(GIT_VER_MINOR 0) -- set(GIT_VER_PATCH 0) -- endif() -- set(OPEN62541_VER_MAJOR ${GIT_VER_MAJOR} PARENT_SCOPE) -- set(OPEN62541_VER_MINOR ${GIT_VER_MINOR} PARENT_SCOPE) -- set(OPEN62541_VER_PATCH ${GIT_VER_PATCH} PARENT_SCOPE) -- set(OPEN62541_VER_LABEL "${GIT_VERSION_LABEL}" PARENT_SCOPE) -- set(OPEN62541_VER_COMMIT ${OPEN62541_VERSION} PARENT_SCOPE) -- else() -- # Final fallback: Just use a bogus version string that is semantically older -- # than anything else and spit out a warning to the developer. -- set(OPEN62541_VERSION "v0.0.0-unknown" PARENT_SCOPE) -- set(OPEN62541_VER_MAJOR 0 PARENT_SCOPE) -- set(OPEN62541_VER_MINOR 0 PARENT_SCOPE) -- set(OPEN62541_VER_PATCH 0 PARENT_SCOPE) -- set(OPEN62541_VER_LABEL "-unknown" PARENT_SCOPE) -- set(OPEN62541_VER_COMMIT "undefined" PARENT_SCOPE) -- message(WARNING "Failed to determine OPEN62541_VERSION from repository tags. Using default version \"${OPEN62541_VERSION}\".") -- endif() --endfunction() -diff --git a/tools/packaging/CMakeLists.txt b/tools/packaging/CMakeLists.txt -deleted file mode 100644 -index 87fd02f5..00000000 ---- a/tools/packaging/CMakeLists.txt -+++ /dev/null -@@ -1,17 +0,0 @@ --########################## --# Packaging (DEB/RPM) # --########################## --# invoke via `make package` -- --set(CPACK_GENERATOR "TGZ;DEB;RPM") --set(CPACK_PACKAGE_VENDOR "open62541 team") --set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "OPC UA implementation") --set(CPACK_PACKAGE_DESCRIPTION "open62541 is a C-based library (linking with C++ projects is possible) with all necessary tools to implement dedicated OPC UA clients and servers, or to integrate OPC UA-based communication into existing applications.") --set(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/README.md") --set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE") --set(CPACK_PACKAGE_VERSION_MAJOR "${OPEN62541_VER_MAJOR}") --set(CPACK_PACKAGE_VERSION_MINOR "${OPEN62541_VER_MINOR}") --set(CPACK_PACKAGE_VERSION_PATCH "${OPEN62541_VER_PATCH}${OPEN62541_VER_LABEL}") --set(CPACK_DEBIAN_PACKAGE_MAINTAINER "open62541 team") #required -- --include(CPack) -diff --git a/tools/packaging/tito/tito.props b/tools/packaging/tito/tito.props -deleted file mode 100644 -index eab3f190..00000000 ---- a/tools/packaging/tito/tito.props -+++ /dev/null -@@ -1,5 +0,0 @@ --[buildconfig] --builder = tito.builder.Builder --tagger = tito.tagger.VersionTagger --changelog_do_not_remove_cherrypick = 0 --changelog_format = %s (%ae) -diff --git a/tools/prepare_packaging.py b/tools/prepare_packaging.py -deleted file mode 100644 -index 6bcc033f..00000000 ---- a/tools/prepare_packaging.py -+++ /dev/null -@@ -1,117 +0,0 @@ --#!/usr/bin/env python -- --# This Source Code Form is subject to the terms of the Mozilla Public --# License, v. 2.0. If a copy of the MPL was not distributed with this --# file, You can obtain one at http://mozilla.org/MPL/2.0/. -- --import subprocess --import os --import re --from email.utils import formatdate --import datetime -- -- --dirpath = os.path.join(os.path.dirname(os.path.realpath(__file__)),"..") -- --git_describe_version = subprocess.check_output(["git", "describe", "--tags", "--dirty", "--match", "v*"]).decode('utf-8').strip() -- --# v1.2 --# v1.2.3 --# v1.2.3-rc1 --# v1.2.3-rc1-dirty --# v1.2.3-5-g4538abcd --# v1.2.3-5-g4538abcd-dirty --# git_describe_version = "v1.2.3" -- --m = re.match(r"^v([0-9]+)(\.[0-9]+)?(\.[0-9]+)?(-(.*)+)?$", git_describe_version) --version_major = m.group(1) if m.group(1) is not None else "0" --version_minor = m.group(2).replace(".", "") if m.group(2) is not None else "0" --version_patch = m.group(3).replace(".", "") if m.group(3) is not None else "0" --version_label = m.group(4) if m.group(4) is not None else "" --#print("major {} minor {} patch {} label {}".format(version_major, version_minor, version_patch, version_label)) -- --# We can not use unstable for now, because dpkg-buildpackage wants to sign them --# It will fail with gpg: skipped "open62541 Team ": No secret key --#debian_distribution = "unstable" --#if version_label is not "": --debian_distribution = "UNRELEASED" -- --debian_path = os.path.join(dirpath, "debian") --changelog_file = os.path.join(debian_path, "changelog") -- --# remove leading 'v' --changelog_version = git_describe_version[1:] if git_describe_version[0] == 'v' else git_describe_version --# replace all '-' with '~' in version --changelog_version = changelog_version.replace('-', '~') -- --# prefix the version string with the current ISO datetime to ensure correct version ordering. --# See https://github.com/open62541/open62541/issues/3140 --changelog_version = datetime.datetime.utcnow().replace(microsecond=0).isoformat().replace('-', '').replace(':', '') + '~' + changelog_version -- --with open(changelog_file, 'r') as original: data = original.read() --with open(changelog_file, 'w') as modified: -- new_entry = """open62541 ({version}) {distribution}; urgency=medium -- -- * Full changelog is available here: -- https://github.com/open62541/open62541/blob/master/CHANGELOG -- -- -- open62541 Team {time} --""".format(version=changelog_version, time=formatdate(), distribution = debian_distribution) -- -- modified.write(new_entry + "\n" + data) -- --# Create control file and replace template variables --control_file_template = os.path.join(debian_path, "control-template") --control_file = os.path.join(debian_path, "control") --os.rename(control_file_template, control_file) -- --with open(control_file, 'r+') as f: -- content = f.read() -- f.seek(0) -- f.truncate() -- f.write(content.replace('', "{}".format(version_major))) -- -- --# rename the install template to match the soname --install_file_template = os.path.join(debian_path, "libopen62541.install-template") --install_file = os.path.join(debian_path, "libopen62541-{}.install".format(version_major)) --os.rename(install_file_template, install_file) -- --install_file_template = os.path.join(debian_path, "libopen62541-dev.install-template") --install_file = os.path.join(debian_path, "libopen62541-{}-dev.install".format(version_major)) --os.rename(install_file_template, install_file) -- --install_file_template = os.path.join(debian_path, "libopen62541-tools.install-template") --install_file = os.path.join(debian_path, "libopen62541-{}-tools.install".format(version_major)) --os.rename(install_file_template, install_file) -- --install_file_template = os.path.join(debian_path, "open62541-doc.doc-base-template") --install_file = os.path.join(debian_path, "open62541-doc.doc-base") --os.rename(install_file_template, install_file) -- --install_file_template = os.path.join(debian_path, "open62541-doc.install-template") --install_file = os.path.join(debian_path, "open62541-doc.install") --os.rename(install_file_template, install_file) -- --# Create rule file and replace template variables --rule_file_template = os.path.join(debian_path, "rules-template") --rule_file = os.path.join(debian_path, "rules") --os.rename(rule_file_template, rule_file) -- --with open(rule_file, 'r+') as f: -- content = f.read() -- f.seek(0) -- f.truncate() -- content = content.replace('', "{}".format(version_major)) -- f.write(content) -- --# Update CMakeLists.txt to include full version string -- --with open(os.path.join(dirpath,"CMakeLists.txt"), 'r+') as f: -- lines = f.readlines() -- f.seek(0) -- f.truncate() -- for idx, line in enumerate(lines): -- if idx == 2: -- f.write('set(OPEN62541_VERSION "{}")\n'.format(git_describe_version)) -- f.write(line) diff --git a/recipes/open62541/all/patches/remove_clang_sanitizer_1_0_3.patch b/recipes/open62541/all/patches/remove_clang_sanitizer_1_0_3.patch new file mode 100644 index 0000000000000..9eb5142e901b0 --- /dev/null +++ b/recipes/open62541/all/patches/remove_clang_sanitizer_1_0_3.patch @@ -0,0 +1,32 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 94ceb127..390f0e90 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -440,18 +440,6 @@ if(NOT UA_COMPILE_AS_CXX AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID + # Linker + set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # cmake sets -rdynamic by default + +- # Debug +- if(BUILD_TYPE_LOWER_CASE STREQUAL "debug" AND UNIX) +- if("x${CMAKE_C_COMPILER_ID}" STREQUAL "xClang" AND NOT UA_ENABLE_UNIT_TESTS_MEMCHECK) +- # Add default sanitizer settings when using clang and Debug build. +- # This allows e.g. CLion to find memory locations for SegFaults +- message(STATUS "Sanitizer enabled") +- set(SANITIZER_FLAGS "-g -fno-omit-frame-pointer -gline-tables-only -fsanitize=address -fsanitize-address-use-after-scope -fsanitize-coverage=trace-pc-guard,trace-cmp -fsanitize=leak -fsanitize=undefined") +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SANITIZER_FLAGS}") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SANITIZER_FLAGS}") +- endif() +- endif() +- + if (NOT MINGW) + if(UA_ENABLE_HARDENING AND ((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))) + check_cc_flag("-D_FORTIFY_SOURCE=2") # run-time buffer overflow detection (needs at least -O1) +@@ -493,8 +481,6 @@ if(APPLE) + endif() + + if(MSVC) +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3 /WX /w44996") # Compiler warnings, error on warning +- + if(UA_MSVC_FORCE_STATIC_CRT AND NOT BUILD_SHARED_LIBS) + set(CompilerFlags CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_C_FLAGS + CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE) diff --git a/recipes/open62541/all/patches/remove_clang_sanitizer_1_1_3.patch b/recipes/open62541/all/patches/remove_clang_sanitizer_1_1_3.patch new file mode 100644 index 0000000000000..c6dd3f9a49a6a --- /dev/null +++ b/recipes/open62541/all/patches/remove_clang_sanitizer_1_1_3.patch @@ -0,0 +1,32 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2fd6ef29..7fc58e1d 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -576,18 +576,6 @@ if(NOT UA_FORCE_CPP AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID}" ST + # Linker + set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # cmake sets -rdynamic by default + +- # Debug +- if(BUILD_TYPE_LOWER_CASE STREQUAL "debug" AND UNIX) +- if("x${CMAKE_C_COMPILER_ID}" STREQUAL "xClang" AND NOT UA_ENABLE_UNIT_TESTS_MEMCHECK) +- # Add default sanitizer settings when using clang and Debug build. +- # This allows e.g. CLion to find memory locations for SegFaults +- message(STATUS "Sanitizer enabled") +- set(SANITIZER_FLAGS "-g -fno-omit-frame-pointer -gline-tables-only -fsanitize=address -fsanitize-address-use-after-scope -fsanitize-coverage=trace-pc-guard,trace-cmp -fsanitize=leak -fsanitize=undefined") +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SANITIZER_FLAGS}") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SANITIZER_FLAGS}") +- endif() +- endif() +- + if (NOT MINGW) + if(UA_ENABLE_HARDENING AND ((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))) + check_add_cc_flag("-D_FORTIFY_SOURCE=2") # run-time buffer overflow detection (needs at least -O1) +@@ -632,8 +620,6 @@ if(APPLE) + endif() + + if(MSVC) +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3 /WX /w44996") # Compiler warnings, error on warning +- + if(UA_MSVC_FORCE_STATIC_CRT AND NOT BUILD_SHARED_LIBS) + set(CompilerFlags CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_C_FLAGS + CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE) diff --git a/recipes/open62541/all/patches/rework_pro_mdsnd_as_conan_dependency_1_0_3.patch b/recipes/open62541/all/patches/rework_pro_mdsnd_as_conan_dependency_1_0_3.patch new file mode 100644 index 0000000000000..8e393048321aa --- /dev/null +++ b/recipes/open62541/all/patches/rework_pro_mdsnd_as_conan_dependency_1_0_3.patch @@ -0,0 +1,93 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 94ceb127..f6c47378 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -343,9 +343,6 @@ mark_as_advanced(UA_PACK_DEBIAN) + set(UA_DYNAMIC_LINKING OFF) + if(BUILD_SHARED_LIBS) + set(UA_DYNAMIC_LINKING ON) +- if (UA_ENABLE_DISCOVERY_MULTICAST) +- set(MDNSD_DYNAMIC_LINKING ON) +- endif() + endif() + + # Warn if experimental features are enabled +@@ -520,8 +517,8 @@ configure_file(include/open62541/config.h.in ${PROJECT_BINARY_DIR}/src_generated + configure_file(open62541.pc.in ${PROJECT_BINARY_DIR}/src_generated/open62541.pc @ONLY) + + if(UA_ENABLE_DISCOVERY_MULTICAST) ++ find_package(pro-mdnsd) + set(MDNSD_LOGLEVEL 300 CACHE STRING "Level at which logs shall be reported" FORCE) +- configure_file("deps/mdnsd/libmdnsd/mdnsd_config.h.in" "${PROJECT_BINARY_DIR}/src_generated/mdnsd_config.h") + endif() + + set(exported_headers ${exported_headers} +@@ -742,22 +739,6 @@ if(UA_DEBUG_DUMP_PKGS) + list(APPEND lib_sources ${PROJECT_SOURCE_DIR}/plugins/ua_debug_dump_pkgs.c) + endif() + +-if(UA_ENABLE_DISCOVERY_MULTICAST) +- # prepend in list, otherwise it complains that winsock2.h has to be included before windows.h +- set(internal_headers ${PROJECT_BINARY_DIR}/src_generated/mdnsd_config.h +- ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/1035.h +- ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/xht.h +- ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/sdtxt.h +- ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/mdnsd.h +- ${internal_headers} ) +- set(lib_sources ${PROJECT_SOURCE_DIR}/src/server/ua_server_discovery_mdns.c +- ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/1035.c +- ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/xht.c +- ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/sdtxt.c +- ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/mdnsd.c +- ${lib_sources}) +-endif() +- + if(UA_BUILD_FUZZING OR UA_BUILD_OSS_FUZZ) + set(lib_sources + ${lib_sources} +@@ -1031,13 +1012,13 @@ endif() + # Ensure that the open62541::open62541 alias can be used inside open62541's build + add_library(open62541::open62541 ALIAS open62541) + ++if(UA_ENABLE_DISCOVERY_MULTICAST) ++ target_link_libraries(open62541 PUBLIC pro-mdnsd::pro-mdnsd) ++endif() ++ + # Export Symbols + target_compile_definitions(open62541-object PRIVATE -DUA_DYNAMIC_LINKING_EXPORT) + target_compile_definitions(open62541 PRIVATE -DUA_DYNAMIC_LINKING_EXPORT) +-if (UA_ENABLE_DISCOVERY_MULTICAST) +- target_compile_definitions(open62541-object PRIVATE -DMDNSD_DYNAMIC_LINKING_EXPORT) +- target_compile_definitions(open62541 PRIVATE -DMDNSD_DYNAMIC_LINKING_EXPORT) +-endif() + # Generate properly versioned shared library links on Linux + SET_TARGET_PROPERTIES(open62541 PROPERTIES SOVERSION "${OPEN62541_VER_MAJOR}" VERSION "${OPEN62541_VER_MAJOR}.${OPEN62541_VER_MINOR}.${OPEN62541_VER_PATCH}") + +diff --git a/src/server/ua_discovery_manager.h b/src/server/ua_discovery_manager.h +index 3d1ae299..e7e5e776 100644 +--- a/src/server/ua_discovery_manager.h ++++ b/src/server/ua_discovery_manager.h +@@ -50,7 +50,7 @@ typedef struct periodicServerRegisterCallback_entry { + + #ifdef UA_ENABLE_DISCOVERY_MULTICAST + +-#include "mdnsd/libmdnsd/mdnsd.h" ++#include "mdnsd/mdnsd.h" + + /** + * TXT record: +diff --git a/src/server/ua_server_discovery_mdns.c b/src/server/ua_server_discovery_mdns.c +index fd9c796c..c15d66a5 100644 +--- a/src/server/ua_server_discovery_mdns.c ++++ b/src/server/ua_server_discovery_mdns.c +@@ -11,8 +11,8 @@ + #ifdef UA_ENABLE_DISCOVERY_MULTICAST + + #ifndef UA_ENABLE_AMALGAMATION +-#include "mdnsd/libmdnsd/xht.h" +-#include "mdnsd/libmdnsd/sdtxt.h" ++#include "mdnsd/xht.h" ++#include "mdnsd/sdtxt.h" + #endif + + #ifdef _WIN32 diff --git a/recipes/open62541/all/patches/rework_pro_mdsnd_as_conan_dependency_1_1_3.patch b/recipes/open62541/all/patches/rework_pro_mdsnd_as_conan_dependency_1_1_3.patch new file mode 100644 index 0000000000000..e6bf09a8c828f --- /dev/null +++ b/recipes/open62541/all/patches/rework_pro_mdsnd_as_conan_dependency_1_1_3.patch @@ -0,0 +1,93 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2fd6ef29..4943c9ef 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -425,9 +425,6 @@ mark_as_advanced(UA_PACK_DEBIAN) + set(UA_DYNAMIC_LINKING OFF) + if(BUILD_SHARED_LIBS) + set(UA_DYNAMIC_LINKING ON) +- if(UA_ENABLE_DISCOVERY_MULTICAST) +- set(MDNSD_DYNAMIC_LINKING ON) +- endif() + endif() + + # Warn if experimental features are enabled +@@ -659,8 +656,8 @@ configure_file(include/open62541/config.h.in ${PROJECT_BINARY_DIR}/src_generated + configure_file(open62541.pc.in ${PROJECT_BINARY_DIR}/src_generated/open62541.pc @ONLY) + + if(UA_ENABLE_DISCOVERY_MULTICAST) ++ find_package(pro-mdnsd) + set(MDNSD_LOGLEVEL 300 CACHE STRING "Level at which logs shall be reported" FORCE) +- configure_file("deps/mdnsd/libmdnsd/mdnsd_config.h.in" "${PROJECT_BINARY_DIR}/src_generated/mdnsd_config.h") + endif() + + set(exported_headers ${exported_headers} +@@ -945,22 +942,6 @@ if(UA_DEBUG_DUMP_PKGS) + list(APPEND lib_sources ${PROJECT_SOURCE_DIR}/tests/testing-plugins/testing_networklayers.c) + endif() + +-if(UA_ENABLE_DISCOVERY_MULTICAST) +- # prepend in list, otherwise it complains that winsock2.h has to be included before windows.h +- set(internal_headers ${PROJECT_BINARY_DIR}/src_generated/mdnsd_config.h +- ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/1035.h +- ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/xht.h +- ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/sdtxt.h +- ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/mdnsd.h +- ${internal_headers} ) +- set(lib_sources ${PROJECT_SOURCE_DIR}/src/server/ua_server_discovery_mdns.c +- ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/1035.c +- ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/xht.c +- ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/sdtxt.c +- ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/mdnsd.c +- ${lib_sources}) +-endif() +- + if(UA_BUILD_FUZZING OR UA_BUILD_OSS_FUZZ) + set(lib_sources + ${lib_sources} +@@ -1250,13 +1231,13 @@ add_dependencies(open62541-object open62541-code-generation) + # Ensure that the open62541::open62541 alias can be used inside open62541's build + add_library(open62541::open62541 ALIAS open62541) + ++if(UA_ENABLE_DISCOVERY_MULTICAST) ++ target_link_libraries(open62541 PUBLIC pro-mdnsd::pro-mdnsd) ++endif() ++ + # Export Symbols + target_compile_definitions(open62541-object PRIVATE -DUA_DYNAMIC_LINKING_EXPORT) + target_compile_definitions(open62541 PRIVATE -DUA_DYNAMIC_LINKING_EXPORT) +-if(UA_ENABLE_DISCOVERY_MULTICAST) +- target_compile_definitions(open62541-object PRIVATE -DMDNSD_DYNAMIC_LINKING_EXPORT) +- target_compile_definitions(open62541 PRIVATE -DMDNSD_DYNAMIC_LINKING_EXPORT) +-endif() + # Generate properly versioned shared library links on Linux + SET_TARGET_PROPERTIES(open62541 PROPERTIES SOVERSION "${OPEN62541_VER_MAJOR}" VERSION "${OPEN62541_VER_MAJOR}.${OPEN62541_VER_MINOR}.${OPEN62541_VER_PATCH}") + +diff --git a/src/server/ua_discovery_manager.h b/src/server/ua_discovery_manager.h +index 7787b40e..bdeabeeb 100644 +--- a/src/server/ua_discovery_manager.h ++++ b/src/server/ua_discovery_manager.h +@@ -50,7 +50,7 @@ typedef struct periodicServerRegisterCallback_entry { + + #ifdef UA_ENABLE_DISCOVERY_MULTICAST + +-#include "mdnsd/libmdnsd/mdnsd.h" ++#include "mdnsd/mdnsd.h" + + /** + * TXT record: +diff --git a/src/server/ua_server_discovery_mdns.c b/src/server/ua_server_discovery_mdns.c +index 6121b8c3..3442ebb4 100644 +--- a/src/server/ua_server_discovery_mdns.c ++++ b/src/server/ua_server_discovery_mdns.c +@@ -11,8 +11,8 @@ + #ifdef UA_ENABLE_DISCOVERY_MULTICAST + + #ifndef UA_ENABLE_AMALGAMATION +-#include "mdnsd/libmdnsd/xht.h" +-#include "mdnsd/libmdnsd/sdtxt.h" ++#include "mdnsd/xht.h" ++#include "mdnsd/sdtxt.h" + #endif + + #ifdef _WIN32 diff --git a/recipes/open62541/all/patches/set_static_version.patch b/recipes/open62541/all/patches/set_static_version.patch index 3570ea5fbcad5..1a6d052b84f14 100644 --- a/recipes/open62541/all/patches/set_static_version.patch +++ b/recipes/open62541/all/patches/set_static_version.patch @@ -1,17 +1,30 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index d426e1da..93031735 100644 +index 2fd6ef29..269a9086 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -5,6 +5,12 @@ if(${CMAKE_VERSION} VERSION_LESS 3.12) - cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}) - endif() +@@ -9,7 +9,6 @@ string(TOLOWER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_LOWER_CASE) + set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/tools/cmake") + find_package(PythonInterp REQUIRED) +-find_package(Git) + include(AssignSourceGroup) + include(GNUInstallDirs) + +@@ -33,12 +32,11 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) + # Version # + ########### + +-include(SetGitBasedVersion) +- +-# The version string will be automatically set based on the git describe output. +-# This will automate the version strings. Just create a new tag, and the version will be set correctly. +-set_open62541_version() +-MESSAGE(STATUS "open62541 Version: ${OPEN62541_VER_MAJOR}.${OPEN62541_VER_MINOR}.${OPEN62541_VER_PATCH}${OPEN62541_VER_LABEL}") +set(OPEN62541_VER_MINOR "0" CACHE STRING "Set the major version. Used by conan") +set(OPEN62541_VER_MAJOR "0" CACHE STRING "Set the minor version. Used by conan") +set(OPEN62541_VER_PATCH "0" CACHE STRING "Set the patch version. Used by conan") +set(OPEN62541_VER_LABEL "") +set(OPEN62541_VER_COMMIT "${OPEN62541_VER_MAJOR}.${OPEN62541_VER_MINOR}.${OPEN62541_VER_PATCH}") -+ - string(TOLOWER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_LOWER_CASE) - set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/tools/cmake") + ################# + # Build Options # From f4b439e82c75a5ce61663dcc3c003f281f024781 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Thu, 3 Dec 2020 13:22:45 +0100 Subject: [PATCH 37/81] rework ua-nodeset into a submodule --- recipes/open62541/all/ submoduledata.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 recipes/open62541/all/ submoduledata.yml diff --git a/recipes/open62541/all/ submoduledata.yml b/recipes/open62541/all/ submoduledata.yml new file mode 100644 index 0000000000000..03509f0fde543 --- /dev/null +++ b/recipes/open62541/all/ submoduledata.yml @@ -0,0 +1,11 @@ +submodules: + "1.0.3": + deps/ua-nodeset: + sha256: 2f6ea6df9fc74daddad287a67bd28c73fcc6d98a560f270a8692e8686b078982 + url: https://github.com/OPCFoundation/UA-Nodeset/archive/v1.04.zip + archive_pattern: "UA-Nodeset-{version}" + "1.1.3": + deps/ua-nodeset: + sha256: 2f6ea6df9fc74daddad287a67bd28c73fcc6d98a560f270a8692e8686b078982 + url: https://github.com/OPCFoundation/UA-Nodeset/archive/v1.04.zip + archive_pattern: "UA-Nodeset-{version}" From 5ce1e4569959021076909fc854be3b3d5e014253 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Thu, 3 Dec 2020 13:23:00 +0100 Subject: [PATCH 38/81] bump to 1.0.3 add 1.1.3 --- recipes/open62541/all/conandata.yml | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/recipes/open62541/all/conandata.yml b/recipes/open62541/all/conandata.yml index 8c0e07e62fc4b..663924190f859 100644 --- a/recipes/open62541/all/conandata.yml +++ b/recipes/open62541/all/conandata.yml @@ -1,18 +1,22 @@ sources: - "1.0.0": - url: "https://github.com/open62541/open62541/archive/v1.0.tar.gz" - sha256: "9be66efefe2cdb07a7638aad91c301b5c6163f99c66995bc41cce31ec0ea207e" - "1.0.1": - url: "https://github.com/open62541/open62541/archive/v1.0.1.tar.gz" - sha256: "ae9fac217267bccdf360fe0f1788f4d65875b06028404cf2440600927d2b3ad3" + "1.0.3": + url: "https://github.com/open62541/open62541/archive/v1.0.3.tar.gz" + sha256: "3e4c939d702d06d89f32a1cafe2b992c7f3d81c8f8579e093a972d4bc4fb3d50" + "1.1.3": + url: "https://github.com/open62541/open62541/archive/v1.1.3.tar.gz" + sha256: "12770bf9f5d9f44dedce0d1b34066dd14111d24c73a2f0153420e0a750e85d19" patches: - "1.0.0": - - patch_file: "patches/add_conan_center_index_compliance_v_1_0.patch" - base_path: "source_subfolder" + "1.0.3": - patch_file: "patches/set_static_version.patch" base_path: "source_subfolder" - "1.0.1": - - patch_file: "patches/add_conan_center_index_compliance_v_1_0_1.patch" + - patch_file: "patches/remove_clang_sanitizer_1_0_3.patch" + base_path: "source_subfolder" + - patch_file: "patches/rework_pro_mdsnd_as_conan_dependency_1_0_3.patch" base_path: "source_subfolder" + "1.1.3": - patch_file: "patches/set_static_version.patch" base_path: "source_subfolder" + - patch_file: "patches/remove_clang_sanitizer_1_1_3.patch" + base_path: "source_subfolder" + - patch_file: "patches/rework_pro_mdsnd_as_conan_dependency_1_1_3.patch" + base_path: "source_subfolder" From e86322611e97624d990278df8950bb88ad219703 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Thu, 3 Dec 2020 13:24:04 +0100 Subject: [PATCH 39/81] refactor based on ideas from @syoliver --- recipes/open62541/all/conanfile.py | 155 ++++++++++++++++++----------- 1 file changed, 98 insertions(+), 57 deletions(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index 64b02904cf616..75c5cdb277f57 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -1,11 +1,10 @@ import os -import sys from conans import ConanFile, CMake, tools -from conans.tools import download, unzip from conans.model.version import Version from conans.errors import ConanInvalidConfiguration -from urllib.parse import urlparse +import glob import shutil +import yaml class Open62541Conan(ConanFile): @@ -15,6 +14,7 @@ class Open62541Conan(ConanFile): "CMakeLists.txt", "patches/**" ] + exports = "submoduledata.yml" homepage = "https://open62541.org/" url = "https://github.com/conan-io/conan-center-index" description = "open62541 is an open source and free implementation of OPC UA (OPC Unified Architecture) written in the common subset of the C99 and C++98 languages. The library is usable with all major compilers and provides the necessary tools to implement dedicated OPC UA clients and servers, or to integrate OPC UA-based communication into existing applications. open62541 library is platform independent. All platform-specific functionality is implemented via exchangeable plugins. Plugin implementations are provided for the major operating systems." @@ -26,21 +26,21 @@ class Open62541Conan(ConanFile): options = { "fPIC": [True, False], "shared": [True, False], - "historize": [True, False], + "historize": ["Off", "On", "Experimental"], "logging_level": ["Fatal", "Error", "Warning", "Info", "Debug", "Trace"], "subscription": [True, False], "subscription_events": [True, False], "methods": [True, False], "dynamic_nodes": [True, False], "single_header": [True, False], - "multithreading": [True, False], + "multithreading": ["Off", "Threadsafe", "Internal threads"], "imutable_nodes": [True, False], "web_socket": [True, False], "discovery": [True, False], "discovery_semaphore": [True, False], "discovery_multicast": [True, False], "query": [True, False], - "encryption": [True, False], + "encryption": ["None", "openssl", "mbedtls-apache", "mbedtls-gpl"], "json_support": [True, False], "pub_sub": ["None", "Simple", "Ethernet", "Ethernet_XDP"], "data_access": [True, False], @@ -55,21 +55,21 @@ class Open62541Conan(ConanFile): default_options = { "fPIC": True, "shared": True, - "historize": False, + "historize": "Off", "logging_level": "Info", "subscription": True, "subscription_events": False, "methods": True, "dynamic_nodes": True, "single_header": False, - "multithreading": False, + "multithreading": "Off", "imutable_nodes": False, "web_socket": False, "discovery": True, "discovery_semaphore": True, "discovery_multicast": False, "query": False, - "encryption": False, + "encryption": "None", "json_support": False, "pub_sub": "None", "data_access": True, @@ -86,61 +86,81 @@ class Open62541Conan(ConanFile): _cmake = None def requirements(self): - if self.options.encryption: - self.requires("mbedtls/2.16.3-apache") + if Version(self.version) >= "1.1.0": + if self.options.encryption == "mbedtls-apache": + self.requires("mbedtls/2.16.3-apache") + elif self.options.encryption == "mbedtls-gpl": + self.requires("mbedtls/2.16.3-gpl") + elif self.options.encryption == "openssl": + self.requires("openssl/1.1.1g") + + if self.options.web_socket: + self.requires("libwebsockets/4.0.15") + else: + if self.options.encryption == "mbedtls-apache": + self.requires("mbedtls/2.16.3-apache") + elif self.options.encryption == "mbedtls-gpl": + self.requires("mbedtls/2.16.3-gpl") + elif self.options.encryption == "openssl": + raise ConanInvalidConfiguration( + "Versions of Open62541 lower than 1.1.0 do not support openssl") + if self.options.web_socket: + raise ConanInvalidConfiguration( + "Versions of Open62541 lower than 1.1.0 do not fully support websockets") + + if self.options.discovery_multicast: + self.requires("pro-mdnsd/0.8.4") @property def _source_subfolder(self): return "source_subfolder" - def _download_deps(self, zip_link, dep_name): - zip_name = dep_name + ".zip" - download(zip_link, zip_name) - dep_path = self._source_subfolder + "/deps/" + dep_name - unzip(zip_name) - full_path = str(urlparse(zip_link).path).split("/") - dir_name = full_path[2] + "-" + full_path[4] - dir_name = dir_name[:-4] - files = os.listdir(dir_name) - for f in files: - shutil.move(os.path.join(dir_name, f), dep_path) - os.unlink(zip_name) - shutil.rmtree(dir_name) - - def _download_ua_nodes(self): - link = "" - if self.version == "1.0.0": - link = "https://github.com/OPCFoundation/UA-Nodeset/archive/0777abd1bc407b4dbd79abc515864f8c3ce6812b.zip" - elif self.version == "1.0.1": - link = "https://github.com/OPCFoundation/UA-Nodeset/archive/0777abd1bc407b4dbd79abc515864f8c3ce6812b.zip" - self._download_deps(zip_link=link, dep_name="ua-nodeset") - - def _download_mdnsd(self): - link = "" - if self.version == "1.0.0": - link = "https://github.com/Pro/mdnsd/archive/8fe3a7e7e9d0a9196b126c64f0d1905569b83d40.zip" - elif self.version == "1.0.1": - link = "https://github.com/Pro/mdnsd/archive/f7f0dd543f12fa7bbf2b667cceb287b9c8184b7d.zip" - self._download_deps(zip_link=link, dep_name="mdnsd") - def _patch_sources(self): for patch in self.conan_data["patches"][self.version]: tools.patch(**patch) + def configure(self): + if not self.options.subscription: + if self.options.subscription_events: + raise ConanInvalidConfiguration( + "Open62541 requires subscription option") + + if not self.options.discovery: + if self.options.discovery_multicast or self.options.discovery_semaphore: + raise ConanInvalidConfiguration( + "Open62541 requires discovery option") + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if not self.options.cpp_compatible: + del self.settings.compiler.cppstd + del self.settings.compiler.libcxx + def source(self): + archive_name = self.name + "-" + self.version tools.get(**self.conan_data["sources"][self.version]) - if Version(self.version) <= "1.0.0": - folder_name = "%s-%s" % (self.name, "1.0") - else: - folder_name = "%s-%s" % (self.name, self.version) - os.rename(folder_name, self._source_subfolder) - if Version(self.version) <= "1.0.1": - self._download_ua_nodes() - self._download_mdnsd() + os.rename(archive_name, self._source_subfolder) + + submodule_filename = os.path.join( + os.path.dirname(__file__), 'submoduledata.yml') + with open(submodule_filename, 'r') as submodule_stream: + submodules_data = yaml.load(submodule_stream) + for path, submodule in submodules_data["submodules"][self.version].items(): + filename = os.path.basename(submodule["url"]) + archive_name = submodule["archive_pattern"].format( + version=os.path.splitext(filename)[0]) + + submodule_data = { + "url": submodule["url"], + "sha256": submodule["sha256"] + } + + tools.get(**submodule_data) + submodule_source = os.path.join(self._source_subfolder, path) + tools.rmdir(submodule_source) + os.rename(archive_name, submodule_source) def _get_log_level(self): return { @@ -153,6 +173,13 @@ def _get_log_level(self): "PackageOption": "300" }.get(str(self.options.logging_level), "300") + def _get_multithreading_option(self): + return { + "Off": "0", + "Threadsafe": "100", + "Internal threads": "200" + }.get(str(self.options.multithreading), "0") + def _configure_cmake(self): if self._cmake: return self._cmake @@ -175,17 +202,22 @@ def _configure_cmake(self): self._cmake.definitions["UA_ENABLE_METHODCALLS"] = self.options.methods self._cmake.definitions["UA_ENABLE_NODEMANAGEMENT"] = self.options.dynamic_nodes self._cmake.definitions["UA_ENABLE_AMALGAMATION"] = self.options.single_header - if self.options.multithreading and Version(self.version) >= "1.0.1": - print("Multithreading is an expermental feature that can cause segmentation faults. Use it at your own risk!") - self._cmake.definitions["UA_ENABLE_MULTITHREADING"] = self.options.multithreading + self._cmake.definitions["UA_ENABLE_MULTITHREADING"] = self._get_multithreading_option( + ) self._cmake.definitions["UA_ENABLE_IMMUTABLE_NODES"] = self.options.imutable_nodes self._cmake.definitions["UA_ENABLE_WEBSOCKET_SERVER"] = self.options.web_socket - self._cmake.definitions["UA_ENABLE_HISTORIZING"] = self.options.historize + if self.options.historize != "Off": + self._cmake.definitions["UA_ENABLE_HISTORIZING"] = True + if self.options.historize == "Experimental": + self._cmake.definitions["UA_ENABLE_EXPERIMENTAL_HISTORIZING"] = True self._cmake.definitions["UA_ENABLE_DISCOVERY"] = self.options.discovery self._cmake.definitions["UA_ENABLE_DISCOVERY_MULTICAST"] = self.options.discovery_multicast self._cmake.definitions["UA_ENABLE_DISCOVERY_SEMAPHORE"] = self.options.discovery_semaphore self._cmake.definitions["UA_ENABLE_QUERY"] = self.options.query - self._cmake.definitions["UA_ENABLE_ENCRYPTION"] = self.options.encryption + if self.options.encryption != "None": + self._cmake.definitions["UA_ENABLE_ENCRYPTION"] = True + if self.options.encryption == "openssl": + self._cmake.definitions["UA_ENABLE_ENCRYPTION_OPENSSL"] = True self._cmake.definitions["UA_ENABLE_JSON_ENCODING"] = self.options.json_support if self.options.pub_sub != "None": self._cmake.definitions["UA_ENABLE_PUBSUB"] = True @@ -194,7 +226,8 @@ def _configure_cmake(self): elif self.settings.os == "Linux" and self.options.pub_sub == "Ethernet_XDP": self._cmake.definitions["UA_ENABLE_PUBSUB_ETH_UADP_XDP"] = True else: - print("PubSub over Ethernet is not supported for your OS!") + raise ConanInvalidConfiguration( + "PubSub over Ethernet is not supported for your OS!") self._cmake.definitions["UA_ENABLE_DA"] = self.options.data_access if self.options.compiled_nodeset_descriptions == True: self._cmake.definitions["UA_ENABLE_NODESET_COMPILER_DESCRIPTIONS"] = self.options.compiled_nodeset_descriptions @@ -207,8 +240,7 @@ def _configure_cmake(self): self._cmake.definitions["UA_ENABLE_HARDENING"] = self.options.hardening if self.settings.compiler == "Visual Studio" and self.options.shared == True: self._cmake.definitions["UA_MSVC_FORCE_STATIC_CRT"] = True - if version > "1.0.1": - self._cmake.definitions["UA_COMPILE_AS_CXX"] = self.options.cpp_compatible + self._cmake.definitions["UA_COMPILE_AS_CXX"] = self.options.cpp_compatible self._cmake.configure() return self._cmake @@ -223,6 +255,15 @@ def package(self): cmake = self._configure_cmake() cmake.install() + for f in glob.glob(os.path.join(self.package_folder, "bin", "*.pdb")): + os.remove(f) + for f in glob.glob(os.path.join(self.package_folder, "lib", "*.pdb")): + os.remove(f) + + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + tools.rmdir(os.path.join(self.package_folder, "share")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + def package_info(self): self.cpp_info.names["cmake_find_package"] = "open62541" self.cpp_info.names["cmake_find_package_multi"] = "open62541" From 888f248034a3570c1b3fb114cd66733af7cfcef8 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Thu, 3 Dec 2020 13:26:10 +0100 Subject: [PATCH 40/81] bump up to 1.0.3 and 1.1.3 --- recipes/open62541/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/open62541/config.yml b/recipes/open62541/config.yml index 5e61e3082c4f0..4f4aa6015fe00 100644 --- a/recipes/open62541/config.yml +++ b/recipes/open62541/config.yml @@ -1,5 +1,5 @@ versions: - "1.0.0": + "1.0.3": folder: all - "1.0.1": + "1.1.3": folder: all From 50919ee1aaf424c5e8ef24ec404283248ab23b33 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Thu, 3 Dec 2020 13:55:01 +0100 Subject: [PATCH 41/81] remove leading whitespace --- recipes/open62541/all/{ submoduledata.yml => submoduledata.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename recipes/open62541/all/{ submoduledata.yml => submoduledata.yml} (100%) diff --git a/recipes/open62541/all/ submoduledata.yml b/recipes/open62541/all/submoduledata.yml similarity index 100% rename from recipes/open62541/all/ submoduledata.yml rename to recipes/open62541/all/submoduledata.yml From d2253096e0980c04aa6a14d350324ef5bf47a739 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Thu, 3 Dec 2020 14:32:47 +0100 Subject: [PATCH 42/81] fix archive patter nmissmatch --- recipes/open62541/all/conanfile.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index 75c5cdb277f57..6b5fa358160cf 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -85,6 +85,10 @@ class Open62541Conan(ConanFile): _cmake = None + @property + def _source_subfolder(self): + return "source_subfolder" + def requirements(self): if Version(self.version) >= "1.1.0": if self.options.encryption == "mbedtls-apache": @@ -111,13 +115,9 @@ def requirements(self): if self.options.discovery_multicast: self.requires("pro-mdnsd/0.8.4") - @property - def _source_subfolder(self): - return "source_subfolder" - def _patch_sources(self): for patch in self.conan_data["patches"][self.version]: - tools.patch(**patch) + tools.patch(**patch, fuzz=True) def configure(self): if not self.options.subscription: @@ -150,7 +150,7 @@ def source(self): for path, submodule in submodules_data["submodules"][self.version].items(): filename = os.path.basename(submodule["url"]) archive_name = submodule["archive_pattern"].format( - version=os.path.splitext(filename)[0]) + version=os.path.splitext(filename.replace('v', ''))[0]) submodule_data = { "url": submodule["url"], From df9114942430f97d40df960645c46ea31bc7b2ef Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Thu, 3 Dec 2020 14:53:19 +0100 Subject: [PATCH 43/81] merge relevant patches into mega patches --- recipes/open62541/all/conandata.yml | 12 +--- ...nan_dependency_1_0_3.patch => 1_0_3.patch} | 64 +++++++++++++++++-- ...nan_dependency_1_1_3.patch => 1_1_3.patch} | 64 +++++++++++++++++-- .../remove_clang_sanitizer_1_0_3.patch | 32 ---------- .../remove_clang_sanitizer_1_1_3.patch | 32 ---------- .../all/patches/set_static_version.patch | 30 --------- 6 files changed, 120 insertions(+), 114 deletions(-) rename recipes/open62541/all/patches/{rework_pro_mdsnd_as_conan_dependency_1_0_3.patch => 1_0_3.patch} (54%) rename recipes/open62541/all/patches/{rework_pro_mdsnd_as_conan_dependency_1_1_3.patch => 1_1_3.patch} (54%) delete mode 100644 recipes/open62541/all/patches/remove_clang_sanitizer_1_0_3.patch delete mode 100644 recipes/open62541/all/patches/remove_clang_sanitizer_1_1_3.patch delete mode 100644 recipes/open62541/all/patches/set_static_version.patch diff --git a/recipes/open62541/all/conandata.yml b/recipes/open62541/all/conandata.yml index 663924190f859..9255fb0db3de7 100644 --- a/recipes/open62541/all/conandata.yml +++ b/recipes/open62541/all/conandata.yml @@ -7,16 +7,8 @@ sources: sha256: "12770bf9f5d9f44dedce0d1b34066dd14111d24c73a2f0153420e0a750e85d19" patches: "1.0.3": - - patch_file: "patches/set_static_version.patch" - base_path: "source_subfolder" - - patch_file: "patches/remove_clang_sanitizer_1_0_3.patch" - base_path: "source_subfolder" - - patch_file: "patches/rework_pro_mdsnd_as_conan_dependency_1_0_3.patch" + - patch_file: "patches/1_0_3.patch" base_path: "source_subfolder" "1.1.3": - - patch_file: "patches/set_static_version.patch" - base_path: "source_subfolder" - - patch_file: "patches/remove_clang_sanitizer_1_1_3.patch" - base_path: "source_subfolder" - - patch_file: "patches/rework_pro_mdsnd_as_conan_dependency_1_1_3.patch" + - patch_file: "patches/1_1_3.patch" base_path: "source_subfolder" diff --git a/recipes/open62541/all/patches/rework_pro_mdsnd_as_conan_dependency_1_0_3.patch b/recipes/open62541/all/patches/1_0_3.patch similarity index 54% rename from recipes/open62541/all/patches/rework_pro_mdsnd_as_conan_dependency_1_0_3.patch rename to recipes/open62541/all/patches/1_0_3.patch index 8e393048321aa..8683bd77373bd 100644 --- a/recipes/open62541/all/patches/rework_pro_mdsnd_as_conan_dependency_1_0_3.patch +++ b/recipes/open62541/all/patches/1_0_3.patch @@ -1,8 +1,34 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 94ceb127..f6c47378 100644 +index 94ceb127..29fe3e1d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -343,9 +343,6 @@ mark_as_advanced(UA_PACK_DEBIAN) +@@ -9,7 +9,6 @@ string(TOLOWER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_LOWER_CASE) + + set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/tools/cmake") + find_package(PythonInterp REQUIRED) +-find_package(Git) + include(AssignSourceGroup) + include(GNUInstallDirs) + +@@ -32,12 +31,11 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) + # Version # + ########### + +-include(SetGitBasedVersion) +- +-# The version string will be automatically set based on the git describe output. +-# This will automate the version strings. Just create a new tag, and the version will be set correctly. +-set_open62541_version() +-MESSAGE(STATUS "open62541 Version: ${OPEN62541_VER_MAJOR}.${OPEN62541_VER_MINOR}.${OPEN62541_VER_PATCH}${OPEN62541_VER_LABEL}") ++set(OPEN62541_VER_MINOR "0" CACHE STRING "Set the major version. Used by conan") ++set(OPEN62541_VER_MAJOR "0" CACHE STRING "Set the minor version. Used by conan") ++set(OPEN62541_VER_PATCH "0" CACHE STRING "Set the patch version. Used by conan") ++set(OPEN62541_VER_LABEL "") ++set(OPEN62541_VER_COMMIT "${OPEN62541_VER_MAJOR}.${OPEN62541_VER_MINOR}.${OPEN62541_VER_PATCH}") + + ################# + # Build Options # +@@ -343,9 +341,6 @@ mark_as_advanced(UA_PACK_DEBIAN) set(UA_DYNAMIC_LINKING OFF) if(BUILD_SHARED_LIBS) set(UA_DYNAMIC_LINKING ON) @@ -12,7 +38,35 @@ index 94ceb127..f6c47378 100644 endif() # Warn if experimental features are enabled -@@ -520,8 +517,8 @@ configure_file(include/open62541/config.h.in ${PROJECT_BINARY_DIR}/src_generated +@@ -440,18 +435,6 @@ if(NOT UA_COMPILE_AS_CXX AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID + # Linker + set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # cmake sets -rdynamic by default + +- # Debug +- if(BUILD_TYPE_LOWER_CASE STREQUAL "debug" AND UNIX) +- if("x${CMAKE_C_COMPILER_ID}" STREQUAL "xClang" AND NOT UA_ENABLE_UNIT_TESTS_MEMCHECK) +- # Add default sanitizer settings when using clang and Debug build. +- # This allows e.g. CLion to find memory locations for SegFaults +- message(STATUS "Sanitizer enabled") +- set(SANITIZER_FLAGS "-g -fno-omit-frame-pointer -gline-tables-only -fsanitize=address -fsanitize-address-use-after-scope -fsanitize-coverage=trace-pc-guard,trace-cmp -fsanitize=leak -fsanitize=undefined") +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SANITIZER_FLAGS}") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SANITIZER_FLAGS}") +- endif() +- endif() +- + if (NOT MINGW) + if(UA_ENABLE_HARDENING AND ((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))) + check_cc_flag("-D_FORTIFY_SOURCE=2") # run-time buffer overflow detection (needs at least -O1) +@@ -493,8 +476,6 @@ if(APPLE) + endif() + + if(MSVC) +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3 /WX /w44996") # Compiler warnings, error on warning +- + if(UA_MSVC_FORCE_STATIC_CRT AND NOT BUILD_SHARED_LIBS) + set(CompilerFlags CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_C_FLAGS + CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE) +@@ -520,8 +501,8 @@ configure_file(include/open62541/config.h.in ${PROJECT_BINARY_DIR}/src_generated configure_file(open62541.pc.in ${PROJECT_BINARY_DIR}/src_generated/open62541.pc @ONLY) if(UA_ENABLE_DISCOVERY_MULTICAST) @@ -22,7 +76,7 @@ index 94ceb127..f6c47378 100644 endif() set(exported_headers ${exported_headers} -@@ -742,22 +739,6 @@ if(UA_DEBUG_DUMP_PKGS) +@@ -742,22 +723,6 @@ if(UA_DEBUG_DUMP_PKGS) list(APPEND lib_sources ${PROJECT_SOURCE_DIR}/plugins/ua_debug_dump_pkgs.c) endif() @@ -45,7 +99,7 @@ index 94ceb127..f6c47378 100644 if(UA_BUILD_FUZZING OR UA_BUILD_OSS_FUZZ) set(lib_sources ${lib_sources} -@@ -1031,13 +1012,13 @@ endif() +@@ -1031,13 +996,13 @@ endif() # Ensure that the open62541::open62541 alias can be used inside open62541's build add_library(open62541::open62541 ALIAS open62541) diff --git a/recipes/open62541/all/patches/rework_pro_mdsnd_as_conan_dependency_1_1_3.patch b/recipes/open62541/all/patches/1_1_3.patch similarity index 54% rename from recipes/open62541/all/patches/rework_pro_mdsnd_as_conan_dependency_1_1_3.patch rename to recipes/open62541/all/patches/1_1_3.patch index e6bf09a8c828f..20b39cb444422 100644 --- a/recipes/open62541/all/patches/rework_pro_mdsnd_as_conan_dependency_1_1_3.patch +++ b/recipes/open62541/all/patches/1_1_3.patch @@ -1,8 +1,34 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 2fd6ef29..4943c9ef 100755 +index 2fd6ef29..e852fe49 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -425,9 +425,6 @@ mark_as_advanced(UA_PACK_DEBIAN) +@@ -9,7 +9,6 @@ string(TOLOWER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_LOWER_CASE) + + set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/tools/cmake") + find_package(PythonInterp REQUIRED) +-find_package(Git) + include(AssignSourceGroup) + include(GNUInstallDirs) + +@@ -33,12 +32,11 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) + # Version # + ########### + +-include(SetGitBasedVersion) +- +-# The version string will be automatically set based on the git describe output. +-# This will automate the version strings. Just create a new tag, and the version will be set correctly. +-set_open62541_version() +-MESSAGE(STATUS "open62541 Version: ${OPEN62541_VER_MAJOR}.${OPEN62541_VER_MINOR}.${OPEN62541_VER_PATCH}${OPEN62541_VER_LABEL}") ++set(OPEN62541_VER_MINOR "0" CACHE STRING "Set the major version. Used by conan") ++set(OPEN62541_VER_MAJOR "0" CACHE STRING "Set the minor version. Used by conan") ++set(OPEN62541_VER_PATCH "0" CACHE STRING "Set the patch version. Used by conan") ++set(OPEN62541_VER_LABEL "") ++set(OPEN62541_VER_COMMIT "${OPEN62541_VER_MAJOR}.${OPEN62541_VER_MINOR}.${OPEN62541_VER_PATCH}") + + ################# + # Build Options # +@@ -425,9 +423,6 @@ mark_as_advanced(UA_PACK_DEBIAN) set(UA_DYNAMIC_LINKING OFF) if(BUILD_SHARED_LIBS) set(UA_DYNAMIC_LINKING ON) @@ -12,7 +38,35 @@ index 2fd6ef29..4943c9ef 100755 endif() # Warn if experimental features are enabled -@@ -659,8 +656,8 @@ configure_file(include/open62541/config.h.in ${PROJECT_BINARY_DIR}/src_generated +@@ -576,18 +571,6 @@ if(NOT UA_FORCE_CPP AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID}" ST + # Linker + set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # cmake sets -rdynamic by default + +- # Debug +- if(BUILD_TYPE_LOWER_CASE STREQUAL "debug" AND UNIX) +- if("x${CMAKE_C_COMPILER_ID}" STREQUAL "xClang" AND NOT UA_ENABLE_UNIT_TESTS_MEMCHECK) +- # Add default sanitizer settings when using clang and Debug build. +- # This allows e.g. CLion to find memory locations for SegFaults +- message(STATUS "Sanitizer enabled") +- set(SANITIZER_FLAGS "-g -fno-omit-frame-pointer -gline-tables-only -fsanitize=address -fsanitize-address-use-after-scope -fsanitize-coverage=trace-pc-guard,trace-cmp -fsanitize=leak -fsanitize=undefined") +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SANITIZER_FLAGS}") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SANITIZER_FLAGS}") +- endif() +- endif() +- + if (NOT MINGW) + if(UA_ENABLE_HARDENING AND ((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))) + check_add_cc_flag("-D_FORTIFY_SOURCE=2") # run-time buffer overflow detection (needs at least -O1) +@@ -632,8 +615,6 @@ if(APPLE) + endif() + + if(MSVC) +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3 /WX /w44996") # Compiler warnings, error on warning +- + if(UA_MSVC_FORCE_STATIC_CRT AND NOT BUILD_SHARED_LIBS) + set(CompilerFlags CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_C_FLAGS + CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE) +@@ -659,8 +640,8 @@ configure_file(include/open62541/config.h.in ${PROJECT_BINARY_DIR}/src_generated configure_file(open62541.pc.in ${PROJECT_BINARY_DIR}/src_generated/open62541.pc @ONLY) if(UA_ENABLE_DISCOVERY_MULTICAST) @@ -22,7 +76,7 @@ index 2fd6ef29..4943c9ef 100755 endif() set(exported_headers ${exported_headers} -@@ -945,22 +942,6 @@ if(UA_DEBUG_DUMP_PKGS) +@@ -945,22 +926,6 @@ if(UA_DEBUG_DUMP_PKGS) list(APPEND lib_sources ${PROJECT_SOURCE_DIR}/tests/testing-plugins/testing_networklayers.c) endif() @@ -45,7 +99,7 @@ index 2fd6ef29..4943c9ef 100755 if(UA_BUILD_FUZZING OR UA_BUILD_OSS_FUZZ) set(lib_sources ${lib_sources} -@@ -1250,13 +1231,13 @@ add_dependencies(open62541-object open62541-code-generation) +@@ -1250,13 +1215,13 @@ add_dependencies(open62541-object open62541-code-generation) # Ensure that the open62541::open62541 alias can be used inside open62541's build add_library(open62541::open62541 ALIAS open62541) diff --git a/recipes/open62541/all/patches/remove_clang_sanitizer_1_0_3.patch b/recipes/open62541/all/patches/remove_clang_sanitizer_1_0_3.patch deleted file mode 100644 index 9eb5142e901b0..0000000000000 --- a/recipes/open62541/all/patches/remove_clang_sanitizer_1_0_3.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 94ceb127..390f0e90 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -440,18 +440,6 @@ if(NOT UA_COMPILE_AS_CXX AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID - # Linker - set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # cmake sets -rdynamic by default - -- # Debug -- if(BUILD_TYPE_LOWER_CASE STREQUAL "debug" AND UNIX) -- if("x${CMAKE_C_COMPILER_ID}" STREQUAL "xClang" AND NOT UA_ENABLE_UNIT_TESTS_MEMCHECK) -- # Add default sanitizer settings when using clang and Debug build. -- # This allows e.g. CLion to find memory locations for SegFaults -- message(STATUS "Sanitizer enabled") -- set(SANITIZER_FLAGS "-g -fno-omit-frame-pointer -gline-tables-only -fsanitize=address -fsanitize-address-use-after-scope -fsanitize-coverage=trace-pc-guard,trace-cmp -fsanitize=leak -fsanitize=undefined") -- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SANITIZER_FLAGS}") -- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SANITIZER_FLAGS}") -- endif() -- endif() -- - if (NOT MINGW) - if(UA_ENABLE_HARDENING AND ((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))) - check_cc_flag("-D_FORTIFY_SOURCE=2") # run-time buffer overflow detection (needs at least -O1) -@@ -493,8 +481,6 @@ if(APPLE) - endif() - - if(MSVC) -- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3 /WX /w44996") # Compiler warnings, error on warning -- - if(UA_MSVC_FORCE_STATIC_CRT AND NOT BUILD_SHARED_LIBS) - set(CompilerFlags CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_C_FLAGS - CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE) diff --git a/recipes/open62541/all/patches/remove_clang_sanitizer_1_1_3.patch b/recipes/open62541/all/patches/remove_clang_sanitizer_1_1_3.patch deleted file mode 100644 index c6dd3f9a49a6a..0000000000000 --- a/recipes/open62541/all/patches/remove_clang_sanitizer_1_1_3.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 2fd6ef29..7fc58e1d 100755 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -576,18 +576,6 @@ if(NOT UA_FORCE_CPP AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID}" ST - # Linker - set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # cmake sets -rdynamic by default - -- # Debug -- if(BUILD_TYPE_LOWER_CASE STREQUAL "debug" AND UNIX) -- if("x${CMAKE_C_COMPILER_ID}" STREQUAL "xClang" AND NOT UA_ENABLE_UNIT_TESTS_MEMCHECK) -- # Add default sanitizer settings when using clang and Debug build. -- # This allows e.g. CLion to find memory locations for SegFaults -- message(STATUS "Sanitizer enabled") -- set(SANITIZER_FLAGS "-g -fno-omit-frame-pointer -gline-tables-only -fsanitize=address -fsanitize-address-use-after-scope -fsanitize-coverage=trace-pc-guard,trace-cmp -fsanitize=leak -fsanitize=undefined") -- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SANITIZER_FLAGS}") -- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SANITIZER_FLAGS}") -- endif() -- endif() -- - if (NOT MINGW) - if(UA_ENABLE_HARDENING AND ((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))) - check_add_cc_flag("-D_FORTIFY_SOURCE=2") # run-time buffer overflow detection (needs at least -O1) -@@ -632,8 +620,6 @@ if(APPLE) - endif() - - if(MSVC) -- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3 /WX /w44996") # Compiler warnings, error on warning -- - if(UA_MSVC_FORCE_STATIC_CRT AND NOT BUILD_SHARED_LIBS) - set(CompilerFlags CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_C_FLAGS - CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE) diff --git a/recipes/open62541/all/patches/set_static_version.patch b/recipes/open62541/all/patches/set_static_version.patch deleted file mode 100644 index 1a6d052b84f14..0000000000000 --- a/recipes/open62541/all/patches/set_static_version.patch +++ /dev/null @@ -1,30 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 2fd6ef29..269a9086 100755 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -9,7 +9,6 @@ string(TOLOWER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_LOWER_CASE) - - set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/tools/cmake") - find_package(PythonInterp REQUIRED) --find_package(Git) - include(AssignSourceGroup) - include(GNUInstallDirs) - -@@ -33,12 +32,11 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) - # Version # - ########### - --include(SetGitBasedVersion) -- --# The version string will be automatically set based on the git describe output. --# This will automate the version strings. Just create a new tag, and the version will be set correctly. --set_open62541_version() --MESSAGE(STATUS "open62541 Version: ${OPEN62541_VER_MAJOR}.${OPEN62541_VER_MINOR}.${OPEN62541_VER_PATCH}${OPEN62541_VER_LABEL}") -+set(OPEN62541_VER_MINOR "0" CACHE STRING "Set the major version. Used by conan") -+set(OPEN62541_VER_MAJOR "0" CACHE STRING "Set the minor version. Used by conan") -+set(OPEN62541_VER_PATCH "0" CACHE STRING "Set the patch version. Used by conan") -+set(OPEN62541_VER_LABEL "") -+set(OPEN62541_VER_COMMIT "${OPEN62541_VER_MAJOR}.${OPEN62541_VER_MINOR}.${OPEN62541_VER_PATCH}") - - ################# - # Build Options # From 94cc0dd4203c83476f8fe6f9d4de391da744fd5a Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Thu, 3 Dec 2020 14:53:54 +0100 Subject: [PATCH 44/81] remove patch fuzzing --- recipes/open62541/all/conanfile.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index 6b5fa358160cf..3c42749950a7a 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -117,7 +117,7 @@ def requirements(self): def _patch_sources(self): for patch in self.conan_data["patches"][self.version]: - tools.patch(**patch, fuzz=True) + tools.patch(**patch) def configure(self): if not self.options.subscription: @@ -190,12 +190,14 @@ def _configure_cmake(self): self._cmake = CMake(self) self._cmake.verbose = True + version = Version(self.version) self._cmake.definitions["OPEN62541_VER_MAJOR"] = version.major( fill=False) self._cmake.definitions["OPEN62541_VER_MINOR"] = version.minor( fill=False) self._cmake.definitions["OPEN62541_VER_PATCH"] = version.patch() + self._cmake.definitions["UA_LOGLEVEL"] = self._get_log_level() self._cmake.definitions["UA_ENABLE_SUBSCRIPTIONS"] = self.options.subscription self._cmake.definitions["UA_ENABLE_SUBSCRIPTIONS_EVENTS"] = self.options.subscription_events @@ -241,7 +243,8 @@ def _configure_cmake(self): if self.settings.compiler == "Visual Studio" and self.options.shared == True: self._cmake.definitions["UA_MSVC_FORCE_STATIC_CRT"] = True self._cmake.definitions["UA_COMPILE_AS_CXX"] = self.options.cpp_compatible - self._cmake.configure() + + self._cmake.configure(source_dir=self._source_subfolder) return self._cmake def build(self): From 0e182d67138d8fee7d018167ef46ba9a369b183f Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Thu, 3 Dec 2020 15:45:25 +0100 Subject: [PATCH 45/81] refactor conan.model.Version import into tools.Version to fix KB-H053 --- recipes/open62541/all/conanfile.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index 3c42749950a7a..28dde8c1297c0 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -1,6 +1,5 @@ import os from conans import ConanFile, CMake, tools -from conans.model.version import Version from conans.errors import ConanInvalidConfiguration import glob import shutil @@ -90,7 +89,7 @@ def _source_subfolder(self): return "source_subfolder" def requirements(self): - if Version(self.version) >= "1.1.0": + if tools.Version(self.version) >= "1.1.0": if self.options.encryption == "mbedtls-apache": self.requires("mbedtls/2.16.3-apache") elif self.options.encryption == "mbedtls-gpl": @@ -191,12 +190,10 @@ def _configure_cmake(self): self._cmake = CMake(self) self._cmake.verbose = True - version = Version(self.version) - self._cmake.definitions["OPEN62541_VER_MAJOR"] = version.major( - fill=False) - self._cmake.definitions["OPEN62541_VER_MINOR"] = version.minor( - fill=False) - self._cmake.definitions["OPEN62541_VER_PATCH"] = version.patch() + version = tools.Version(self.version) + self._cmake.definitions["OPEN62541_VER_MAJOR"] = version.major + self._cmake.definitions["OPEN62541_VER_MINOR"] = version.minor + self._cmake.definitions["OPEN62541_VER_PATCH"] = version.patch self._cmake.definitions["UA_LOGLEVEL"] = self._get_log_level() self._cmake.definitions["UA_ENABLE_SUBSCRIPTIONS"] = self.options.subscription From 1b3bd4dc528a8b700771db3a0d3b1597b213f481 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Thu, 3 Dec 2020 15:49:59 +0100 Subject: [PATCH 46/81] fix conflict with KB-H050 --- recipes/open62541/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index 28dde8c1297c0..b90daf44c655e 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -53,7 +53,7 @@ class Open62541Conan(ConanFile): } default_options = { "fPIC": True, - "shared": True, + "shared": False, "historize": "Off", "logging_level": "Info", "subscription": True, From 84302ce4a3fd9c49ca2f6cd363744b2ffb6dbf37 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Thu, 3 Dec 2020 16:12:34 +0100 Subject: [PATCH 47/81] move invalid configutation exceptions to configure() --- recipes/open62541/all/conanfile.py | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index b90daf44c655e..3e62a764784e1 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -104,12 +104,6 @@ def requirements(self): self.requires("mbedtls/2.16.3-apache") elif self.options.encryption == "mbedtls-gpl": self.requires("mbedtls/2.16.3-gpl") - elif self.options.encryption == "openssl": - raise ConanInvalidConfiguration( - "Versions of Open62541 lower than 1.1.0 do not support openssl") - if self.options.web_socket: - raise ConanInvalidConfiguration( - "Versions of Open62541 lower than 1.1.0 do not fully support websockets") if self.options.discovery_multicast: self.requires("pro-mdnsd/0.8.4") @@ -129,6 +123,23 @@ def configure(self): raise ConanInvalidConfiguration( "Open62541 requires discovery option") + if tools.Version(self.version) <= "1.1.0": + if self.options.encryption == "openssl": + raise ConanInvalidConfiguration( + "Versions of Open62541 lower than 1.1.0 do not support openssl") + + if self.options.web_socket: + raise ConanInvalidConfiguration( + "Versions of Open62541 lower than 1.1.0 do not fully support websockets") + + if self.settings.compiler == "clang" and not self.options.shared: + raise ConanInvalidConfiguration( + "Clang compiler can not be used to build a static library") + + if self.options.pub_sub != "None" and self.settings.os != "Linux": + raise ConanInvalidConfiguration( + "PubSub over Ethernet is not supported for your OS!") + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -183,10 +194,6 @@ def _configure_cmake(self): if self._cmake: return self._cmake - if self.settings.compiler == "clang" and not self.options.shared: - raise ConanInvalidConfiguration( - "Clang compiler can not be used to build a static library") - self._cmake = CMake(self) self._cmake.verbose = True @@ -224,9 +231,6 @@ def _configure_cmake(self): self._cmake.definitions["UA_ENABLE_PUBSUB_ETH_UADP"] = True elif self.settings.os == "Linux" and self.options.pub_sub == "Ethernet_XDP": self._cmake.definitions["UA_ENABLE_PUBSUB_ETH_UADP_XDP"] = True - else: - raise ConanInvalidConfiguration( - "PubSub over Ethernet is not supported for your OS!") self._cmake.definitions["UA_ENABLE_DA"] = self.options.data_access if self.options.compiled_nodeset_descriptions == True: self._cmake.definitions["UA_ENABLE_NODESET_COMPILER_DESCRIPTIONS"] = self.options.compiled_nodeset_descriptions From dc4493363594d405b736af3397a126d71b2de754 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Thu, 3 Dec 2020 16:18:38 +0100 Subject: [PATCH 48/81] rework options to mixed types --- recipes/open62541/all/conanfile.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index 3e62a764784e1..d485a6542178b 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -25,23 +25,23 @@ class Open62541Conan(ConanFile): options = { "fPIC": [True, False], "shared": [True, False], - "historize": ["Off", "On", "Experimental"], + "historize": [True, False, "Experimental"], "logging_level": ["Fatal", "Error", "Warning", "Info", "Debug", "Trace"], "subscription": [True, False], "subscription_events": [True, False], "methods": [True, False], "dynamic_nodes": [True, False], "single_header": [True, False], - "multithreading": ["Off", "Threadsafe", "Internal threads"], + "multithreading": [None, "Threadsafe", "Internal threads"], "imutable_nodes": [True, False], "web_socket": [True, False], "discovery": [True, False], "discovery_semaphore": [True, False], "discovery_multicast": [True, False], "query": [True, False], - "encryption": ["None", "openssl", "mbedtls-apache", "mbedtls-gpl"], + "encryption": [None, "openssl", "mbedtls-apache", "mbedtls-gpl"], "json_support": [True, False], - "pub_sub": ["None", "Simple", "Ethernet", "Ethernet_XDP"], + "pub_sub": [None, "Simple", "Ethernet", "Ethernet_XDP"], "data_access": [True, False], "compiled_nodeset_descriptions": [True, False], "namespace_zero": ["MINIMAL", "REDUCED", "FULL"], @@ -54,23 +54,23 @@ class Open62541Conan(ConanFile): default_options = { "fPIC": True, "shared": False, - "historize": "Off", + "historize": False, "logging_level": "Info", "subscription": True, "subscription_events": False, "methods": True, "dynamic_nodes": True, "single_header": False, - "multithreading": "Off", + "multithreading": None, "imutable_nodes": False, "web_socket": False, "discovery": True, "discovery_semaphore": True, "discovery_multicast": False, "query": False, - "encryption": "None", + "encryption": None, "json_support": False, - "pub_sub": "None", + "pub_sub": None, "data_access": True, "compiled_nodeset_descriptions": True, "namespace_zero": "FULL", @@ -136,7 +136,7 @@ def configure(self): raise ConanInvalidConfiguration( "Clang compiler can not be used to build a static library") - if self.options.pub_sub != "None" and self.settings.os != "Linux": + if self.options.pub_sub != None and self.settings.os != "Linux": raise ConanInvalidConfiguration( "PubSub over Ethernet is not supported for your OS!") @@ -185,7 +185,7 @@ def _get_log_level(self): def _get_multithreading_option(self): return { - "Off": "0", + None: "0", "Threadsafe": "100", "Internal threads": "200" }.get(str(self.options.multithreading), "0") @@ -212,7 +212,7 @@ def _configure_cmake(self): ) self._cmake.definitions["UA_ENABLE_IMMUTABLE_NODES"] = self.options.imutable_nodes self._cmake.definitions["UA_ENABLE_WEBSOCKET_SERVER"] = self.options.web_socket - if self.options.historize != "Off": + if self.options.historize != False: self._cmake.definitions["UA_ENABLE_HISTORIZING"] = True if self.options.historize == "Experimental": self._cmake.definitions["UA_ENABLE_EXPERIMENTAL_HISTORIZING"] = True @@ -220,12 +220,12 @@ def _configure_cmake(self): self._cmake.definitions["UA_ENABLE_DISCOVERY_MULTICAST"] = self.options.discovery_multicast self._cmake.definitions["UA_ENABLE_DISCOVERY_SEMAPHORE"] = self.options.discovery_semaphore self._cmake.definitions["UA_ENABLE_QUERY"] = self.options.query - if self.options.encryption != "None": + if self.options.encryption != None: self._cmake.definitions["UA_ENABLE_ENCRYPTION"] = True if self.options.encryption == "openssl": self._cmake.definitions["UA_ENABLE_ENCRYPTION_OPENSSL"] = True self._cmake.definitions["UA_ENABLE_JSON_ENCODING"] = self.options.json_support - if self.options.pub_sub != "None": + if self.options.pub_sub != None: self._cmake.definitions["UA_ENABLE_PUBSUB"] = True if self.settings.os == "Linux" and self.options.pub_sub == "Ethernet": self._cmake.definitions["UA_ENABLE_PUBSUB_ETH_UADP"] = True From 107c75cebb5be9a27c4e934957f3148a2c8ff08a Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Thu, 3 Dec 2020 17:16:23 +0100 Subject: [PATCH 49/81] add remove_files_by_mask, exception for multithreading option, change exceptio nwording --- recipes/open62541/all/conanfile.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index d485a6542178b..a7bb937c299bb 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -1,7 +1,6 @@ import os from conans import ConanFile, CMake, tools from conans.errors import ConanInvalidConfiguration -import glob import shutil import yaml @@ -126,11 +125,15 @@ def configure(self): if tools.Version(self.version) <= "1.1.0": if self.options.encryption == "openssl": raise ConanInvalidConfiguration( - "Versions of Open62541 lower than 1.1.0 do not support openssl") + "Lower Open62541 versions than 1.1.0 do not support openssl") + + if self.options.multithreading != None: + raise ConanInvalidConfiguration( + "Lower Open62541 versions than 1.1.0 do not fully support multithreading!") if self.options.web_socket: raise ConanInvalidConfiguration( - "Versions of Open62541 lower than 1.1.0 do not fully support websockets") + "Lower Open62541 versions than 1.1.0 do not fully support websockets") if self.settings.compiler == "clang" and not self.options.shared: raise ConanInvalidConfiguration( @@ -208,8 +211,9 @@ def _configure_cmake(self): self._cmake.definitions["UA_ENABLE_METHODCALLS"] = self.options.methods self._cmake.definitions["UA_ENABLE_NODEMANAGEMENT"] = self.options.dynamic_nodes self._cmake.definitions["UA_ENABLE_AMALGAMATION"] = self.options.single_header - self._cmake.definitions["UA_ENABLE_MULTITHREADING"] = self._get_multithreading_option( - ) + if version >= "1.1.3": + self._cmake.definitions["UA_MULTITHREADING"] = self._get_multithreading_option( + ) self._cmake.definitions["UA_ENABLE_IMMUTABLE_NODES"] = self.options.imutable_nodes self._cmake.definitions["UA_ENABLE_WEBSOCKET_SERVER"] = self.options.web_socket if self.options.historize != False: @@ -259,10 +263,10 @@ def package(self): cmake = self._configure_cmake() cmake.install() - for f in glob.glob(os.path.join(self.package_folder, "bin", "*.pdb")): - os.remove(f) - for f in glob.glob(os.path.join(self.package_folder, "lib", "*.pdb")): - os.remove(f) + tools.remove_files_by_mask(os.path.join( + self.package_folder, "bin"), '*.pdb') + tools.remove_files_by_mask(os.path.join( + self.package_folder, "lib"), '*.pdb') tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) tools.rmdir(os.path.join(self.package_folder, "share")) From 6106e05be23ad95a8e958527f34ba04d42736952 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Thu, 3 Dec 2020 18:10:53 +0100 Subject: [PATCH 50/81] rollback None types to "None" string literals --- recipes/open62541/all/conanfile.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index a7bb937c299bb..21600df9397b3 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -31,16 +31,16 @@ class Open62541Conan(ConanFile): "methods": [True, False], "dynamic_nodes": [True, False], "single_header": [True, False], - "multithreading": [None, "Threadsafe", "Internal threads"], + "multithreading": ["None", "Threadsafe", "Internal threads"], "imutable_nodes": [True, False], "web_socket": [True, False], "discovery": [True, False], "discovery_semaphore": [True, False], "discovery_multicast": [True, False], "query": [True, False], - "encryption": [None, "openssl", "mbedtls-apache", "mbedtls-gpl"], + "encryption": ["None", "openssl", "mbedtls-apache", "mbedtls-gpl"], "json_support": [True, False], - "pub_sub": [None, "Simple", "Ethernet", "Ethernet_XDP"], + "pub_sub": ["None", "Simple", "Ethernet", "Ethernet_XDP"], "data_access": [True, False], "compiled_nodeset_descriptions": [True, False], "namespace_zero": ["MINIMAL", "REDUCED", "FULL"], @@ -60,16 +60,16 @@ class Open62541Conan(ConanFile): "methods": True, "dynamic_nodes": True, "single_header": False, - "multithreading": None, + "multithreading": "None", "imutable_nodes": False, "web_socket": False, "discovery": True, "discovery_semaphore": True, "discovery_multicast": False, "query": False, - "encryption": None, + "encryption": "None", "json_support": False, - "pub_sub": None, + "pub_sub": "None", "data_access": True, "compiled_nodeset_descriptions": True, "namespace_zero": "FULL", @@ -127,7 +127,7 @@ def configure(self): raise ConanInvalidConfiguration( "Lower Open62541 versions than 1.1.0 do not support openssl") - if self.options.multithreading != None: + if self.options.multithreading != "None": raise ConanInvalidConfiguration( "Lower Open62541 versions than 1.1.0 do not fully support multithreading!") @@ -139,7 +139,7 @@ def configure(self): raise ConanInvalidConfiguration( "Clang compiler can not be used to build a static library") - if self.options.pub_sub != None and self.settings.os != "Linux": + if self.options.pub_sub != "None" and self.settings.os != "Linux": raise ConanInvalidConfiguration( "PubSub over Ethernet is not supported for your OS!") @@ -188,7 +188,7 @@ def _get_log_level(self): def _get_multithreading_option(self): return { - None: "0", + "None": "0", "Threadsafe": "100", "Internal threads": "200" }.get(str(self.options.multithreading), "0") @@ -224,12 +224,12 @@ def _configure_cmake(self): self._cmake.definitions["UA_ENABLE_DISCOVERY_MULTICAST"] = self.options.discovery_multicast self._cmake.definitions["UA_ENABLE_DISCOVERY_SEMAPHORE"] = self.options.discovery_semaphore self._cmake.definitions["UA_ENABLE_QUERY"] = self.options.query - if self.options.encryption != None: + if self.options.encryption != "None": self._cmake.definitions["UA_ENABLE_ENCRYPTION"] = True if self.options.encryption == "openssl": self._cmake.definitions["UA_ENABLE_ENCRYPTION_OPENSSL"] = True self._cmake.definitions["UA_ENABLE_JSON_ENCODING"] = self.options.json_support - if self.options.pub_sub != None: + if self.options.pub_sub != "None": self._cmake.definitions["UA_ENABLE_PUBSUB"] = True if self.settings.os == "Linux" and self.options.pub_sub == "Ethernet": self._cmake.definitions["UA_ENABLE_PUBSUB_ETH_UADP"] = True From fe925dc0c532168236072d3102f7304b1dfd2be3 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Fri, 4 Dec 2020 12:30:45 +0100 Subject: [PATCH 51/81] move .dll files to bin, to resolve conflict with KB-H013 --- recipes/open62541/all/conanfile.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index 21600df9397b3..bc68c97e6a248 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -263,6 +263,9 @@ def package(self): cmake = self._configure_cmake() cmake.install() + if self.settings.os == "Windows" and self.options.shared: + self.copy("*.dll", dst="bin", keep_path=False) + tools.remove_files_by_mask(os.path.join( self.package_folder, "bin"), '*.pdb') tools.remove_files_by_mask(os.path.join( From 69d99944b735233dca870f456c4a7e37b50fba75 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Fri, 4 Dec 2020 12:53:44 +0100 Subject: [PATCH 52/81] Re-trigger CI-CD Build From ce003083483024ede5c955500cf2d84b876acb68 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Fri, 4 Dec 2020 13:32:59 +0100 Subject: [PATCH 53/81] remove .dll files from package source dir after copy --- recipes/open62541/all/conanfile.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index bc68c97e6a248..7a8fe3240bae1 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -265,8 +265,8 @@ def package(self): if self.settings.os == "Windows" and self.options.shared: self.copy("*.dll", dst="bin", keep_path=False) + tools.remove_files_by_mask(self.package_folder, '*.dll') - tools.remove_files_by_mask(os.path.join( self.package_folder, "bin"), '*.pdb') tools.remove_files_by_mask(os.path.join( self.package_folder, "lib"), '*.pdb') @@ -276,10 +276,10 @@ def package(self): tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): - self.cpp_info.names["cmake_find_package"] = "open62541" - self.cpp_info.names["cmake_find_package_multi"] = "open62541" - self.cpp_info.libs = tools.collect_libs(self) - self.cpp_info.includedirs = [ + self.cpp_info.names["cmake_find_package"]="open62541" + self.cpp_info.names["cmake_find_package_multi"]="open62541" + self.cpp_info.libs=tools.collect_libs(self) + self.cpp_info.includedirs=[ "include", os.path.join("include", "plugin") ] @@ -290,7 +290,7 @@ def package_info(self): self.cpp_info.includedirs.append(os.path.join("include", "win32")) else: self.cpp_info.includedirs.append(os.path.join("include", "posix")) - self.cpp_info.builddirs = [ + self.cpp_info.builddirs=[ "lib", os.path.join("lib", "cmake"), os.path.join("lib", "cmake", "open62541") From 3833bd1bb79bf1ac17d38b6fdb01ddbedaee2f8d Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Fri, 4 Dec 2020 13:38:03 +0100 Subject: [PATCH 54/81] fix typos in package() --- recipes/open62541/all/conanfile.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index 7a8fe3240bae1..7996dd39010e8 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -265,8 +265,9 @@ def package(self): if self.settings.os == "Windows" and self.options.shared: self.copy("*.dll", dst="bin", keep_path=False) - tools.remove_files_by_mask(self.package_folder, '*.dll') + tools.remove_files_by_mask(self.package_folder, '*.pdb') + tools.remove_files_by_mask(os.path.join( self.package_folder, "bin"), '*.pdb') tools.remove_files_by_mask(os.path.join( self.package_folder, "lib"), '*.pdb') @@ -276,10 +277,10 @@ def package(self): tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): - self.cpp_info.names["cmake_find_package"]="open62541" - self.cpp_info.names["cmake_find_package_multi"]="open62541" - self.cpp_info.libs=tools.collect_libs(self) - self.cpp_info.includedirs=[ + self.cpp_info.names["cmake_find_package"] = "open62541" + self.cpp_info.names["cmake_find_package_multi"] = "open62541" + self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.includedirs = [ "include", os.path.join("include", "plugin") ] @@ -290,7 +291,7 @@ def package_info(self): self.cpp_info.includedirs.append(os.path.join("include", "win32")) else: self.cpp_info.includedirs.append(os.path.join("include", "posix")) - self.cpp_info.builddirs=[ + self.cpp_info.builddirs = [ "lib", os.path.join("lib", "cmake"), os.path.join("lib", "cmake", "open62541") From b673d771628c919fbb6e38ba07863ae0396da1d3 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Fri, 4 Dec 2020 14:06:08 +0100 Subject: [PATCH 55/81] fix typo for .dll removal in package() --- recipes/open62541/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index 7996dd39010e8..e65b6c5b71533 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -265,7 +265,7 @@ def package(self): if self.settings.os == "Windows" and self.options.shared: self.copy("*.dll", dst="bin", keep_path=False) - tools.remove_files_by_mask(self.package_folder, '*.pdb') + tools.remove_files_by_mask(self.package_folder, '*.dll') tools.remove_files_by_mask(os.path.join( self.package_folder, "bin"), '*.pdb') From 4589df6ee160fcc6f52e599f88b0d9c408b0c078 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Fri, 4 Dec 2020 14:13:24 +0100 Subject: [PATCH 56/81] Re-trigger CI-CD Build From 0b9ea87b1a3be637d58c5f7a2afe5279a4e7c033 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Fri, 4 Dec 2020 15:40:36 +0100 Subject: [PATCH 57/81] Re-trigger CI-CD Build From 586d6580a2d5a8e3fabfc1cc9f952a12ddd788e1 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Mon, 7 Dec 2020 09:37:45 +0100 Subject: [PATCH 58/81] patch out runtime install path to bin --- recipes/open62541/all/patches/1_0_3.patch | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/recipes/open62541/all/patches/1_0_3.patch b/recipes/open62541/all/patches/1_0_3.patch index 8683bd77373bd..a38c9039dae65 100644 --- a/recipes/open62541/all/patches/1_0_3.patch +++ b/recipes/open62541/all/patches/1_0_3.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 94ceb127..29fe3e1d 100644 +index 94ceb127..575963fd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,6 @@ string(TOLOWER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_LOWER_CASE) @@ -117,6 +117,15 @@ index 94ceb127..29fe3e1d 100644 # Generate properly versioned shared library links on Linux SET_TARGET_PROPERTIES(open62541 PROPERTIES SOVERSION "${OPEN62541_VER_MAJOR}" VERSION "${OPEN62541_VER_MAJOR}.${OPEN62541_VER_MINOR}.${OPEN62541_VER_PATCH}") +@@ -1163,7 +1128,7 @@ install(TARGETS open62541 ${EXTRATARGETS} + EXPORT open62541Targets + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +- RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION include) + + if(UA_ENABLE_AMALGAMATION) diff --git a/src/server/ua_discovery_manager.h b/src/server/ua_discovery_manager.h index 3d1ae299..e7e5e776 100644 --- a/src/server/ua_discovery_manager.h From 599967ba959ed1d8c544d7749c360e3767fea52f Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Mon, 7 Dec 2020 09:38:41 +0100 Subject: [PATCH 59/81] remove .dll handling --- recipes/open62541/all/conanfile.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index e65b6c5b71533..21600df9397b3 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -263,10 +263,6 @@ def package(self): cmake = self._configure_cmake() cmake.install() - if self.settings.os == "Windows" and self.options.shared: - self.copy("*.dll", dst="bin", keep_path=False) - tools.remove_files_by_mask(self.package_folder, '*.dll') - tools.remove_files_by_mask(os.path.join( self.package_folder, "bin"), '*.pdb') tools.remove_files_by_mask(os.path.join( From eeec5e995dcd7b44a020e6081f3a4fdb43c9d677 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Mon, 7 Dec 2020 10:41:31 +0100 Subject: [PATCH 60/81] remvoe support for older than v4.x clang versions --- recipes/open62541/all/conanfile.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index 21600df9397b3..65eb3b3dae81c 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -135,9 +135,13 @@ def configure(self): raise ConanInvalidConfiguration( "Lower Open62541 versions than 1.1.0 do not fully support websockets") - if self.settings.compiler == "clang" and not self.options.shared: - raise ConanInvalidConfiguration( - "Clang compiler can not be used to build a static library") + if self.settings.compiler == "clang" + if tools.Version(self.settings.compiler.version) <= "4": + raise ConanInvalidConfiguration( + "Older clang compiler version than 4.0 are not supported") + if not self.options.shared: + raise ConanInvalidConfiguration( + "Clang compiler can not be used to build a static library") if self.options.pub_sub != "None" and self.settings.os != "Linux": raise ConanInvalidConfiguration( From 80c08000beca6768beb23d9a17fc7398a390bcad Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Mon, 7 Dec 2020 10:42:47 +0100 Subject: [PATCH 61/81] fix typo --- recipes/open62541/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index 65eb3b3dae81c..eba19a93b863a 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -135,7 +135,7 @@ def configure(self): raise ConanInvalidConfiguration( "Lower Open62541 versions than 1.1.0 do not fully support websockets") - if self.settings.compiler == "clang" + if self.settings.compiler == "clang": if tools.Version(self.settings.compiler.version) <= "4": raise ConanInvalidConfiguration( "Older clang compiler version than 4.0 are not supported") From cbaf06defc50f43335cc895a096552f26f8821e5 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Mon, 7 Dec 2020 10:48:39 +0100 Subject: [PATCH 62/81] fix if formating --- recipes/open62541/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index eba19a93b863a..6b07b18e55b00 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -136,7 +136,7 @@ def configure(self): "Lower Open62541 versions than 1.1.0 do not fully support websockets") if self.settings.compiler == "clang": - if tools.Version(self.settings.compiler.version) <= "4": + if tools.Version(self.settings.compiler.version) <= "4": raise ConanInvalidConfiguration( "Older clang compiler version than 4.0 are not supported") if not self.options.shared: From b13fd7342b0522c492d618df4b11068c19de0490 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Mon, 7 Dec 2020 12:25:43 +0100 Subject: [PATCH 63/81] add Clang 9 support, fix mdnsd find package --- recipes/open62541/all/patches/1_0_3.patch | 126 +++++++++++++++------- recipes/open62541/all/patches/1_1_3.patch | 69 ++++++------ 2 files changed, 120 insertions(+), 75 deletions(-) diff --git a/recipes/open62541/all/patches/1_0_3.patch b/recipes/open62541/all/patches/1_0_3.patch index a38c9039dae65..2ce1c1cea43ca 100644 --- a/recipes/open62541/all/patches/1_0_3.patch +++ b/recipes/open62541/all/patches/1_0_3.patch @@ -1,10 +1,13 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 94ceb127..575963fd 100644 +index 94ceb127..2bba3d04 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -9,7 +9,6 @@ string(TOLOWER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_LOWER_CASE) +@@ -7,9 +7,8 @@ endif() - set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/tools/cmake") + string(TOLOWER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_LOWER_CASE) + +-set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/tools/cmake") ++set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${PROJECT_SOURCE_DIR};${PROJECT_SOURCE_DIR}/tools/cmake") find_package(PythonInterp REQUIRED) -find_package(Git) include(AssignSourceGroup) @@ -28,17 +31,69 @@ index 94ceb127..575963fd 100644 ################# # Build Options # -@@ -343,9 +341,6 @@ mark_as_advanced(UA_PACK_DEBIAN) - set(UA_DYNAMIC_LINKING OFF) - if(BUILD_SHARED_LIBS) - set(UA_DYNAMIC_LINKING ON) -- if (UA_ENABLE_DISCOVERY_MULTICAST) -- set(MDNSD_DYNAMIC_LINKING ON) -- endif() - endif() +@@ -388,23 +386,44 @@ endif() + include(CompilerFlags) + if(NOT UA_COMPILE_AS_CXX AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID}" STREQUAL "xClang")) + # Compiler +- add_definitions(-std=c99 -pipe +- -Wall -Wextra -Wpedantic +- -Wno-static-in-inline # clang doesn't like the use of static inline methods inside static inline methods +- -Wno-overlength-strings # may happen in the nodeset compiler when complex values are directly encoded +- -Wno-unused-parameter # some methods may require unused arguments to cast to a method pointer +- -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls +- -Wformat -Wformat-security -Wformat-nonliteral +- -Wuninitialized -Winit-self +- -Wcast-qual +- -Wstrict-overflow +- -Wnested-externs +- -Wmultichar +- -Wundef +- -Wc++-compat +- -fno-strict-aliasing # fewer compiler assumptions about pointer types +- -fexceptions # recommended for multi-threaded C code, also in combination with C++ code +- ) ++ string(COMPARE GREATER_EQUAL ${CMAKE_C_COMPILER_VERSION} "9.0.0" IS_CLANG_9_COMPATIBLE) ++ if(${IS_CLANG_9_COMPATIBLE}) ++ add_definitions(-std=c99 -pipe ++ -Wall -Wextra -Wpedantic ++ -Wno-static-in-inline # clang doesn't like the use of static inline methods inside static inline methods ++ -Wno-overlength-strings # may happen in the nodeset compiler when complex values are directly encoded ++ -Qunused-arguments # some methods may require unused arguments to cast to a method pointer ++ -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls ++ -Wformat -Wformat-security -Wformat-nonliteral ++ -Wuninitialized -Winit-self ++ -Wcast-qual ++ -Wstrict-overflow ++ -Wnested-externs ++ -Wmultichar ++ -Wundef ++ -Wc++-compat ++ -fno-strict-aliasing # fewer compiler assumptions about pointer types ++ -fexceptions # recommended for multi-threaded C code, also in combination with C++ code ++ ) ++ else() ++ add_definitions(-std=c99 -pipe ++ -Wall -Wextra -Wpedantic ++ -Wno-static-in-inline # clang doesn't like the use of static inline methods inside static inline methods ++ -Wno-overlength-strings # may happen in the nodeset compiler when complex values are directly encoded ++ -Wno-unused-parameter # some methods may require unused arguments to cast to a method pointer ++ -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls ++ -Wformat -Wformat-security -Wformat-nonliteral ++ -Wuninitialized -Winit-self ++ -Wcast-qual ++ -Wstrict-overflow ++ -Wnested-externs ++ -Wmultichar ++ -Wundef ++ -Wc++-compat ++ -fno-strict-aliasing # fewer compiler assumptions about pointer types ++ -fexceptions # recommended for multi-threaded C code, also in combination with C++ code ++ ) ++ endif() + set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Werror") - # Warn if experimental features are enabled -@@ -440,18 +435,6 @@ if(NOT UA_COMPILE_AS_CXX AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID + if (NOT MINGW) +@@ -440,18 +459,6 @@ if(NOT UA_COMPILE_AS_CXX AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID # Linker set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # cmake sets -rdynamic by default @@ -57,7 +112,7 @@ index 94ceb127..575963fd 100644 if (NOT MINGW) if(UA_ENABLE_HARDENING AND ((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))) check_cc_flag("-D_FORTIFY_SOURCE=2") # run-time buffer overflow detection (needs at least -O1) -@@ -493,8 +476,6 @@ if(APPLE) +@@ -493,8 +500,6 @@ if(APPLE) endif() if(MSVC) @@ -66,17 +121,17 @@ index 94ceb127..575963fd 100644 if(UA_MSVC_FORCE_STATIC_CRT AND NOT BUILD_SHARED_LIBS) set(CompilerFlags CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE) -@@ -520,8 +501,8 @@ configure_file(include/open62541/config.h.in ${PROJECT_BINARY_DIR}/src_generated +@@ -520,8 +525,8 @@ configure_file(include/open62541/config.h.in ${PROJECT_BINARY_DIR}/src_generated configure_file(open62541.pc.in ${PROJECT_BINARY_DIR}/src_generated/open62541.pc @ONLY) if(UA_ENABLE_DISCOVERY_MULTICAST) -+ find_package(pro-mdnsd) ++ find_package(mdnsd) set(MDNSD_LOGLEVEL 300 CACHE STRING "Level at which logs shall be reported" FORCE) - configure_file("deps/mdnsd/libmdnsd/mdnsd_config.h.in" "${PROJECT_BINARY_DIR}/src_generated/mdnsd_config.h") endif() set(exported_headers ${exported_headers} -@@ -742,22 +723,6 @@ if(UA_DEBUG_DUMP_PKGS) +@@ -742,22 +747,6 @@ if(UA_DEBUG_DUMP_PKGS) list(APPEND lib_sources ${PROJECT_SOURCE_DIR}/plugins/ua_debug_dump_pkgs.c) endif() @@ -99,25 +154,18 @@ index 94ceb127..575963fd 100644 if(UA_BUILD_FUZZING OR UA_BUILD_OSS_FUZZ) set(lib_sources ${lib_sources} -@@ -1031,13 +996,13 @@ endif() - # Ensure that the open62541::open62541 alias can be used inside open62541's build - add_library(open62541::open62541 ALIAS open62541) - -+if(UA_ENABLE_DISCOVERY_MULTICAST) -+ target_link_libraries(open62541 PUBLIC pro-mdnsd::pro-mdnsd) -+endif() +@@ -972,6 +961,10 @@ else() + open62541-generator-namespace + ) + target_include_directories(open62541-object PRIVATE ${PROJECT_SOURCE_DIR}/src) ++ if(UA_ENABLE_DISCOVERY_MULTICAST) ++ target_link_libraries(open62541-object PUBLIC mdnsd::mdnsd) ++ endif() + - # Export Symbols - target_compile_definitions(open62541-object PRIVATE -DUA_DYNAMIC_LINKING_EXPORT) - target_compile_definitions(open62541 PRIVATE -DUA_DYNAMIC_LINKING_EXPORT) --if (UA_ENABLE_DISCOVERY_MULTICAST) -- target_compile_definitions(open62541-object PRIVATE -DMDNSD_DYNAMIC_LINKING_EXPORT) -- target_compile_definitions(open62541 PRIVATE -DMDNSD_DYNAMIC_LINKING_EXPORT) --endif() - # Generate properly versioned shared library links on Linux - SET_TARGET_PROPERTIES(open62541 PROPERTIES SOVERSION "${OPEN62541_VER_MAJOR}" VERSION "${OPEN62541_VER_MAJOR}.${OPEN62541_VER_MINOR}.${OPEN62541_VER_PATCH}") -@@ -1163,7 +1128,7 @@ install(TARGETS open62541 ${EXTRATARGETS} + add_library(open62541-plugins OBJECT ${default_plugin_sources} ${ua_architecture_sources} ${exported_headers}) + add_dependencies(open62541-plugins open62541-generator-types open62541-generator-transport open62541-generator-namespace) +@@ -1163,7 +1156,7 @@ install(TARGETS open62541 ${EXTRATARGETS} EXPORT open62541Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} @@ -127,7 +175,7 @@ index 94ceb127..575963fd 100644 if(UA_ENABLE_AMALGAMATION) diff --git a/src/server/ua_discovery_manager.h b/src/server/ua_discovery_manager.h -index 3d1ae299..e7e5e776 100644 +index 3d1ae299..7d5f1051 100644 --- a/src/server/ua_discovery_manager.h +++ b/src/server/ua_discovery_manager.h @@ -50,7 +50,7 @@ typedef struct periodicServerRegisterCallback_entry { @@ -135,12 +183,12 @@ index 3d1ae299..e7e5e776 100644 #ifdef UA_ENABLE_DISCOVERY_MULTICAST -#include "mdnsd/libmdnsd/mdnsd.h" -+#include "mdnsd/mdnsd.h" ++#include "libmdnsd/mdnsd.h" /** * TXT record: diff --git a/src/server/ua_server_discovery_mdns.c b/src/server/ua_server_discovery_mdns.c -index fd9c796c..c15d66a5 100644 +index fd9c796c..3417505a 100644 --- a/src/server/ua_server_discovery_mdns.c +++ b/src/server/ua_server_discovery_mdns.c @@ -11,8 +11,8 @@ @@ -149,8 +197,8 @@ index fd9c796c..c15d66a5 100644 #ifndef UA_ENABLE_AMALGAMATION -#include "mdnsd/libmdnsd/xht.h" -#include "mdnsd/libmdnsd/sdtxt.h" -+#include "mdnsd/xht.h" -+#include "mdnsd/sdtxt.h" ++#include "libmdnsd/xht.h" ++#include "libmdnsd/sdtxt.h" #endif #ifdef _WIN32 diff --git a/recipes/open62541/all/patches/1_1_3.patch b/recipes/open62541/all/patches/1_1_3.patch index 20b39cb444422..55f4011ab5023 100644 --- a/recipes/open62541/all/patches/1_1_3.patch +++ b/recipes/open62541/all/patches/1_1_3.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 2fd6ef29..e852fe49 100755 +index 2fd6ef29..779c7c2a 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,6 @@ string(TOLOWER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_LOWER_CASE) @@ -28,17 +28,22 @@ index 2fd6ef29..e852fe49 100755 ################# # Build Options # -@@ -425,9 +423,6 @@ mark_as_advanced(UA_PACK_DEBIAN) - set(UA_DYNAMIC_LINKING OFF) - if(BUILD_SHARED_LIBS) - set(UA_DYNAMIC_LINKING ON) -- if(UA_ENABLE_DISCOVERY_MULTICAST) -- set(MDNSD_DYNAMIC_LINKING ON) -- endif() - endif() +@@ -508,7 +506,13 @@ if(NOT UA_FORCE_CPP AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID}" ST - # Warn if experimental features are enabled -@@ -576,18 +571,6 @@ if(NOT UA_FORCE_CPP AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID}" ST + check_add_cc_flag("-Wno-static-in-inline") # Clang doesn't like the use of static inline methods inside static inline methods + check_add_cc_flag("-Wno-overlength-strings") # May happen in the nodeset compiler when complex values are directly encoded +- check_add_cc_flag("-Wno-unused-parameter") # some methods may require unused arguments to cast to a method pointer ++ ++ string(COMPARE GREATER_EQUAL ${CMAKE_C_COMPILER_VERSION} "9.0.0" IS_CLANG_9_COMPATIBLE) ++ if(${IS_CLANG_9_COMPATIBLE}) ++ check_add_cc_flag("-Qunused-arguments") ++ else() ++ check_add_cc_flag("-Wno-unused-parameter") # some methods may require unused arguments to cast to a method pointer ++ endif() + + # Use a strict subset of the C and C++ languages + check_add_cc_flag("-Wc++-compat") +@@ -576,18 +580,6 @@ if(NOT UA_FORCE_CPP AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID}" ST # Linker set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # cmake sets -rdynamic by default @@ -57,7 +62,7 @@ index 2fd6ef29..e852fe49 100755 if (NOT MINGW) if(UA_ENABLE_HARDENING AND ((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))) check_add_cc_flag("-D_FORTIFY_SOURCE=2") # run-time buffer overflow detection (needs at least -O1) -@@ -632,8 +615,6 @@ if(APPLE) +@@ -632,8 +624,6 @@ if(APPLE) endif() if(MSVC) @@ -66,17 +71,17 @@ index 2fd6ef29..e852fe49 100755 if(UA_MSVC_FORCE_STATIC_CRT AND NOT BUILD_SHARED_LIBS) set(CompilerFlags CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE) -@@ -659,8 +640,8 @@ configure_file(include/open62541/config.h.in ${PROJECT_BINARY_DIR}/src_generated +@@ -659,8 +649,8 @@ configure_file(include/open62541/config.h.in ${PROJECT_BINARY_DIR}/src_generated configure_file(open62541.pc.in ${PROJECT_BINARY_DIR}/src_generated/open62541.pc @ONLY) if(UA_ENABLE_DISCOVERY_MULTICAST) -+ find_package(pro-mdnsd) ++ find_package(mdnsd) set(MDNSD_LOGLEVEL 300 CACHE STRING "Level at which logs shall be reported" FORCE) - configure_file("deps/mdnsd/libmdnsd/mdnsd_config.h.in" "${PROJECT_BINARY_DIR}/src_generated/mdnsd_config.h") endif() set(exported_headers ${exported_headers} -@@ -945,22 +926,6 @@ if(UA_DEBUG_DUMP_PKGS) +@@ -945,22 +935,6 @@ if(UA_DEBUG_DUMP_PKGS) list(APPEND lib_sources ${PROJECT_SOURCE_DIR}/tests/testing-plugins/testing_networklayers.c) endif() @@ -99,26 +104,18 @@ index 2fd6ef29..e852fe49 100755 if(UA_BUILD_FUZZING OR UA_BUILD_OSS_FUZZ) set(lib_sources ${lib_sources} -@@ -1250,13 +1215,13 @@ add_dependencies(open62541-object open62541-code-generation) - # Ensure that the open62541::open62541 alias can be used inside open62541's build - add_library(open62541::open62541 ALIAS open62541) +@@ -1186,6 +1160,9 @@ else() + ) -+if(UA_ENABLE_DISCOVERY_MULTICAST) -+ target_link_libraries(open62541 PUBLIC pro-mdnsd::pro-mdnsd) -+endif() -+ - # Export Symbols - target_compile_definitions(open62541-object PRIVATE -DUA_DYNAMIC_LINKING_EXPORT) - target_compile_definitions(open62541 PRIVATE -DUA_DYNAMIC_LINKING_EXPORT) --if(UA_ENABLE_DISCOVERY_MULTICAST) -- target_compile_definitions(open62541-object PRIVATE -DMDNSD_DYNAMIC_LINKING_EXPORT) -- target_compile_definitions(open62541 PRIVATE -DMDNSD_DYNAMIC_LINKING_EXPORT) --endif() - # Generate properly versioned shared library links on Linux - SET_TARGET_PROPERTIES(open62541 PROPERTIES SOVERSION "${OPEN62541_VER_MAJOR}" VERSION "${OPEN62541_VER_MAJOR}.${OPEN62541_VER_MINOR}.${OPEN62541_VER_PATCH}") + target_include_directories(open62541-object PRIVATE ${PROJECT_SOURCE_DIR}/src) ++ if(UA_ENABLE_DISCOVERY_MULTICAST) ++ target_link_libraries(open62541-object PUBLIC mdnsd::mdnsd) ++ endif() + add_library(open62541-plugins OBJECT ${default_plugin_sources} ${ua_architecture_sources} ${exported_headers}) + add_dependencies(open62541-plugins open62541-generator-types open62541-generator-transport open62541-generator-namespace) diff --git a/src/server/ua_discovery_manager.h b/src/server/ua_discovery_manager.h -index 7787b40e..bdeabeeb 100644 +index 7787b40e..99dc884b 100644 --- a/src/server/ua_discovery_manager.h +++ b/src/server/ua_discovery_manager.h @@ -50,7 +50,7 @@ typedef struct periodicServerRegisterCallback_entry { @@ -126,12 +123,12 @@ index 7787b40e..bdeabeeb 100644 #ifdef UA_ENABLE_DISCOVERY_MULTICAST -#include "mdnsd/libmdnsd/mdnsd.h" -+#include "mdnsd/mdnsd.h" ++#include "libmdnsd/mdnsd.h" /** * TXT record: diff --git a/src/server/ua_server_discovery_mdns.c b/src/server/ua_server_discovery_mdns.c -index 6121b8c3..3442ebb4 100644 +index 6121b8c3..e4cae7c5 100644 --- a/src/server/ua_server_discovery_mdns.c +++ b/src/server/ua_server_discovery_mdns.c @@ -11,8 +11,8 @@ @@ -140,8 +137,8 @@ index 6121b8c3..3442ebb4 100644 #ifndef UA_ENABLE_AMALGAMATION -#include "mdnsd/libmdnsd/xht.h" -#include "mdnsd/libmdnsd/sdtxt.h" -+#include "mdnsd/xht.h" -+#include "mdnsd/sdtxt.h" ++#include "libmdnsd/xht.h" ++#include "libmdnsd/sdtxt.h" #endif #ifdef _WIN32 From 212724eb3b4c62f1f408280cc1622844f9956256 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Mon, 7 Dec 2020 12:26:40 +0100 Subject: [PATCH 64/81] merge subscription_events option into subscription --- recipes/open62541/all/conanfile.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index 6b07b18e55b00..4b87a1b0f9313 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -26,8 +26,7 @@ class Open62541Conan(ConanFile): "shared": [True, False], "historize": [True, False, "Experimental"], "logging_level": ["Fatal", "Error", "Warning", "Info", "Debug", "Trace"], - "subscription": [True, False], - "subscription_events": [True, False], + "subscription": [True, False, "With Events"], "methods": [True, False], "dynamic_nodes": [True, False], "single_header": [True, False], @@ -56,7 +55,6 @@ class Open62541Conan(ConanFile): "historize": False, "logging_level": "Info", "subscription": True, - "subscription_events": False, "methods": True, "dynamic_nodes": True, "single_header": False, @@ -65,7 +63,7 @@ class Open62541Conan(ConanFile): "web_socket": False, "discovery": True, "discovery_semaphore": True, - "discovery_multicast": False, + "discovery_multicast": True, "query": False, "encryption": "None", "json_support": False, @@ -210,8 +208,10 @@ def _configure_cmake(self): self._cmake.definitions["OPEN62541_VER_PATCH"] = version.patch self._cmake.definitions["UA_LOGLEVEL"] = self._get_log_level() - self._cmake.definitions["UA_ENABLE_SUBSCRIPTIONS"] = self.options.subscription - self._cmake.definitions["UA_ENABLE_SUBSCRIPTIONS_EVENTS"] = self.options.subscription_events + if self.options.subscription != False: + self._cmake.definitions["UA_ENABLE_SUBSCRIPTIONS"] = True + if self.options.subscription == "With Events": + self._cmake.definitions["UA_ENABLE_SUBSCRIPTIONS_EVENTS"] = True self._cmake.definitions["UA_ENABLE_METHODCALLS"] = self.options.methods self._cmake.definitions["UA_ENABLE_NODEMANAGEMENT"] = self.options.dynamic_nodes self._cmake.definitions["UA_ENABLE_AMALGAMATION"] = self.options.single_header @@ -284,6 +284,7 @@ def package_info(self): "include", os.path.join("include", "plugin") ] + if self.options.single_header: self.cpp_info.defines.append("UA_ENABLE_AMALGAMATION") if self.settings.os == "Windows": From 611c794416c298c05e1e26f0ff2da874786452d5 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Mon, 7 Dec 2020 12:47:22 +0100 Subject: [PATCH 65/81] fix mdnsd linking --- recipes/open62541/all/patches/1_0_3.patch | 22 +++++++++------------- recipes/open62541/all/patches/1_1_3.patch | 20 ++++++++------------ 2 files changed, 17 insertions(+), 25 deletions(-) diff --git a/recipes/open62541/all/patches/1_0_3.patch b/recipes/open62541/all/patches/1_0_3.patch index 2ce1c1cea43ca..3d3a3cbef8ea1 100644 --- a/recipes/open62541/all/patches/1_0_3.patch +++ b/recipes/open62541/all/patches/1_0_3.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 94ceb127..2bba3d04 100644 +index 94ceb127..80eb36d1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,9 +7,8 @@ endif() @@ -131,11 +131,10 @@ index 94ceb127..2bba3d04 100644 endif() set(exported_headers ${exported_headers} -@@ -742,22 +747,6 @@ if(UA_DEBUG_DUMP_PKGS) - list(APPEND lib_sources ${PROJECT_SOURCE_DIR}/plugins/ua_debug_dump_pkgs.c) +@@ -743,18 +748,7 @@ if(UA_DEBUG_DUMP_PKGS) endif() --if(UA_ENABLE_DISCOVERY_MULTICAST) + if(UA_ENABLE_DISCOVERY_MULTICAST) - # prepend in list, otherwise it complains that winsock2.h has to be included before windows.h - set(internal_headers ${PROJECT_BINARY_DIR}/src_generated/mdnsd_config.h - ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/1035.h @@ -143,18 +142,15 @@ index 94ceb127..2bba3d04 100644 - ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/sdtxt.h - ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/mdnsd.h - ${internal_headers} ) -- set(lib_sources ${PROJECT_SOURCE_DIR}/src/server/ua_server_discovery_mdns.c + set(lib_sources ${PROJECT_SOURCE_DIR}/src/server/ua_server_discovery_mdns.c - ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/1035.c - ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/xht.c - ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/sdtxt.c - ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/mdnsd.c -- ${lib_sources}) --endif() -- - if(UA_BUILD_FUZZING OR UA_BUILD_OSS_FUZZ) - set(lib_sources - ${lib_sources} -@@ -972,6 +961,10 @@ else() + ${lib_sources}) + endif() + +@@ -972,6 +966,10 @@ else() open62541-generator-namespace ) target_include_directories(open62541-object PRIVATE ${PROJECT_SOURCE_DIR}/src) @@ -165,7 +161,7 @@ index 94ceb127..2bba3d04 100644 add_library(open62541-plugins OBJECT ${default_plugin_sources} ${ua_architecture_sources} ${exported_headers}) add_dependencies(open62541-plugins open62541-generator-types open62541-generator-transport open62541-generator-namespace) -@@ -1163,7 +1156,7 @@ install(TARGETS open62541 ${EXTRATARGETS} +@@ -1163,7 +1161,7 @@ install(TARGETS open62541 ${EXTRATARGETS} EXPORT open62541Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} diff --git a/recipes/open62541/all/patches/1_1_3.patch b/recipes/open62541/all/patches/1_1_3.patch index 55f4011ab5023..1882eef33bb9d 100644 --- a/recipes/open62541/all/patches/1_1_3.patch +++ b/recipes/open62541/all/patches/1_1_3.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 2fd6ef29..779c7c2a 100755 +index 2fd6ef29..989a575b 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,6 @@ string(TOLOWER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_LOWER_CASE) @@ -81,11 +81,10 @@ index 2fd6ef29..779c7c2a 100755 endif() set(exported_headers ${exported_headers} -@@ -945,22 +935,6 @@ if(UA_DEBUG_DUMP_PKGS) - list(APPEND lib_sources ${PROJECT_SOURCE_DIR}/tests/testing-plugins/testing_networklayers.c) +@@ -946,18 +936,7 @@ if(UA_DEBUG_DUMP_PKGS) endif() --if(UA_ENABLE_DISCOVERY_MULTICAST) + if(UA_ENABLE_DISCOVERY_MULTICAST) - # prepend in list, otherwise it complains that winsock2.h has to be included before windows.h - set(internal_headers ${PROJECT_BINARY_DIR}/src_generated/mdnsd_config.h - ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/1035.h @@ -93,18 +92,15 @@ index 2fd6ef29..779c7c2a 100755 - ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/sdtxt.h - ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/mdnsd.h - ${internal_headers} ) -- set(lib_sources ${PROJECT_SOURCE_DIR}/src/server/ua_server_discovery_mdns.c + set(lib_sources ${PROJECT_SOURCE_DIR}/src/server/ua_server_discovery_mdns.c - ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/1035.c - ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/xht.c - ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/sdtxt.c - ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/mdnsd.c -- ${lib_sources}) --endif() -- - if(UA_BUILD_FUZZING OR UA_BUILD_OSS_FUZZ) - set(lib_sources - ${lib_sources} -@@ -1186,6 +1160,9 @@ else() + ${lib_sources}) + endif() + +@@ -1186,6 +1165,9 @@ else() ) target_include_directories(open62541-object PRIVATE ${PROJECT_SOURCE_DIR}/src) From 30dc27f763b9d4600f49e893c758f02516b04a14 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Mon, 7 Dec 2020 12:53:26 +0100 Subject: [PATCH 66/81] merge discovery_multicast option into discovery --- recipes/open62541/all/conanfile.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index 4b87a1b0f9313..c23e2ecf911e7 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -33,9 +33,8 @@ class Open62541Conan(ConanFile): "multithreading": ["None", "Threadsafe", "Internal threads"], "imutable_nodes": [True, False], "web_socket": [True, False], - "discovery": [True, False], + "discovery": [True, False, "With Multicast"], "discovery_semaphore": [True, False], - "discovery_multicast": [True, False], "query": [True, False], "encryption": ["None", "openssl", "mbedtls-apache", "mbedtls-gpl"], "json_support": [True, False], @@ -63,7 +62,6 @@ class Open62541Conan(ConanFile): "web_socket": False, "discovery": True, "discovery_semaphore": True, - "discovery_multicast": True, "query": False, "encryption": "None", "json_support": False, @@ -116,9 +114,9 @@ def configure(self): "Open62541 requires subscription option") if not self.options.discovery: - if self.options.discovery_multicast or self.options.discovery_semaphore: + if self.options.discovery_semaphore: raise ConanInvalidConfiguration( - "Open62541 requires discovery option") + "Open62541 discovery sempahore option requires discovery option to be enabled") if tools.Version(self.version) <= "1.1.0": if self.options.encryption == "openssl": @@ -127,7 +125,7 @@ def configure(self): if self.options.multithreading != "None": raise ConanInvalidConfiguration( - "Lower Open62541 versions than 1.1.0 do not fully support multithreading!") + "Lower Open62541 versions than 1.1.0 do not fully support multithreading") if self.options.web_socket: raise ConanInvalidConfiguration( @@ -224,9 +222,11 @@ def _configure_cmake(self): self._cmake.definitions["UA_ENABLE_HISTORIZING"] = True if self.options.historize == "Experimental": self._cmake.definitions["UA_ENABLE_EXPERIMENTAL_HISTORIZING"] = True - self._cmake.definitions["UA_ENABLE_DISCOVERY"] = self.options.discovery - self._cmake.definitions["UA_ENABLE_DISCOVERY_MULTICAST"] = self.options.discovery_multicast - self._cmake.definitions["UA_ENABLE_DISCOVERY_SEMAPHORE"] = self.options.discovery_semaphore + if self.options.discovery != False: + self._cmake.definitions["UA_ENABLE_DISCOVERY"] = self.options.discovery + if self.options.discovery == "With Multicast": + self._cmake.definitions["UA_ENABLE_DISCOVERY_MULTICAST"] = self.options.discovery_multicast + self._cmake.definitions["UA_ENABLE_DISCOVERY_SEMAPHORE"] = self.options.discovery_semaphore self._cmake.definitions["UA_ENABLE_QUERY"] = self.options.query if self.options.encryption != "None": self._cmake.definitions["UA_ENABLE_ENCRYPTION"] = True From f3a2f0095aeaa01e13ea6acb63b4ff2a196ee500 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Mon, 7 Dec 2020 12:56:24 +0100 Subject: [PATCH 67/81] remove static lib restriction for clang compiler --- recipes/open62541/all/conanfile.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index c23e2ecf911e7..add2cbe7d40c0 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -135,9 +135,6 @@ def configure(self): if tools.Version(self.settings.compiler.version) <= "4": raise ConanInvalidConfiguration( "Older clang compiler version than 4.0 are not supported") - if not self.options.shared: - raise ConanInvalidConfiguration( - "Clang compiler can not be used to build a static library") if self.options.pub_sub != "None" and self.settings.os != "Linux": raise ConanInvalidConfiguration( From 4727ede8d4b5b286b6cef3a05ee84f4a2751c24a Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Mon, 7 Dec 2020 12:58:54 +0100 Subject: [PATCH 68/81] remove discovery_multicast remnants --- recipes/open62541/all/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index add2cbe7d40c0..7129befeeb623 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -100,7 +100,7 @@ def requirements(self): elif self.options.encryption == "mbedtls-gpl": self.requires("mbedtls/2.16.3-gpl") - if self.options.discovery_multicast: + if self.options.discovery == "With Multicast": self.requires("pro-mdnsd/0.8.4") def _patch_sources(self): @@ -222,7 +222,7 @@ def _configure_cmake(self): if self.options.discovery != False: self._cmake.definitions["UA_ENABLE_DISCOVERY"] = self.options.discovery if self.options.discovery == "With Multicast": - self._cmake.definitions["UA_ENABLE_DISCOVERY_MULTICAST"] = self.options.discovery_multicast + self._cmake.definitions["UA_ENABLE_DISCOVERY_MULTICAST"] = True self._cmake.definitions["UA_ENABLE_DISCOVERY_SEMAPHORE"] = self.options.discovery_semaphore self._cmake.definitions["UA_ENABLE_QUERY"] = self.options.query if self.options.encryption != "None": From c8ec48019cf41159979d3e1aa3a69d6b68fa07e6 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Mon, 7 Dec 2020 13:23:57 +0100 Subject: [PATCH 69/81] improve clang compiler handling --- recipes/open62541/all/patches/1_0_3.patch | 4 ++-- recipes/open62541/all/patches/1_1_3.patch | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/recipes/open62541/all/patches/1_0_3.patch b/recipes/open62541/all/patches/1_0_3.patch index 3d3a3cbef8ea1..160f41a04f3fd 100644 --- a/recipes/open62541/all/patches/1_0_3.patch +++ b/recipes/open62541/all/patches/1_0_3.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 94ceb127..80eb36d1 100644 +index 94ceb127..78c71fcc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,9 +7,8 @@ endif() @@ -53,7 +53,7 @@ index 94ceb127..80eb36d1 100644 - -fexceptions # recommended for multi-threaded C code, also in combination with C++ code - ) + string(COMPARE GREATER_EQUAL ${CMAKE_C_COMPILER_VERSION} "9.0.0" IS_CLANG_9_COMPATIBLE) -+ if(${IS_CLANG_9_COMPATIBLE}) ++ if(${IS_CLANG_9_COMPATIBLE} AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + add_definitions(-std=c99 -pipe + -Wall -Wextra -Wpedantic + -Wno-static-in-inline # clang doesn't like the use of static inline methods inside static inline methods diff --git a/recipes/open62541/all/patches/1_1_3.patch b/recipes/open62541/all/patches/1_1_3.patch index 1882eef33bb9d..41d77c2caf48d 100644 --- a/recipes/open62541/all/patches/1_1_3.patch +++ b/recipes/open62541/all/patches/1_1_3.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 2fd6ef29..989a575b 100755 +index 2fd6ef29..6ea6c1dc 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,6 @@ string(TOLOWER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_LOWER_CASE) @@ -35,7 +35,7 @@ index 2fd6ef29..989a575b 100755 - check_add_cc_flag("-Wno-unused-parameter") # some methods may require unused arguments to cast to a method pointer + + string(COMPARE GREATER_EQUAL ${CMAKE_C_COMPILER_VERSION} "9.0.0" IS_CLANG_9_COMPATIBLE) -+ if(${IS_CLANG_9_COMPATIBLE}) ++ if(${IS_CLANG_9_COMPATIBLE} AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + check_add_cc_flag("-Qunused-arguments") + else() + check_add_cc_flag("-Wno-unused-parameter") # some methods may require unused arguments to cast to a method pointer From 14ece9c45702526dd325d2b3b3b728432835b683 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Mon, 7 Dec 2020 15:04:47 +0100 Subject: [PATCH 70/81] add debugging information for Clang 9 checks --- recipes/open62541/all/patches/1_0_3.patch | 18 ++++++++-------- recipes/open62541/all/patches/1_1_3.patch | 25 ++++++++++++++++------- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/recipes/open62541/all/patches/1_0_3.patch b/recipes/open62541/all/patches/1_0_3.patch index 160f41a04f3fd..19ba0a8beea3e 100644 --- a/recipes/open62541/all/patches/1_0_3.patch +++ b/recipes/open62541/all/patches/1_0_3.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 94ceb127..78c71fcc 100644 +index 94ceb127..f10ddb3b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,9 +7,8 @@ endif() @@ -31,7 +31,7 @@ index 94ceb127..78c71fcc 100644 ################# # Build Options # -@@ -388,23 +386,44 @@ endif() +@@ -388,23 +386,46 @@ endif() include(CompilerFlags) if(NOT UA_COMPILE_AS_CXX AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID}" STREQUAL "xClang")) # Compiler @@ -54,6 +54,7 @@ index 94ceb127..78c71fcc 100644 - ) + string(COMPARE GREATER_EQUAL ${CMAKE_C_COMPILER_VERSION} "9.0.0" IS_CLANG_9_COMPATIBLE) + if(${IS_CLANG_9_COMPATIBLE} AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang") ++ message(STATUS "Using Clang ${CMAKE_C_COMPILER_VERSION} version compatible compiler flags") + add_definitions(-std=c99 -pipe + -Wall -Wextra -Wpedantic + -Wno-static-in-inline # clang doesn't like the use of static inline methods inside static inline methods @@ -72,6 +73,7 @@ index 94ceb127..78c71fcc 100644 + -fexceptions # recommended for multi-threaded C code, also in combination with C++ code + ) + else() ++ message(STATUS "Using ${CMAKE_CXX_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION} version compatible compiler flags") + add_definitions(-std=c99 -pipe + -Wall -Wextra -Wpedantic + -Wno-static-in-inline # clang doesn't like the use of static inline methods inside static inline methods @@ -93,7 +95,7 @@ index 94ceb127..78c71fcc 100644 set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Werror") if (NOT MINGW) -@@ -440,18 +459,6 @@ if(NOT UA_COMPILE_AS_CXX AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID +@@ -440,18 +461,6 @@ if(NOT UA_COMPILE_AS_CXX AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID # Linker set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # cmake sets -rdynamic by default @@ -112,7 +114,7 @@ index 94ceb127..78c71fcc 100644 if (NOT MINGW) if(UA_ENABLE_HARDENING AND ((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))) check_cc_flag("-D_FORTIFY_SOURCE=2") # run-time buffer overflow detection (needs at least -O1) -@@ -493,8 +500,6 @@ if(APPLE) +@@ -493,8 +502,6 @@ if(APPLE) endif() if(MSVC) @@ -121,7 +123,7 @@ index 94ceb127..78c71fcc 100644 if(UA_MSVC_FORCE_STATIC_CRT AND NOT BUILD_SHARED_LIBS) set(CompilerFlags CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE) -@@ -520,8 +525,8 @@ configure_file(include/open62541/config.h.in ${PROJECT_BINARY_DIR}/src_generated +@@ -520,8 +527,8 @@ configure_file(include/open62541/config.h.in ${PROJECT_BINARY_DIR}/src_generated configure_file(open62541.pc.in ${PROJECT_BINARY_DIR}/src_generated/open62541.pc @ONLY) if(UA_ENABLE_DISCOVERY_MULTICAST) @@ -131,7 +133,7 @@ index 94ceb127..78c71fcc 100644 endif() set(exported_headers ${exported_headers} -@@ -743,18 +748,7 @@ if(UA_DEBUG_DUMP_PKGS) +@@ -743,18 +750,7 @@ if(UA_DEBUG_DUMP_PKGS) endif() if(UA_ENABLE_DISCOVERY_MULTICAST) @@ -150,7 +152,7 @@ index 94ceb127..78c71fcc 100644 ${lib_sources}) endif() -@@ -972,6 +966,10 @@ else() +@@ -972,6 +968,10 @@ else() open62541-generator-namespace ) target_include_directories(open62541-object PRIVATE ${PROJECT_SOURCE_DIR}/src) @@ -161,7 +163,7 @@ index 94ceb127..78c71fcc 100644 add_library(open62541-plugins OBJECT ${default_plugin_sources} ${ua_architecture_sources} ${exported_headers}) add_dependencies(open62541-plugins open62541-generator-types open62541-generator-transport open62541-generator-namespace) -@@ -1163,7 +1161,7 @@ install(TARGETS open62541 ${EXTRATARGETS} +@@ -1163,7 +1163,7 @@ install(TARGETS open62541 ${EXTRATARGETS} EXPORT open62541Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} diff --git a/recipes/open62541/all/patches/1_1_3.patch b/recipes/open62541/all/patches/1_1_3.patch index 41d77c2caf48d..7f44b4091ef23 100644 --- a/recipes/open62541/all/patches/1_1_3.patch +++ b/recipes/open62541/all/patches/1_1_3.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 2fd6ef29..6ea6c1dc 100755 +index 2fd6ef29..f45075be 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,6 @@ string(TOLOWER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_LOWER_CASE) @@ -28,7 +28,16 @@ index 2fd6ef29..6ea6c1dc 100755 ################# # Build Options # -@@ -508,7 +506,13 @@ if(NOT UA_FORCE_CPP AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID}" ST +@@ -493,6 +491,8 @@ function(check_add_cc_flag CC_FLAG) + check_c_compiler_flag("${CC_FLAG}" flag_supported) + if(flag_supported) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CC_FLAG}" PARENT_SCOPE) ++ else() ++ message(STATUS "Flag ${CC_FLAG} is not supported.") + endif() + unset(flag_supported CACHE) + endif() +@@ -508,7 +508,15 @@ if(NOT UA_FORCE_CPP AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID}" ST check_add_cc_flag("-Wno-static-in-inline") # Clang doesn't like the use of static inline methods inside static inline methods check_add_cc_flag("-Wno-overlength-strings") # May happen in the nodeset compiler when complex values are directly encoded @@ -36,14 +45,16 @@ index 2fd6ef29..6ea6c1dc 100755 + + string(COMPARE GREATER_EQUAL ${CMAKE_C_COMPILER_VERSION} "9.0.0" IS_CLANG_9_COMPATIBLE) + if(${IS_CLANG_9_COMPATIBLE} AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang") ++ message(STATUS "Using Clang ${CMAKE_C_COMPILER_VERSION} version") + check_add_cc_flag("-Qunused-arguments") + else() ++ message(STATUS "Using ${CMAKE_CXX_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION} version") + check_add_cc_flag("-Wno-unused-parameter") # some methods may require unused arguments to cast to a method pointer + endif() # Use a strict subset of the C and C++ languages check_add_cc_flag("-Wc++-compat") -@@ -576,18 +580,6 @@ if(NOT UA_FORCE_CPP AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID}" ST +@@ -576,18 +584,6 @@ if(NOT UA_FORCE_CPP AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID}" ST # Linker set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # cmake sets -rdynamic by default @@ -62,7 +73,7 @@ index 2fd6ef29..6ea6c1dc 100755 if (NOT MINGW) if(UA_ENABLE_HARDENING AND ((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))) check_add_cc_flag("-D_FORTIFY_SOURCE=2") # run-time buffer overflow detection (needs at least -O1) -@@ -632,8 +624,6 @@ if(APPLE) +@@ -632,8 +628,6 @@ if(APPLE) endif() if(MSVC) @@ -71,7 +82,7 @@ index 2fd6ef29..6ea6c1dc 100755 if(UA_MSVC_FORCE_STATIC_CRT AND NOT BUILD_SHARED_LIBS) set(CompilerFlags CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE) -@@ -659,8 +649,8 @@ configure_file(include/open62541/config.h.in ${PROJECT_BINARY_DIR}/src_generated +@@ -659,8 +653,8 @@ configure_file(include/open62541/config.h.in ${PROJECT_BINARY_DIR}/src_generated configure_file(open62541.pc.in ${PROJECT_BINARY_DIR}/src_generated/open62541.pc @ONLY) if(UA_ENABLE_DISCOVERY_MULTICAST) @@ -81,7 +92,7 @@ index 2fd6ef29..6ea6c1dc 100755 endif() set(exported_headers ${exported_headers} -@@ -946,18 +936,7 @@ if(UA_DEBUG_DUMP_PKGS) +@@ -946,18 +940,7 @@ if(UA_DEBUG_DUMP_PKGS) endif() if(UA_ENABLE_DISCOVERY_MULTICAST) @@ -100,7 +111,7 @@ index 2fd6ef29..6ea6c1dc 100755 ${lib_sources}) endif() -@@ -1186,6 +1165,9 @@ else() +@@ -1186,6 +1169,9 @@ else() ) target_include_directories(open62541-object PRIVATE ${PROJECT_SOURCE_DIR}/src) From 303d94d0518a97d7981532591b0bb1a17a20adc2 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Mon, 7 Dec 2020 15:29:30 +0100 Subject: [PATCH 71/81] improve debug informatio nfor 1.0.3 --- recipes/open62541/all/patches/1_0_3.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/open62541/all/patches/1_0_3.patch b/recipes/open62541/all/patches/1_0_3.patch index 19ba0a8beea3e..55458c7588813 100644 --- a/recipes/open62541/all/patches/1_0_3.patch +++ b/recipes/open62541/all/patches/1_0_3.patch @@ -54,7 +54,7 @@ index 94ceb127..f10ddb3b 100644 - ) + string(COMPARE GREATER_EQUAL ${CMAKE_C_COMPILER_VERSION} "9.0.0" IS_CLANG_9_COMPATIBLE) + if(${IS_CLANG_9_COMPATIBLE} AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang") -+ message(STATUS "Using Clang ${CMAKE_C_COMPILER_VERSION} version compatible compiler flags") ++ message(STATUS "Using Clang ${CMAKE_C_COMPILER_VERSION} version compatible compiler flags -Qunused-arguments") + add_definitions(-std=c99 -pipe + -Wall -Wextra -Wpedantic + -Wno-static-in-inline # clang doesn't like the use of static inline methods inside static inline methods @@ -73,7 +73,7 @@ index 94ceb127..f10ddb3b 100644 + -fexceptions # recommended for multi-threaded C code, also in combination with C++ code + ) + else() -+ message(STATUS "Using ${CMAKE_CXX_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION} version compatible compiler flags") ++ message(STATUS "Using ${CMAKE_CXX_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION} version compatible compiler flags -Wno-unused-parameter") + add_definitions(-std=c99 -pipe + -Wall -Wextra -Wpedantic + -Wno-static-in-inline # clang doesn't like the use of static inline methods inside static inline methods From 6bcef34d6e8be097e2ed35f984f24b562f7fc90d Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Mon, 7 Dec 2020 15:45:09 +0100 Subject: [PATCH 72/81] remove support for v1.0.3 cpp_compatible option --- recipes/open62541/all/conanfile.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index 7129befeeb623..c9543d275d027 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -131,6 +131,10 @@ def configure(self): raise ConanInvalidConfiguration( "Lower Open62541 versions than 1.1.0 do not fully support websockets") + if self.options.cpp_compatible: + raise ConanInvalidConfiguration( + "Lower Open62541 versions than 1.1.0 are not cpp compatible due to -fpermisive flags") + if self.settings.compiler == "clang": if tools.Version(self.settings.compiler.version) <= "4": raise ConanInvalidConfiguration( From e7a7306cfb839e86b4ea510ff703df92d54a3785 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Mon, 7 Dec 2020 15:54:17 +0100 Subject: [PATCH 73/81] remove clang 9 and later support for v1.0.3 --- recipes/open62541/all/conanfile.py | 4 ++ recipes/open62541/all/patches/1_0_3.patch | 78 ++--------------------- 2 files changed, 11 insertions(+), 71 deletions(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index c9543d275d027..cf9f22e67115d 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -135,6 +135,10 @@ def configure(self): raise ConanInvalidConfiguration( "Lower Open62541 versions than 1.1.0 are not cpp compatible due to -fpermisive flags") + if self.settings.compiler == "clang" and tools.Version(self.settings.compiler.version) >= "9": + raise ConanInvalidConfiguration( + "Lower Open62541 versions than 1.1.0 do not support Clang 9.x.x and later compiler versions!") + if self.settings.compiler == "clang": if tools.Version(self.settings.compiler.version) <= "4": raise ConanInvalidConfiguration( diff --git a/recipes/open62541/all/patches/1_0_3.patch b/recipes/open62541/all/patches/1_0_3.patch index 55458c7588813..c0c8b9dedbe4d 100644 --- a/recipes/open62541/all/patches/1_0_3.patch +++ b/recipes/open62541/all/patches/1_0_3.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 94ceb127..f10ddb3b 100644 +index 94ceb127..e8d73ad7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,9 +7,8 @@ endif() @@ -31,71 +31,7 @@ index 94ceb127..f10ddb3b 100644 ################# # Build Options # -@@ -388,23 +386,46 @@ endif() - include(CompilerFlags) - if(NOT UA_COMPILE_AS_CXX AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID}" STREQUAL "xClang")) - # Compiler -- add_definitions(-std=c99 -pipe -- -Wall -Wextra -Wpedantic -- -Wno-static-in-inline # clang doesn't like the use of static inline methods inside static inline methods -- -Wno-overlength-strings # may happen in the nodeset compiler when complex values are directly encoded -- -Wno-unused-parameter # some methods may require unused arguments to cast to a method pointer -- -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -- -Wformat -Wformat-security -Wformat-nonliteral -- -Wuninitialized -Winit-self -- -Wcast-qual -- -Wstrict-overflow -- -Wnested-externs -- -Wmultichar -- -Wundef -- -Wc++-compat -- -fno-strict-aliasing # fewer compiler assumptions about pointer types -- -fexceptions # recommended for multi-threaded C code, also in combination with C++ code -- ) -+ string(COMPARE GREATER_EQUAL ${CMAKE_C_COMPILER_VERSION} "9.0.0" IS_CLANG_9_COMPATIBLE) -+ if(${IS_CLANG_9_COMPATIBLE} AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang") -+ message(STATUS "Using Clang ${CMAKE_C_COMPILER_VERSION} version compatible compiler flags -Qunused-arguments") -+ add_definitions(-std=c99 -pipe -+ -Wall -Wextra -Wpedantic -+ -Wno-static-in-inline # clang doesn't like the use of static inline methods inside static inline methods -+ -Wno-overlength-strings # may happen in the nodeset compiler when complex values are directly encoded -+ -Qunused-arguments # some methods may require unused arguments to cast to a method pointer -+ -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -+ -Wformat -Wformat-security -Wformat-nonliteral -+ -Wuninitialized -Winit-self -+ -Wcast-qual -+ -Wstrict-overflow -+ -Wnested-externs -+ -Wmultichar -+ -Wundef -+ -Wc++-compat -+ -fno-strict-aliasing # fewer compiler assumptions about pointer types -+ -fexceptions # recommended for multi-threaded C code, also in combination with C++ code -+ ) -+ else() -+ message(STATUS "Using ${CMAKE_CXX_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION} version compatible compiler flags -Wno-unused-parameter") -+ add_definitions(-std=c99 -pipe -+ -Wall -Wextra -Wpedantic -+ -Wno-static-in-inline # clang doesn't like the use of static inline methods inside static inline methods -+ -Wno-overlength-strings # may happen in the nodeset compiler when complex values are directly encoded -+ -Wno-unused-parameter # some methods may require unused arguments to cast to a method pointer -+ -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -+ -Wformat -Wformat-security -Wformat-nonliteral -+ -Wuninitialized -Winit-self -+ -Wcast-qual -+ -Wstrict-overflow -+ -Wnested-externs -+ -Wmultichar -+ -Wundef -+ -Wc++-compat -+ -fno-strict-aliasing # fewer compiler assumptions about pointer types -+ -fexceptions # recommended for multi-threaded C code, also in combination with C++ code -+ ) -+ endif() - set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Werror") - - if (NOT MINGW) -@@ -440,18 +461,6 @@ if(NOT UA_COMPILE_AS_CXX AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID +@@ -440,18 +438,6 @@ if(NOT UA_COMPILE_AS_CXX AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID # Linker set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # cmake sets -rdynamic by default @@ -114,7 +50,7 @@ index 94ceb127..f10ddb3b 100644 if (NOT MINGW) if(UA_ENABLE_HARDENING AND ((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))) check_cc_flag("-D_FORTIFY_SOURCE=2") # run-time buffer overflow detection (needs at least -O1) -@@ -493,8 +502,6 @@ if(APPLE) +@@ -493,8 +479,6 @@ if(APPLE) endif() if(MSVC) @@ -123,7 +59,7 @@ index 94ceb127..f10ddb3b 100644 if(UA_MSVC_FORCE_STATIC_CRT AND NOT BUILD_SHARED_LIBS) set(CompilerFlags CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE) -@@ -520,8 +527,8 @@ configure_file(include/open62541/config.h.in ${PROJECT_BINARY_DIR}/src_generated +@@ -520,8 +504,8 @@ configure_file(include/open62541/config.h.in ${PROJECT_BINARY_DIR}/src_generated configure_file(open62541.pc.in ${PROJECT_BINARY_DIR}/src_generated/open62541.pc @ONLY) if(UA_ENABLE_DISCOVERY_MULTICAST) @@ -133,7 +69,7 @@ index 94ceb127..f10ddb3b 100644 endif() set(exported_headers ${exported_headers} -@@ -743,18 +750,7 @@ if(UA_DEBUG_DUMP_PKGS) +@@ -743,18 +727,7 @@ if(UA_DEBUG_DUMP_PKGS) endif() if(UA_ENABLE_DISCOVERY_MULTICAST) @@ -152,7 +88,7 @@ index 94ceb127..f10ddb3b 100644 ${lib_sources}) endif() -@@ -972,6 +968,10 @@ else() +@@ -972,6 +945,10 @@ else() open62541-generator-namespace ) target_include_directories(open62541-object PRIVATE ${PROJECT_SOURCE_DIR}/src) @@ -163,7 +99,7 @@ index 94ceb127..f10ddb3b 100644 add_library(open62541-plugins OBJECT ${default_plugin_sources} ${ua_architecture_sources} ${exported_headers}) add_dependencies(open62541-plugins open62541-generator-types open62541-generator-transport open62541-generator-namespace) -@@ -1163,7 +1163,7 @@ install(TARGETS open62541 ${EXTRATARGETS} +@@ -1163,7 +1140,7 @@ install(TARGETS open62541 ${EXTRATARGETS} EXPORT open62541Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} From b7ecb9fc6a981cf659e78e50f802aa8c36d5593f Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Mon, 7 Dec 2020 17:29:15 +0100 Subject: [PATCH 74/81] fix cmake module path, find_package lib names, libwebsockets linking --- recipes/open62541/all/patches/1_1_3.patch | 92 ++++++++++++++++++++--- 1 file changed, 82 insertions(+), 10 deletions(-) diff --git a/recipes/open62541/all/patches/1_1_3.patch b/recipes/open62541/all/patches/1_1_3.patch index 7f44b4091ef23..1c622e91bea3e 100644 --- a/recipes/open62541/all/patches/1_1_3.patch +++ b/recipes/open62541/all/patches/1_1_3.patch @@ -1,10 +1,13 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 2fd6ef29..f45075be 100755 +index 2fd6ef29..77961baa 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -9,7 +9,6 @@ string(TOLOWER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_LOWER_CASE) +@@ -7,9 +7,8 @@ endif() - set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/tools/cmake") + string(TOLOWER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_LOWER_CASE) + +-set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/tools/cmake") ++set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${PROJECT_SOURCE_DIR};${PROJECT_SOURCE_DIR}/tools/cmake") find_package(PythonInterp REQUIRED) -find_package(Git) include(AssignSourceGroup) @@ -28,7 +31,36 @@ index 2fd6ef29..f45075be 100755 ################# # Build Options # -@@ -493,6 +491,8 @@ function(check_add_cc_flag CC_FLAG) +@@ -456,13 +454,13 @@ if(UA_ENABLE_ENCRYPTION) + # use the OpenSSL encryption library + # https://cmake.org/cmake/help/v3.0/module/FindOpenSSL.html + find_package(OpenSSL REQUIRED) +- list(APPEND open62541_LIBRARIES ${OPENSSL_LIBRARIES}) ++ list(APPEND open62541_LIBRARIES ${OpenSSL_LIBRARIES}) + else() + # The recommended way is to install mbedtls via the OS package manager. If + # that is not possible, manually compile mbedTLS and set the cmake variables + # defined in /tools/cmake/FindMbedTLS.cmake. + find_package(MbedTLS REQUIRED) +- list(APPEND open62541_LIBRARIES ${MBEDTLS_LIBRARIES}) ++ list(APPEND open62541_LIBRARIES ${MbedTLS_LIBRARIES}) + endif() + endif() + +@@ -470,8 +468,10 @@ if(UA_ENABLE_WEBSOCKET_SERVER) + # The recommended way is to install libwebsockets via the OS package manager. If + # that is not possible, manually compile libwebsockets and set the cmake variables + # defined in /tools/cmake/Findlibwebsockets.cmake +- find_package(libwebsockets REQUIRED) +- list(APPEND open62541_LIBRARIES ${LIBWEBSOCKETS_LIBRARIES}) ++ find_package(Libwebsockets REQUIRED) ++ list(APPEND open62541_LIBRARIES ${Libwebsockets_LIBRARIES}) ++ message(STATUS "Libwebsockets library: ${Libwebsockets_LIBRARIES}") ++ message(STATUS "Libwebsockets includes: ${Libwebsockets_INCLUDE_DIRS}") + endif() + + if(MINGW) +@@ -493,6 +493,8 @@ function(check_add_cc_flag CC_FLAG) check_c_compiler_flag("${CC_FLAG}" flag_supported) if(flag_supported) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CC_FLAG}" PARENT_SCOPE) @@ -37,7 +69,7 @@ index 2fd6ef29..f45075be 100755 endif() unset(flag_supported CACHE) endif() -@@ -508,7 +508,15 @@ if(NOT UA_FORCE_CPP AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID}" ST +@@ -508,7 +510,15 @@ if(NOT UA_FORCE_CPP AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID}" ST check_add_cc_flag("-Wno-static-in-inline") # Clang doesn't like the use of static inline methods inside static inline methods check_add_cc_flag("-Wno-overlength-strings") # May happen in the nodeset compiler when complex values are directly encoded @@ -54,7 +86,7 @@ index 2fd6ef29..f45075be 100755 # Use a strict subset of the C and C++ languages check_add_cc_flag("-Wc++-compat") -@@ -576,18 +584,6 @@ if(NOT UA_FORCE_CPP AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID}" ST +@@ -576,18 +586,6 @@ if(NOT UA_FORCE_CPP AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID}" ST # Linker set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # cmake sets -rdynamic by default @@ -73,7 +105,7 @@ index 2fd6ef29..f45075be 100755 if (NOT MINGW) if(UA_ENABLE_HARDENING AND ((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))) check_add_cc_flag("-D_FORTIFY_SOURCE=2") # run-time buffer overflow detection (needs at least -O1) -@@ -632,8 +628,6 @@ if(APPLE) +@@ -632,8 +630,6 @@ if(APPLE) endif() if(MSVC) @@ -82,7 +114,7 @@ index 2fd6ef29..f45075be 100755 if(UA_MSVC_FORCE_STATIC_CRT AND NOT BUILD_SHARED_LIBS) set(CompilerFlags CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE) -@@ -659,8 +653,8 @@ configure_file(include/open62541/config.h.in ${PROJECT_BINARY_DIR}/src_generated +@@ -659,8 +655,8 @@ configure_file(include/open62541/config.h.in ${PROJECT_BINARY_DIR}/src_generated configure_file(open62541.pc.in ${PROJECT_BINARY_DIR}/src_generated/open62541.pc @ONLY) if(UA_ENABLE_DISCOVERY_MULTICAST) @@ -92,7 +124,7 @@ index 2fd6ef29..f45075be 100755 endif() set(exported_headers ${exported_headers} -@@ -946,18 +940,7 @@ if(UA_DEBUG_DUMP_PKGS) +@@ -946,18 +942,7 @@ if(UA_DEBUG_DUMP_PKGS) endif() if(UA_ENABLE_DISCOVERY_MULTICAST) @@ -111,7 +143,23 @@ index 2fd6ef29..f45075be 100755 ${lib_sources}) endif() -@@ -1186,6 +1169,9 @@ else() +@@ -1147,10 +1132,13 @@ if(UA_ENABLE_AMALGAMATION) + target_include_directories(open62541-object PRIVATE ${PROJECT_BINARY_DIR}) + target_include_directories(open62541-object PRIVATE "${ua_architecture_directories_to_include}") + if(UA_ENABLE_ENCRYPTION_MBEDTLS) +- target_include_directories(open62541-object PRIVATE ${MBEDTLS_INCLUDE_DIRS}) ++ target_include_directories(open62541-object PRIVATE ${MbedTLS_INCLUDE_DIRS}) + endif() + if(UA_ENABLE_ENCRYPTION_OPENSSL) +- target_include_directories(open62541-object PRIVATE ${OPENSSL_INCLUDE_DIR}) ++ target_include_directories(open62541-object PRIVATE ${OpenSSL_INCLUDE_DIR}) ++ endif() ++ if(UA_ENABLE_WEBSOCKET_SERVER) ++ target_include_directories(open62541-plugins PRIVATE ${Libwebsockets_INCLUDE_DIR}) + endif() + + # make sure the open62541_amalgamation target builds before so that amalgamation is finished and it is not executed again for open62541-object +@@ -1186,6 +1174,9 @@ else() ) target_include_directories(open62541-object PRIVATE ${PROJECT_SOURCE_DIR}/src) @@ -121,6 +169,30 @@ index 2fd6ef29..f45075be 100755 add_library(open62541-plugins OBJECT ${default_plugin_sources} ${ua_architecture_sources} ${exported_headers}) add_dependencies(open62541-plugins open62541-generator-types open62541-generator-transport open62541-generator-namespace) +@@ -1194,6 +1185,10 @@ else() + target_compile_definitions(open62541-plugins PRIVATE -DUA_DYNAMIC_LINKING_EXPORT) + set_target_properties(open62541-plugins PROPERTIES FOLDER "open62541/lib") + ++ if(UA_ENABLE_WEBSOCKET_SERVER) ++ target_link_libraries(open62541-plugins PRIVATE Libwebsockets::Libwebsockets) ++ endif() ++ + if(UA_PACK_DEBIAN) + add_library(open62541-static STATIC $ $) + set_target_properties(open62541-static PROPERTIES OUTPUT_NAME open62541) +@@ -1232,10 +1227,10 @@ else() + include_directories_private("${PROJECT_BINARY_DIR}") + + if(UA_ENABLE_ENCRYPTION_MBEDTLS) +- include_directories_private(${MBEDTLS_INCLUDE_DIRS}) ++ include_directories_private(${MbedTLS_INCLUDE_DIRS}) + endif() + if(UA_ENABLE_ENCRYPTION_OPENSSL) +- include_directories_private(${OPENSSL_INCLUDE_DIR}) ++ include_directories_private(${OpenSSL_INCLUDE_DIR}) + endif() + + # Option-specific includes diff --git a/src/server/ua_discovery_manager.h b/src/server/ua_discovery_manager.h index 7787b40e..99dc884b 100644 --- a/src/server/ua_discovery_manager.h From 0ef82e483e7fd21c6566cdbac797b4fdf95a7b0c Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Mon, 7 Dec 2020 17:31:31 +0100 Subject: [PATCH 75/81] change "None" options to False, forward encryption option to libwebosckets, set hardening to True remove clang 9 support --- recipes/open62541/all/conanfile.py | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index cf9f22e67115d..33f89a0be4c93 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -36,9 +36,9 @@ class Open62541Conan(ConanFile): "discovery": [True, False, "With Multicast"], "discovery_semaphore": [True, False], "query": [True, False], - "encryption": ["None", "openssl", "mbedtls-apache", "mbedtls-gpl"], + "encryption": [False, "openssl", "mbedtls-apache", "mbedtls-gpl"], "json_support": [True, False], - "pub_sub": ["None", "Simple", "Ethernet", "Ethernet_XDP"], + "pub_sub": [False, "Simple", "Ethernet", "Ethernet_XDP"], "data_access": [True, False], "compiled_nodeset_descriptions": [True, False], "namespace_zero": ["MINIMAL", "REDUCED", "FULL"], @@ -63,15 +63,15 @@ class Open62541Conan(ConanFile): "discovery": True, "discovery_semaphore": True, "query": False, - "encryption": "None", + "encryption": False, "json_support": False, - "pub_sub": "None", + "pub_sub": False, "data_access": True, "compiled_nodeset_descriptions": True, "namespace_zero": "FULL", "embedded_profile": False, "typenames": True, - "hardening": False, + "hardening": True, "cpp_compatible": False, "readable_statuscodes": True } @@ -135,19 +135,21 @@ def configure(self): raise ConanInvalidConfiguration( "Lower Open62541 versions than 1.1.0 are not cpp compatible due to -fpermisive flags") - if self.settings.compiler == "clang" and tools.Version(self.settings.compiler.version) >= "9": - raise ConanInvalidConfiguration( - "Lower Open62541 versions than 1.1.0 do not support Clang 9.x.x and later compiler versions!") - if self.settings.compiler == "clang": if tools.Version(self.settings.compiler.version) <= "4": raise ConanInvalidConfiguration( "Older clang compiler version than 4.0 are not supported") + if tools.Version(self.settings.compiler.version) >= "9": + raise ConanInvalidConfiguration( + "Open62541 does not support Clang 9.x.x and later compiler versions") - if self.options.pub_sub != "None" and self.settings.os != "Linux": + if self.options.pub_sub != False and self.settings.os != "Linux": raise ConanInvalidConfiguration( "PubSub over Ethernet is not supported for your OS!") + if self.options.web_socket: + self.options["libwebsockets"].with_ssl = self.options.encryption + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -233,12 +235,12 @@ def _configure_cmake(self): self._cmake.definitions["UA_ENABLE_DISCOVERY_MULTICAST"] = True self._cmake.definitions["UA_ENABLE_DISCOVERY_SEMAPHORE"] = self.options.discovery_semaphore self._cmake.definitions["UA_ENABLE_QUERY"] = self.options.query - if self.options.encryption != "None": + if self.options.encryption != False: self._cmake.definitions["UA_ENABLE_ENCRYPTION"] = True if self.options.encryption == "openssl": self._cmake.definitions["UA_ENABLE_ENCRYPTION_OPENSSL"] = True self._cmake.definitions["UA_ENABLE_JSON_ENCODING"] = self.options.json_support - if self.options.pub_sub != "None": + if self.options.pub_sub != False: self._cmake.definitions["UA_ENABLE_PUBSUB"] = True if self.settings.os == "Linux" and self.options.pub_sub == "Ethernet": self._cmake.definitions["UA_ENABLE_PUBSUB_ETH_UADP"] = True From f38dd369617aa9ba4a88880081e5671d39943577 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Mon, 7 Dec 2020 18:18:00 +0100 Subject: [PATCH 76/81] remove -Qunused-arguments compiler argument --- recipes/open62541/all/patches/1_1_3.patch | 44 +++++------------------ 1 file changed, 9 insertions(+), 35 deletions(-) diff --git a/recipes/open62541/all/patches/1_1_3.patch b/recipes/open62541/all/patches/1_1_3.patch index 1c622e91bea3e..a6ca725bf6b98 100644 --- a/recipes/open62541/all/patches/1_1_3.patch +++ b/recipes/open62541/all/patches/1_1_3.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 2fd6ef29..77961baa 100755 +index 2fd6ef29..01bc869e 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,9 +7,8 @@ endif() @@ -60,33 +60,7 @@ index 2fd6ef29..77961baa 100755 endif() if(MINGW) -@@ -493,6 +493,8 @@ function(check_add_cc_flag CC_FLAG) - check_c_compiler_flag("${CC_FLAG}" flag_supported) - if(flag_supported) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CC_FLAG}" PARENT_SCOPE) -+ else() -+ message(STATUS "Flag ${CC_FLAG} is not supported.") - endif() - unset(flag_supported CACHE) - endif() -@@ -508,7 +510,15 @@ if(NOT UA_FORCE_CPP AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID}" ST - - check_add_cc_flag("-Wno-static-in-inline") # Clang doesn't like the use of static inline methods inside static inline methods - check_add_cc_flag("-Wno-overlength-strings") # May happen in the nodeset compiler when complex values are directly encoded -- check_add_cc_flag("-Wno-unused-parameter") # some methods may require unused arguments to cast to a method pointer -+ -+ string(COMPARE GREATER_EQUAL ${CMAKE_C_COMPILER_VERSION} "9.0.0" IS_CLANG_9_COMPATIBLE) -+ if(${IS_CLANG_9_COMPATIBLE} AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang") -+ message(STATUS "Using Clang ${CMAKE_C_COMPILER_VERSION} version") -+ check_add_cc_flag("-Qunused-arguments") -+ else() -+ message(STATUS "Using ${CMAKE_CXX_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION} version") -+ check_add_cc_flag("-Wno-unused-parameter") # some methods may require unused arguments to cast to a method pointer -+ endif() - - # Use a strict subset of the C and C++ languages - check_add_cc_flag("-Wc++-compat") -@@ -576,18 +586,6 @@ if(NOT UA_FORCE_CPP AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID}" ST +@@ -576,18 +576,6 @@ if(NOT UA_FORCE_CPP AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID}" ST # Linker set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # cmake sets -rdynamic by default @@ -105,7 +79,7 @@ index 2fd6ef29..77961baa 100755 if (NOT MINGW) if(UA_ENABLE_HARDENING AND ((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))) check_add_cc_flag("-D_FORTIFY_SOURCE=2") # run-time buffer overflow detection (needs at least -O1) -@@ -632,8 +630,6 @@ if(APPLE) +@@ -632,8 +620,6 @@ if(APPLE) endif() if(MSVC) @@ -114,7 +88,7 @@ index 2fd6ef29..77961baa 100755 if(UA_MSVC_FORCE_STATIC_CRT AND NOT BUILD_SHARED_LIBS) set(CompilerFlags CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE) -@@ -659,8 +655,8 @@ configure_file(include/open62541/config.h.in ${PROJECT_BINARY_DIR}/src_generated +@@ -659,8 +645,8 @@ configure_file(include/open62541/config.h.in ${PROJECT_BINARY_DIR}/src_generated configure_file(open62541.pc.in ${PROJECT_BINARY_DIR}/src_generated/open62541.pc @ONLY) if(UA_ENABLE_DISCOVERY_MULTICAST) @@ -124,7 +98,7 @@ index 2fd6ef29..77961baa 100755 endif() set(exported_headers ${exported_headers} -@@ -946,18 +942,7 @@ if(UA_DEBUG_DUMP_PKGS) +@@ -946,18 +932,7 @@ if(UA_DEBUG_DUMP_PKGS) endif() if(UA_ENABLE_DISCOVERY_MULTICAST) @@ -143,7 +117,7 @@ index 2fd6ef29..77961baa 100755 ${lib_sources}) endif() -@@ -1147,10 +1132,13 @@ if(UA_ENABLE_AMALGAMATION) +@@ -1147,10 +1122,13 @@ if(UA_ENABLE_AMALGAMATION) target_include_directories(open62541-object PRIVATE ${PROJECT_BINARY_DIR}) target_include_directories(open62541-object PRIVATE "${ua_architecture_directories_to_include}") if(UA_ENABLE_ENCRYPTION_MBEDTLS) @@ -159,7 +133,7 @@ index 2fd6ef29..77961baa 100755 endif() # make sure the open62541_amalgamation target builds before so that amalgamation is finished and it is not executed again for open62541-object -@@ -1186,6 +1174,9 @@ else() +@@ -1186,6 +1164,9 @@ else() ) target_include_directories(open62541-object PRIVATE ${PROJECT_SOURCE_DIR}/src) @@ -169,7 +143,7 @@ index 2fd6ef29..77961baa 100755 add_library(open62541-plugins OBJECT ${default_plugin_sources} ${ua_architecture_sources} ${exported_headers}) add_dependencies(open62541-plugins open62541-generator-types open62541-generator-transport open62541-generator-namespace) -@@ -1194,6 +1185,10 @@ else() +@@ -1194,6 +1175,10 @@ else() target_compile_definitions(open62541-plugins PRIVATE -DUA_DYNAMIC_LINKING_EXPORT) set_target_properties(open62541-plugins PROPERTIES FOLDER "open62541/lib") @@ -180,7 +154,7 @@ index 2fd6ef29..77961baa 100755 if(UA_PACK_DEBIAN) add_library(open62541-static STATIC $ $) set_target_properties(open62541-static PROPERTIES OUTPUT_NAME open62541) -@@ -1232,10 +1227,10 @@ else() +@@ -1232,10 +1217,10 @@ else() include_directories_private("${PROJECT_BINARY_DIR}") if(UA_ENABLE_ENCRYPTION_MBEDTLS) From a7b9cb7af0a8628d43e130996ee02b76e5055a5e Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Tue, 8 Dec 2020 09:57:57 +0100 Subject: [PATCH 77/81] add -Wno-unused-command-line-argument to patch --- recipes/open62541/all/patches/1_1_3.patch | 26 +++++++++++++++-------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/recipes/open62541/all/patches/1_1_3.patch b/recipes/open62541/all/patches/1_1_3.patch index a6ca725bf6b98..1fb31be0e5a57 100644 --- a/recipes/open62541/all/patches/1_1_3.patch +++ b/recipes/open62541/all/patches/1_1_3.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 2fd6ef29..01bc869e 100755 +index 2fd6ef29..e74915c2 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,9 +7,8 @@ endif() @@ -60,7 +60,15 @@ index 2fd6ef29..01bc869e 100755 endif() if(MINGW) -@@ -576,18 +576,6 @@ if(NOT UA_FORCE_CPP AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID}" ST +@@ -509,6 +509,7 @@ if(NOT UA_FORCE_CPP AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID}" ST + check_add_cc_flag("-Wno-static-in-inline") # Clang doesn't like the use of static inline methods inside static inline methods + check_add_cc_flag("-Wno-overlength-strings") # May happen in the nodeset compiler when complex values are directly encoded + check_add_cc_flag("-Wno-unused-parameter") # some methods may require unused arguments to cast to a method pointer ++ check_add_cc_flag("-Wno-unused-command-line-argument") + + # Use a strict subset of the C and C++ languages + check_add_cc_flag("-Wc++-compat") +@@ -576,18 +577,6 @@ if(NOT UA_FORCE_CPP AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID}" ST # Linker set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # cmake sets -rdynamic by default @@ -79,7 +87,7 @@ index 2fd6ef29..01bc869e 100755 if (NOT MINGW) if(UA_ENABLE_HARDENING AND ((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))) check_add_cc_flag("-D_FORTIFY_SOURCE=2") # run-time buffer overflow detection (needs at least -O1) -@@ -632,8 +620,6 @@ if(APPLE) +@@ -632,8 +621,6 @@ if(APPLE) endif() if(MSVC) @@ -88,7 +96,7 @@ index 2fd6ef29..01bc869e 100755 if(UA_MSVC_FORCE_STATIC_CRT AND NOT BUILD_SHARED_LIBS) set(CompilerFlags CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE) -@@ -659,8 +645,8 @@ configure_file(include/open62541/config.h.in ${PROJECT_BINARY_DIR}/src_generated +@@ -659,8 +646,8 @@ configure_file(include/open62541/config.h.in ${PROJECT_BINARY_DIR}/src_generated configure_file(open62541.pc.in ${PROJECT_BINARY_DIR}/src_generated/open62541.pc @ONLY) if(UA_ENABLE_DISCOVERY_MULTICAST) @@ -98,7 +106,7 @@ index 2fd6ef29..01bc869e 100755 endif() set(exported_headers ${exported_headers} -@@ -946,18 +932,7 @@ if(UA_DEBUG_DUMP_PKGS) +@@ -946,18 +933,7 @@ if(UA_DEBUG_DUMP_PKGS) endif() if(UA_ENABLE_DISCOVERY_MULTICAST) @@ -117,7 +125,7 @@ index 2fd6ef29..01bc869e 100755 ${lib_sources}) endif() -@@ -1147,10 +1122,13 @@ if(UA_ENABLE_AMALGAMATION) +@@ -1147,10 +1123,13 @@ if(UA_ENABLE_AMALGAMATION) target_include_directories(open62541-object PRIVATE ${PROJECT_BINARY_DIR}) target_include_directories(open62541-object PRIVATE "${ua_architecture_directories_to_include}") if(UA_ENABLE_ENCRYPTION_MBEDTLS) @@ -133,7 +141,7 @@ index 2fd6ef29..01bc869e 100755 endif() # make sure the open62541_amalgamation target builds before so that amalgamation is finished and it is not executed again for open62541-object -@@ -1186,6 +1164,9 @@ else() +@@ -1186,6 +1165,9 @@ else() ) target_include_directories(open62541-object PRIVATE ${PROJECT_SOURCE_DIR}/src) @@ -143,7 +151,7 @@ index 2fd6ef29..01bc869e 100755 add_library(open62541-plugins OBJECT ${default_plugin_sources} ${ua_architecture_sources} ${exported_headers}) add_dependencies(open62541-plugins open62541-generator-types open62541-generator-transport open62541-generator-namespace) -@@ -1194,6 +1175,10 @@ else() +@@ -1194,6 +1176,10 @@ else() target_compile_definitions(open62541-plugins PRIVATE -DUA_DYNAMIC_LINKING_EXPORT) set_target_properties(open62541-plugins PROPERTIES FOLDER "open62541/lib") @@ -154,7 +162,7 @@ index 2fd6ef29..01bc869e 100755 if(UA_PACK_DEBIAN) add_library(open62541-static STATIC $ $) set_target_properties(open62541-static PROPERTIES OUTPUT_NAME open62541) -@@ -1232,10 +1217,10 @@ else() +@@ -1232,10 +1218,10 @@ else() include_directories_private("${PROJECT_BINARY_DIR}") if(UA_ENABLE_ENCRYPTION_MBEDTLS) From 8b2a79cda42515b5de6cfb335db1cee55180ee42 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Tue, 8 Dec 2020 09:58:18 +0100 Subject: [PATCH 78/81] re-enable clang 9 support for 1.1.3 --- recipes/open62541/all/conanfile.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index 33f89a0be4c93..2edff8ee7dcaf 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -135,13 +135,14 @@ def configure(self): raise ConanInvalidConfiguration( "Lower Open62541 versions than 1.1.0 are not cpp compatible due to -fpermisive flags") + if self.settings.compiler == "clang" and tools.Version(self.settings.compiler.version) >= "9": + raise ConanInvalidConfiguration( + "Open62541 does not support Clang 9.x.x and later compiler versions") + if self.settings.compiler == "clang": if tools.Version(self.settings.compiler.version) <= "4": raise ConanInvalidConfiguration( "Older clang compiler version than 4.0 are not supported") - if tools.Version(self.settings.compiler.version) >= "9": - raise ConanInvalidConfiguration( - "Open62541 does not support Clang 9.x.x and later compiler versions") if self.options.pub_sub != False and self.settings.os != "Linux": raise ConanInvalidConfiguration( From 9c5de64b5047fc0bd77d2f34380ed7c68d88e870 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Thu, 10 Dec 2020 10:45:26 +0100 Subject: [PATCH 79/81] fix comparison operators, use self.recipe_folder instead of os.path.dirname(__file__) --- recipes/open62541/all/conanfile.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index 2edff8ee7dcaf..e146cc11e8230 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -118,7 +118,7 @@ def configure(self): raise ConanInvalidConfiguration( "Open62541 discovery sempahore option requires discovery option to be enabled") - if tools.Version(self.version) <= "1.1.0": + if tools.Version(self.version) < "1.1.0": if self.options.encryption == "openssl": raise ConanInvalidConfiguration( "Lower Open62541 versions than 1.1.0 do not support openssl") @@ -140,7 +140,7 @@ def configure(self): "Open62541 does not support Clang 9.x.x and later compiler versions") if self.settings.compiler == "clang": - if tools.Version(self.settings.compiler.version) <= "4": + if tools.Version(self.settings.compiler.version) < "4": raise ConanInvalidConfiguration( "Older clang compiler version than 4.0 are not supported") @@ -165,7 +165,7 @@ def source(self): os.rename(archive_name, self._source_subfolder) submodule_filename = os.path.join( - os.path.dirname(__file__), 'submoduledata.yml') + self.recipe_folder, 'submoduledata.yml') with open(submodule_filename, 'r') as submodule_stream: submodules_data = yaml.load(submodule_stream) for path, submodule in submodules_data["submodules"][self.version].items(): From 8718bc1f2433e6c7e9469f79c569349821121544 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Thu, 10 Dec 2020 10:52:08 +0100 Subject: [PATCH 80/81] reduce integration test from 1 second to 1 milisecond --- recipes/open62541/all/test_package/test_package.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/open62541/all/test_package/test_package.cpp b/recipes/open62541/all/test_package/test_package.cpp index c6548b5ad36e4..5bd48d813e399 100644 --- a/recipes/open62541/all/test_package/test_package.cpp +++ b/recipes/open62541/all/test_package/test_package.cpp @@ -19,7 +19,7 @@ int main(void) { std::thread server_thread( [&]() { return_code = UA_Server_run(server, &running); }); - std::this_thread::sleep_for(std::chrono::seconds(1)); + std::this_thread::sleep_for(std::chrono::milliseconds(1)); running = false; server_thread.join(); From c15446ecc7f2c07387c03e681b7ab92d81fe6c28 Mon Sep 17 00:00:00 2001 From: Dovydas Girdvainis Date: Thu, 10 Dec 2020 11:14:39 +0100 Subject: [PATCH 81/81] remove clang 4 support and fix configuration message --- recipes/open62541/all/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index e146cc11e8230..eb7ecafac24e1 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -140,9 +140,9 @@ def configure(self): "Open62541 does not support Clang 9.x.x and later compiler versions") if self.settings.compiler == "clang": - if tools.Version(self.settings.compiler.version) < "4": + if tools.Version(self.settings.compiler.version) < "5": raise ConanInvalidConfiguration( - "Older clang compiler version than 4.0 are not supported") + "Older clang compiler version than 5.0 are not supported") if self.options.pub_sub != False and self.settings.os != "Linux": raise ConanInvalidConfiguration(