Release build headache: -inline

Jonathan M Davis jmdavisProg at gmx.com
Sat Mar 5 15:56:27 PST 2011


On Saturday 05 March 2011 15:37:15 Tom wrote:
> I have some kind of a middle-size project written in D2. I've been
> compiling always with -debug -unittest switches and, despite having to
> workaround two or three bugs since the beginning, I could always build
> everything. Now I'm ready to give release build a try, so I go with -O
> -release -noboundscheck -inline and get:
> 
> E:\d\dmd2\windows\bin\..\..\src\phobos\std\typecons.d(364): expression
> expected, not 'EOF'
> E:\d\dmd2\windows\bin\..\..\src\phobos\std\typecons.d(364): found 'EOF'
> when exp ecting ']'
> E:\d\dmd2\windows\bin\..\..\src\phobos\std\typecons.d(364): found 'EOF'
> when expecting ')' following template argument list
> E:\d\dmd2\windows\bin\..\..\src\phobos\std\typecons.d(364): found 'EOF'
> when expecting ']'
> E:\d\dmd2\windows\bin\..\..\src\phobos\std\typecons.d(364): found 'EOF'
> when expecting ')' following template argument list
> E:\d\dmd2\windows\bin\..\..\src\phobos\std\typecons.d(364): found 'EOF'
> when expecting ']'
> E:\d\dmd2\windows\bin\..\..\src\phobos\std\typecons.d(364): found 'EOF'
> when expecting ')' following template argument list
> E:\d\dmd2\windows\bin\..\..\src\phobos\std\typecons.d(364): found 'EOF'
> when expecting ']'
> E:\d\dmd2\windows\bin\..\..\src\phobos\std\typecons.d(364): found 'EOF'
> when expecting ')' following template argument list
> E:\d\dmd2\windows\bin\..\..\src\phobos\std\typecons.d(364): found 'EOF'
> when expecting ']'
> E:\d\dmd2\windows\bin\..\..\src\phobos\std\typecons.d(364): found 'EOF'
> when expecting ')' following template argument list
> E:\d\dmd2\windows\bin\..\..\src\phobos\std\typecons.d(364): no
> identifier for declarator
> Identity!(field[Identity!(field[Identity!(field[Identity!(field[Identity!(f
> ield[0])])])])])
> E:\d\dmd2\windows\bin\..\..\src\phobos\std\typecons.d(364): semicolon
> expected, not 'EOF'
> 
> If I remove -inline, it compiles, but I need performance and to track
> this DMD bug at this point is too damn hard. Any suggestions? :'(


Hmm. It looks like it's probably failing due to a bad string mixin related to a 
tuple - though the fact that it only happens with -inline would make it so that 
it's a dmd bug of some kind (regardless of how good of bad the string mixin is).

It's mixing in an alias for each of the types in the tuple, and somehow, it ends 
up with mismatched brackets. To really debug this, it's probably going to 
require know _exactly_ what the tuple is that's failing. It looks like it's a 
tuple which holds several levels of tuples for its first type/field - something 
like 4 or 5 of them. Maybe it's blowing up on some kind of recursive template 
instantiation or something.

So, if you can, _please_ find which tuple is dying. Splitting up the build so 
that you only build one file at a time should make it so that you can find the 
offending file, which should make it much easier to find the offending line.

> Sometimes I have sinful thoughts and I regret having done this in D...
> But now is too late.

The reality of the matter is that as fantastic as D2 is, it is still in 
development, and you run into bugs from time to time. Usually, they're not too 
bad, but sometimes they can be pretty nasty. Fortunately, things have been 
steadily improving. Unfortunately, bugs need to be _found_ before they can be 
fixed, and using D for real projects helps us find bugs and make it so that you 
_won't_ have problems with D in real projects.

I suppose that it's a bit like KDE 4.0's situation. They felt that they had to 
release it or the developers wouldn't port their applications to it, and it 
wouldn't be ready in any kind of reasonable time frame, but releasing it in the 
state that it was meant that they were releasing a version which really wasn't 
ready for general use yet. However, as applications were ported to it and 
brave/foolish people used it, it improved. And now, the current KDE 4 is quite 
solid.

So, I feel for you, but at the same time, we _need_ people to be developing in D 
and running into the bugs in dmd, druntime, and Phobos if it's going to become 
fully fit for general development.

- Jonathn M Davis


More information about the Digitalmars-d-learn mailing list