#332: Cactus should not interpret environment variables as configuration options
Reporter:Ian Hinder
Status:new
Milestone:
Version:
Type:bug
Priority:minor
Component:Cactus

Comment (by Roland Haas):

Rewriting the top level Makefile will not actually prevent Cactus from interpreting (and giving precedence to) ENV variables over what is in option lists. That behaviour is explicitly coded in the ProcessConfiguration subroutine in ib/sbin/ProcessConfiguration.pl (and more specifically in AmalgamateOptions in CSTUtils.pl).

It is related to make indeed passes variables specified on its command line as ENV variables to its children, ie:

make FOO=bar

makes a variable FOO available to sub-shells. In particular he ExternalLibaries' use of configure.sh scripts relies then on (a subset those in @allowed_options in CST and ProcessConfiguration.pl) of those being passed as ENV variables which is where ENV{HDF5_DIR} messing up HDF5_DIR in an option list actually comes from.

If one wants to use only command line options instead of all ENV variables as a source for those @allowed_options then one can parse MAKEFLAGS the way that lib/make/setup_configuration.pl does:

# parse make command line options FOO=BAR
# Set variables from makefile command line first
my %MAKEFLAGS;
my $commandline = $ENV{"MAKEFLAGS"};
$commandline =~ s/^.*? -- //;
while ($commandline =~ /^(

--
Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/332/cactus-should-not-interpret-environment