Add Config::DEBUGGING to test perl was built with DEBUGGING defined - #24784
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. |
6f518f3 to
2db57e7
Compare
2db57e7 to
019d4eb
Compare
|
I vote that you rename it and put it in builtin. Internals should only be for things we really dont want people to use and which we expect to remove or change in the future (even if that future might be distant). IMO something like this will always be useful so put it in builtin. |
I still wonder if there should be a sub-namespace, making it |
|
A sub-namespace would essentially be a core module with different rules; though it could follow the conventions of builtin intuitively. Personally I think one clearly-named function for this in builtin would be fine, there is little chance of it being confusing. I don't think "these names are intended to become builtins at some point" is correct, builtin.pm is where they are intended to live for the forseeable future because the core namespace cannot gain new keywords. The only future implication would be if they get added to a 'builtin bundle', which for a function like this is unnecessary. But |
The title was out of date, I moved it to Config later. As to builtin - the names defined in builtin are intended to be included in a later version bundle once they become non-experimental, from perldoc builtin:
which means they become part of any package namespace that does: Though perhaps we be inconsistent and skip that for
It doesn't really work with the way builtin names are intended to be promoted to being directly visible under some As to builtin, I wouldn't mind a way to |
Fair enough. (That promotion model does make picking-names-to-minimize-collisions more difficult. |
I suppose we could decide whether this is acceptable at a future time if it comes up. I think it's consistent with feature.pm to leave some builtins "optional".
I view it as part of the |
|
On Thu, 17 Sept 2026 at 00:53, Grinnz ***@***.***> wrote:
*Grinnz* left a comment (Perl/perl5#24784)
<#24784 (comment)>
Internals should only be for things we really dont want people to use and
which we expect to remove or change in the future (even if that future
might be distant).
The title was out of date, I moved it to Config later.
As to builtin - the names defined in builtin are intended to be included
in a later version bundle once they become non-experimental, from perldoc
builtin:
Version Bundles
The entire set of builtin functions that were considered non-experimental
by a version of perl can be imported all at once, by requesting a version
bundle. This is done by giving the perl release version (without its
subversion suffix) after a colon character:
use builtin ':5.40';
which means they become part of any package namespace that does:
use v5.48.0; # some version, maybe not this one
Though perhaps we be inconsistent and skip that for DEBUGGING.
I suppose we could decide whether this is acceptable at a future time if
it comes up. I think it's consistent with feature.pm to leave some
builtins "optional".
I still wonder if there should be a sub-namespace, making it
builtin::<something>::DEBUGGING, rather than having to worry about having
a crowded top-level some years hence?
It doesn't really work with the way builtin names are intended to be
promoted to being directly visible under some use v... in the future.
As to builtin, I wouldn't mind a way to use v5.xx and not get the builtin
bundle imported - for line of business code I'm unlikely to use any of
blessed, reftype, created_as_string/number, is_tainted, export_lexically,
is_bool, unweaken, is_weak, load_module. But that should probably be
discussed elsewhere.
I view it as part of the use VERSION contract: you are asking for a new
"version" of perl, which has these keywords and functions available. I
think it is straightforward enough to piecemeal the parts you want (since
they are all default invocations), especially as part of something like
Import::Base. But I would probably not be opposed to more options if
there's an elegant way to do it. But now we're getting very off topic.
FWIW, when I first recommended the builtin namespace (yes it was my idea,
first introduced as 'mauve') I did not envisage anything that would import
them all at once. I think that is a misfeature. Features should define
builtins they import, and people should explicity import them as needed. We
shouldn't be linking importing all of them as part of a version
requirement, IMO that is backwards. People can either fully qualify or
import what they need.
The entire point was that in theory you could create a dist that backwards
exposes everything in builtin to older perls. Having them be linked to
versions basically defeats that point. Any code that uses a version to
import them all is implicitly not backwards compatible.
Yves
…--
perl -Mre=debug -e "/just|another|perl|hacker/"
|
|
To avoid continuing this off topic discussion, I will just note that builtin::compat does exist, and "use VERSION" working that way is a tradeoff not specific to builtin.pm, which I think is the correct one. |
019d4eb to
8729493
Compare
| sub DEBUG () { 0 } # Set to 0 for production; 1 for development | ||
| $| = 1 if DEBUG; | ||
| my $debugging_build = $Config{"ccflags"} =~ /-DDEBUGGING/; | ||
| my $debugging_build = Config::DEBUGGING; |
There was a problem hiding this comment.
This does mean that mktables currently doesn't can't run with an older perl, and it does look like it was meant to be able to do that (it explicitly requires only 5.10.1)
|
On 9/25/26 14:14, Leon Timmermans wrote:
***@***.**** commented on this pull request.
------------------------------------------------------------------------
In lib/unicore/mktables <https://github.com/Perl/perl5/
pull/24784#discussion_r4108264180>:
> @@ -54,7 +54,7 @@ no warnings qw( experimental::builtin );
sub DEBUG () { 0 } # Set to 0 for production; 1 for development
$| = 1 if DEBUG;
-my $debugging_build = $Config{"ccflags"} =~ /-DDEBUGGING/;
+my $debugging_build = Config::DEBUGGING;
This does mean that |mktables| currently doesn't can't run with an older
perl, and it does look like it was meant to be able to do that (it
explicitly requires only 5.10.1)
I don't now know why it requires 5.10.1. It doesn't need any perl to be
available to it in order to be able to run. Instead it requires a
miniperl. (That was painful when I was revamping of it.) Like anything
else in /lib, it doesn't have a life apart from the version of perl it
comes with. So I think this change is ok. But I may be overlooking
something.
…
—
Reply to this email directly, view it on GitHub <https://github.com/
Perl/perl5#24784?
email_source=notifications&email_token=AAA2DH2HOKS3OCCIMNWDVN35Q3GZRA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTKMZSGIZDINZRGIYKM4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOSWGM33PORSXEX3DNRUWG2Y#pullrequestreview-5322247120>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAA2DH7Q227G4FGE5MGUT4T5Q3GZRAVCNFSNUABDKJSXA33TNF2G64TZHM4DCOBTGU3TAO2JONZXKZJ3GUZTANRVGEZDGNZVUF3AE>.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
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.