CompNeedsDoc.Tioga
Last Edited by: Spreitzer, November 21, 1983 9:12 pm
While you're waiting for the system modeller, try CompNeeds!
CompNeeds is a hack that determines (by parsing (parts of) source files) what needs to be compiled in order to get up-to-date BCDs for a given list of modules (interfaces, programs and configs).
To use it:
% Bringover /a /p [Indigo]<PreCedar>Top>CompNeeds.DF
% Run CompNeeds
or
% Run [Indigo]<PostCedar>CompNeeds>CompNeeds.BCD
then
% CompNeeds <list of module names>
This will produce (but not execute) a command to compile and bind all that is necessary.
For example, suppose you have a definitions file Bar.Mesa, a definitions file Foo.Mesa that depends on Bar, and a program FooImpl.Mesa. You have compiled Bar, then Foo, then FooImpl. But then you needed to make a change to Bar. You did so, and recompiled it. Now, doing
% CompNeeds FooImpl
should type out
Compile Foo FooImpl;
%
You can execute this by copying with Tioga.
The reason the command is only typed, not executed, is to allow you to review it. CompNeeds is unable to distinguish what is in the release from what is not. Also, CompNeeds is not completely correct, in that it uses create dates, rather than functional version stamps. As a consequence, it is possible for CompNeeds to mistakenly decide to compile something that doesn't need it. If that something is in the release, compiling it could cause great difficulties. Hence the ability to review.
Every time CompNeeds analyzes a source, it caches the result, so that the time to re-analyze it is not spent unless the file's create date changes.
If CompNeeds thinks there is a syntax error in the source, a message will be displayed, and parsing of the offending file will be aborted. Information from the file before the syntax error will be used. A known mis-feature: CompNeeds does not know about FROM phrases in DIRECTORY clauses.
The rules that CompNeeds uses to determine what needs to be compiled can be found in comments at the beginning of CompNeeds.Mesa.
CompNeeds also registers another command: ListNeeds.
% ListNeeds <list of module names>
will list, for each module, the create dates for the source and bcd files (if they exist) of it and the modules it depends on. An exclaimation mark after a module name indicates that the last time CompNeeds looked at that module, it determined that that module's bcd was needed for some compilation (or binding).