Error by building druntime

Jonathan M Davis jmdavisProg at gmx.com
Sun Dec 23 15:06:58 PST 2012


On Sunday, December 23, 2012 23:53:16 Namespace wrote:
> I tried to fork and build dmd, druntime and phobos. With dmd it
> works fine but if I try "make -f win32.mak" on druntime I get:
> [code]
> src\core\sys\windows\windows.d(81): Warning: else is dangling,
> add { } after con
> dition at src\core\sys\windows\windows.d(17)
> src\core\sys\windows\windows.d(164): Warning: else is dangling,
> add { } after co
> ndition at src\core\sys\windows\windows.d(17)
> src\core\sys\windows\windows.d(1286): Warning: else is dangling,
> add { } after c
> ondition at src\core\sys\windows\windows.d(17)
> src\rt\arraycast.d(33): Error: object.Error is thrown but not
> caught
> src\rt\arraycast.d(26): Error: function rt.arraycast._d_arraycast
> '_d_arraycast'
>   is nothrow yet may throw
> src\rt\arraycat.d(36): Error: object.Error is thrown but not
> caught
> src\rt\arraycat.d(45): Error: object.Error is thrown but not
> caught
> src\rt\arraycat.d(25): Error: function rt.arraycat._d_arraycopy
> '_d_arraycopy' i
> s nothrow yet may throw
> [/code]
> 
> Is that my fault? :o
> Is there any official manual for building dmd, druntime and
> phobos?

You need to build the current versions of druntime and Phobos with the current 
version of dmd, and you need to build the current version of Phobos with the 
current version of druntime. Mixing and matching versions will inevitably 
result in compilation errors.

I'm sure that someone has instructions for it somewhere, but I don't know 
where.

This page on the wiki explains some but not enough:

http://wiki.dlang.org/Pull_Requests

I'd expect fuller instructions to end up on the wiki at some point though. I 
wrote this up a while ago, but I don't know if it needs any tweaking at this 
point or not.:

--------------------
* Download dmc from dlang.org. Unzip it in C:\

* Download dmd from dlang.org. Unzip it in C:\

* Add this to your path: C:\dm\bin;C:\dmd2\windows\bin

* Download libcurl from dlang.org. Unzip it in C:\ so that the files in its 
dmd2
  directory go in C:\dmd2

* Build a test program to make sure that dmd works properly.

* Create a directory to hold your git repositories. (I'm assuming C:\github)

* Setup your dmd, druntime, and phobos repositories in C:\github per the
  instructions on github for setting up repositories

* Change C:\dmd2\windows\bin\sc.ini to this:
-------------
[Version]
version=7.51 Build 020

[Environment]
LIB="c:\github\druntime\lib";"c:\github\phobos\";"c:\dmd2\windows\lib";c:
\dm\lib
DFLAGS="-Ic:\github\phobos\";"c:\github\druntime\import"
LINKCMD=%@P%\link.exe
-------------

* Go to C:\github\dmd\src and run
make -f win32.mak clean
make -f win32.mak

Make sure that you run a clean for every build of dmd. It's makefiles don't 
always
work correctly when you do partial builds.

* Copy C:\github\dmd\src\dmd.exe to C:\dmd2\windows\bin

* Run dmd without any arguments and check its version number to make sure that
  it's one greater than the latest release.

* Go to C:\github\druntime and run
make -f win32.mak clean
make -f win32.mak

You may see errors from the clean about files which didn't exist. They happen
because the makefile is trying to delete stuff that won't exist until you've
run a build.

* Go to C:\github\phobos and run
make -f win32.mak clean
make -f win32.mak

* dmd should now work properly with the latest druntime and Phobos.

* If you wish to run the unit tests for either druntime or Phobos, then go to
  that repository and run
make -f win32.mak clean
make -f win32.mak unittest
make -f win32.mak
unittest.exe

If you build druntime's unit tests, make sure that you build it normally again
afterwards, or your druntime may not be setup correctly for normal usage.
--------------------

Since I wrote it primarily for myself, it may make assumptions about how you 
want to set things up that aren't necessary (e.g. using C:\github), and there 
may be ways to do things better. But it should at least help you along.


- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list