Add Internals::DEBUGGING to test perl was built with DEBUGGING defined - #24784
Add Internals::DEBUGGING to test perl was built with DEBUGGING defined#24784tonycoz wants to merge 4 commits into
Conversation
|
Given that right now I can type OTOH, farther down ... which sounds like, "We're showing you the rope with which you can hang yourself, but if you use it the Secretary will disavow all knowledge of your activity." I know that as a person working on the tests found in the core distribution, I need a definitive way to determine whether a given executable is a debugging perl or not, and I need that to work with |
|
Why not put this in a |
|
Nevermind, Debian's debugperl wouldn't be compatible with it. What an odd setup to support, BTW. |
|
It feels like this would make more sense as a |
|
I like the correctness of the implementation; not sure about if/how to expose it publicly. If it is useful to people, then might we end up exposing more build details in the future? If so, not sure we'll want to If it does go into |
Config seems like a good place to put it, assuming the value depends on the perl binary rather than the canned config. Rather than a
Do you need it before Config.pm is built? Since that isn't necessarily available for
I'm not sure if you meant this to be "where tests are not run via
I think it could be useful for XS authors |
|
The following test files are all run during
There may be others. I didn't look at tests under |
The thing is: minitest isn't meant to require that Config.pm ls loadable, minitest_prep: will try to build Config.pm, but even if that fails it will try to run the tests. So ideally tests in should avoid a hard requirement on Config.pm. Though we don't follow that well except for base, comp and cmd. From what you've listed it looks like we don't really need it before Config.pm. |
This is one possible implementation, others might be:
- builtin::is_debug_build (or some other name)
- ${^DEBUGGING}
both of which use a more public namespace, but Internals::DEBUGGING
seemed the least disruptive for now.
and lose the XS.
6f518f3 to
2db57e7
Compare
This is one possible implementation, others might be:
both of which use a more public namespace, but
Internals::DEBUGGINGseemed the least disruptive for now.This was inspired by #24762, but it's an issue that has come up before - someone writes a test conditional on whether perl was built with
-DDEBUGGINGor its platform specific invocation (MSWin32, VMS), and that conditional is incomplete or incorrect.The idea here is to add an authoritative and always correct way to check whether perl itself was builtin with DEBUGGING enabled - by checking whether
universal.chas theDEBUGGINGmacro defined. This should also work where a debugging build perl binary is parallel installed with a non-debugging build, as withdebugperlbinary installed by theperl-debugpackage on Debian.We could suggest parsing
Internals::V, and the test code for this change does that, butInternals::Vis subject to any changes needed for Config::_V() so it's fragile.The main type of feedback in addition to the implementation that I'm looking for, is should this be public? If public, what shape should that public-ness take - a
builtin::name? a^variable? Or documentInternals::DEBUGGING?I'm not fond of putting this into
builtin::- those names are intended to become builtins at some point, and this doesn't seem suitable for that.