From b8ddadd4109bc58b72b311d9d03d265079949df8 Mon Sep 17 00:00:00 2001 From: Rosario Pulella Date: Fri, 6 Nov 2026 15:03:43 -0500 Subject: [PATCH 01/16] libigt2 1.9.0 -> 1.9.5 --- build.zig.zon | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.zig.zon b/build.zig.zon index 738dab3..c4e0840 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -5,9 +5,9 @@ .fingerprint = 0x7f0051374dea2cba, .dependencies = .{ .libgit2 = .{ - .version = "1.9.0", - .url = "https://github.com/libgit2/libgit2/archive/refs/tags/v1.9.0.tar.gz", - .hash = "N-V-__8AAJbmLwHHxHDWkz0i6WIR6FpNe6tXSLzaPuWtvBBg", + .version = "1.9.5", + .url = "https://github.com/libgit2/libgit2/archive/refs/tags/v1.9.5.tar.gz", + .hash = "N-V-__8AAL42NgFNPhVK1LtsZzl90Lnp-y3YLV_UFKSRzDzj", }, .openssl = .{ .url = "git+https://github.com/allyourcodebase/openssl.git#0ac677650d43eadf669067d050992118b13338d2", From 2f342bd8c9325e3e07bb27bb54f98daa3599c119 Mon Sep 17 00:00:00 2001 From: Rosario Pulella Date: Fri, 6 Nov 2026 15:03:43 -0500 Subject: [PATCH 02/16] Point to pcre2 dir --- build.zig | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build.zig b/build.zig index 2041fb7..d829e43 100644 --- a/build.zig +++ b/build.zig @@ -289,7 +289,7 @@ pub fn build(b: *std.Build) !void { .link_libc = true, }); pcre.addConfigHeader(b.addConfigHeader( - .{ .style = .{ .cmake = libgit_src.path("deps/pcre/config.h.in") } }, + .{ .style = .{ .cmake = libgit_src.path("deps/pcre2/config.h.in") } }, .{ .SUPPORT_PCRE8 = 1, .PCRE_LINK_SIZE = 2, @@ -303,9 +303,9 @@ pub fn build(b: *std.Build) !void { .PCREGREP_BUFSIZE = null, }, )); - pcre.addIncludePath(libgit_src.path("deps/pcre")); + pcre.addIncludePath(libgit_src.path("deps/pcre2")); pcre.addCSourceFiles(.{ - .root = libgit_src.path("deps/pcre"), + .root = libgit_src.path("deps/pcre2"), .files = &sources.pcre, .flags = &.{ "-Wno-unused-function", @@ -314,7 +314,7 @@ pub fn build(b: *std.Build) !void { }, }); - mod.addIncludePath(libgit_src.path("deps/pcre")); + mod.addIncludePath(libgit_src.path("deps/pcre2")); mod.linkLibrary(b.addLibrary(.{ .name = "pcre", .linkage = .static, @@ -489,7 +489,7 @@ pub fn build(b: *std.Build) !void { runner.addIncludePath(zlib_includes); runner.addIncludePath(libgit_src.path("deps/xdiff")); - runner.addIncludePath(libgit_src.path("deps/pcre")); + runner.addIncludePath(libgit_src.path("deps/pcre2")); maybeAddTlsIncludes(runner, tls_dep, tls_backend); runner.linkLibrary(lib); From 9668349f88f9ac4b44968d80df0503d8e4c54167 Mon Sep 17 00:00:00 2001 From: Rosario Pulella Date: Wed, 11 Nov 2026 21:09:25 -0500 Subject: [PATCH 03/16] Update deps/pcre sources --- build/sources.zon | 54 +++++++++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 23 deletions(-) diff --git a/build/sources.zon b/build/sources.zon index 5c728a2..4035291 100644 --- a/build/sources.zon +++ b/build/sources.zon @@ -202,29 +202,37 @@ // deps/pcre .pcre = .{ - "pcre_byte_order.c", - "pcre_chartables.c", - "pcre_compile.c", - "pcre_config.c", - "pcre_dfa_exec.c", - "pcre_exec.c", - "pcre_fullinfo.c", - "pcre_get.c", - "pcre_globals.c", - "pcre_jit_compile.c", - "pcre_maketables.c", - "pcre_newline.c", - "pcre_ord2utf8.c", - "pcre_printint.c", - "pcre_refcount.c", - "pcre_string_utils.c", - "pcre_study.c", - "pcre_tables.c", - "pcre_ucd.c", - "pcre_valid_utf8.c", - "pcre_version.c", - "pcre_xclass.c", - "pcreposix.c", + "pcre2_auto_possess.c", + "pcre2_chartables.c", + "pcre2_chkdint.c", + "pcre2_compile.c", + "pcre2_compile_cgroup.c", + "pcre2_compile_class.c", + "pcre2_config.c", + "pcre2_context.c", + "pcre2_convert.c", + "pcre2_dfa_match.c", + "pcre2_error.c", + "pcre2_extuni.c", + "pcre2_find_bracket.c", + "pcre2_fuzzsupport.c", + "pcre2_maketables.c", + "pcre2_match.c", + "pcre2_match_data.c", + "pcre2_match_next.c", + "pcre2_newline.c", + "pcre2_ord2utf.c", + "pcre2_pattern_info.c", + "pcre2_script_run.c", + "pcre2_serialize.c", + "pcre2_string_utils.c", + "pcre2_study.c", + "pcre2_substitute.c", + "pcre2_substring.c", + "pcre2_tables.c", + "pcre2_ucd.c", + "pcre2_valid_utf.c", + "pcre2_xclass.c", }, .xdiff = .{ From ef2792fed8124a4c4de339b3166091db4dc54078 Mon Sep 17 00:00:00 2001 From: Rosario Pulella Date: Fri, 6 Nov 2026 15:26:10 -0500 Subject: [PATCH 04/16] Rename trivial PRCE macros --- build.zig | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build.zig b/build.zig index d829e43..bbba0d6 100644 --- a/build.zig +++ b/build.zig @@ -292,15 +292,15 @@ pub fn build(b: *std.Build) !void { .{ .style = .{ .cmake = libgit_src.path("deps/pcre2/config.h.in") } }, .{ .SUPPORT_PCRE8 = 1, - .PCRE_LINK_SIZE = 2, - .PCRE_PARENS_NEST_LIMIT = 250, - .PCRE_MATCH_LIMIT = 10000000, + .PCRE2_LINK_SIZE = 2, + .PCRE2_PARENS_NEST_LIMIT = 250, + .PCRE2_MATCH_LIMIT = 10000000, .PCRE_MATCH_LIMIT_RECURSION = "MATCH_LIMIT", - .NEWLINE = '\n', + .NEWLINE_DEFAULT = '\n', .NO_RECURSE = 1, .PCRE_POSIX_MALLOC_THRESHOLD = 10, .BSR_ANYCRLF = 0, - .PCREGREP_BUFSIZE = null, + .PCRE2GREP_BUFSIZE = null, }, )); pcre.addIncludePath(libgit_src.path("deps/pcre2")); From d23a8446a6862a0c9fee22204cb544474c0a4efe Mon Sep 17 00:00:00 2001 From: Rosario Pulella Date: Fri, 6 Nov 2026 15:26:10 -0500 Subject: [PATCH 05/16] PCRE_MATCH_LIMIT_RECURSION -> PCRE_MATCH_LIMIT_DEPTH --- build.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.zig b/build.zig index bbba0d6..d4a5083 100644 --- a/build.zig +++ b/build.zig @@ -295,7 +295,7 @@ pub fn build(b: *std.Build) !void { .PCRE2_LINK_SIZE = 2, .PCRE2_PARENS_NEST_LIMIT = 250, .PCRE2_MATCH_LIMIT = 10000000, - .PCRE_MATCH_LIMIT_RECURSION = "MATCH_LIMIT", + .PCRE2_MATCH_LIMIT_DEPTH = "MATCH_LIMIT", .NEWLINE_DEFAULT = '\n', .NO_RECURSE = 1, .PCRE_POSIX_MALLOC_THRESHOLD = 10, From 613fbb4c8978bd7fed7d886a2f3f65d84f055489 Mon Sep 17 00:00:00 2001 From: Rosario Pulella Date: Fri, 6 Nov 2026 15:26:10 -0500 Subject: [PATCH 06/16] pcre: Remove unused macro --- build.zig | 1 - 1 file changed, 1 deletion(-) diff --git a/build.zig b/build.zig index d4a5083..49d4a7e 100644 --- a/build.zig +++ b/build.zig @@ -297,7 +297,6 @@ pub fn build(b: *std.Build) !void { .PCRE2_MATCH_LIMIT = 10000000, .PCRE2_MATCH_LIMIT_DEPTH = "MATCH_LIMIT", .NEWLINE_DEFAULT = '\n', - .NO_RECURSE = 1, .PCRE_POSIX_MALLOC_THRESHOLD = 10, .BSR_ANYCRLF = 0, .PCRE2GREP_BUFSIZE = null, From 136a47bb8ce4b6b250383d905ad2284821831b0c Mon Sep 17 00:00:00 2001 From: Rosario Pulella Date: Fri, 6 Nov 2026 15:26:10 -0500 Subject: [PATCH 07/16] Default value and removed --- build.zig | 1 - 1 file changed, 1 deletion(-) diff --git a/build.zig b/build.zig index 49d4a7e..3b73764 100644 --- a/build.zig +++ b/build.zig @@ -297,7 +297,6 @@ pub fn build(b: *std.Build) !void { .PCRE2_MATCH_LIMIT = 10000000, .PCRE2_MATCH_LIMIT_DEPTH = "MATCH_LIMIT", .NEWLINE_DEFAULT = '\n', - .PCRE_POSIX_MALLOC_THRESHOLD = 10, .BSR_ANYCRLF = 0, .PCRE2GREP_BUFSIZE = null, }, From 341dd715b84291684128e52ccf6ab33ad246b2a3 Mon Sep 17 00:00:00 2001 From: Rosario Pulella Date: Fri, 6 Nov 2026 15:26:10 -0500 Subject: [PATCH 08/16] pcre: Use defaults from PCRE2Project's build.zig file https://github.com/PCRE2Project/pcre2/blob/3a0e7c4c47603294d17974759f9d497ea90274c3/build.zig#L1 --- build.zig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build.zig b/build.zig index 3b73764..11f6018 100644 --- a/build.zig +++ b/build.zig @@ -292,6 +292,8 @@ pub fn build(b: *std.Build) !void { .{ .style = .{ .cmake = libgit_src.path("deps/pcre2/config.h.in") } }, .{ .SUPPORT_PCRE8 = 1, + .PCRE2_HEAP_LIMIT = 20000000, + .PCRE2_MAX_VARLOOKBEHIND = 255, .PCRE2_LINK_SIZE = 2, .PCRE2_PARENS_NEST_LIMIT = 250, .PCRE2_MATCH_LIMIT = 10000000, @@ -299,6 +301,7 @@ pub fn build(b: *std.Build) !void { .NEWLINE_DEFAULT = '\n', .BSR_ANYCRLF = 0, .PCRE2GREP_BUFSIZE = null, + .PCRE2GREP_MAX_BUFSIZE = 1048576, }, )); pcre.addIncludePath(libgit_src.path("deps/pcre2")); From 148eb8a6c1f2c71b2a33934c72ca5d2f333a81df Mon Sep 17 00:00:00 2001 From: Rosario Pulella Date: Wed, 11 Nov 2026 21:09:25 -0500 Subject: [PATCH 09/16] WIP: PCRE8 --- build.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.zig b/build.zig index 11f6018..99d9da6 100644 --- a/build.zig +++ b/build.zig @@ -291,7 +291,7 @@ pub fn build(b: *std.Build) !void { pcre.addConfigHeader(b.addConfigHeader( .{ .style = .{ .cmake = libgit_src.path("deps/pcre2/config.h.in") } }, .{ - .SUPPORT_PCRE8 = 1, + .SUPPORT_PCRE2_8 = 1, .PCRE2_HEAP_LIMIT = 20000000, .PCRE2_MAX_VARLOOKBEHIND = 255, .PCRE2_LINK_SIZE = 2, From a36c59738ae9a9027673e4c59051e6c1d0fc306a Mon Sep 17 00:00:00 2001 From: Rosario Pulella Date: Wed, 11 Nov 2026 21:09:25 -0500 Subject: [PATCH 10/16] WIP: From PCRE2Project's build.zig file --- build.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.zig b/build.zig index 99d9da6..c9832e1 100644 --- a/build.zig +++ b/build.zig @@ -300,7 +300,7 @@ pub fn build(b: *std.Build) !void { .PCRE2_MATCH_LIMIT_DEPTH = "MATCH_LIMIT", .NEWLINE_DEFAULT = '\n', .BSR_ANYCRLF = 0, - .PCRE2GREP_BUFSIZE = null, + .PCRE2GREP_BUFSIZE = 20480, .PCRE2GREP_MAX_BUFSIZE = 1048576, }, )); From 2e1eacf67652aa83e549b2c83ff6d34bbe2ad121 Mon Sep 17 00:00:00 2001 From: Rosario Pulella Date: Wed, 11 Nov 2026 21:09:25 -0500 Subject: [PATCH 11/16] WIP: From PCRE2Project's build.zig file --- build.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.zig b/build.zig index c9832e1..8241376 100644 --- a/build.zig +++ b/build.zig @@ -298,7 +298,7 @@ pub fn build(b: *std.Build) !void { .PCRE2_PARENS_NEST_LIMIT = 250, .PCRE2_MATCH_LIMIT = 10000000, .PCRE2_MATCH_LIMIT_DEPTH = "MATCH_LIMIT", - .NEWLINE_DEFAULT = '\n', + .NEWLINE_DEFAULT = 2, .BSR_ANYCRLF = 0, .PCRE2GREP_BUFSIZE = 20480, .PCRE2GREP_MAX_BUFSIZE = 1048576, From 59fdf66c3b6fb9884a963ed724acea10433fca17 Mon Sep 17 00:00:00 2001 From: Rosario Pulella Date: Wed, 11 Nov 2026 21:09:25 -0500 Subject: [PATCH 12/16] WIP: From PCRE2Project's build.zig file --- build.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/build.zig b/build.zig index 8241376..0f4ba29 100644 --- a/build.zig +++ b/build.zig @@ -291,6 +291,7 @@ pub fn build(b: *std.Build) !void { pcre.addConfigHeader(b.addConfigHeader( .{ .style = .{ .cmake = libgit_src.path("deps/pcre2/config.h.in") } }, .{ + .PCRE2_EXPORT = null, .SUPPORT_PCRE2_8 = 1, .PCRE2_HEAP_LIMIT = 20000000, .PCRE2_MAX_VARLOOKBEHIND = 255, From 6e233264f2c11c7d98c5e5b0b355ba7a6601cb32 Mon Sep 17 00:00:00 2001 From: Rosario Pulella Date: Wed, 11 Nov 2026 21:09:25 -0500 Subject: [PATCH 13/16] WIP --- build.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/build.zig b/build.zig index 0f4ba29..b53144d 100644 --- a/build.zig +++ b/build.zig @@ -24,6 +24,7 @@ pub fn build(b: *std.Build) !void { .{ .GIT_THREADS = 1, .GIT_USE_NSEC = 1, + .GIT_REGEX_PCRE2 = 1, }, ); From 91651341e7ad52d04c61c4eecfdd69bc6c9a9a7d Mon Sep 17 00:00:00 2001 From: Rosario Pulella Date: Wed, 11 Nov 2026 21:09:25 -0500 Subject: [PATCH 14/16] WIP --- build.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.zig b/build.zig index b53144d..15656cb 100644 --- a/build.zig +++ b/build.zig @@ -319,7 +319,7 @@ pub fn build(b: *std.Build) !void { mod.addIncludePath(libgit_src.path("deps/pcre2")); mod.linkLibrary(b.addLibrary(.{ - .name = "pcre", + .name = "pcre2", .linkage = .static, .root_module = pcre, })); From 5eb06cd026a45fcb5c8bc081beeaa0f270162315 Mon Sep 17 00:00:00 2001 From: Rosario Pulella Date: Wed, 11 Nov 2026 21:09:25 -0500 Subject: [PATCH 15/16] Rename zig build pcre vars to pcre2 --- build.zig | 12 ++++++------ build/sources.zon | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/build.zig b/build.zig index 15656cb..a166b24 100644 --- a/build.zig +++ b/build.zig @@ -284,12 +284,12 @@ pub fn build(b: *std.Build) !void { features.addValues(.{ .GIT_HTTPPARSER_BUILTIN = 1 }); } if (target.result.os.tag != .macos) { - const pcre = b.createModule(.{ + const pcre2 = b.createModule(.{ .target = target, .optimize = optimize, .link_libc = true, }); - pcre.addConfigHeader(b.addConfigHeader( + pcre2.addConfigHeader(b.addConfigHeader( .{ .style = .{ .cmake = libgit_src.path("deps/pcre2/config.h.in") } }, .{ .PCRE2_EXPORT = null, @@ -306,10 +306,10 @@ pub fn build(b: *std.Build) !void { .PCRE2GREP_MAX_BUFSIZE = 1048576, }, )); - pcre.addIncludePath(libgit_src.path("deps/pcre2")); - pcre.addCSourceFiles(.{ + pcre2.addIncludePath(libgit_src.path("deps/pcre2")); + pcre2.addCSourceFiles(.{ .root = libgit_src.path("deps/pcre2"), - .files = &sources.pcre, + .files = &sources.pcre2, .flags = &.{ "-Wno-unused-function", "-Wno-implicit-fallthrough", @@ -321,7 +321,7 @@ pub fn build(b: *std.Build) !void { mod.linkLibrary(b.addLibrary(.{ .name = "pcre2", .linkage = .static, - .root_module = pcre, + .root_module = pcre2, })); features.addValues(.{ .GIT_REGEX_BUILTIN = 1 }); } diff --git a/build/sources.zon b/build/sources.zon index 4035291..052f312 100644 --- a/build/sources.zon +++ b/build/sources.zon @@ -200,8 +200,8 @@ "llhttp.c", }, - // deps/pcre - .pcre = .{ + // deps/pcre2 + .pcre2 = .{ "pcre2_auto_possess.c", "pcre2_chartables.c", "pcre2_chkdint.c", From 1953af5f0e76dbfcd1ce7ec4c86e9ab592bb46c8 Mon Sep 17 00:00:00 2001 From: Parzival-3141 <29632054+Parzival-3141@users.noreply.github.com> Date: Fri, 13 Nov 2026 17:20:37 -0500 Subject: [PATCH 16/16] fix pcre2 build errors Our config header was missing some variables and defining unecessary ones. The source files were missing some definitions from SelectRegex.cmake. GIT_REGEX_PCRE2 flag is only used if linking system pcre2. --- build.zig | 19 +++++++++++-------- build/sources.zon | 1 - 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/build.zig b/build.zig index a166b24..8ec6c9e 100644 --- a/build.zig +++ b/build.zig @@ -24,7 +24,6 @@ pub fn build(b: *std.Build) !void { .{ .GIT_THREADS = 1, .GIT_USE_NSEC = 1, - .GIT_REGEX_PCRE2 = 1, }, ); @@ -292,18 +291,17 @@ pub fn build(b: *std.Build) !void { pcre2.addConfigHeader(b.addConfigHeader( .{ .style = .{ .cmake = libgit_src.path("deps/pcre2/config.h.in") } }, .{ - .PCRE2_EXPORT = null, .SUPPORT_PCRE2_8 = 1, - .PCRE2_HEAP_LIMIT = 20000000, - .PCRE2_MAX_VARLOOKBEHIND = 255, + .SUPPORT_UNICODE = 1, + .NEWLINE_DEFAULT = 2, .PCRE2_LINK_SIZE = 2, + .PCRE2_MAX_VARLOOKBEHIND = 255, .PCRE2_PARENS_NEST_LIMIT = 250, + .PCRE2_HEAP_LIMIT = 20000000, .PCRE2_MATCH_LIMIT = 10000000, .PCRE2_MATCH_LIMIT_DEPTH = "MATCH_LIMIT", - .NEWLINE_DEFAULT = 2, - .BSR_ANYCRLF = 0, - .PCRE2GREP_BUFSIZE = 20480, - .PCRE2GREP_MAX_BUFSIZE = 1048576, + .PCRE2GREP_BUFSIZE = {}, + .PCRE2GREP_MAX_BUFSIZE = {}, }, )); pcre2.addIncludePath(libgit_src.path("deps/pcre2")); @@ -314,6 +312,11 @@ pub fn build(b: *std.Build) !void { "-Wno-unused-function", "-Wno-implicit-fallthrough", "-DHAVE_CONFIG_H", + "-DPCRE2_CODE_UNIT_WIDTH=8", + "-DPCRE2_STATIC", + "-DPCRE2_EXPORT=", + "-DPCRE2_EXP_DECL=", + "-DPCRE2_EXP_DEFN=", }, }); diff --git a/build/sources.zon b/build/sources.zon index 052f312..12344ba 100644 --- a/build/sources.zon +++ b/build/sources.zon @@ -215,7 +215,6 @@ "pcre2_error.c", "pcre2_extuni.c", "pcre2_find_bracket.c", - "pcre2_fuzzsupport.c", "pcre2_maketables.c", "pcre2_match.c", "pcre2_match_data.c",