Hacking on Phobos

Jacob Carlborg doob at me.com
Wed Apr 18 03:04:17 PDT 2012


On 2012-04-17 20:10, Joseph Rushton Wakeling wrote:
> Hello all,
>
> As per earlier discussion I'm trying to hack on Phobos to update the
> random sampling code.
>
> To do this I've just copied random.d into a new file, randomsample.d,
> which I'm modifying and messing around with; I'm trying to build against
> a local copy of the GitHub Phobos sources.

This is how I'm compiling when developing on dmd, druntime or phobos. 
Create a new directory, <path>. Clone dmd, druntime and phobos to <path> 
from github: https://github.com/D-Programming-Language

Download and install DVM: https://bitbucket.org/doob/dvm

Run "dvm compile <path>". This will compile dmd, druntime and phobos and 
setup a correct dmd.conf file. The binary will be placed in 
<path>/dmd/bin<arch>, if I recall correctly.

Then I create a build script, <path>/phobos/build.sh, looking something 
like this:

#!/bin/bash

dvm compile ..
rdmd --compiler=../dmd/bin<arch>/dmd --build-only main.d

"main.d" would be a test file I'm using. Then I just run "./build.sh" 
and it will build everything.

main.d and build.sh can be added to <path>/phobos/.git/info/exclude to 
be ignored.

> I can't find any easy or friendly "get started hacking on Phobos" page,
> so can anyone advise how to get set up correctly?

I've thought about this several times, we need one badly.

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list