EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: msi again
From: Benjamin Franksen <[email protected]>
To: [email protected]
Date: Fri, 20 Aug 2010 11:46:50 +0200
After upgrading to msi-1.5, I noticed that definitions in substitution files 
are no longer global, but statically scoped (scopes being delimited by curly 
braces).

I remember mentioning this on tech-talk as a bug many, many years ago, and 
so did others. Every time we got the answer that there are people who rely 
on this behaviour, so this could not be changed. So, finally accepting it as 
a feature instead of a bug, we also began to rely on it.

And now someone silently fixes it without even bothering to mention it 
anywhere, neither on the msi web page, nor in release notes (there are 
none), nor can I remember a message on tech-talk (although I haven't checked 
the archive to verify this). This is about as bad as it can get.

If compatibility is valued as high as the answers during all those years 
suggest, I would have (at least) expected the old behaviour to remain the 
default, with the fixed (scoped) behaviour enabled by a command line switch.

Fortunately, I did not delete our old version of msi and could restore it.

Anyway...

We used the old (unscoped) behaviour in order to give global definitions at 
the top of the substitution file that should be available to all template 
file expansions throughout the substitution file. A typical example goes 
like this:

	file /dev/null {{
	    DEVN="KNOGHGP",
	    MCLK="MCLKHGP",
	    PROT="SMG",
	    LINK="$(LINK)",
	    ADDR="$(ADDR)",
	}}
	
	file streamAnalogChan.template
	{
	....
	}

This is something that can no longer be done if definitions are scoped. I 
have thought about how to extend the substitution file syntax (and 
semantics) of msi so that this can still be done. Here is one possibility:

In addition to

	file <filename> { {<definition-list>} ... }

allow (any number of)

	global { <definition-list> }

blocks at the top-level before any of the the file{}-blocks.

This is very easy to implement and is also completely backwards compatible. 
It works the same as if you give additional substitutions on the command 
line.

I also propose that we revert to an unscoped semantics for definitions, 
introducing a new command line switch to enable the scoped one. This means 
people can upgrade to new versions (e.g. to get bug-fixes) w/o having to 
change any of their substitution files.

I have implemented and tested all these changes and can provide patches.

Cheers
Ben

PS: One of the patches I sent the last time (the one that allows an instance 
for a template file w/o any substitutions) does not work in msi-1.5, it 
needs another 3 lines to work.

Navigate by Date:
Prev: Re: Small patch for asynMask bitmask values Angus Gratton
Next: Re: CA gateway dies without error message Dirk Zimoch
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Small patch for asynMask bitmask values Angus Gratton
Next: Re: msi again Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Sep 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·