www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - can't build git head phobos

reply "anonymous" <anonymous example.com> writes:
Git head dmd and druntime build fine, but phobos hangs at
(shortened):

../dmd/src/dmd -I../druntime/import  -w -m64  -O -release -lib
-ofgenerated/linux/release/64/libphobos2.a
../druntime/lib/libdruntime-linux64.a [... *.d ...] [... *.o ...]

This used to finish in a couple of seconds. Now it runs forever,
maxing out one core while memory consumption doesn't change.
Looks like dmd is in an endless loop.

I'm running a 64 bit Ubuntu. I'm testing with fresh clones from
Github:
----
mkdir dtest
cd dtest
git clone https://github.com/D-Programming-Language/dmd
git clone https://github.com/D-Programming-Language/druntime
git clone https://github.com/D-Programming-Language/phobos
cd dmd
make -f posix.mak
cd ../druntime
make -f posix.mak
cd ../phobos
make -f posix.mak
----

I tried compiling the .d files individually, and got an error
with std/concurrency.d:

----
../dmd/src/dmd -I../druntime/import  -w -m64  -O -release -lib
-ofgenerated/linux/release/64/libphobos2.a
../druntime/lib/libdruntime-linux64.a std/concurrency.d
----
std/array.d(2586): Error: CTFE ICE: cannot resolve array length
std/range/primitives.d(191):        called from here: r.put(e)
std/range/primitives.d(280):        called from here: doPut(r, e)
std/format.d(802):        called from here: put(writer,
this.trailing[0..i])
std/format.d(443):        called from here:
spec.writeUpToNextSpec(w)
std/format.d(6378):        called from here: formattedWrite(w,
fmt, _param_1, _param_2)
std/typecons.d(406):        called from here: format("alias _%s =
Identity!(field[%s]);", 0LU, 0LU)
std/typecons.d(496):        called from here: injectNamedFields()
std/typecons.d(496): Error: argument to mixin must be a string,
not (injectNamedFields()) of type string
std/array.d(2586): Error: CTFE ICE: cannot resolve array length
std/range/primitives.d(191):        called from here: r.put(e)
std/range/primitives.d(280):        called from here: doPut(r, e)
std/format.d(802):        called from here: put(writer,
this.trailing[0..i])
std/format.d(443):        called from here:
spec.writeUpToNextSpec(w)
std/format.d(6378):        called from here: formattedWrite(w,
fmt, _param_1, _param_2)
std/typecons.d(406):        called from here: format("alias _%s =
Identity!(field[%s]);", 0LU, 0LU)
std/typecons.d(496):        called from here: injectNamedFields()
std/typecons.d(496): Error: argument to mixin must be a string,
not (injectNamedFields()) of type string
std/typecons.d(506): Error: template instance
std.typecons.Tuple!(ulong, ulong) error instantiating
std/algorithm.d(9491):        instantiated from here:
Tuple!(ulong, "pos", ulong, "len")
std/concurrency.d(1005):        instantiated from here:
remove!(cast(SwapStrategy)0, string[], long)
std/concurrency.d(997): Error: function
std.concurrency.unregister no return exp; or assert(0); at end of
function
----
Nov 30 2014
parent reply "anonymous" <anonymous example.com> writes:
On Sunday, 30 November 2014 at 12:22:58 UTC, anonymous wrote:
 I'm testing with fresh clones from
 Github:
Seems to be an issue with my setup. Testing on a fresh user, phobos builds without problems.
Nov 30 2014
parent "anonymous" <anonymous example.com> writes:
On Sunday, 30 November 2014 at 12:41:38 UTC, anonymous wrote:
 Seems to be an issue with my setup. Testing on a fresh user,
 phobos builds without problems.
Alright, traced it down. I have a copy of gdc lying around. Its /bin/ was in my $PATH. Apparently, gdc's g++ caused the trouble. When I move it out of the way so that /usr/bin/g++ is used, everything's fine. So, as far as I understand it, when dmd is built with gdc's g++, the result is a faulty binary. This may hint at a bug in dmd or g++.
Nov 30 2014