Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package re2 for openSUSE:Factory checked in at 2023-03-08 14:51:56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/re2 (Old) and /work/SRC/openSUSE:Factory/.re2.new.31432 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "re2" Wed Mar 8 14:51:56 2023 rev:51 rq:1069909 version:MACRO Changes: -------- --- /work/SRC/openSUSE:Factory/re2/re2.changes 2023-02-07 18:47:53.866748792 +0100 +++ /work/SRC/openSUSE:Factory/.re2.new.31432/re2.changes 2023-03-08 14:51:57.694476410 +0100 @@ -1,0 +2,6 @@ +Tue Mar 7 11:47:59 UTC 2023 - Andreas Stieger <andreas.stie...@gmx.de> + +- update to 2023-03-01: + * changes for other platforms + +------------------------------------------------------------------- Old: ---- re2-2023-02-01.tar.gz New: ---- re2-2023-03-01.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ re2.spec ++++++ --- /var/tmp/diff_new_pack.kZIL8S/_old 2023-03-08 14:51:58.158478936 +0100 +++ /var/tmp/diff_new_pack.kZIL8S/_new 2023-03-08 14:51:58.162478958 +0100 @@ -16,7 +16,7 @@ # -%global longver 2023-02-01 +%global longver 2023-03-01 %global shortver %(echo %{longver}|sed 's|-||g') %define libname libre2-10 Name: re2 ++++++ re2-2023-02-01.tar.gz -> re2-2023-03-01.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/re2-2023-02-01/CMakeLists.txt new/re2-2023-03-01/CMakeLists.txt --- old/re2-2023-02-01/CMakeLists.txt 2023-01-30 21:19:18.000000000 +0100 +++ new/re2-2023-03-01/CMakeLists.txt 2023-02-20 19:50:47.000000000 +0100 @@ -17,6 +17,11 @@ # For historical reasons, this is just "USEPCRE", not "RE2_USE_PCRE". option(USEPCRE "build against PCRE for testing and benchmarking" OFF) +# See https://groups.google.com/g/re2-dev/c/P6_NM0YIWvA for details. +# This has no effect unless RE2 is being built for an Apple platform +# such as macOS or iOS. +option(RE2_BUILD_FRAMEWORK "build RE2 as a framework" OFF) + # CMake seems to have no way to enable/disable testing per subproject, # so we provide an option similar to BUILD_TESTING, but just for RE2. option(RE2_BUILD_TESTING "enable testing for RE2" ON) @@ -93,12 +98,29 @@ util/strutil.cc ) +set(RE2_HEADERS + re2/filtered_re2.h + re2/re2.h + re2/set.h + re2/stringpiece.h + ) + add_library(re2 ${RE2_SOURCES}) target_compile_features(re2 PUBLIC cxx_std_11) target_include_directories(re2 PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>) +# CMake gives "set_target_properties called with incorrect number of arguments." +# errors if we don't quote ${RE2_HEADERS}, so quote it despite prevailing style. +set_target_properties(re2 PROPERTIES PUBLIC_HEADER "${RE2_HEADERS}") set_target_properties(re2 PROPERTIES SOVERSION ${SONAME} VERSION ${SONAME}.0.0) add_library(re2::re2 ALIAS re2) +if(APPLE AND RE2_BUILD_FRAMEWORK) + set_target_properties(re2 PROPERTIES + FRAMEWORK TRUE + FRAMEWORK_VERSION A + MACOSX_FRAMEWORK_IDENTIFIER com.googlesource.code.re2) +endif() + if(UNIX) target_link_libraries(re2 PUBLIC Threads::Threads) endif() @@ -165,20 +187,13 @@ endforeach() endif() -set(RE2_HEADERS - re2/filtered_re2.h - re2/re2.h - re2/set.h - re2/stringpiece.h - ) - -install(FILES ${RE2_HEADERS} - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/re2) install(TARGETS re2 EXPORT re2Targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/re2 INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) install(EXPORT re2Targets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/re2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/re2-2023-02-01/re2/fuzzing/re2_fuzzer.cc new/re2-2023-03-01/re2/fuzzing/re2_fuzzer.cc --- old/re2-2023-02-01/re2/fuzzing/re2_fuzzer.cc 2023-01-30 21:19:18.000000000 +0100 +++ new/re2-2023-03-01/re2/fuzzing/re2_fuzzer.cc 2023-02-20 19:50:47.000000000 +0100 @@ -9,8 +9,10 @@ #include <string> #include <vector> +#include "re2/filtered_re2.h" #include "re2/re2.h" #include "re2/regexp.h" +#include "re2/set.h" #include "re2/walker-inl.h" using re2::StringPiece; @@ -96,7 +98,7 @@ }; void TestOneInput(StringPiece pattern, const RE2::Options& options, - StringPiece text) { + RE2::Anchor anchor, StringPiece text) { // Crudely limit the use of ., \p, \P, \d, \D, \s, \S, \w and \W. // Otherwise, we will waste time on inputs that have long runs of various // character classes. The fuzzer has shown itself to be easily capable of @@ -209,6 +211,29 @@ dummy += re.NamedCapturingGroups().size(); dummy += re.CapturingGroupNames().size(); dummy += RE2::QuoteMeta(pattern).size(); + + RE2::Set set(options, anchor); + int index = set.Add(pattern, /*error=*/NULL); // -1 on error + if (index != -1 && set.Compile()) { + std::vector<int> matches; + set.Match(text, &matches); + } + + re2::FilteredRE2 filter; + index = -1; // not clobbered on error + filter.Add(pattern, options, &index); + if (index != -1) { + std::vector<std::string> atoms; + filter.Compile(&atoms); + // Pretend that all atoms match, which + // triggers the AND-OR tree maximally. + std::vector<int> matched_atoms; + matched_atoms.reserve(atoms.size()); + for (size_t i = 0; i < atoms.size(); ++i) + matched_atoms.push_back(static_cast<int>(i)); + std::vector<int> matches; + filter.AllMatches(text, matched_atoms, &matches); + } } // Entry point for libFuzzer. @@ -242,9 +267,17 @@ options.set_word_boundary(fdp.ConsumeBool()); options.set_one_line(fdp.ConsumeBool()); + // ConsumeEnum<RE2::Anchor>() would require RE2::Anchor to specify + // kMaxValue, so just use PickValueInArray<RE2::Anchor>() instead. + RE2::Anchor anchor = fdp.PickValueInArray<RE2::Anchor>({ + RE2::UNANCHORED, + RE2::ANCHOR_START, + RE2::ANCHOR_BOTH, + }); + std::string pattern = fdp.ConsumeRandomLengthString(999); std::string text = fdp.ConsumeRandomLengthString(999); - TestOneInput(pattern, options, text); + TestOneInput(pattern, options, anchor, text); return 0; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/re2-2023-02-01/re2/re2.h new/re2-2023-03-01/re2/re2.h --- old/re2-2023-02-01/re2/re2.h 2023-01-30 21:19:18.000000000 +0100 +++ new/re2-2023-03-01/re2/re2.h 2023-02-20 19:50:47.000000000 +0100 @@ -591,7 +591,7 @@ // Replace(). E.g. if rewrite == "foo \\2,\\1", returns 2. static int MaxSubmatch(const StringPiece& rewrite); - // Append the "rewrite" string, with backslash subsitutions from "vec", + // Append the "rewrite" string, with backslash substitutions from "vec", // to string "out". // Returns true on success. This method can fail because of a malformed // rewrite string. CheckRewriteString guarantees that the rewrite will diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/re2-2023-02-01/util/fuzz.cc new/re2-2023-03-01/util/fuzz.cc --- old/re2-2023-02-01/util/fuzz.cc 2023-01-30 21:19:18.000000000 +0100 +++ new/re2-2023-03-01/util/fuzz.cc 2023-02-20 19:50:47.000000000 +0100 @@ -10,12 +10,12 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size); int main(int argc, char** argv) { - uint8_t data[32]; - for (int i = 0; i < 32; i++) { - for (int j = 0; j < 32; j++) { + uint8_t data[4096]; + for (int i = 0; i < 4096; i++) { + for (int j = 0; j < 4096; j++) { data[j] = random() & 0xFF; } - LLVMFuzzerTestOneInput(data, 32); + LLVMFuzzerTestOneInput(data, 4096); } return 0; }