Skip to content

t/op/glob.t fails on -DEBUGGING build - #24762

Open
t-a-k wants to merge 1 commit into
Perl:bleadfrom
t-a-k:fix-DEBUGGING
Open

t-a-k wants to merge 1 commit into
Perl:bleadfrom
t-a-k:fix-DEBUGGING

Conversation

@t-a-k

@t-a-k t-a-k commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

I have found that in v5.45.2 t/op/glob.t fails when configured with -DEBUGGING.

This seems to be because t/op/glob.t only searches DDEBUGGING in 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 (like is_miniperl) is eventually provided in test.pl.


This set of changes is a trivial test fix, so I think:

  • This set of changes does not require a perldelta entry.

…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.
@tonycoz

tonycoz commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

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.

Comment thread t/op/glob.t

use Config;
my $is_debugging_build = $Config{config_args} =~ /\bDDEBUGGING\b(*nla:=none)/;
my $is_debugging_build = $Config{ccflags} =~ /(?<!\S)-DDEBUGGING(?!\S)/;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for delayed response.

can you point to the place in ./Configure or Makefile.SH where this assignment is nailed down?

-DDEBUGGING in $Config{ccflags} seems to come from this assignment in ./Configure:

perl5/Configure

Lines 5414 to 5417 in 1fe3afe

dflt=''
case "$DEBUGGING" in
both|$define) dflt='-DDEBUGGING'
esac

Then this $dflt works as the default $ccflags.

perl5/Configure

Lines 5565 to 5573 in 1fe3afe

set X $dflt
shift
dflt=${1+"$@"}
rp="Any additional cc flags?"
. ./myread
case "$ans" in
none) ccflags='';;
*) ccflags="$ans";;
esac

(These scripts seem to came from compline/ccflags.U Metaconfig unit.)

@jkeenan

jkeenan commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

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.

I took a peek at that branch and it looks promising. I hope you can make it into a formal pull request soon.

@tonycoz

tonycoz commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

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.

@jkeenan

jkeenan commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

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.

@tonycoz

tonycoz commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

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.

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.

3 participants