Skip to content

Fix: Fetch SLJIT through the zig package manager for JIT builds#922

Open
nankishre wants to merge 1 commit into
PCRE2Project:mainfrom
nankishre:main
Open

Fix: Fetch SLJIT through the zig package manager for JIT builds#922
nankishre wants to merge 1 commit into
PCRE2Project:mainfrom
nankishre:main

Conversation

@nankishre

@nankishre nankishre commented Jul 19, 2026

Copy link
Copy Markdown

Zig fetched git packages do not include submodule contents, which caused the following error while building pcre2 with JIT mode on:

image

So I made this tiny patch to fetch the pinned SLJIT revision through zig's package manager when JIT support is enabled and stage the fetched sources alongside pcre2_jit_compile.c. This works without modifying the C source or affecting non-JIT builds of pcre2.

Comment thread build.zig.zon
Comment on lines +12 to +13
.url = "git+https://github.com/zherczeg/sljit.git#45f910b78c6605ebf5b53d3ec7cb00f2312fe417",
.hash = "N-V-__8AAIUFRABdZku3bW_1S5GOC4iaFh17LsRurEDR1lvv",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't this require updating whenever a new version of the sljit submodule is committed?

a git clone is meant to be followed by git submodule update --init or equivalent; could zig or its package manager do that?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, yes the sljit commit hash would have to be updated whenever gitmodules changes aswell and I'm not aware of a helper cmd which has that feature.

Rn, the maintainers would have to run
zig fetch --save=sljit "git+https://github.com/zherczeg/sljit.git#$(git ls-tree HEAD deps/sljit | awk '{print $3}')"
every time sljit's commit # is changed. If they aren't interested in doing that maybe I could setup a workflow to check for and update the zig package that if that's okay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants