[M3devel] INSTALL_ROOT and PKG_USE in cm3.cfg

Jay jayk123 at hotmail.com
Fri Jan 25 06:19:31 CET 2008


 >> shouldn't it come up with "C:\cm3\bin\.." for the path?  
 
Correct.
 
 >> be confusing internally when it tries to make paths like "C:\cm3\bin\..\pkg".  I don't know.  Just a thought
 
No. It works fine. I've been building this way a while now, no problems. YOU built this way I believe, just not using Reactor.
It looks a little ugly if you see it, I admit, but it's worth it. I usually bootstrap from circa 5.1.6 and surely from 5.5.0 or .1 itself. I had been bootstrapping from something in between but haven't lately. So I can't vouch for all that many builds. I'm also using this code on PPC_LINUX and PPC_DARWIN (should be called PPC_MACOSX but oh well) successfully (look in m3-sys\cminstall\src\config-no-install).
 
I have seen path() return empty with some older builds, but not with current builds.
Where I have seen it, I added in if defined() to cope and something more that I forget, maybe just the "normal" thing, like to bootstrap from an older build, and it gets overwritten during the bootstrap, once there is a current cm3.exe. I should check, I should check the history, and consistently workaround for all the files with this construct (ie. config-no-install and NT386).
 
The documentation says it returns the path or directory of cm3.exe.
But I did find that to be false, but the function is still useful. It seems to return the path of the current Quake code. I haven't looked at the implementation (yet).
 
Something is different in the Reactor path.
 
 >>> 2) Again again, can you make the stuff you are working on available? To just some people?
?
 
 - Jay


Date: Fri, 25 Jan 2008 00:07:28 -0500From: rcoleburn at scires.comTo: jay123 at hotmail.com; jayk123 at hotmail.comCC: m3devel at elegosoft.comSubject: RE: [M3devel] INSTALL_ROOT and PKG_USE in cm3.cfg

Jay:
 
Based on your description of path(), I don't think it is working correctly.
 
My INSTALL_ROOT is turning up as "\.." instead of "C:\cm3\bin\.."
 
If this path() function worked as advertised, I think your solution might work.  Reactor/CM3-IDE is running from C:\cm3\bin, so when it uses quake to evaluate cm3.cfg, shouldn't it come up with "C:\cm3\bin\.." for the path?  Maybe it does, and if so, then the ".." in the path may be confusing internally when it tries to make paths like "C:\cm3\bin\..\pkg".  I don't know.  Just a thought.
 
Regards,
Randy>>> Jay <jayk123 at hotmail.com> 1/24/2008 11:44 PM >>>1) the general user population could revert back to cminstall; nobody else complained except me (a common occurence), and Olaf did improve it; I'd have to deign to putting together such a distribution yuck. Perhaps when a nice GUI installer comes along it won't feel so bad.2) Again, can you make the stuff you are working on available? To just some people? path() returns the directory of the currently executing Quake code.And in this case, the file is in the directory that contains cm3.exe, so it is cm3.exe's directory, which we know is INSTALLROOT\bin, so go up one with .. and we have INSTALLROOT. It's a little unsightly to have ".." in all the resulting paths, but I think it is worth it. It could be fixed in a number of ways. 1) add a function PathDotDot or PathUp to cm3 2) more generally add a function PathCanonicalize to cm3. Or heck, move more and more of this stuff into cm3. I asked about this recently -- what are the requirements for compatibility with older tools. It is that unanswered, and presuming "the worst", besides my persistant distaste for Modula-3, that keeps me writing Quake code..  - Jay


Date: Thu, 24 Jan 2008 21:48:28 -0500From: rcoleburn at scires.comTo: jay123 at hotmail.com; jayk123 at hotmail.comCC: m3devel at elegosoft.comSubject: Re: [M3devel] INSTALL_ROOT and PKG_USE in cm3.cfg
Jay:
 
I've already edited my version of cm3.cfg to make it work for me.
 
I don't know what the path() function does.
 
The path() function is only used in the following code:
 
if not defined("INSTALL_ROOT")    if not equal ($INSTALLROOT, "")        INSTALL_ROOT = $INSTALLROOT    else        INSTALL_ROOT = (path() & "\\..")    endend
Since this code is not executed when I define INSTALL_ROOT as "c:\\cm3", there is no need to remove it for my use.
 
I've already confirmed that the other variables I need get set correctly inside CM3-IDE/Reactor once the INSTALL_ROOT is set properly.  Note that a bunch of variables inside cm3.cfg depend on INSTALL_ROOT.
 
I'm still want to find a solution for the general user population.
 
Regards,
Randy>>> Jay <jayk123 at hotmail.com> 1/24/2008 9:23 PM >>>Randy, don't worry, whatever you do, I'll be able to recover from. Just try editing your \cm3\bin\cm3.cfg file to say INSTALLROOT="c:\cm3" or whatever.Remove the path() function as a variable.See what happens. Maybe it's the problem, maybe not. It is something that I changed, and is worth trying the old way. Use write() and error() to print the other variables. Can you make the stuff you are working on available? To just some people?  - Jay


Date: Thu, 24 Jan 2008 21:07:29 -0500From: rcoleburn at scires.comTo: jay123 at hotmail.com; jayk123 at hotmail.comCC: m3devel at elegosoft.comSubject: Re: [M3devel] INSTALL_ROOT and PKG_USE in cm3.cfg
Jay:
 
Not sure exactly what you mean by:>I'm not sure what versions of cm3 have path(). I did think I saw it missing the other day.
I assume you are not referring to the path env variable.  Is this some built-in quake function or a function you have written in quake?
The version of cm3.cfg that I am using is the one that *you* put in the minimal binary installation for windows.
 
Reactor does indeed "run" the cm3.cfg in that it uses quake to load and interpret this file.
 
What is the significance of doing the copy you suggest below?
>In terms of my workflow, you can go ahead and copy NT386 to the config-no-install directory. I'll survive.
I'm not trying to be obtuse here.  It's just that you have been working on the windows distribution and all these scripts etc for a while now.  I don't want to mess up anything you are doing and I know I don't have a deep understanding of all this, so I am reluctant to change anything like cm3.cfg for my needs.
 
My goal is to make the CM3-IDE (old Reactor) available to everyone.  As I said before, it does "run" the cm3.cfg and it needs to use this somehow to come up with a valid "PKG_USE" which should point to the "pkg" folder inside the cm3 installation root.
 
Regards,
Randy
>>> Jay <jayk123 at hotmail.com> 1/24/2008 8:33 PM >>>I'm not sure what versions of cm3 have path(). I did think I saw it missing the other day.That could be your problem.m3cgcat also doesn't like my config file, it wants to open it to find TARGET, not sure it uses it at all, but it wants it. When I run mcgcat, I first put back a TARGET line in my cm3.cfg. And then remove it.This is very related.I would suspect that whoever reads the files MIGHT find it acceptable to RUN them.Running them doesn't mean compiling or linking or anything, those are functions that the "host" would chose to call or not. But toplevel can have arbitrary code so maybe this is not great. Reactor is a persistant web server though, right? It should be ok "running" the file, esp. since it doesn't start often. The "normal" alternative that other folks use is to run cminstall, which I find all but useless. In terms of my workflow, you can go ahead and copy NT386 to the config-no-install directory. I'll survive. Randy you should try debugging stuff. Quake is readily debuggabe through printing. if defined("path")  write("path is defined")  write("path is " & path())else  write("path is not defined")enderror("") I put in error so I stop after my printing and don't go and build stuff when my intent was just to run a snippet of Quake.  - Jay 



Date: Thu, 24 Jan 2008 20:06:09 -0500From: rcoleburn at scires.comTo: jay123 at hotmail.com; jayk123 at hotmail.comCC: m3devel at elegosoft.comSubject: RE: [M3devel] INSTALL_ROOT and PKG_USE in cm3.cfg

Jay:
 
That's the reason I asked before making a change.  I don't want to break or mess up what you are doing.
 
I can get around the problem easily for me.  I just remove the comment from the 
%INSTALL_ROOT="c:\\cm3" 
and "everything" is ok.
 
I'm hoping we can come up with a way that works for everyone.  Once the CM3_IDE (formerly known as Reactor) package is in the repository and part of the standard distribution, it would be best if folks don't have to go around editing cm3.cfg to make it work properly.
 
Now, you are saying your way is more automatic and portable.  I like these words.  Is there a way we can set something in cm3.cfg that I can key off of for CM3_IDE/Reactor?  I don't mind changing the code to accommodate.
 
The big thing for CM3_IDE/Reactor, is that it needs to know where to look for the cm3 installation because it has to find all of the subdirs, like doc, examples, etc.
 
BTW, I still don't see why all this "works" since I am getting "\.." as my INSTALL_ROOT.
 
Regards,
Randy>>> Jay <jayk123 at hotmail.com> 1/24/2008 7:24 PM >>>Blech. My way is more automatic and "portable" in the sense that you can move installations around and they keep working. As well, with my way, you just extract an archive and go, no setup/cminstall, no editing of the cm3.cfg file, just set %PATH% and run vcvars, and vcvars I think I can remove the need for. path() is a builtin Quake function that returns the directory of the currently being run Quake code. But yet Reactor.To unblock yourself, remove my code, add back the commented out, fix the path to match your particular install, don't submit the file. Perhaps move the current checked in file over to the config-no-install directory and then put config's file back in the old style, that requires running cminstall. My workflow will keep working, since it probes for config-no-install first.  - Jay



Date: Thu, 24 Jan 2008 18:53:48 -0500From: rcoleburn at scires.comTo: jay123 at hotmail.comCC: m3devel at elegosoft.comSubject: [M3devel] INSTALL_ROOT and PKG_USE in cm3.cfg

Jay:
 
The cm3.cfg that comes with your minimal binary installation on Windows (NT386) has the following lines:
 
-----------------------------------------
% INSTALL_ROOT = BEGIN_CONFIG%   "Where should CM3 be installed?"%     7 %-- user specified install root% END_CONFIG
 
% INSTALL_ROOT = "c:\\cm3"
 
if not defined("INSTALL_ROOT")    if not equal ($INSTALLROOT, "")        INSTALL_ROOT = $INSTALLROOT    else        INSTALL_ROOT = (path() & "\\..")    endend
 
BIN_INSTALL   = INSTALL_ROOT & "\\bin"          % executablesLIB_INSTALL   = INSTALL_ROOT & "\\lib"          % librariesPKG_INSTALL   = INSTALL_ROOT & "\\pkg"          % packagesDOC_INSTALL   = INSTALL_ROOT & "\\doc"          % documentsEMACS_INSTALL = INSTALL_ROOT & "\\elisp"        % emacs lisp codeMAN_INSTALL   = INSTALL_ROOT & "\\man"          % man pagesHTML_INSTALL  = INSTALL_ROOT & "\\www"          % public hypertext
 
%% On some systems (e.g. AFS) you must install public files in a different% place from where you use them.  If that is the case for your system,% specify the "use" location here, otherwise leave them alone.%%USE_ROOT  = INSTALL_ROOTBIN_USE   = BIN_INSTALL   % executablesLIB_USE   = LIB_INSTALL   % librariesPKG_USE   = PKG_INSTALL   % packages
-----------------------------------------
 
Notice that the lines for INSTALL_ROOT and USE_ROOT are commented out.
 
The Reactor program is coded to grab several variables out of cm3.cfg.  For example,
 
    build_dir       := M3Config.Get ("BUILD_DIR");    system_root     := M3Config.Get ("PKG_USE");    doc_root        := M3Config.Get ("DOC_INSTALL");    initial_browser := M3Config.Get ("INITIAL_CM3_IDE_BROWSER");    initial_editor  := M3Config.Get ("INITIAL_CM3_IDE_EDITOR");
What is happening on my installation is that PKG_USE winds up being "\..\PKG".  This is not a valid path and it is causing all sorts of trouble for Reactor.
 
The reason it is getting set this way is that the ELSE branch of the, if not defined("INSTALL_ROOT"), is getting executed resulting in INSTALL_ROOT=\..
 
I'm not sure why this is coded this way.
 
How do you suggest this should be repaired?  
 
Note, I have not checked all of the cm3.cfg variants for the other target platforms, but in order for reactor to work properly, it must be able to find a valid "PKG_USE" in the cm3.cfg.
 
Regards,
Randy

Climb to the top of the charts! Play the word scramble challenge with star power. Play now! 

Climb to the top of the charts! Play the word scramble challenge with star power. Play now! 

Need to know the score, the latest news, or you need your Hotmail®-get your "fix". Check it out. 

Need to know the score, the latest news, or you need your Hotmail®-get your "fix". Check it out. 
_________________________________________________________________
Shed those extra pounds with MSN and The Biggest Loser!
http://biggestloser.msn.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20080125/a3fd26ef/attachment-0002.html>


More information about the M3devel mailing list