Skip to content

Document PHP environment build configuration vars #12050

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

Closed
wants to merge 1 commit into from

Conversation

petk
Copy link
Member

@petk petk commented Aug 25, 2023

This marks some environment variables as precious and they show in the ./configure --help output. These variables can be used like this:

./configure PHP_BUILD_SYSTEM="..." PHP_BUILD_PROVIDER="..."

when customizing the build system info on some systems and are then displayed in the phpinfo() output.

@petk petk marked this pull request as draft August 29, 2023 11:11
@petk petk changed the title Add PHP build configuration variables to help info Document PHP environment build configuration vars Aug 29, 2023
@petk petk force-pushed the patch-arg-vars branch 2 times, most recently from 28a1c67 to 3ad49a0 Compare November 17, 2023 19:43
This marks the following environment variables as precious:

- EXTENSION_DIR
- EXTRA_CFLAGS
- EXTRA_INCLUDES
- EXTRA_LDFLAGS
- PHP_BUILD_ARCH
- PHP_BUILD_COMPILER
- PHP_BUILD_PROVIDER
- PHP_BUILD_SYSTEM
- PHP_UNAME

These variables can be used like this when configuring the PHP build:

    ./configure PHP_BUILD_SYSTEM="..." PHP_BUILD_PROVIDER="..." ...

And they are now also shown in the `./configure --help` output.

Additionally:

- EXTRA_INCLUDES, EXTRA_CFLAGS and EXTRA_LDFLAGS can be now defined
  directly in the configure step to more intuitively append additional
  build options, without changing default flags for Autoconf checks.
@petk
Copy link
Member Author

petk commented Mar 14, 2024

Just for the info, @iluuu1994 this might be also a better approach for the ASAN build to pass those CFLAGS and LDFLAGS. Currently the ASAN build is unstable because the configure checks are randomly failing and variable configuration is defined.

So instead of doing ./configure CFLAGS=... LDFLAGS=... this can be done and only build step takes these flags into compilation:
./configuration EXTRA_CFLAGS=... EXTRA_LDFLAGS=...

This PR is still a bit messy and needs to be properly adjusted, CS fixed etc...

@iluuu1994
Copy link
Member

Currently the ASAN build is unstable because the configure checks are randomly failing and variable configuration is defined.

@petk I noticed. That's very odd. I believe it's an ASAN issue. Even when ./configure succeeds, running tests will fail with a segfault in most tests. Because passing CFLAGS="-fsanitize=..." to ./configure will enable this flag for all autoconf checks internally, I'm guessing they will also randomly fail.

Unfortunately, I cannot reproduce it locally, and the segfault message on GitHub action is unhelpful.

@petk
Copy link
Member Author

petk commented Sep 4, 2024

Closing this in favor of #15684 and #15743

The remaining EXTRA_* variables are still in recheck what to do with them. Because the issue is that today's practices are a bit different and these type of variables are not that good idea in an ideal build system case scenario with all checks working properly etc.

@petk petk closed this Sep 4, 2024
@petk petk deleted the patch-arg-vars branch September 4, 2024 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants