This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new bb5002434f Fixes some build issues around cripts (#10592)
bb5002434f is described below

commit bb5002434fd6368286e4c749d0edf8277237f3e3
Author: Leif Hedstrom <[email protected]>
AuthorDate: Thu Oct 12 14:26:41 2023 -0600

    Fixes some build issues around cripts (#10592)
---
 include/cripts/Instance.hpp | 2 +-
 src/cripts/CMakeLists.txt   | 4 ++--
 src/cripts/Instance.cc      | 1 -
 src/cripts/Lulu.cc          | 4 +---
 src/cripts/Matcher.cc       | 1 -
 5 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/include/cripts/Instance.hpp b/include/cripts/Instance.hpp
index 043518cf0a..e11c4a9dc1 100644
--- a/include/cripts/Instance.hpp
+++ b/include/cripts/Instance.hpp
@@ -80,7 +80,7 @@ public:
   [[nodiscard]] bool
   debugOn() const
   {
-    return (diags_on_for_plugins && TSIsDebugTagSet(plugin_debug_tag.c_str()));
+    return dbg_ctl_cript.on();
   }
 
   void
diff --git a/src/cripts/CMakeLists.txt b/src/cripts/CMakeLists.txt
index d3cf4c18b4..38d99a9730 100644
--- a/src/cripts/CMakeLists.txt
+++ b/src/cripts/CMakeLists.txt
@@ -23,12 +23,12 @@ find_package(fmt 8.1 REQUIRED)
 pkg_check_modules(PCRE2 REQUIRED IMPORTED_TARGET libpcre2-8)
 
 # The source files, globbed so we can drop in local / custom Bundles and 
extensions.
-file(GLOB CPP_FILES ${PROJECT_SOURCE_DIR}/src/cripts/*.cc 
${PROJECT_SOURCE_DIR}/src/cripts/Bundles/*.cc)
+file(GLOB CPP_FILES ${PROJECT_SOURCE_DIR}/src/cripts/*.cc 
${PROJECT_SOURCE_DIR}/src/cripts/*/*.cc)
 
 add_library(cripts SHARED ${CPP_FILES})
 add_library(ts::cripts ALIAS cripts)
 
-target_link_libraries(cripts fmt::fmt PkgConfig::PCRE2)
+target_link_libraries(cripts libswoc fmt::fmt PkgConfig::PCRE2)
 target_include_directories(cripts PRIVATE
     ${PROJECT_SOURCE_DIR}
     ${PROJECT_SOURCE_DIR}/proxy
diff --git a/src/cripts/Instance.cc b/src/cripts/Instance.cc
index b4e08eb0d3..aed923587e 100644
--- a/src/cripts/Instance.cc
+++ b/src/cripts/Instance.cc
@@ -50,7 +50,6 @@ Cript::Instance::initialize(int argc, char *argv[], const 
char *filename)
   }
 
   dbg_ctl_cript.set(plugin_debug_tag.c_str());
-  TSDebug("Cript", "Switching instance debug tag to %s", 
plugin_debug_tag.c_str());
 }
 
 #include <iostream>
diff --git a/src/cripts/Lulu.cc b/src/cripts/Lulu.cc
index d9172ad945..b83b41d642 100644
--- a/src/cripts/Lulu.cc
+++ b/src/cripts/Lulu.cc
@@ -33,8 +33,6 @@ const Cript::string maxMindDBPath = CRIPTS_MAXMIND_DB;
 void
 global_initialization()
 {
-  TSDebug("Cript", "Initializing the Cript library, this should only happen 
once!");
-
   std::srand(std::time(nullptr) * getpid());
 
 #if CRIPTS_HAS_MAXMIND
@@ -42,7 +40,7 @@ global_initialization()
 
   int status = MMDB_open(maxMindDBPath.c_str(), MMDB_MODE_MMAP, gMaxMindDB);
   if (MMDB_SUCCESS != status) {
-    TSDebug("Cript", "Cannot open %s - %s", maxMindDBPath.c_str(), 
MMDB_strerror(status));
+    TSError("[Cripts] Cannot open %s - %s", maxMindDBPath.c_str(), 
MMDB_strerror(status));
     delete gMaxMindDB;
     gMaxMindDB = nullptr;
     return;
diff --git a/src/cripts/Matcher.cc b/src/cripts/Matcher.cc
index 1af63ffbc7..521d0b755f 100644
--- a/src/cripts/Matcher.cc
+++ b/src/cripts/Matcher.cc
@@ -61,7 +61,6 @@ Matcher::PCRE::add(Cript::string_view regex, uint32_t 
options, bool jit)
         TSReleaseAssert(!"Failed to JIT compile regex");
       }
     }
-    TSDebug("Cripts", "Adding regex: %.*s", (int)regex.length(), regex.data());
     _regexes.push_back(Matcher::PCRE::Regex{regex, re});
   }
 }

Reply via email to