Closed bobh0303 closed 6 years ago
Yeh it's lying. What you are doing is overriding the calculated result. What is shown is the calculated result. Not a lot we can do about that since the configure() is called after a value is calculated for MAKE_GDL. How is smith to know you are overriding it and adapt accordingly?
If you really wanted to, we could add a function to set the environment as in: setenv(ctx, 'MAKE_GDL', 'perl ../bin/my_make_gdl') which would set the env entry and print a message. But it seems a lot for not much?
Oh, I thought smith configure
was doing some processing of the wscript file -- Didn't you say every time the wscript changes one should run configure
again? Maybe I'm misremembering.
So perhaps this is just a documentation issue.
smith configure runs your wscript, but it doesn't call the configure function at that point. After running the script, it uses that information to tell it which programs it needs to go and look for. After working out where all the programs are, for which it produces the report on the screen, it then runs your configure function (if it's there) and silently changes things (like where MAKE_GDL points).
OK, I understand how the current program generates the output it does, but if it is under our control -- and I realize it may not be -- it would be more useful if it displayed the final configuration instead of an intermediate one. Can your last two steps (produce report, run configure function) be easily reversed?
no since the reporting is done at the point of searching for the program. And your configure function isn't calling that particular function. So, yes, all things are possible, but how many weeks would you like me to spend on it?
If it is more than an hour it probably isn't worth it because wscript authors can add the output they want in configure()
, e.g.:
print "wcript-specific configuration:"
for k in ('MAKE_GDL', 'FFCOPYGLYPHS', 'PDFSHAPED') :
print "%-20s: %s" % (k.lower(), ctx.env[k])
Maybe we could suggest this in the manual...
or more simply something like:
def configure(ctx) :
myprogs = { 'MYPROG' : '../tools/myprog', 'OTHERPROG' : 'perl ../tools/otherprog.pl' }
for k, v in myprogs.items() :
ctx.env[k] = v
ctx.msg("Local config for " + k.lower(), v)
If I have the following in my wscript:
is it expected that
smith configure
output indicates:? Seems it should indicate I am using my_make_gdl