Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Match upstream PCRE2_SYS_STATIC env variable behavior #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mqudsi
Copy link

@mqudsi mqudsi commented May 21, 2024

Upstream pcre2-sys crate has tri-state behavior for the PCRE2_SYS_STATIC environment variable, where 0 is force dynamic linking, 1 is force static linking, otherwise it is based off the heuristic.

We do have the STATIC_PCRE2 feature that upstream doesn't have, but the benefit of an environment variable is that a) it can be set for transitive dependencies, b) it can be set without modifying any code or even locally checking out the project.

This does effectively give PCRE2_SYS_STATIC=0 a veto over the STATIC_PCRE2 feature, but that's probably preferable since it gives maximum control to the person ultimately building the downstream app.

Upstream pcre2-sys crate has tri-state behavior for the PCRE2_SYS_STATIC
environment variable, where 0 is force dynamic linking, 1 is force static
linking, otherwise it is based off the heuristic.

We *do* have the STATIC_PCRE2 feature that upstream doesn't have, but the
benefit of an environment variable is that a) it can be set for transitive
dependencies, b) it can be set without modifying any code or even locally
checking out the project.

This does effectively give PCRE2_SYS_STATIC=0 a veto over the STATIC_PCRE2
feature, but that's probably preferable since it gives maximum control to the
person ultimately building the downstream app (i.e. fish).
@mqudsi
Copy link
Author

mqudsi commented May 21, 2024

For precedent, at least the OpenSSL crate has the vendored feature for direct dependents to request a static build, but also allows the top-level end user to compile a transitive dependency on OpenSSL statically via the OPENSSL_STATIC environment variable.

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.

1 participant