Source code control in Eiffel 
Author Message
 Source code control in Eiffel

UNIX programmers are no doubt familiar with SCCS.
Using SCCS with C files one would insert a line like:
#pragma ident "%Z%%Y%%M% %I% %E% %U%" which SCCS maps to
"(#)<filename> <ver#> <date> <time>".

        In our office we use SCCS for all our source code
including Ace files and Eiffel classes.  In each Eiffel class
we insert a constant attribute of the form:
CLASSNAME_SCCSID : STRING is "%%Q%%Z%%Y%%M%%Q%% %%Q%%I%%Q%%
%%Q%%E%%Q%% %%Q%%U%%Q%%".  The attribute is prefixed by the
class name to prevent name clashes with inheritance.  The extra
characters are needed because percent signs have special meaning
in Eiffel strings.  By making the SCCS string be an attribute
it appears in the executable code and can be searched for using
the UNIX "what" command.

        Unfortunately, to get the SCCS string to appear in the executable code
you must set dead code removal to no in the Ace
file or make use of all the SCCS string attributes for all the
classes used in the code.  Currently, we set dead code removal
to no, resulting in executables about 70% larger.

        With ISE 3.3.7, I attempted to limit no dead code
removal to the clusters written in house but the compiler
complains this option is only available at the system level.
Will future versions have this retriction removed?  Does
anyone have any other ideas for improving on my solution for
source code control with Eiffel under UNIX?

---------------------------------------------------------------
 Paul Des Rivieres   Senior Computer Analyst/Programmer
 Communications Security Establishment, Govt of Canada, Ottawa



Fri, 04 Dec 1998 03:00:00 GMT  
 Source code control in Eiffel



Quote:
>UNIX programmers are no doubt familiar with SCCS.  <...>
>In each Eiffel class
>we insert a constant attribute of the form:
>CLASSNAME_SCCSID : STRING is "%%Q%%Z%%Y%%M%%Q%% %%Q%%I%%Q%%
>%%Q%%E%%Q%% %%Q%%U%%Q%%".  <...>

>    Unfortunately, to get the SCCS string to appear in the executable code
>you must set dead code removal to no in the Ace
>file or make use of all the SCCS string attributes for all the
>classes used in the code.  Currently, we set dead code removal
>to no, resulting in executables about 70% larger.

Messing with dead code removal strikes me as throwing the baby out
with the bath water.

I can't think of any ways of getting what you want that aren't
hacks, but then, what you're trying to do is essentially a low-level
hack from the C tradition.  (A very pragmatic and *useful* hack to
be sure, but a hack nonetheless).

Here are some ideas:

    *  Have some class (perhaps called GROTESQUE_SCCS_KLUDGE) with a feature
       that accesses the CLASSNAME_SCCSID constant of every class in the
       system.  Write a small script that automatically creates the source
       code of this class as part of your build process.  Your main class
       will probably need to call this feature somewhere.

    *  As above, but make the results available via a command-line switch.
       This way, you don't have to rely on the "what" command (which is,
       after all, a tad non-portable -- what happens if Eiffel starts
       using Unicode internally, hmmmm?).

    *  Get a real configuration management / build management system
       that records the versions of every file used for a given build.

    *  If possible, adopt a more disciplined release process, where you
       don't need to ask youself "Is this the FROBULATOR class from before
       or after the changes I made on St. Swithen's day"?  YMMV

Just my $0.02,
--
Bill Foote                       |  L'homme est n pour vivre dans les

http://www.jovial.com/~billf/    |  lthargie de l'ennui       -- Voltaire



Sat, 12 Dec 1998 03:00:00 GMT  
 Source code control in Eiffel

|> The first time I see someone complaining that Eiffel compilers optimize too much!
|> And that's true that now, the assembly language code obtained from an Eiffel
|> program followed with a gcc compilation is quite impressive. Far beyond what is
|> achieved most of the time with C++ and the virtual/non virtual/inline mess.
|>
|> May be a solution to your problem would be to insert the following code
|> in each creation routine of the classes where you want to keep the SCCS string
|> for runtime identification:
|>
|>   if False then print(CLASSNAME_SCCSID) end
|>
|> I doubt the compiler would be smart enough to optimize this out. And then the
|> value of CLASSNAME_SCCSID would be kept at runtime.
|> I did not try it though.
Sorry, but for SmallEiffel, the print instruction is dead code and thus, no C code
is produced for the print call (this is true in mode -boost).

--
------------------------------------------------------------
Dominique COLNET -- Talk Eiffel with SmallEiffel Talk Eiffel
C.R.I.N. (Centre de Recherche en Informatique de Nancy)
POST: CRIN,BP 239,54506 Vandoeuvre les Nancy Cedex,FRANCE



Fri, 18 Dec 1998 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. GNU Eiffel Compiler source code

2. C++ To Eiffel Source Code Translator

3. Java, C, and C++ To Eiffel Source Code Translator

4. Data Recovery SOURCE CODE ( SOURCE CODES of Professional Data Recovery Software )

5. Converting FORTRAN source code to C source code

6. Source code control for VisualWorks ?

7. Source Code Control With RealBasic

8. Digitalk's Team/V for Source Code Control

9. Source Code Control system wanted

10. Source Code Problem: Loop true all controls on a window

11. Source code for CW Stock Control

12. Best source code control program

 

 
Powered by phpBB® Forum Software