Skip to content
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

Curl fails at make check with Perl 5.41.7 / 5.41.8 due to "Possible precedence problem between ! and string eq" in runtests.pl #16128

Closed
IgorTodorovskiIBM opened this issue Jan 30, 2025 · 2 comments
Labels

Comments

@IgorTodorovskiIBM
Copy link
Contributor

I did this

Curl fails at make check with Perl 5.41.7 due to:

make[2]: Leaving directory '/jenkins/workspace/Port-Build/curl/curl-8.11.1/tests'
srcdir=. /jenkins/zopen/usr/local/zopen/perl/perl5-heads.v5.41.7.20250123_102326.zos/bin/perl -I. ./runtests.pl   -a -s 
Possible precedence problem between ! and string eq at ./runtests.pl line 1691.
make[1]: *** [Makefile:898: quiet-test] Error 129
make[1]: Leaving directory '/jenkins/workspace/Port-Build/curl/curl-8.11.1/tests'

See related issue: Perl/perl5#22954 (comment)

I expected the following

make check to run clean

curl/libcurl version

curl 8.11.1

operating system

any

mauke added a commit to mauke/curl that referenced this issue Jan 30, 2025
The condition `!$cmdtype eq "perl"` (introduced in a4765b0) is always false.
It checks whether a logical negation (giving true/false) is equal to the string
`"perl"`. This is impossible, so the logging never worked.

The intent was probably to negate the result of the string
comparison:`!($cmdtype eq "perl"` or simply `$cmdtype ne "perl"`.

Fixes curl#16128.
mauke added a commit to mauke/curl that referenced this issue Jan 30, 2025
The condition `!$cmdtype eq "perl"` (introduced in a4765b0) is always false.
It checks whether a logical negation (giving true/false) is equal to the string
`"perl"`. This is impossible, so the logging never worked.

The intent was probably to negate the result of the string
comparison:`!($cmdtype eq "perl")` or simply `$cmdtype ne "perl"`.

Fixes curl#16128.
@Leont
Copy link

Leont commented Jan 30, 2025

The affected line does

if(!$cmdtype eq "perl")

This is wrong, and perl is rightly giving a warning here. The code is equivalent to

if (not($cmdtype) eq "perl")

when what was undoubtedly meant was

if ($cmdtype ne "perl")

@vszakats vszakats added the tests label Jan 31, 2025
@Leont
Copy link

Leont commented Jan 31, 2025

Also note that the script has set «use warnings FATAL => 'all';». That promotes these warnings to exceptions. I'm not sure that's a good idea for a script like this where you can't control the version of perl other people will run it on: it means that any existent version of curl can break with a future perl when it adds a warning like this. It's probably more appropriate to use non-fatal warnings here.

dfandrich added a commit that referenced this issue Feb 3, 2025
While this is useful on CI to highlight issues in the scripts, it's a
recipe for pain when enabled on users' builds.

Suggested-by: Leon Timmermans
Ref: #16128
@bagder bagder closed this as completed in bfec1d7 Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

3 participants