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

patch #10416: Drop unreliable dependency on which program, publicize settable variables in --help #291

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

eli-schwartz
Copy link

It accepts a filename, not a directory name, so say that.
…H_PROG

The "which" utility is not guaranteed to be installed either, and if it
is, its behavior is not portable either. This means that when
llvm-config is installed, the `which` check will report a fatal error
because the which tool did not exist and the shell returned a nonzero
status when attempting to fork+exec. If it did exist, it might not be an
implementation of `which` that returns nonzero when commands do not
exist.

The general scripting suggestion is to use the "command -v" shell
builtin is required to exist in all POSIX 2008 compliant shells, and is
thus guaranteed to work everywhere.

For some in-depth discussions on the topic, see:
- https://mywiki.wooledge.org/BashFAQ/081
- https://unix.stackexchange.com/questions/85249/why-not-use-which-what-to-use-then/85250#85250

Examples of open-source shells likely to be installed as /bin/sh on
Linux, which implement the 15-year-old standard: ash, bash, busybox,
dash, ksh, mksh and zsh.

Since this is an autoconf extension, however, autoconf provides its own
guarantees: you are always supposed to use AC_PATH_PROG, which is
guaranteed to generate code which does the right thing, and in
particular tends to work even on systems which predate POSIX. It
officially becomes autoconf's job to make sure path detection works.

This has some convenient knock-on effects. In particular, we now permit
users to specify the path via $LLVM_CONFIG, which is a somewhat standard
approach, and we document it as well.
Fallout from commit c765658. Using
shell quotes around autoconf macro parameters leads to literal
double-quote chars appearing in ./configure --help output, in this case.
…PATH_PROG

The "which" utility is not guaranteed to be installed either, and if it
is, its behavior is not portable either. This means that when Qt is
installed, the `which` check will report a fatal error because the which
tool did not exist and the shell returned a nonzero status when
attempting to fork+exec. If it did exist, it might not be an
implementation of `which` that returns nonzero when commands do not
exist.

The general scripting suggestion is to use the "command -v" shell
builtin is required to exist in all POSIX 2008 compliant shells, and is
thus guaranteed to work everywhere.

For some in-depth discussions on the topic, see:
- https://mywiki.wooledge.org/BashFAQ/081
- https://unix.stackexchange.com/questions/85249/why-not-use-which-what-to-use-then/85250#85250

Examples of open-source shells likely to be installed as /bin/sh on
Linux, which implement the 15-year-old standard: ash, bash, busybox,
dash, ksh, mksh and zsh.

Since this is an autoconf extension, however, autoconf provides its own
guarantees: you are always supposed to use AC_PATH_PROG, which is
guaranteed to generate code which does the right thing, and in
particular tends to work even on systems which predate POSIX. It
officially becomes autoconf's job to make sure path detection works.

This has some convenient knock-on effects. In particular, we now permit
users to specify the path via $QT_* variables, which are documented
inline as being set and are now documented as publicly settable too.
This was even already the case with qmake.
```
/usr/lib/python3.11/subprocess.py:1016: RuntimeWarning: line buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant