Skip to content

m4: fix test(1) operator#19371

Closed
0-wiz-0 wants to merge 1 commit into
curl:masterfrom
0-wiz-0:master
Closed

m4: fix test(1) operator#19371
0-wiz-0 wants to merge 1 commit into
curl:masterfrom
0-wiz-0:master

Conversation

@0-wiz-0

@0-wiz-0 0-wiz-0 commented Nov 5, 2025

Copy link
Copy Markdown
Contributor

'=' is the operator defined by POSIX, only bash supports '=='

@github-actions github-actions Bot added the build label Nov 5, 2025
@0-wiz-0

0-wiz-0 commented Nov 5, 2025

Copy link
Copy Markdown
Contributor Author

The failing checks are connection problems with github.

@vszakats vszakats added the appleOS specific to an Apple operating system label Nov 5, 2025

@vszakats vszakats left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe say 'Apple SecTrust' in the title or commit message to narrow the scope of the issue?

@0-wiz-0

0-wiz-0 commented Nov 5, 2025

Copy link
Copy Markdown
Contributor Author

The problem is this becomes part of the main configure script, so all systems are affected.

@vszakats

vszakats commented Nov 5, 2025

Copy link
Copy Markdown
Member

The problem is this becomes part of the main configure script, so all systems are affected.

Would these test commands be only executed if the SecTrust option is enabled?

'=' is the operator defined by POSIX, only bash supports '=='
@0-wiz-0

0-wiz-0 commented Nov 5, 2025

Copy link
Copy Markdown
Contributor Author

I think yes.
I've added 'sectrust' to the commit message.

@icing

icing commented Nov 5, 2025

Copy link
Copy Markdown
Contributor

@0-wiz-0 thanks. Silly me for sticking to bash on my macos dev machine. But why was this not noticed in CI, I wonder?

With what local setup do you see the problem?

@0-wiz-0

0-wiz-0 commented Nov 5, 2025

Copy link
Copy Markdown
Contributor Author

We have an extra check for this kind of incorrect test(1) in pkgsrc.

@vszakats

vszakats commented Nov 5, 2025

Copy link
Copy Markdown
Member

@0-wiz-0 thanks. Silly me for sticking to bash on my macos dev machine. But why was this not noticed in CI, I wonder?

With what local setup do you see the problem?

macOS uses zsh by default (and previously used bash IIRC), and should not be affected.

I was looking for a shellcheck solution for m4 files for a while, but didn't find any so far. It'd be super to use one if such tool existed.

@bagder

bagder commented Nov 5, 2025

Copy link
Copy Markdown
Member

I was looking for a shellcheck solution for m4 files for a while, but didn't find any so far. It'd be super to use one if such tool existed.

Does it blow up if we run it on the generated configure script?

@vszakats

vszakats commented Nov 5, 2025

Copy link
Copy Markdown
Member

I was looking for a shellcheck solution for m4 files for a while, but didn't find any so far. It'd be super to use one if such tool existed.

Does it blow up if we run it on the generated configure script?

Something to try ...it took 177 seconds (on a fast machine) and
the result is 5100 warnings, 1 MB of log output.

Part of the problem is that lots of code is coming from autotools
itself. Another is that it's written for very old standards.

Maybe possible to tweak options to tame results a bit, but one run
taking so much time, it'd be quite a task.

I have an open PR aiming to tidy up mainly ifs, I plan to continue
with the TODOs/idea pending there (also possibly-maybe keeping
the dreaded xs for input values): #18189

@bagder

bagder commented Nov 5, 2025

Copy link
Copy Markdown
Member

I tried checkbashisms.pl from Debian's devscripts 2.25.23 package on the generated configure from 8.17.0 to see what it says. It didn't work:

error: /home/dast/src/curl/configure:  Unterminated heredoc found, EOF reached. Wanted: <_EOT>, opened in line 194

@vszakats

vszakats commented Nov 5, 2025

Copy link
Copy Markdown
Member

_EOT

A heredoc within backticks:

xc_tst_str=`cat <<_EOT 2>/dev/null \
  | wc -l 2>/dev/null | tr -d "$xc_space$xc_tab" 2>/dev/null
unknown
unknown
unknown
_EOT`

@bagder bagder closed this in 2e770b3 Nov 5, 2025
@bagder

bagder commented Nov 5, 2025

Copy link
Copy Markdown
Member

Thanks!

@dfandrich

dfandrich commented Nov 5, 2025 via email

Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

appleOS specific to an Apple operating system build

Development

Successfully merging this pull request may close these issues.

5 participants