Where do you keep your source? (was Re: Module packaging)

Pragma ericanderton at yahoo.removeme.com
Thu May 17 13:41:03 PDT 2007


Justin C Calvarese wrote:
> Julio César Carrascal Urquijo wrote:
>> Anders F Björklund wrote:
>>> Thiago wrote:
>>>
>>>> Someone could tell me if such system already exists? If not, its 
>>>> creation would be a good idea?
>>>
>>> See http://dsource.org/projects/dsss/, the "D Shared Software System"
>>>
>>> You can also use normal packaging for C/C++ etc. I normally install 
>>> the import modules in $PREFIX/include/d and the libraries in 
>>> $PREFIX/lib...
>>>
>>> --anders
>>
>> I think he refers to a standard folder where a library can be dropped 
>> and it's included by the compiler automatically.
> 
> Just for fun, let's take a survey.
> 
> I can't decide where to store my code. On my home computer I've been 
> using "C:\pgm\d\src", but on my work computer, I've been using 
> "D:\MyFiles\pgm\d\src".
> 
> I suspect at least one person is using "C:\dmd\src" (or something similar).
> 
> But I have multiple versions of DMD on my comptuer, so I guess I would 
> have to decide between:
> C:\PrgFiles\dmd-1.000\src
> C:\PrgFiles\dmd-1.007\src
> C:\PrgFiles\dmd-1.013\src
> etc.
> 
> 

I take a two-pronged approach under Windows.

First off I have a DMD installation \bin directory on the current %PATH%, that contains any libraries I use frequently 
tucked away under that installation's include path.  I recently moved from Phobos to Tango, so this was under 
c:\programs\dmd and is now under c:\programs\tango.  I have rebuild and bud installed side-by-side with dmd.exe, with 
one or the other copied to "build.exe".  This makes it easy to switch build tools if need be.

Then, when doing development I do all my builds from that project's root, with any secondary libraries (code that's 
experimental, beta, patched by me, unstable, etc.) dumped in that directory.  This way I keep the main include path free 
from such clutter and thus, projects don't interfere with each other should they have common dependencies.

I do *not* use pre-compiled libraries in any of my development, save phobos.lib and tango.lib.  DMD and OPTLINK are so 
damn fast that there's no point for open projects.  Since bud/rebuild are less sophisticated than make (can't associate 
a lib build with its dependencies to trigger a sub-build), I find that this is almost necessary in some cases.  As it 
happens, it also makes things very easy to hack should the need arise.

I've never used multiple versions of DMD, but if I had to, I'd probably rename my install dir and install the secondary 
compiler in it's place - renaming directories as needed.

While we're on the topic, my Linux setup is a little more conventional.

I followed the install instructions on the Wiki for Phobos, and I'll be shifting to Tango soon via the installer.  I 
typically only use it for VNV* to ensure that my stuff is portable and deployable.  I simply re-extract the current 
project via SVN, as any of you would, and try to build against it.  Changes are made locally and re-submitted to SVN to 
be re-checked in windows the same way.

Using SVN like that may sound kind of crazy, but I've caught quite a few missing files in the repository this way.

Also, FWIW, I've taken to using BASH scripts for larger build tasks in both Windows and Linux.  The Win32 port of the 
GNU Linux shell utilities (sh, ls, find, grep, and more) makes this a snap and is *highly* recommended for anyone who 
works in both systems frequently.

(*not the band "VNV Nation", although they're cool; I mean "Verifcation aNd Validation")

-- 
- EricAnderton at yahoo



More information about the Digitalmars-d mailing list