[M3devel] package groups question
Jay K
jay.krell at cornell.edu
Thu Jul 30 22:11:41 CEST 2009
Randy, the short answer is:
Find a goal state in a graph, which you haven't clearly done, walk that graph from the bottom up, and if there are circularities (there are, you need to have cm3 first, before you can build cm3), you need to download prebuilt files from somewhere (cm3 and mklib).
Everything else is filling in the details of the goal state, discovering the circularities, and that we have the graph recorded in a redundant fashion in pkginfo.txt. The real data is the m3makefiles.
longer answer:
Randy, what is a "minimal" distribution? You have't defined the goal.
What is "build"? You haven't defined the goal.
I could just say: "Whatever you need, to build it, just download it from here."
I'll define it as some arbitrary very minimal compiler and runtime set, specifically m3core and libm3.
But you can have working Modula-3 programs certainly without libm3.
And some Modula-3 programs will have a GUI so will want more libraries.
What is "minimal"?
And depending on future changes, the steps might change.
Or maybe just pkginfo.txt will change.
If there is no documentation and there is code, the code is the documentation.
A lot of the code is declarative -- you look at the import statements in m3makefile.
For given package foo, say "cm3", you walk the list of imports transitively.
I'm not sure cm3 actually uses libm3 for example, and maybe it won't in the future.
This is a very real point. pkginfo.txt duplicates dependency information by
nature of being "in the correct order", but that information is already contained
in the m3makefiles. Your questions have made me realize the redundancy we have
and that we should fix it.
Or, really, older cm3 did not use sysutils, but now it does.
Things change.
And you haven't really defined the goal.
Instead of "walk pkginfo.txt in order", it should be "pick a package you want,
say cm3, and build its dependency tree from the bottom up, using the m3makefiles
to discover that tree, plus the PKGS file to locate packages".
I'm going to make up a goal that might resemble yours and correct your instructions.
> 1. Install Visual C++ 2008 Express Edition.
ok. Though you don't need all of it by far.
You don't need the entire IDE.
>
> 2. Download latest minimal binary distribution and unzip to "C:\cm3" so that you have C:\cm3\bin, C:\cm3\pkg, etc..
No. You don't need all of it. You only need two files -- cm3.exe and mklib.exe.
Other platforms need cm3cg and don't need mklib.
Except you never really need cm3cg, it falls out of the instructions -- cm3 can build it.
It depends on how much you want to build vs. download.
And optionally the config files. You can get them from either the source tree or download them.
See, two legitimate places for things -- download from one place or another.
>
>
> 3. Checkout complete CVS CM3 tree and place in say "C:\cm3\Sandbox", so now Sandbox has m3-sys, m3-libs, scripts, etc.
No. You don't need all of it.
You need, roughly, only m3-libs\m3core, m3-libs\libm3, m3-libs\sysutils, some of m3-sys.
m3-sys/m3cc is needed for most platforms, but not the gcc-apple directory, that's
only for iphone.
>
> 4. Copy "C:\cm3\Sandbox\doc" folder to "C:\cm3\doc"
Not needed.
>
> 5. Copy "C:\cm3\Sandbox\examples" folder to "C:\cm3\examples"
Not needed.
>
> 6. Open Visual Studio Command prompt window and put "C:\cm3\bin" on your path.
Many ways to do that.
>
>
> 7. For each file in "Sandbox\m3-sys\cm3install\src\config-no-install" and "Sandbox\m3-sys\cm3install\src\config" delete the corresponding file in "C:\cm3\bin" if it exists.
Multiple ways to do this but ok.
>
>
> 8. mkdir "C:\cm3\bin\config" if it is missing
ok. You can just mkdir unconditionally.
>
>
> 9. copy contents of "C:\cm3\Sandbox\m3-sys\cm3install\src\config-no-install" to "C:\cm3\bin\config"
You don't need all of it, but ok, that is what I do.
>
>
> 10. (Re)create "C:\cm3\cm3.cfg" to contain the following 2 lines only:
>
> INSTALL_ROOT = path() & "/.."
>
> include(path() & "/config/" & HOST)
ok
>
>
> 11. Rebuild the compiler and minimal install using the latest sources in "C:\cm3\Sandbox". The only packages that need to be built are those listed in the "min" group in "Sandbox\scripts\PkgInfo.txt". Build them in the order listed using -realclean -build -ship. (Granted, there may be scripts for this, but is what I am saying here what is actually required?)
No. Well, it depends on the goal. Really.
You already have a cm3.
"min" gives you m3core and libm3.
Combine that with the cm3 you already have and great, you have a slightly larger more useful set of libraries.
>
>
> 12. Repeat step #11 to ensure the new compiler is used to rebuild the core stuff.
NOt really. The repitition isn't doing what you say.
Look at the group called "front".
Which isn't completely accurate since it includes m3cc.
Perhaps there should be a group compiler.
But really, again, this is cm3 plus its transitive dependencies.
I think maybe we need to partly ditch "groups".
In paritcular, "groups" should contain useful end results and not their dependencies.
m3middle doesn't belong in any group, it is just implied by cm3.
Seriously.
But the scripts don't currently read m3makefiles.
Redoing things in cm3 would be better?
>
>
> 13. Now, for any or all packages listed in "Sandbox\scripts\PkgInfo.txt", use cm3 to build and ship those that you want. You could build everything, but for example, if you wanted only a "std" installation, you could simply build and ship only those packages tagged as "std".
Ok. Sort of.
>
> I know you've probably got scripts for all of this
Yep.
> Scripts are an expression of the requirements
Sometimes it is the other way around.
- Jay
More information about the M3devel
mailing list