-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Expose os, compiler, arch in php -v
#19328
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
base: master
Are you sure you want to change the base?
Conversation
Can be confusing to report both
This information already in
Notice IMHO, |
Co-authored-by: Michael Voříšek <[email protected]>
Agreed. I've updated the branch to use only build-time information.
I feel this is less convenient than
The compiler version can be useful to analyze bugs, as some features may only be enabled on some versions. This is the primary reason I'm interested in making this change. Just the major version would be fine, however.
I've updated the output of Without PHP_BUILD_PROVIDER:
With PHP_BUILD_PROVIDER:
|
Sorry, I was wrong in my previous comment, I think we need to use Provider is already part on php -v
|
main/main.c
Outdated
} | ||
smart_string_append_printf(&version_info, "Built %s\n", | ||
#ifdef PHP_BUILD_PROVIDER | ||
"by " PHP_BUILD_PROVIDER |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHP_BUILD_PROVIDER
should always be there (built by)
And condition for PHP_BUILD_SYSTEM
or PHP_UNAME_S + PHP_UNAME_R
(built on)
Sorry I've just pushed an update before seeing your latest comments: I've updated the branch to use only information provided by the compiler, rather than by uname (event at build time), as the latter would be wrong when cross-compiling (including when compiling for x86 on a x64 machine):
This is also a bit shorter, less detailed but always correct. One issue with Edit: Adding "Built on $PHP_BUILD_SYSTEM" would be correct, as we say "Built on". I'm fine adding this line in addition to the rest. |
Probably not mandatory, php -v is already long (and we have php -i) |
FWIW, at least with users I support, they seem to use |
See #19256
The bug system requires the output of
php -v
when reporting bugs. Exposing more information inphp -v
can be useful.PHP_BUILD_COMPILER
andPHP_BUILD_ARCH
are always defined in Windows build, or when defined in the environment during the build (#5834). In other cases I determine these from compiler macros.Output examples: #19328 (comment)
Outdated examples