Conversation
…s} rather than $Config{config_args}
Previous logic to determine whether a build is a debugging build,
$Config{config_args} =~ /\bDDEBUGGING\b(*nla:=none)/;
will get false result for -DEBUGGING (which is an alias for -DDEBUGGING
described in INSTALL), and false positive for -DDEBUGGING=-g (which
actually does not make a debugging build).
I think $Config{ccflags} is better for this purpose thus replaced
the logic with one borrowed from t/run/switchDx.t and t/op/aassign.t.
|
I have a more comprehensive fix for this waiting on CI at https://github.com/tonycoz/perl5/tree/internals-debugging - though I'm not insistent on the name. |
|
|
||
| use Config; | ||
| my $is_debugging_build = $Config{config_args} =~ /\bDDEBUGGING\b(*nla:=none)/; | ||
| my $is_debugging_build = $Config{ccflags} =~ /(?<!\S)-DDEBUGGING(?!\S)/; |
There was a problem hiding this comment.
I suspect you're correct that $Config{ccflags} is the right place to look for a definitive ruling as to whether a build is "debugging" or not -- but can you point to the place in ./Configure or Makefile.SH where this assignment is nailed down?
There was a problem hiding this comment.
Sorry for delayed response.
can you point to the place in
./ConfigureorMakefile.SHwhere this assignment is nailed down?
-DDEBUGGING in $Config{ccflags} seems to come from this assignment in ./Configure:
Lines 5414 to 5417 in 1fe3afe
Then this
$dflt works as the default $ccflags.Lines 5565 to 5573 in 1fe3afe
(These scripts seem to came from
compline/ccflags.U Metaconfig unit.)
I took a peek at that branch and it looks promising. I hope you can make it into a formal pull request soon. |
I won't have a chance to look at the failures on that branch until Monday (AU time), and I expect (hope) there will be some discussion on the shape of the API, so that shouldn't delay this PR. |
@tonycoz, any update on the status of this? Thanks. |
Just merged it. |
I have found that in v5.45.2
t/op/glob.tfails when configured with-DEBUGGING.This seems to be because
t/op/glob.tonly searchesDDEBUGGINGin Configure argument to determine whether the build is a debugging build, so a test intended to be skipped in debugging builds is inadvertently not skipped if a debugging build is specified by-DEBUGGING(which is described in INSTALL as an alias for-DDEBUGGING).This PR will address this problem, but IMHO it would be nice if an unified interface such as
is_debugging_build(likeis_miniperl) is eventually provided intest.pl.This set of changes is a trivial test fix, so I think: