Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open62541 - Allow more clang versions #20892

Merged
merged 24 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
9ec2e90
Added open62541 v1.3.8
Kischy Nov 2, 2023
14db385
Added libary version check to clang support check
Kischy Nov 2, 2023
2d8382a
Updated invalid configuration string
Kischy Nov 2, 2023
eaff362
Merge branch 'master' into open62541/allow_clang
Kischy Nov 6, 2023
a5fb448
Merge branch 'master' into open62541/allow_clang
Kischy Nov 6, 2023
1756ff2
Added -fsanitize=address compile flag to test_package for clang
Kischy Nov 6, 2023
86ecd7b
Removed support for clang-12
Kischy Nov 9, 2023
3fac0e5
Readded support for clang-12
Kischy Nov 10, 2023
f087b82
Added compiler option -fsanitize=address to
Kischy Nov 10, 2023
42cd45c
Removed cmake generator expression and
Kischy Nov 10, 2023
74011b0
Corrected cmake of test_package
Kischy Nov 10, 2023
1f57abf
Merge branch 'master' into open62541/allow_clang
Kischy Nov 10, 2023
00fb5b6
- Added -fsanitize=address to test_package of v1
Kischy Nov 13, 2023
21c656d
- Added debug_sanitizer option to recipe
Kischy Nov 14, 2023
4866dba
Removed lower bug versions of open62541
Kischy Nov 14, 2023
2ea9b13
Updated supported clang versions to allow a broader
Kischy Nov 14, 2023
07c2056
Updated forgotten config.yml
Kischy Nov 14, 2023
4c4dbfb
Added usage of debug_sanitizer to generate()
Kischy Nov 15, 2023
606f757
Deleted old patch files
Kischy Nov 15, 2023
c2a0bc1
- Removed debug_sanitizer option from conanfile.py
Kischy Nov 15, 2023
c614495
Switched to f-string instead of format string
Kischy Nov 16, 2023
91118b9
Updated patch so unused code is removed instead
Kischy Nov 16, 2023
1a16cd0
Merge branch 'master' into open62541/allow_clang
Kischy Nov 21, 2023
d8515d7
Merge branch 'master' into open62541/allow_clang
Kischy Nov 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 6 additions & 69 deletions recipes/open62541/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,67 +1,22 @@
sources:
"1.3.6":
url: "https://github.com/open62541/open62541/archive/v1.3.6.tar.gz"
sha256: "0751ce6273908b1e571f36591665f3d5b9451514c2478ea5f6b4b466d7da6b02"
"1.3.4":
url: "https://github.com/open62541/open62541/archive/v1.3.4.tar.gz"
sha256: "3489cfa2f98c52df252adc8e641a9e59cb675bdfd5ef413b0d947e667cddd16d"
"1.3.1":
url: "https://github.com/open62541/open62541/archive/v1.3.1.tar.gz"
sha256: "f54d10325fd08fc1505aea37d83daa085912a269521e6d018bfc41a744ba57aa"
"1.3.8":
url: "https://github.com/open62541/open62541/archive/v1.3.8.tar.gz"
sha256: "b6943b564787c4953b77ca8d7f987c4b896b3f3e91f45d9f13e9056b6148bc1d"
"1.2.6":
url: "https://github.com/open62541/open62541/archive/v1.2.6.tar.gz"
sha256: "7470c1e2f97d0e7dad9632ced7b62f0add66a3c689532204ef85b0556d129106"
"1.2.4":
url: "https://github.com/open62541/open62541/archive/v1.2.4.tar.gz"
sha256: "b2d00b91e8315b61efaef6398f0902a0c9a8f357aa6d02f7f000a429048c97ae"
"1.2.2":
url: "https://github.com/open62541/open62541/archive/v1.2.2.tar.gz"
sha256: "9b5bfd811ee523be601f11abc514a93c67fe5c6e957cd6c36fe6ea4f28e009bb"
"1.1.6":
url: "https://github.com/open62541/open62541/archive/v1.1.6.tar.gz"
sha256: "005bb336ba52f2c0add479bb46de8aa4216efa7f2bfd8b1c24a0271494edbd3f"
"1.1.5":
url: "https://github.com/open62541/open62541/archive/v1.1.5.tar.gz"
sha256: "a3e689216d75c3313bffdbb1cb7190d63b173410f392b8c558062fdd667635d7"
"1.1.3":
url: "https://github.com/open62541/open62541/archive/v1.1.3.tar.gz"
sha256: "12770bf9f5d9f44dedce0d1b34066dd14111d24c73a2f0153420e0a750e85d19"
"1.0.6":
url: "https://github.com/open62541/open62541/archive/v1.0.6.tar.gz"
sha256: "299940025c14929533064abe0044d5805ea50d52b32d05ad9bc0e6996569c2a6"
"1.0.3":
url: "https://github.com/open62541/open62541/archive/v1.0.3.tar.gz"
sha256: "3e4c939d702d06d89f32a1cafe2b992c7f3d81c8f8579e093a972d4bc4fb3d50"
patches:
"1.3.4":
- patch_file: "patches/0001-fix-cmake-find-deps-1_3_4.patch"
patch_description: "Use Cmake find_package(*) to resolve external dependencies"
patch_type: "portability"
"1.3.1":
- patch_file: "patches/0001-fix-cmake-find-deps-1_3_1.patch"
patch_description: "Use Cmake find_package(*) to resolve external dependencies"
patch_type: "portability"
"1.2.6":
- patch_file: "patches/0001-fix-cmake-find-deps-1_2_x.patch"
patch_description: "Use Cmake find_package(*) to resolve external dependencies"
patch_type: "portability"
- patch_file: "patches/0003-disable-sanitizers-1_2_x.patch"
patch_description: "Disable static code analysis"
patch_type: "conan"
- patch_file: "patches/0003-fix-use-usr-bin-env-python3.patch"
patch_description: "Use python3 instead of default python interpreter"
patch_type: "conan"
"1.2.4":
- patch_file: "patches/0001-fix-cmake-find-deps-1_2_x.patch"
patch_description: "Use Cmake find_package(*) to resolve external dependencies"
patch_type: "portability"
- patch_file: "patches/0003-disable-sanitizers-1_2_x.patch"
"1.3.8":
- patch_file: "patches/0001-disable-sanitizers-1_3_x.patch"
patch_description: "Disable static code analysis"
patch_type: "conan"
- patch_file: "patches/0003-fix-use-usr-bin-env-python3.patch"
patch_description: "Use python3 instead of default python interpreter"
patch_type: "conan"
"1.2.2":
"1.2.6":
- patch_file: "patches/0001-fix-cmake-find-deps-1_2_x.patch"
patch_description: "Use Cmake find_package(*) to resolve external dependencies"
patch_type: "portability"
Expand All @@ -78,25 +33,7 @@ patches:
- patch_file: "patches/0003-disable-sanitizers-1_1_6.patch"
patch_description: "Disable static code analysis"
patch_type: "conan"
"1.1.5":
- patch_file: "patches/0001-fix-cmake-find-deps-1_1_x.patch"
patch_description: "Use Cmake find_package(*) to resolve external dependencies"
patch_type: "portability"
- patch_file: "patches/0002-disable-sanitizers-1_1_3-and-1_1_5.patch"
patch_description: "Disable static code analysis"
patch_type: "conan"
"1.1.3":
- patch_file: "patches/0001-fix-cmake-find-deps-1_1_x.patch"
patch_description: "Use Cmake find_package(*) to resolve external dependencies"
patch_type: "portability"
- patch_file: "patches/0002-disable-sanitizers-1_1_3-and-1_1_5.patch"
patch_description: "Disable static code analysis"
patch_type: "conan"
"1.0.6":
- patch_file: "patches/1_0_x.patch"
patch_description: "Fix CMAKE_MODULE_PATH and PROJECT_VERSION variables, remove -Werror flag, disable static code analysis, use Cmake find_package(*) to resolve external dependencies, fix include paths"
patch_type: "conan"
"1.0.3":
- patch_file: "patches/1_0_x.patch"
patch_description: "Fix CMAKE_MODULE_PATH and PROJECT_VERSION variables, remove -Werror flag, disable static code analysis, use Cmake find_package(*) to resolve external dependencies, fix include paths"
patch_type: "conan"
13 changes: 7 additions & 6 deletions recipes/open62541/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class Open62541Conan(ConanFile):
# UA_COMPILE_AS_CXX=cpp_compatible
"cpp_compatible": [True, False],
# UA_ENABLE_STATUSCODE_DESCRIPTIONS=readable_statuscodes
"readable_statuscodes": [True, False]
"readable_statuscodes": [True, False],
}
default_options = {
"fPIC": True,
Expand Down Expand Up @@ -136,7 +136,7 @@ class Open62541Conan(ConanFile):
"typenames": True,
"hardening": True,
"cpp_compatible": False,
"readable_statuscodes": True
"readable_statuscodes": True,
}

exports = "submoduledata.yml"
Expand Down Expand Up @@ -215,10 +215,10 @@ def validate(self):
raise ConanInvalidConfiguration(
"Lower Open62541 versions than 1.1.0 are not cpp compatible due to -fpermisive flags")

max_clang_version = "8" if Version(self.version) < "1.1.0" else "9"
if self.settings.compiler == "clang" and Version(self.settings.compiler.version) > max_clang_version:
unsupported_clang_version = "8" if Version(self.version) < "1.1.0" else "9"
if self.settings.compiler == "clang" and Version(self.settings.compiler.version) == unsupported_clang_version:
raise ConanInvalidConfiguration(
"Open62541 supports Clang up to {} compiler version".format(max_clang_version))
f"{self.ref} does not support Clang version {self.settings.compiler.version}")

if self.settings.compiler == "clang":
if Version(self.settings.compiler.version) < "5":
Expand Down Expand Up @@ -353,7 +353,7 @@ def generate(self):
tc.variables["UA_MSVC_FORCE_STATIC_CRT"] = True

tc.variables["UA_COMPILE_AS_CXX"] = self.options.cpp_compatible

# Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840)
tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW"

Expand Down Expand Up @@ -451,3 +451,4 @@ def package_info(self):
self._module_file_rel_path]
self.cpp_info.set_property("cmake_build_modules", [
self._module_file_rel_path])

24 changes: 24 additions & 0 deletions recipes/open62541/all/patches/0001-disable-sanitizers-1_3_x.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5300b12f6..9a80321da 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -749,19 +749,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 AND NOT UA_BUILD_OSS_FUZZ AND
- "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=leak -fsanitize=undefined")
- if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10.0)
- set(SANITIZER_FLAGS "${SANITIZER_FLAGS} -fsanitize-coverage=trace-pc-guard")
- endif()
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SANITIZER_FLAGS}")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SANITIZER_FLAGS}")
- endif()

if(NOT MINGW AND 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)
200 changes: 0 additions & 200 deletions recipes/open62541/all/patches/0001-fix-cmake-find-deps-1_3_1.patch

This file was deleted.

Loading