Skip to content

pcre2test: detect setrlimit instead of hardcoding platform list#893

Open
puffnfresh wants to merge 2 commits intoPCRE2Project:mainfrom
puffnfresh:wasi-support
Open

pcre2test: detect setrlimit instead of hardcoding platform list#893
puffnfresh wants to merge 2 commits intoPCRE2Project:mainfrom
puffnfresh:wasi-support

Conversation

@puffnfresh
Copy link
Copy Markdown

Replace the growing platform preprocessor check for -S flag support with AC_CHECK_FUNCS/check_symbol_exists detection of setrlimit. This automatically handles any platform lacking setrlimit (WASI, VMS, etc.) without maintaining a manual list.

Haiku and z/OS are kept as explicit exclusions because they provide setrlimit but don't support RLIMIT_STACK.

Replace the growing platform preprocessor check for -S flag support
with AC_CHECK_FUNCS/check_symbol_exists detection of setrlimit. This
automatically handles any platform lacking setrlimit (WASI, VMS, etc.)
without maintaining a manual list.

Haiku and z/OS are kept as explicit exclusions because they provide
setrlimit but don't support RLIMIT_STACK.
@NWilson
Copy link
Copy Markdown
Member

NWilson commented Mar 11, 2026

Thank you, there are several of these in pcre2test and pcre2grep which I would love to clear up. Much appreciated! I will have to do a little bit of platform checking testing before I merge, but in principle, this is good.

@NWilson
Copy link
Copy Markdown
Member

NWilson commented Apr 3, 2026

Hi @puffnfresh.

Thank you very much for this WASI fix!

I would like to merge it. I have now had the chance to do some testing of my own.

I pushed a small fix to your branch, excluding WIN32 as before. This may not be needed... but I have tried a few versions of MinGW, MSYS2, etc, and I'm nervous a regression is possible. Plus - the #if HAVE_SETRLIMIT block where you do the header include is only present on non-Win32.

Secondly, I seem not to have permissions to push merge commits to your branch, so I can't update this PR with a merge from main.

I would like to add the following to build.zig, however it will conflict unless the merge is done:

            .HAVE_SETRLIMIT = is_unix and !is_mingw,

Copy link
Copy Markdown
Member

@NWilson NWilson left a comment

Choose a reason for hiding this comment

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

Needs merge with main, and build.zig update

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