Discussion:
Question about build-aux/bootstrap regarding $(...)
Akash Rawal
2017-05-16 05:47:34 UTC
Permalink
Hello everyone,

I observed that build-aux/bootstrap uses $(command) for command
substitution which is known to be less portable than `command`.[1]

Is it on purpose? Thanks in advance.

Regards,
Akash Rawal.

[1]
https://www.gnu.org/software/autoconf/manual/autoconf-2.63/html_node/Shell-Substitutions.html#Shell-Substitutions
Eric Blake
2017-05-16 15:12:22 UTC
Permalink
Post by Akash Rawal
Hello everyone,
I observed that build-aux/bootstrap uses $(command) for command
substitution which is known to be less portable than `command`.[1]
It's less portable only if you still intend to develop on any system
with /bin/sh as a non-POSIX sh (which is pretty much Solaris). There
aren't many GNU developers that use Solaris as their primary system. So
we haven't had many complaints.

At one point, Gary Vaughan contributed patches to rewrite the bootstrap
script using Autoconf's m4sh language, which uses portable shell
everywhere. But while projects like libtool and M4 have used his
rewrite, no one really ever took the time to review it for inclusion in
upstream gnulib.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
Gary V. Vaughan
2017-05-17 04:45:50 UTC
Permalink
Post by Eric Blake
Post by Akash Rawal
Hello everyone
Hi,
Post by Eric Blake
Post by Akash Rawal
I observed that build-aux/bootstrap uses $(command) for command
substitution which is known to be less portable than `command`.[1]
It's less portable only if you still intend to develop on any system
with /bin/sh as a non-POSIX sh (which is pretty much Solaris). There
aren't many GNU developers that use Solaris as their primary system. So
we haven't had many complaints.
At one point, Gary Vaughan contributed patches to rewrite the bootstrap
script using Autoconf's m4sh language, which uses portable shell
everywhere.
Feels like a nit, but since it may affect another project owner's decision about whether to use the rewrite or not: there is no m4sh in there, it is portable she'll all the way down, and the repo is designed to work as a git submodule that easily interoperates with gnulib:

https://github.com/gnulib-modules/bootstrap

Pavel Raiskup kindly took over maintenance, and has considerably speeded up the script since then. Other pros and cons are discussed briefly in the README.
Post by Eric Blake
But while projects like libtool and M4 have used his
rewrite, no one really ever took the time to review it for inclusion in upstream gnulib.
It's not too late! :-)

Cheers,
Gary

Loading...