From 86b2970fea44435980158170b18bb3aa11046d0d Mon Sep 17 00:00:00 2001 From: raakella1 <114193113+raakella1@users.noreply.github.com> Date: Thu, 29 Jun 2023 15:45:22 -0700 Subject: [PATCH 1/9] dump breakpad stacktrace file in the same dir as logfile (#151) Co-authored-by: Ravi Akella email = raakella@ebay.com --- conanfile.py | 2 +- include/sisl/logging/logging.h | 1 + src/logging/logging.cpp | 35 +++++++++++++++++++--------------- src/logging/stacktrace.cpp | 2 +- 4 files changed, 23 insertions(+), 17 deletions(-) diff --git a/conanfile.py b/conanfile.py index 6b4dc1ee..fd643757 100644 --- a/conanfile.py +++ b/conanfile.py @@ -8,7 +8,7 @@ class SISLConan(ConanFile): name = "sisl" - version = "8.6.2" + version = "8.6.3" homepage = "https://github.com/eBay/sisl" description = "Library for fast data structures, utilities" topics = ("ebay", "components", "core", "efficiency") diff --git a/include/sisl/logging/logging.h b/include/sisl/logging/logging.h index 16407415..4dc951c9 100644 --- a/include/sisl/logging/logging.h +++ b/include/sisl/logging/logging.h @@ -474,6 +474,7 @@ extern bool is_crash_handler_installed(); extern bool restore_signal_handler(const SignalType sig_num); extern bool restore_signal_handlers(); extern bool send_thread_signal(const pthread_t thr, const SignalType sig_num); +extern std::filesystem::path get_base_dir(); template < typename... Args > std::string format_log_msg(const char* const msg, Args&&... args) { diff --git a/src/logging/logging.cpp b/src/logging/logging.cpp index e8bf2c41..5c294fb5 100644 --- a/src/logging/logging.cpp +++ b/src/logging/logging.cpp @@ -132,19 +132,25 @@ std::shared_ptr< spdlog::logger >& GetCriticalLogger() { return logger_thread_ctx.m_critical_logger; } -static std::filesystem::path get_base_dir() { - const auto cwd{std::filesystem::current_path()}; - auto p{cwd / "logs"}; - // Construct a unique directory path based on the current time - auto const current_time{std::chrono::system_clock::now()}; - auto const current_t{std::chrono::system_clock::to_time_t(current_time)}; - auto const current_tm{std::localtime(¤t_t)}; - std::array< char, PATH_MAX > c_time; - if (std::strftime(c_time.data(), c_time.size(), "%F_%R", current_tm)) { - p /= c_time.data(); - std::filesystem::create_directories(p); - } - return p; +static std::filesystem::path g_base_dir; + +std::filesystem::path get_base_dir() { + static std::once_flag one_base_dir; + std::call_once(one_base_dir, [] { + const auto cwd{std::filesystem::current_path()}; + g_base_dir = cwd / "logs"; + // Construct a unique directory path based on the current time + auto const current_time{std::chrono::system_clock::now()}; + auto const current_t{std::chrono::system_clock::to_time_t(current_time)}; + auto const current_tm{std::localtime(¤t_t)}; + std::array< char, PATH_MAX > c_time; + if (std::strftime(c_time.data(), c_time.size(), "%F_%R", current_tm)) { + g_base_dir /= c_time.data(); + std::filesystem::create_directories(g_base_dir); + } + }); + + return g_base_dir; } static std::filesystem::path log_path(std::string const& name) { @@ -152,8 +158,7 @@ static std::filesystem::path log_path(std::string const& name) { if (0 < SISL_OPTIONS.count("logfile")) { p = std::filesystem::path{SISL_OPTIONS["logfile"].as< std::string >()}; } else { - static std::filesystem::path base_dir{get_base_dir()}; - p = base_dir / std::filesystem::path{name}.filename(); + p = get_base_dir() / std::filesystem::path{name}.filename(); } return p; } diff --git a/src/logging/stacktrace.cpp b/src/logging/stacktrace.cpp index 8287507b..844e5362 100644 --- a/src/logging/stacktrace.cpp +++ b/src/logging/stacktrace.cpp @@ -126,7 +126,7 @@ static bool dumpCallback(const google_breakpad::MinidumpDescriptor& descriptor, } static void bt_dumper([[maybe_unused]] const SignalType signal_number) { - google_breakpad::ExceptionHandler::WriteMinidump("./", dumpCallback, nullptr); + google_breakpad::ExceptionHandler::WriteMinidump(get_base_dir().string(), dumpCallback, nullptr); } static void crash_handler(const SignalType signal_number) { From 0084eb081de41585215b3e9fdae47608a2308156 Mon Sep 17 00:00:00 2001 From: raakella1 <114193113+raakella1@users.noreply.github.com> Date: Wed, 30 Aug 2023 10:17:51 -0700 Subject: [PATCH 2/9] Token Caching (#169) * add caching to auth_manager * fix the auth test after caching * update folly cmake * add build missing for all branch builds --------- Authored-by: Ravi Akella email = raakella@ebay.com --- .jenkins/Jenkinsfile | 9 +- 3rd_party/folly/conanfile.py | 3 +- conanfile.py | 8 +- include/sisl/auth_manager/LRUCache.h | 82 ++++++++++++++++++ include/sisl/auth_manager/auth_manager.hpp | 36 +++++++- src/auth_manager/CMakeLists.txt | 2 +- src/auth_manager/auth_manager.cpp | 97 +++++++++++++++++++--- src/auth_manager/security_config.fbs | 4 + src/auth_manager/tests/AuthTest.cpp | 4 +- src/grpc/tests/unit/CMakeLists.txt | 2 +- 10 files changed, 220 insertions(+), 27 deletions(-) create mode 100644 include/sisl/auth_manager/LRUCache.h diff --git a/.jenkins/Jenkinsfile b/.jenkins/Jenkinsfile index 894495b6..05d762cf 100644 --- a/.jenkins/Jenkinsfile +++ b/.jenkins/Jenkinsfile @@ -18,18 +18,13 @@ pipeline { steps { script { sh(script: "sed -Ei 's, version = .*\"([[:digit:]]+\\.[[:digit:]]+\\.[[:digit:]]+).*, version = \"\\1-${env.BUILD_NUMBER}\",' conanfile.py") - BUILD_MISSING = "--build missing" } } } - stage('Adjust for Testing/Stable') { - when { anyOf { - branch "${TESTING_BRANCH}" - branch "${STABLE_BRANCH}" - } } + stage('include build missing') { steps { script { - BUILD_MISSING = "" + BUILD_MISSING = "--build missing" } } } diff --git a/3rd_party/folly/conanfile.py b/3rd_party/folly/conanfile.py index 06dc6965..2ed4f619 100755 --- a/3rd_party/folly/conanfile.py +++ b/3rd_party/folly/conanfile.py @@ -145,7 +145,8 @@ def validate(self): # FIXME: Freeze max. CMake version at 3.16.2 to fix the Linux build def build_requirements(self): - self.build_requires("cmake/3.16.9") + pass + # self.build_requires("cmake/3.16.9") def source(self): files.get(self, **self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) diff --git a/conanfile.py b/conanfile.py index fd643757..1d9e80ad 100644 --- a/conanfile.py +++ b/conanfile.py @@ -8,7 +8,7 @@ class SISLConan(ConanFile): name = "sisl" - version = "8.6.3" + version = "8.6.4" homepage = "https://github.com/eBay/sisl" description = "Library for fast data structures, utilities" topics = ("ebay", "components", "core", "efficiency") @@ -41,7 +41,7 @@ def build_requirements(self): self.build_requires("benchmark/1.7.0") self.build_requires("gtest/1.11.0") if self.settings.compiler in ["gcc"]: - self.build_requires("pistache/cci.20201127") + self.build_requires("pistache/0.0.5") def requirements(self): # Custom packages @@ -59,7 +59,6 @@ def requirements(self): self.requires("folly/2022.01.31.00") self.requires("grpc/1.48.0") self.requires("jwt-cpp/0.4.0") - self.requires("libcurl/7.86.0") self.requires("nlohmann_json/3.11.2") self.requires("prometheus-cpp/1.0.1") self.requires("spdlog/1.11.0") @@ -68,7 +67,8 @@ def requirements(self): self.requires("zmarok-semver/1.1.0") self.requires("fmt/8.1.1", override=True) self.requires("libevent/2.1.12", override=True) - self.requires("openssl/1.1.1q", override=True) + self.requires("openssl/1.1.1s", override=True) + self.requires("libcurl/7.86.0") self.requires("xz_utils/5.2.5", override=True) self.requires("zlib/1.2.12", override=True) if self.options.malloc_impl == "jemalloc": diff --git a/include/sisl/auth_manager/LRUCache.h b/include/sisl/auth_manager/LRUCache.h new file mode 100644 index 00000000..f5eb3cdc --- /dev/null +++ b/include/sisl/auth_manager/LRUCache.h @@ -0,0 +1,82 @@ +#pragma once + +#include +#include +#include +#include +#include +#include + +namespace sisl { + +/** + * + * written by @jiankun + * + * A high performance LRU cache implementation. + * + * The cache provides two atomic operations: + * put(key, value): put an object into the cache. + * get(key): returns a optional reference to the value found by key in cache + * + * Important notes: + * 1. The get() method returns a const reference, any change to the reference + * needs to be done by a Put call. + * 2. The put/get methods are thread safe. + */ +template < typename key_t, typename value_t > +class LRUCache { +public: + using kv_pair_t = std::pair< key_t, value_t >; + using list_iterator_t = typename std::list< kv_pair_t >::iterator; + + explicit LRUCache(size_t capacity) : capacity_(capacity) {} + + template < typename K, typename V > + void put(K&& key, V&& value) { + std::unique_lock< std::shared_mutex > l{mtx_}; + + auto it = items_map_.find(key); + if (it != items_map_.end()) { + items_list_.erase(it->second); + items_map_.erase(it); + } + + items_list_.emplace_front(std::make_pair(std::forward< K >(key), std::forward< V >(value))); + items_map_[key] = items_list_.begin(); + + if (items_map_.size() > capacity_) { + auto last = items_list_.rbegin(); + items_map_.erase(last->first); + items_list_.pop_back(); + } + } + + [[nodiscard]] const std::optional< std::reference_wrapper< value_t const > > get(const key_t& key) { + std::shared_lock< std::shared_mutex > l{mtx_}; + + auto it = items_map_.find(key); + if (it == items_map_.end()) { return std::nullopt; } + + items_list_.splice(items_list_.begin(), items_list_, it->second); + return std::optional(std::cref(it->second->second)); + } + + bool exists(const key_t& key) const { + std::shared_lock< std::shared_mutex > l{mtx_}; + return items_map_.find(key) != items_map_.end(); + } + + [[nodiscard]] size_t size() const { + std::shared_lock< std::shared_mutex > l{mtx_}; + return items_map_.size(); + } + +private: + std::list< kv_pair_t > items_list_; + std::unordered_map< key_t, list_iterator_t > items_map_; + size_t capacity_; + mutable std::shared_mutex mtx_; +}; + +} // namespace sisl diff --git a/include/sisl/auth_manager/auth_manager.hpp b/include/sisl/auth_manager/auth_manager.hpp index bf5ea957..01885809 100644 --- a/include/sisl/auth_manager/auth_manager.hpp +++ b/include/sisl/auth_manager/auth_manager.hpp @@ -18,14 +18,40 @@ #include #include "security_config.hpp" +#include "LRUCache.h" namespace sisl { ENUM(AuthVerifyStatus, uint8_t, OK, UNAUTH, FORBIDDEN) +template < typename key_t, typename value_t > +class LRUCache; + +/** + * This struct holds information of a token, that can be used as if + * they were extracted from decoded token. + */ +struct CachedToken { + AuthVerifyStatus response_status; + std::string msg; + bool valid; + std::chrono::system_clock::time_point expires_at; + + inline void set_invalid(AuthVerifyStatus code, const std::string& reason) { + valid = false; + response_status = code; + msg = reason; + } + + inline void set_valid() { + valid = true; + response_status = AuthVerifyStatus::OK; + } +}; + class AuthManager { public: - AuthManager() {} + AuthManager(); virtual ~AuthManager() = default; AuthVerifyStatus verify(const std::string& token, std::string& msg) const; @@ -33,5 +59,13 @@ class AuthManager { void verify_decoded(const jwt::decoded_jwt& decoded) const; virtual std::string download_key(const std::string& key_url) const; std::string get_app(const jwt::decoded_jwt& decoded) const; + + // the verify method is declared const. We make this mutable + // as these caches are modified in the verify method. md5_sum(raw_token) -> + // DecodedToken + mutable LRUCache< std::string, CachedToken > m_cached_tokens; + + // key_id -> signing public key + mutable LRUCache< std::string, std::string > m_cached_keys; }; } // namespace sisl diff --git a/src/auth_manager/CMakeLists.txt b/src/auth_manager/CMakeLists.txt index aa554c36..ff83dc6d 100644 --- a/src/auth_manager/CMakeLists.txt +++ b/src/auth_manager/CMakeLists.txt @@ -34,7 +34,7 @@ target_link_libraries(test_auth_mgr sisl ${COMMON_DEPS} cpr::cpr - pistache::pistache + Pistache::Pistache flatbuffers::flatbuffers jwt-cpp::jwt-cpp GTest::gmock diff --git a/src/auth_manager/auth_manager.cpp b/src/auth_manager/auth_manager.cpp index 38396cca..d50b7e7e 100644 --- a/src/auth_manager/auth_manager.cpp +++ b/src/auth_manager/auth_manager.cpp @@ -2,14 +2,59 @@ #include #include +extern "C" { +#include +} #include "sisl/auth_manager/auth_manager.hpp" namespace sisl { +static std::string md5_sum(std::string const& s) { + unsigned char digest[MD5_DIGEST_LENGTH]; + + MD5(reinterpret_cast< unsigned char* >(const_cast< char* >(s.c_str())), s.length(), + reinterpret_cast< unsigned char* >(&digest)); + + std::ostringstream out; + out << std::hex; + for (int i = 0; i < MD5_DIGEST_LENGTH; i++) { + out << std::setfill('0') << std::setw(2) << std::hex << (int)(unsigned char)digest[i]; + } + return out.str(); +} + +struct incomplete_verification_error : std::exception { + explicit incomplete_verification_error(const std::string& error) : error_(error) {} + const char* what() const noexcept { return error_.c_str(); } + +private: + const std::string error_; +}; + +AuthManager::AuthManager() : + m_cached_tokens(SECURITY_DYNAMIC_CONFIG(auth_manager->auth_token_cache_size)), + m_cached_keys(SECURITY_DYNAMIC_CONFIG(auth_manager->auth_key_cache_size)) {} + AuthVerifyStatus AuthManager::verify(const std::string& token, std::string& msg) const { + // if we have it in cache, just use it to make the decision + auto const token_hash = md5_sum(token); + if (auto const ct = m_cached_tokens.get(token_hash); ct) { + auto const& cached_token = ct->get(); + if (cached_token.valid) { + auto now = std::chrono::system_clock::now(); + if (now > cached_token.expires_at + std::chrono::seconds(SECURITY_DYNAMIC_CONFIG(auth_manager->leeway))) { + m_cached_tokens.put( + token_hash, CachedToken{AuthVerifyStatus::UNAUTH, "token expired", false, cached_token.expires_at}); + } + } + msg = cached_token.msg; + return cached_token.response_status; + } + + // not found in cache + CachedToken cached_token; std::string app_name; - // TODO: cache tokens for better performance try { // this may throw if token is ill formed const auto decoded{jwt::decode(token)}; @@ -18,34 +63,66 @@ AuthVerifyStatus AuthManager::verify(const std::string& token, std::string& msg) // exception is thrown. verify_decoded(decoded); app_name = get_app(decoded); - } catch (const std::exception& e) { + cached_token.expires_at = decoded.get_expires_at(); + cached_token.set_valid(); + } catch (const incomplete_verification_error& e) { + // verification incomplete, the token validity is not determined, shouldn't + // cache msg = e.what(); return AuthVerifyStatus::UNAUTH; + } catch (const std::exception& e) { + cached_token.set_invalid(AuthVerifyStatus::UNAUTH, e.what()); + m_cached_tokens.put(token_hash, cached_token); + msg = cached_token.msg; + return cached_token.response_status; } // check client application if (SECURITY_DYNAMIC_CONFIG(auth_manager->auth_allowed_apps) != "all") { if (SECURITY_DYNAMIC_CONFIG(auth_manager->auth_allowed_apps).find(app_name) == std::string::npos) { - msg = fmt::format("application '{}' is not allowed to perform the request", app_name); - return AuthVerifyStatus::FORBIDDEN; + cached_token.set_invalid(AuthVerifyStatus::FORBIDDEN, + fmt::format("application '{}' is not allowed to perform the request", app_name)); } } - return AuthVerifyStatus::OK; + m_cached_tokens.put(token_hash, cached_token); + msg = cached_token.msg; + return cached_token.response_status; } + void AuthManager::verify_decoded(const jwt::decoded_jwt& decoded) const { const auto alg{decoded.get_algorithm()}; if (alg != "RS256") throw std::runtime_error(fmt::format("unsupported algorithm: {}", alg)); - if (!decoded.has_header_claim("x5u")) throw std::runtime_error("no indication of verification key"); + std::string signing_key; + std::string key_id; + auto should_cache_key = true; - auto key_url = decoded.get_header_claim("x5u").as_string(); + if (decoded.has_key_id()) { + key_id = decoded.get_key_id(); + auto cached_key = m_cached_keys.get(key_id); + if (cached_key) { + signing_key = cached_key->get(); + should_cache_key = false; + } + } else { + should_cache_key = false; + } - if (key_url.rfind(SECURITY_DYNAMIC_CONFIG(auth_manager->tf_token_url), 0) != 0) { - throw std::runtime_error(fmt::format("key url {} is not trusted", key_url)); + if (signing_key.empty()) { + if (!decoded.has_header_claim("x5u")) throw std::runtime_error("no indication of verification key"); + + auto key_url = decoded.get_header_claim("x5u").as_string(); + + if (key_url.rfind(SECURITY_DYNAMIC_CONFIG(auth_manager->tf_token_url), 0) != 0) { + throw std::runtime_error(fmt::format("key url {} is not trusted", key_url)); + } + signing_key = download_key(key_url); } - const std::string signing_key{download_key(key_url)}; + + if (should_cache_key) { m_cached_keys.put(key_id, signing_key); } + const auto verifier{jwt::verify() .with_issuer(SECURITY_DYNAMIC_CONFIG(auth_manager->issuer)) .allow_algorithm(jwt::algorithm::rs256(signing_key)) diff --git a/src/auth_manager/security_config.fbs b/src/auth_manager/security_config.fbs index e560455b..20cbec5a 100644 --- a/src/auth_manager/security_config.fbs +++ b/src/auth_manager/security_config.fbs @@ -33,6 +33,10 @@ table AuthManager { // ssl verification for the signing key download url verify: bool = true; + + // LRUCache sizes + auth_token_cache_size: uint32 = 2000; + auth_key_cache_size: uint32 = 100; } table SecuritySettings { diff --git a/src/auth_manager/tests/AuthTest.cpp b/src/auth_manager/tests/AuthTest.cpp index 7447a346..79ba44ac 100644 --- a/src/auth_manager/tests/AuthTest.cpp +++ b/src/auth_manager/tests/AuthTest.cpp @@ -210,12 +210,12 @@ TEST_F(AuthTest, trf_allow_valid_token) { EXPECT_EQ(mock_auth_mgr->verify(mock_trf_client.get_token()), AuthVerifyStatus::OK); // use the acces_token saved from the previous call - EXPECT_CALL(*mock_auth_mgr, download_key(_)).Times(1).WillOnce(Return(rsa_pub_key)); + EXPECT_CALL(*mock_auth_mgr, download_key(_)).Times(0); EXPECT_EQ(mock_auth_mgr->verify(mock_trf_client.get_token()), AuthVerifyStatus::OK); // set token to be expired invoking request_with_grant_token mock_trf_client.set_expiry(std::chrono::system_clock::now() - std::chrono::seconds(100)); - EXPECT_CALL(*mock_auth_mgr, download_key(_)).Times(1).WillOnce(Return(rsa_pub_key)); + EXPECT_CALL(*mock_auth_mgr, download_key(_)).Times(0); EXPECT_EQ(mock_auth_mgr->verify(mock_trf_client.get_token()), AuthVerifyStatus::OK); } diff --git a/src/grpc/tests/unit/CMakeLists.txt b/src/grpc/tests/unit/CMakeLists.txt index 1e82a780..bd163d99 100644 --- a/src/grpc/tests/unit/CMakeLists.txt +++ b/src/grpc/tests/unit/CMakeLists.txt @@ -7,7 +7,7 @@ add_executable(auth_test target_link_libraries(auth_test sisl sisl_grpc - pistache::pistache + Pistache::Pistache GTest::gmock ${COMMON_DEPS} ) From 8cc3704dacf6b1a5521ab80e3f2e3525c3ba3660 Mon Sep 17 00:00:00 2001 From: raakella1 <114193113+raakella1@users.noreply.github.com> Date: Wed, 30 Aug 2023 11:36:24 -0700 Subject: [PATCH 3/9] add date to 3rd party (#170) Co-authored-by: Ravi Akella email = raakella@ebay.com --- .github/workflows/build_dependencies.yml | 1 + 3rd_party/date/conandata.yml | 29 +++++ 3rd_party/date/conanfile.py | 140 ++++++++++++++++++++++ 3rd_party/date/patches/0001-fix-uwp.patch | 17 +++ 3rd_party/date/patches/cmake-3.0.0.patch | 14 +++ 3rd_party/date/patches/cmake-3.0.1.patch | 14 +++ 3rd_party/date/patches/cmake.patch | 19 +++ 3rd_party/date/patches/string_view.patch | 13 ++ 8 files changed, 247 insertions(+) create mode 100644 3rd_party/date/conandata.yml create mode 100644 3rd_party/date/conanfile.py create mode 100644 3rd_party/date/patches/0001-fix-uwp.patch create mode 100644 3rd_party/date/patches/cmake-3.0.0.patch create mode 100644 3rd_party/date/patches/cmake-3.0.1.patch create mode 100644 3rd_party/date/patches/cmake.patch create mode 100644 3rd_party/date/patches/string_view.patch diff --git a/.github/workflows/build_dependencies.yml b/.github/workflows/build_dependencies.yml index 93f988f5..693d13f7 100644 --- a/.github/workflows/build_dependencies.yml +++ b/.github/workflows/build_dependencies.yml @@ -106,6 +106,7 @@ jobs: conan export 3rd_party/jemalloc conan export 3rd_party/prerelease_dummy conan export 3rd_party/pistache pistache/cci.20201127@ + conan export 3rd_party/date date/3.0.1@ cached_pkgs=$(ls -1d ~/.conan/data/*/*/*/*/export 2>/dev/null | sed 's,.*data/,,' | cut -d'/' -f1,2 | paste -sd',' - -) echo "::info:: Pre-cached: ${cached_pkgs}" if: ${{ inputs.testing == 'True' || steps.restore-cache.outputs.cache-hit != 'true' }} diff --git a/3rd_party/date/conandata.yml b/3rd_party/date/conandata.yml new file mode 100644 index 00000000..bed2d768 --- /dev/null +++ b/3rd_party/date/conandata.yml @@ -0,0 +1,29 @@ +sources: + "3.0.1": + url: "https://github.com/HowardHinnant/date/archive/refs/tags/v3.0.1.tar.gz" + sha256: "7a390f200f0ccd207e8cff6757e04817c1a0aec3e327b006b7eb451c57ee3538" + "3.0.0": + url: "https://github.com/HowardHinnant/date/archive/refs/tags/v3.0.0.tar.gz" + sha256: "87bba2eaf0ebc7ec539e5e62fc317cb80671a337c1fb1b84cb9e4d42c6dbebe3" + "2.4.1": + url: "https://github.com/HowardHinnant/date/archive/refs/tags/v2.4.1.tar.gz" + sha256: "98907d243397483bd7ad889bf6c66746db0d7d2a39cc9aacc041834c40b65b98" +patches: + "3.0.1": + - patch_file: "patches/cmake-3.0.1.patch" + patch_description: "Disable string view to workaround clang 5 not having it" + patch_type: "portability" + "3.0.0": + - patch_file: "patches/cmake-3.0.0.patch" + patch_description: "Disable string view to workaround clang 5 not having it" + patch_type: "portability" + "2.4.1": + - patch_file: "patches/0001-fix-uwp.patch" + patch_description: "Fix Universal Windows Platform (UWP) unhandled exception support. See https://github.com/microsoft/vcpkg/pull/8151#issuecomment-531175393." + patch_type: "portability" + - patch_file: "patches/cmake.patch" + patch_description: "Add libcurl target for conan compatibility" + patch_type: "conan" + - patch_file: "patches/string_view.patch" + patch_description: "Disable string view to workaround clang 5 not having it" + patch_type: "portability" diff --git a/3rd_party/date/conanfile.py b/3rd_party/date/conanfile.py new file mode 100644 index 00000000..7c597110 --- /dev/null +++ b/3rd_party/date/conanfile.py @@ -0,0 +1,140 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools.files import get, rmdir, apply_conandata_patches, export_conandata_patches, copy +from conan.tools.scm import Version + +import os + +required_conan_version = ">=1.53.0" + + +class DateConan(ConanFile): + name = "date" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/HowardHinnant/date" + description = "A date and time library based on the C++11/14/17 header" + topics = ("datetime", "timezone", "calendar", "time", "iana-database") + license = "MIT" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "header_only": [True, False], + "use_system_tz_db": [True, False], + "use_tz_db_in_dot": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "header_only": False, + "use_system_tz_db": False, + "use_tz_db_in_dot": False, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if self.settings.os in ["iOS", "tvOS", "watchOS", "Android"]: + self.options.use_system_tz_db = True + + def configure(self): + if self.options.shared or self.options.header_only: + self.options.rm_safe("fPIC") + if self.options.header_only: + del self.options.shared + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if not self.options.header_only and not self.options.use_system_tz_db: + self.requires("libcurl/7.86.0") + + def package_id(self): + if self.info.options.header_only: + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ENABLE_DATE_TESTING"] = False + tc.variables["USE_SYSTEM_TZ_DB"] = self.options.use_system_tz_db + tc.variables["USE_TZ_DB_IN_DOT"] = self.options.use_tz_db_in_dot + tc.variables["BUILD_TZ_LIB"] = not self.options.header_only + # workaround for clang 5 not having string_view + if Version(self.version) >= "3.0.0" and self.settings.compiler == "clang" \ + and Version(self.settings.compiler.version) <= "5.0": + tc.cache_variables["DISABLE_STRING_VIEW"] = True + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + if not self.options.header_only: + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + if self.options.header_only: + src = os.path.join(self.source_folder, "include", "date") + dst = os.path.join(self.package_folder, "include", "date") + copy(self, "date.h", dst=dst, src=src) + copy(self, "tz.h", dst=dst, src=src) + copy(self, "ptz.h", dst=dst, src=src) + copy(self, "iso_week.h", dst=dst, src=src) + copy(self, "julian.h", dst=dst, src=src) + copy(self, "islamic.h", dst=dst, src=src) + else: + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "CMake")) + + def package_info(self): + self.cpp_info.set_property("cmake_target_name", "date::date") + # TODO: Remove legacy .names attribute when conan 2.0 is released + self.cpp_info.names["cmake_find_package"] = "date" + self.cpp_info.names["cmake_find_package_multi"] = "date" + + # date-tz + if not self.options.header_only: + self.cpp_info.components["date-tz"].set_property("cmake_target_name", "date::date-tz") + # TODO: Remove legacy .names attribute when conan 2.0 is released + self.cpp_info.components["date-tz"].names["cmake_find_package"] = "date-tz" + self.cpp_info.components["date-tz"].names["cmake_find_package_multi"] = "date-tz" + lib_name = "{}tz".format("date-" if Version(self.version) >= "3.0.0" else "") + self.cpp_info.components["date-tz"].libs = [lib_name] + if self.settings.os == "Linux": + self.cpp_info.components["date-tz"].system_libs.append("pthread") + self.cpp_info.components["date-tz"].system_libs.append("m") + + if not self.options.use_system_tz_db: + self.cpp_info.components["date-tz"].requires.append("libcurl::libcurl") + + if self.options.use_system_tz_db and not self.settings.os == "Windows": + use_os_tzdb = 1 + else: + use_os_tzdb = 0 + + defines = ["USE_OS_TZDB={}".format(use_os_tzdb)] + if self.settings.os == "Windows" and self.options.shared: + defines.append("DATE_USE_DLL=1") + + self.cpp_info.components["date-tz"].defines.extend(defines) + else: + self.cpp_info.defines.append("DATE_HEADER_ONLY") diff --git a/3rd_party/date/patches/0001-fix-uwp.patch b/3rd_party/date/patches/0001-fix-uwp.patch new file mode 100644 index 00000000..f7b5c246 --- /dev/null +++ b/3rd_party/date/patches/0001-fix-uwp.patch @@ -0,0 +1,17 @@ +diff --git a/include/date/date.h b/include/date/date.h +index cb115a9..66d87c2 100644 +--- a/include/date/date.h ++++ b/include/date/date.h +@@ -76,6 +76,12 @@ + # endif + #endif + ++#ifdef _MSC_VER ++# pragma warning(push) ++// warning C4127: conditional expression is constant ++# pragma warning(disable : 4127 4996) ++#endif ++ + namespace date + { + diff --git a/3rd_party/date/patches/cmake-3.0.0.patch b/3rd_party/date/patches/cmake-3.0.0.patch new file mode 100644 index 00000000..583e86e5 --- /dev/null +++ b/3rd_party/date/patches/cmake-3.0.0.patch @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ad74900..ac390a9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -127,6 +127,9 @@ if( BUILD_TZ_LIB ) + target_include_directories( date-tz SYSTEM PRIVATE ${CURL_INCLUDE_DIRS} ) + target_link_libraries( date-tz PRIVATE ${CURL_LIBRARIES} ) + endif( ) ++ if( DISABLE_STRING_VIEW ) ++ target_compile_definitions( date-tz PRIVATE -DHAS_STRING_VIEW=0 -DHAS_DEDUCTION_GUIDES=0 ) ++ endif( ) + endif( ) + + #[===================================================================[ diff --git a/3rd_party/date/patches/cmake-3.0.1.patch b/3rd_party/date/patches/cmake-3.0.1.patch new file mode 100644 index 00000000..8edcb309 --- /dev/null +++ b/3rd_party/date/patches/cmake-3.0.1.patch @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ad74900..ac390a9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -156,6 +156,9 @@ if( BUILD_TZ_LIB ) + target_include_directories( date-tz SYSTEM PRIVATE ${CURL_INCLUDE_DIRS} ) + target_link_libraries( date-tz PRIVATE ${CURL_LIBRARIES} ) + endif( ) ++ if( DISABLE_STRING_VIEW ) ++ target_compile_definitions( date-tz PRIVATE -DHAS_STRING_VIEW=0 -DHAS_DEDUCTION_GUIDES=0 ) ++ endif( ) + endif( ) + + #[===================================================================[ diff --git a/3rd_party/date/patches/cmake.patch b/3rd_party/date/patches/cmake.patch new file mode 100644 index 00000000..3f9df797 --- /dev/null +++ b/3rd_party/date/patches/cmake.patch @@ -0,0 +1,19 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f025a3a..7bc93df 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -57,8 +57,12 @@ else( ) + target_compile_definitions( tz PRIVATE -DHAS_REMOTE_API=1 ) + target_compile_definitions( tz PUBLIC -DUSE_OS_TZDB=0 ) + find_package( CURL REQUIRED ) +- include_directories( SYSTEM ${CURL_INCLUDE_DIRS} ) +- set( OPTIONAL_LIBRARIES ${CURL_LIBRARIES} ) ++ set( OPTIONAL_LIBRARIES CURL::libcurl ) ++endif() ++ ++if( BUILD_SHARED_LIBS ) ++ target_compile_definitions( tz PRIVATE -DDATE_BUILD_DLL=1 ) ++ target_compile_definitions( tz PUBLIC -DDATE_USE_DLL=1 ) + endif( ) + + if( USE_TZ_DB_IN_DOT ) diff --git a/3rd_party/date/patches/string_view.patch b/3rd_party/date/patches/string_view.patch new file mode 100644 index 00000000..008dd04c --- /dev/null +++ b/3rd_party/date/patches/string_view.patch @@ -0,0 +1,13 @@ +diff --git a/include/date/date.h b/include/date/date.h +index cb115a9..23cd05a 100644 +--- a/include/date/date.h ++++ b/include/date/date.h +@@ -31,7 +31,7 @@ + // We did not mean to shout. + + #ifndef HAS_STRING_VIEW +-# if __cplusplus >= 201703 ++# if __cplusplus >= 201703 && __has_include() + # define HAS_STRING_VIEW 1 + # else + # define HAS_STRING_VIEW 0 From 0079b86b5f7a8ec17305c92009861f037ae45626 Mon Sep 17 00:00:00 2001 From: raakella1 <114193113+raakella1@users.noreply.github.com> Date: Fri, 8 Sep 2023 11:13:14 -0700 Subject: [PATCH 4/9] include filesystem header in logging.h (#175) Co-authored-by: Ravi Akella email = raakella@ebay.com --- conanfile.py | 2 +- include/sisl/logging/logging.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/conanfile.py b/conanfile.py index 1d9e80ad..01a148b2 100644 --- a/conanfile.py +++ b/conanfile.py @@ -8,7 +8,7 @@ class SISLConan(ConanFile): name = "sisl" - version = "8.6.4" + version = "8.6.5" homepage = "https://github.com/eBay/sisl" description = "Library for fast data structures, utilities" topics = ("ebay", "components", "core", "efficiency") diff --git a/include/sisl/logging/logging.h b/include/sisl/logging/logging.h index 4dc951c9..66c96bb4 100644 --- a/include/sisl/logging/logging.h +++ b/include/sisl/logging/logging.h @@ -31,6 +31,7 @@ #include #include #include +#include #include #include From 005fc2c9b70319d7fdc1173dddafc118fd1c6a5a Mon Sep 17 00:00:00 2001 From: raakella1 <114193113+raakella1@users.noreply.github.com> Date: Fri, 8 Sep 2023 12:01:37 -0700 Subject: [PATCH 5/9] acquire unique lock for LRU cache get operation (#176) Co-authored-by: Ravi Akella email = raakella@ebay.com --- include/sisl/auth_manager/LRUCache.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/sisl/auth_manager/LRUCache.h b/include/sisl/auth_manager/LRUCache.h index f5eb3cdc..b32bce3f 100644 --- a/include/sisl/auth_manager/LRUCache.h +++ b/include/sisl/auth_manager/LRUCache.h @@ -53,7 +53,8 @@ class LRUCache { } [[nodiscard]] const std::optional< std::reference_wrapper< value_t const > > get(const key_t& key) { - std::shared_lock< std::shared_mutex > l{mtx_}; + // we need unique lock for the splice operation + std::unique_lock< std::shared_mutex > l{mtx_}; auto it = items_map_.find(key); if (it == items_map_.end()) { return std::nullopt; } From a424845d219cd83997494f9cc14d36643fa9b5b9 Mon Sep 17 00:00:00 2001 From: raakella1 <114193113+raakella1@users.noreply.github.com> Date: Mon, 11 Sep 2023 09:29:48 -0700 Subject: [PATCH 6/9] lru get to return a copy rather than ref. Add more lru tests (#177) Co-authored-by: Ravi Akella email = raakella@ebay.com --- include/sisl/auth_manager/LRUCache.h | 4 +- src/auth_manager/CMakeLists.txt | 11 +++ src/auth_manager/auth_manager.cpp | 15 ++- src/auth_manager/tests/LRUCacheTest.cpp | 123 ++++++++++++++++++++++++ 4 files changed, 143 insertions(+), 10 deletions(-) create mode 100644 src/auth_manager/tests/LRUCacheTest.cpp diff --git a/include/sisl/auth_manager/LRUCache.h b/include/sisl/auth_manager/LRUCache.h index b32bce3f..504141d4 100644 --- a/include/sisl/auth_manager/LRUCache.h +++ b/include/sisl/auth_manager/LRUCache.h @@ -52,7 +52,7 @@ class LRUCache { } } - [[nodiscard]] const std::optional< std::reference_wrapper< value_t const > > get(const key_t& key) { + [[nodiscard]] std::optional< value_t > get(const key_t& key) { // we need unique lock for the splice operation std::unique_lock< std::shared_mutex > l{mtx_}; @@ -60,7 +60,7 @@ class LRUCache { if (it == items_map_.end()) { return std::nullopt; } items_list_.splice(items_list_.begin(), items_list_, it->second); - return std::optional(std::cref(it->second->second)); + return std::optional(it->second->second); } bool exists(const key_t& key) const { diff --git a/src/auth_manager/CMakeLists.txt b/src/auth_manager/CMakeLists.txt index ff83dc6d..ee75918d 100644 --- a/src/auth_manager/CMakeLists.txt +++ b/src/auth_manager/CMakeLists.txt @@ -40,3 +40,14 @@ target_link_libraries(test_auth_mgr GTest::gmock ) add_test(NAME AuthManager COMMAND test_auth_mgr) + +add_executable(test_lru_cache) +target_sources(test_lru_cache PRIVATE + tests/LRUCacheTest.cpp + ) +target_link_libraries(test_lru_cache + sisl + ${COMMON_DEPS} + GTest::gmock + ) +add_test(NAME LRUCache COMMAND test_lru_cache) diff --git a/src/auth_manager/auth_manager.cpp b/src/auth_manager/auth_manager.cpp index d50b7e7e..6e083cd4 100644 --- a/src/auth_manager/auth_manager.cpp +++ b/src/auth_manager/auth_manager.cpp @@ -40,16 +40,15 @@ AuthVerifyStatus AuthManager::verify(const std::string& token, std::string& msg) // if we have it in cache, just use it to make the decision auto const token_hash = md5_sum(token); if (auto const ct = m_cached_tokens.get(token_hash); ct) { - auto const& cached_token = ct->get(); - if (cached_token.valid) { + if (ct->valid) { auto now = std::chrono::system_clock::now(); - if (now > cached_token.expires_at + std::chrono::seconds(SECURITY_DYNAMIC_CONFIG(auth_manager->leeway))) { - m_cached_tokens.put( - token_hash, CachedToken{AuthVerifyStatus::UNAUTH, "token expired", false, cached_token.expires_at}); + if (now > ct->expires_at + std::chrono::seconds(SECURITY_DYNAMIC_CONFIG(auth_manager->leeway))) { + m_cached_tokens.put(token_hash, + CachedToken{AuthVerifyStatus::UNAUTH, "token expired", false, ct->expires_at}); } } - msg = cached_token.msg; - return cached_token.response_status; + msg = ct->msg; + return ct->response_status; } // not found in cache @@ -103,7 +102,7 @@ void AuthManager::verify_decoded(const jwt::decoded_jwt& decoded) const { key_id = decoded.get_key_id(); auto cached_key = m_cached_keys.get(key_id); if (cached_key) { - signing_key = cached_key->get(); + signing_key = *cached_key; should_cache_key = false; } } else { diff --git a/src/auth_manager/tests/LRUCacheTest.cpp b/src/auth_manager/tests/LRUCacheTest.cpp new file mode 100644 index 00000000..250b8647 --- /dev/null +++ b/src/auth_manager/tests/LRUCacheTest.cpp @@ -0,0 +1,123 @@ +#include "sisl/auth_manager/LRUCache.h" +#include +#include +#include +#include + +SISL_OPTIONS_ENABLE(logging) + +namespace sisl::testing { + +using namespace ::testing; + +TEST(LRUTest, basic) { + auto lru = LRUCache< int, int >(3); + + EXPECT_EQ(0, lru.size()); + EXPECT_FALSE(lru.exists(1)); + + lru.put(0, 0); + lru.put(1, 1); + EXPECT_EQ(2, lru.size()); + EXPECT_TRUE(lru.exists(0)); + EXPECT_TRUE(lru.exists(1)); + + lru.put(2, 2); + + // this will evict 0 from cache + lru.put(3, 3); + + EXPECT_EQ(3, lru.size()); + + EXPECT_FALSE(lru.exists(0)); + EXPECT_TRUE(lru.exists(1)); + EXPECT_TRUE(lru.exists(2)); + EXPECT_TRUE(lru.exists(3)); + + // current elements in cache are 3, 2, 1 + // let's re-insert 1, this will move 1 to the head of cache + lru.put(1, 1); + + // insert another new key, this will evict 2 + lru.put(4, 4); + + EXPECT_EQ(3, lru.size()); + EXPECT_FALSE(lru.exists(2)); + EXPECT_TRUE(lru.exists(1)); + EXPECT_TRUE(lru.exists(3)); + EXPECT_TRUE(lru.exists(4)); +} + +TEST(LRUTest, get) { + auto lru = LRUCache< std::string, std::string >(3); + + lru.put("key1", "value1"); + EXPECT_EQ("value1", lru.get("key1")); + auto v = lru.get("no-such-key"); + EXPECT_EQ(std::nullopt, v); + + // use variable as key, to test the perfect forwarding + std::string key{"key2"}; + std::string value{"value2"}; + lru.put(key, value); + ASSERT_TRUE(lru.get(key)); + EXPECT_EQ(value, lru.get(key)); +} + +TEST(LRUTest, stress_test) { + struct val { + std::string s; + }; + auto p_get = std::make_shared< std::promise< void > >(); + auto f_get = p_get->get_future(); + auto p_put = std::make_shared< std::promise< void > >(); + auto f_put = p_put->get_future(); + static constexpr size_t iter = 3000; + auto lru = LRUCache< int, val >(2000); + auto putter = [&lru, p_put](int const i) { + lru.put(i, val{std::to_string(i)}); + if (i == iter) { p_put->set_value(); } + }; + auto getter = [&lru, p_get](int const i) { + if (lru.exists(i)) { + auto v = lru.get(i); + EXPECT_EQ(v->s, std::to_string(i)); + } + if (i == iter) { p_get->set_value(); } + }; + for (size_t i = 1; i <= iter; i++) { + std::thread(putter, i).detach(); + } + f_put.get(); + + for (size_t i = 1; i <= iter; i++) { + std::thread(getter, i).detach(); + } + + f_get.get(); + auto p_get1 = std::make_shared< std::promise< void > >(); + auto f_get1 = p_get1->get_future(); + static constexpr int single_key = 10000; + lru.put(single_key, val{std::to_string(single_key)}); + for (size_t i = 1; i <= 5000; i++) { + std::thread( + [&lru, p_get1](int const i) { + if (lru.exists(single_key)) { + auto v = lru.get(single_key); + EXPECT_EQ(v->s, std::to_string(single_key)); + } + if (i == 5000) { p_get1->set_value(); } + }, + i) + .detach(); + } + f_get1.get(); +} + +} // namespace sisl::testing + +int main(int argc, char* argv[]) { + testing::InitGoogleMock(&argc, argv); + SISL_OPTIONS_LOAD(argc, argv, logging) + return RUN_ALL_TESTS(); +} \ No newline at end of file From cbc315f0850009aa6707c82d54bda879fc051834 Mon Sep 17 00:00:00 2001 From: raakella1 <114193113+raakella1@users.noreply.github.com> Date: Mon, 11 Sep 2023 10:23:23 -0700 Subject: [PATCH 7/9] disable stress test (#178) Co-authored-by: Ravi Akella email = raakella@ebay.com --- src/auth_manager/tests/LRUCacheTest.cpp | 50 ------------------------- 1 file changed, 50 deletions(-) diff --git a/src/auth_manager/tests/LRUCacheTest.cpp b/src/auth_manager/tests/LRUCacheTest.cpp index 250b8647..cdb901f4 100644 --- a/src/auth_manager/tests/LRUCacheTest.cpp +++ b/src/auth_manager/tests/LRUCacheTest.cpp @@ -64,56 +64,6 @@ TEST(LRUTest, get) { EXPECT_EQ(value, lru.get(key)); } -TEST(LRUTest, stress_test) { - struct val { - std::string s; - }; - auto p_get = std::make_shared< std::promise< void > >(); - auto f_get = p_get->get_future(); - auto p_put = std::make_shared< std::promise< void > >(); - auto f_put = p_put->get_future(); - static constexpr size_t iter = 3000; - auto lru = LRUCache< int, val >(2000); - auto putter = [&lru, p_put](int const i) { - lru.put(i, val{std::to_string(i)}); - if (i == iter) { p_put->set_value(); } - }; - auto getter = [&lru, p_get](int const i) { - if (lru.exists(i)) { - auto v = lru.get(i); - EXPECT_EQ(v->s, std::to_string(i)); - } - if (i == iter) { p_get->set_value(); } - }; - for (size_t i = 1; i <= iter; i++) { - std::thread(putter, i).detach(); - } - f_put.get(); - - for (size_t i = 1; i <= iter; i++) { - std::thread(getter, i).detach(); - } - - f_get.get(); - auto p_get1 = std::make_shared< std::promise< void > >(); - auto f_get1 = p_get1->get_future(); - static constexpr int single_key = 10000; - lru.put(single_key, val{std::to_string(single_key)}); - for (size_t i = 1; i <= 5000; i++) { - std::thread( - [&lru, p_get1](int const i) { - if (lru.exists(single_key)) { - auto v = lru.get(single_key); - EXPECT_EQ(v->s, std::to_string(single_key)); - } - if (i == 5000) { p_get1->set_value(); } - }, - i) - .detach(); - } - f_get1.get(); -} - } // namespace sisl::testing int main(int argc, char* argv[]) { From 801b1163fac3c5f93ecbfea057185c115f496f9c Mon Sep 17 00:00:00 2001 From: raakella1 <114193113+raakella1@users.noreply.github.com> Date: Thu, 4 Jan 2024 10:11:17 -0800 Subject: [PATCH 8/9] remove file from the map regardless of the inotify result during remove watch (#201) Co-authored-by: Ravi Nagarjun Akella --- conanfile.py | 2 +- src/file_watcher/file_watcher.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/conanfile.py b/conanfile.py index 01a148b2..9a19b678 100644 --- a/conanfile.py +++ b/conanfile.py @@ -8,7 +8,7 @@ class SISLConan(ConanFile): name = "sisl" - version = "8.6.5" + version = "8.6.6" homepage = "https://github.com/eBay/sisl" description = "Library for fast data structures, utilities" topics = ("ebay", "components", "core", "efficiency") diff --git a/src/file_watcher/file_watcher.cpp b/src/file_watcher/file_watcher.cpp index 05145ba1..94989052 100644 --- a/src/file_watcher/file_watcher.cpp +++ b/src/file_watcher/file_watcher.cpp @@ -119,9 +119,11 @@ bool FileWatcher::unregister_listener(const std::string& file_path, const std::s } bool FileWatcher::remove_watcher(FileInfo& file_info) { - if (auto err = inotify_rm_watch(m_inotify_fd, file_info.m_wd); err != 0) { return false; } + bool success = true; + if (auto err = inotify_rm_watch(m_inotify_fd, file_info.m_wd); err != 0) { success = false; } + // remove the file from the map regardless of the inotify_rm_watch result m_files.erase(file_info.m_filepath); - return true; + return success; } bool FileWatcher::stop() { From 537e8deccd85b8be818a986b90023e6a11bef787 Mon Sep 17 00:00:00 2001 From: raakella1 <114193113+raakella1@users.noreply.github.com> Date: Wed, 10 Jan 2024 09:10:50 -0800 Subject: [PATCH 9/9] remove -u option from conan create to fix build conflict in libcurl (#202) Co-authored-by: Ravi Nagarjun Akella --- .jenkins/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.jenkins/Jenkinsfile b/.jenkins/Jenkinsfile index 05d762cf..bdb80554 100644 --- a/.jenkins/Jenkinsfile +++ b/.jenkins/Jenkinsfile @@ -129,7 +129,7 @@ pipeline { if (("${env.BRANCH_NAME}" =~ /PR-/) && ("$BUILD_TYPE" == "debug")) { sh "echo Skipping debug build for PR branch" } else { - sh "conan create -u ${BUILD_MISSING} -o ${PROJECT}:malloc_impl=${ALLOC} -o ${PROJECT}:prerelease=${PRERELEASE} -o ${PROJECT}:sanitize=${SANITIZE} -pr ${BUILD_PROFILE} . ${PROJECT}/${TAG}" + sh "conan create ${BUILD_MISSING} -o ${PROJECT}:malloc_impl=${ALLOC} -o ${PROJECT}:prerelease=${PRERELEASE} -o ${PROJECT}:sanitize=${SANITIZE} -pr ${BUILD_PROFILE} . ${PROJECT}/${TAG}" } } }