[M3devel] config init problem

Olaf Wagner wagner at elegosoft.com
Sat Aug 22 11:45:44 CEST 2009


Quoting Jay K <jay.krell at cornell.edu>:

> In the top of cm3.cfg put
> if not defined("SL") SL = "/"
> and/or just hardcode forward slash -- it works on Windows.
>
> There is already similar in a few places.
> Look at cminstall/src/config-no-install/cm3.cfg.

I'm not really comfortable with this solution. And I don't think
you are ;-) It's just a workaround for SL, but doesn't deal with the
other several dozens of definitions whiche _might_ be used in the
config scripts.

> This is why m3tohtml and such were crashing, but I dealt with them.
> I thought. Again, see the cm3.cfg and cm3cfg.common, etc.

If the exception wouldn't have been silently ignored in MxConfig.m3,
that should have been easy to diagnose. We probably need to build
some kind of quality-check tool for M3, which warns about such
coding, or should review our changes more often and better. Alas,
I'm afraid that won't happen because nobody has enougth time :-(

Or perhpas just add a warning to the compiler if a caught exception
is just thrown away?

> I have a proposal for next release that the predefines that cm3 does
> be made available to all quake clients via some new function.

We could of course pass down the correctly initialized QM in cm3
(M3Build -> Makefile -> MxConfig). That would fix the problem for
cm3, but not for other clients, unless we make them depend on most
of the build functions. The latter seems rather unnecessary and
inconvenient if only some simple definitions like TARGET are needed.
Perhaps we need to distinguish between two kinds of config files:
one level for simple clients which may only contain assignments
and basic quake functions from m3quake, and more complex initialization
for cm3.

I agree we should probably not make such changes in the release branch
now and postpone them.

Olaf

>> Date: Sat, 22 Aug 2009 01:16:49 +0200
>> From: wagner at elegosoft.com
>> To: m3devel at elegosoft.com
>> Subject: [M3devel] config init problem
>>
>> In MxConfig.m3 quake runtime exception were ignored and thrown away
>> in EvalConfig. Writing them to stderr, we get the following output
>> for a simple cm3.cfg file:
>>
>> % cat ~/cm3-rc3/bin/cm3.cfg
>>
>> %INSTALL_ROOT = "/ad0e/home/wagner/cm3-rc3"
>> INSTALL_ROOT = path() & SL & ".."
>>
>> include(path() & "/config/FreeBSD4")
>>
>> luthien [~/work/cm3] wagner
>> % cm3 -trace -version
>> Critical Mass Modula-3 version p5.8.3
>>    last updated: 2009-08-10
>>    compiled: 2009-08-21 22:59:34
>>    configuration: /ad0e/home/wagner/cm3-rc3/bin/cm3.cfg
>>    host: FreeBSD4
>> ****** /ad0e/home/wagner/cm3-rc3/bin/cm3.cfg ******
>> .0    SetLine  1
>> .1    SetLine  3
>> .2    LoadVar  (193) "path"
>> .3    StartCall
>> .4    CallFunc  0
>> .5    LoadVar  (373) "SL"
>> quake runtime error: "/ad0e/home/wagner/cm3-rc3/bin/cm3.cfg", line 3:
>> quake runtime error: undefined variable: SL
>>
>> --procedure--  -line-  -file---
>>                      3  /ad0e/home/wagner/cm3-rc3/bin/cm3.cfg
>>    target:
>>
>> SL gets defined in M3Build.m3 in cm3, along with all the other
>> builtins that the compiler may use (and the config file author).
>> Of course MxConfig in package m3quake does not know about these,
>> as it creates its own quake machine on the fly.
>>
>> So configuration evaluation won't work in general currently,
>> unless only standard quake functions and definitions are used.
>>
>> Any ideas?
-- 
Olaf Wagner -- elego Software Solutions GmbH
                Gustav-Meyer-Allee 25 / Gebäude 12, 13355 Berlin, Germany
phone: +49 30 23 45 86 96  mobile: +49 177 2345 869  fax: +49 30 23 45 86 95
    http://www.elegosoft.com | Geschäftsführer: Olaf Wagner | Sitz: Berlin
Handelregister: Amtsgericht Charlottenburg HRB 77719 | USt-IdNr: DE163214194




More information about the M3devel mailing list