[Bugs] [Bug 1444228] New: Autoconf leaves unexpanded variables in path names of non-shell-script text files
bugzilla at redhat.com
bugzilla at redhat.com
Thu Apr 20 22:44:51 UTC 2017
https://bugzilla.redhat.com/show_bug.cgi?id=1444228
Bug ID: 1444228
Summary: Autoconf leaves unexpanded variables in path names of
non-shell-script text files
Product: GlusterFS
Version: mainline
Component: build
Assignee: bugs at gluster.org
Reporter: csaba at redhat.com
CC: bugs at gluster.org
Created attachment 1273092
--> https://bugzilla.redhat.com/attachment.cgi?id=1273092&action=edit
Test script for the bug.
Description of problem:
The GlusterFS build system makes use of the autoconf functionality of
generating installed versions of certain text files from templates with .in
extensions. In some cases it occurs that autotools managed variables make their
ways into the template expansions. It can be a problem (but not always). For
example, the mount.glusterfs script is produced as the template expansion of
mount.glusterfs.in, which contains:
prefix="@prefix@";
exec_prefix=@exec_prefix@;
cmd_line=$(echo "@sbindir@/glusterfs");
that might expand to (depending on configuration):
prefix="/usr";
exec_prefix=${prefix};
cmd_line=$(echo "${exec_prefix}/sbin/glusterfs");
Here the definitions of exec_prefix and cmd_line include variables but it's not
a problem, as mount.glusterfs is a shell script and according to shell script
syntax, the variables will be substituted with the actual string values upon
running the script.
However, there are other cases, like that of glusterd.vol.in / glusterd.vol,
option working-directory @GLUSTERD_WORKDIR@
becaming
option working-directory ${prefix}/var/lib/glusterd
or that of geo-replication/syncdaemon/conf.py.in /
/usr/libexec/glusterfs/glusterfind/conf.py,
GLUSTERFS_LIBEXECDIR = '@GLUSTERFS_LIBEXECDIR@'
GLUSTERD_WORKDIR = "@GLUSTERD_WORKDIR@"
LOCALSTATEDIR = "@localstatedir@"
UUID_FILE = "@GLUSTERD_WORKDIR@/glusterd.info"
becoming
GLUSTERFS_LIBEXECDIR = '${exec_prefix}/libexec/glusterfs'
GLUSTERD_WORKDIR = "${prefix}/var/lib/glusterd"
LOCALSTATEDIR = "${prefix}/var"
UUID_FILE = "${prefix}/var/lib/glusterd/glusterd.info"
where the expanded version of the file functions as config file or python
script, which does not support shell style variables and these values will be
used verbatim.
After some investigation, I identified the following list of *.in files where
variables in the expansion are problematic:
- events/src/eventsapiconf.py.in
- extras/geo-rep/schedule_georep.py.in
- extras/glusterd.vol.in
- extras/snap_scheduler/conf.py.in
- geo-replication/src/peer_georep-sshkey.py.in
- geo-replication/src/peer_mountbroker.in
- geo-replication/src/peer_mountbroker.py.in
- geo-replication/syncdaemon/conf.py.in
- tools/glusterfind/glusterfind.in
- tools/glusterfind/src/tool.conf.in
I've done testing with the following configure invocations:
- ./configure
- ./configure --prefix=/usr
- RHEL's configure invocation
- Ubuntu's configure invocation
How reproducible:
Deterministically.
Steps to Reproduce:
In a GlusterFS source tree with configure script present (ie. either shipped by
vendor or ./autogen.sh has been run) run the attached glusterdotin.sh script.
The script calls configure with various arguments (according to the above
invocation list). For each invocation it shows information about the invocation
(the arguments and summary of results) and a optionally a diff excerpt from the
diffs of the possibly affected *.in files and their expanded versions. The diff
excerpt shall contain those lines which exhibit the issue.
Actual results:
With some configure invocations a diff excerpt is shown.
Expected results:
No diff excerpt should be shown.
Additional info:
Before change https://review.gluster.org/16880 the issue was present, but among
the tested configurations it occurred only with "./configure --prefix=/usr",
whereby the following files were affected:
- events/src/eventsapiconf.py.in
- geo-replication/src/peer_mountbroker.py.in
However, https://review.gluster.org/16880 worsened the situation to a great
extent -- after this change only RHEL's configuration featured flawless
template expansion, and for the other three configurations a higher number of
files (5 to 9) were affected. (Implied: https://review.gluster.org/16880 is not
the final fix for Ubuntu build issues that are reported in the assiciated bug,
Bug 1430841.)
--
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.
More information about the Bugs
mailing list