New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GDC-4.{9,8} don't like vibe.core.stream #647

Closed
Geod24 opened this Issue May 5, 2014 · 8 comments

Comments

Projects
None yet
3 participants
@Geod24
Contributor

Geod24 commented May 5, 2014

While hunting for another bug, I came across this one. Very annoying.

How to reproduce:

dub init test vibe.d
cd test
echo "import vibe.core.stream;" > source/app.d
dub build --compiler=gdc-4.9 # FAIL
dub build --compiler=gdc-4.8 # FAIL
dub build --compiler=dmd # Success

Notice the odd error message:

Running gdc-4.8...
/usr/include/d/4.8/std/traits.d:2573: error: template instance isStaticArray!(__T23RepresentationTypeTupleTS3std9container54__T5ArrayTS4vibe4core7drivers9libevent212TimeoutEntryZ5Array7PayloadZ) does not match template declaration isStaticArray(T)
/usr/include/d/4.8/std/traits.d:2583: error: template instance isPointer!(__T23RepresentationTypeTupleTS3std9container54__T5ArrayTS4vibe4core7drivers9libevent212TimeoutEntryZ5Array7PayloadZ) does not match template declaration isPointer(T)
/usr/include/d/4.8/std/traits.d:2583: error: template instance isDynamicArray!(__T23RepresentationTypeTupleTS3std9container54__T5ArrayTS4vibe4core7drivers9libevent212TimeoutEntryZ5Array7PayloadZ) does not match template declaration isDynamicArray(T)
/usr/include/d/4.8/std/traits.d:2584: error: template instance isAssociativeArray!(__T23RepresentationTypeTupleTS3std9container54__T5ArrayTS4vibe4core7drivers9libevent212TimeoutEntryZ5Array7PayloadZ) does not match template declaration isAssociativeArray(T)
/usr/include/d/4.8/std/traits.d:2586: error: template instance std.traits.hasIndirections!(Payload).Impl!(__T23RepresentationTypeTupleTS3std9container54__T5ArrayTS4vibe4core7drivers9libevent212TimeoutEntryZ5Array7PayloadZ) error instantiating
/usr/include/d/4.8/std/traits.d:2590: note: instantiated from here: Impl!(Payload, __T23RepresentationTypeTupleTS3std9container54__T5ArrayTS4vibe4core7drivers9libevent212TimeoutEntryZ5Array7PayloadZ)
/usr/include/d/4.8/std/typecons.d:3602: note: instantiated from here: hasIndirections!(Payload)
/usr/include/d/4.8/std/container.d:2645: note: instantiated from here: RefCounted!(Payload, cast(RefCountedAutoInitialize)0)
/home/geod/.dub/packages/vibe-d-0.7.19/source/vibe/core/drivers/libevent2.d:75: note: instantiated from here: Array!(TimeoutEntry)
/usr/include/d/4.8/std/traits.d:2590: error: template instance std.traits.hasIndirections!(Payload).Impl!(Payload, __T23RepresentationTypeTupleTS3std9container54__T5ArrayTS4vibe4core7drivers9libevent212TimeoutEntryZ5Array7PayloadZ) error instantiating
/usr/include/d/4.8/std/typecons.d:3602: note: instantiated from here: hasIndirections!(Payload)
/usr/include/d/4.8/std/container.d:2645: note: instantiated from here: RefCounted!(Payload, cast(RefCountedAutoInitialize)0)
/home/geod/.dub/packages/vibe-d-0.7.19/source/vibe/core/drivers/libevent2.d:75: note: instantiated from here: Array!(TimeoutEntry)
/usr/include/d/4.8/std/typecons.d:3602: error: template instance std.traits.hasIndirections!(Payload) error instantiating
/usr/include/d/4.8/std/container.d:2645: note: instantiated from here: RefCounted!(Payload, cast(RefCountedAutoInitialize)0)
/home/geod/.dub/packages/vibe-d-0.7.19/source/vibe/core/drivers/libevent2.d:75: note: instantiated from here: Array!(TimeoutEntry)
/home/geod/.dub/packages/vibe-d-0.7.19/source/vibe/core/drivers/libevent2.d:75: error: template instance std.container.Array!(TimeoutEntry) error instantiating
FAIL .dub/build/application-debug-linux.posix-x86_64-gdc-4.8-9A0B9692462D2125FF8204CCC9531C78 test executable
Error executing command build: GDC compile run failed with exit code 1

Now if you also import vibe.core.sync in the same file, it compiles just fine.

Note: I used the gdc compilers from d-apt repository.

geod@Barsoom:~/test$ gdc-4.9 --version
gdc-4.9 (Debian 4.9.0-1) 4.9.0
geod@Barsoom:~/test$ gdc-4.8 --version
gdc-4.8 (Debian 4.8.2-21) 4.8.2

I'm surprised no one noticed it earlyier, as core.stream is publicly imported by http.{server,client}

@s-ludwig

This comment has been minimized.

Show comment
Hide comment
@s-ludwig

s-ludwig May 5, 2014

Member

Which DMD frontend are those GDC versions based on? I think the most recent GDC version works with vibe.d, but the 2.063 frontend has an issue with std.container.BinaryHeap!(std.container.Array!T). It could be worked around pretty easily by replacing this in core/drivers/libevent.d:75 with something else (the most naive replacement that probably works would be to use Array!T and then call sort on that after each insertion).

Member

s-ludwig commented May 5, 2014

Which DMD frontend are those GDC versions based on? I think the most recent GDC version works with vibe.d, but the 2.063 frontend has an issue with std.container.BinaryHeap!(std.container.Array!T). It could be worked around pretty easily by replacing this in core/drivers/libevent.d:75 with something else (the most naive replacement that probably works would be to use Array!T and then call sort on that after each insertion).

@mihails-strasuns

This comment has been minimized.

Show comment
Hide comment
@mihails-strasuns

mihails-strasuns May 5, 2014

Contributor

checking frontend version can be done by compiling this small D program:

pragma(msg, __VERSION__);
Contributor

mihails-strasuns commented May 5, 2014

checking frontend version can be done by compiling this small D program:

pragma(msg, __VERSION__);
@mihails-strasuns

This comment has been minimized.

Show comment
Hide comment
@mihails-strasuns

mihails-strasuns May 5, 2014

Contributor

Also there are no GDC/LDC packages in D-APT repos as far as I know.

Contributor

mihails-strasuns commented May 5, 2014

Also there are no GDC/LDC packages in D-APT repos as far as I know.

@Geod24

This comment has been minimized.

Show comment
Hide comment
@Geod24

Geod24 May 6, 2014

Contributor

You are right, they are in Jessie/testing.
Thanks for the trick, I started to look in .deb... Both gdc-4.8 and 4.9 output '2064L'.

Contributor

Geod24 commented May 6, 2014

You are right, they are in Jessie/testing.
Thanks for the trick, I started to look in .deb... Both gdc-4.8 and 4.9 output '2064L'.

@s-ludwig s-ludwig added this to the 0.7.20 milestone May 16, 2014

@s-ludwig

This comment has been minimized.

Show comment
Hide comment
@s-ludwig

s-ludwig May 17, 2014

Member

I've added a less efficient workaround using DList for <2.065 now. Can you test again if that fixed it?

Member

s-ludwig commented May 17, 2014

I've added a less efficient workaround using DList for <2.065 now. Can you test again if that fixed it?

@s-ludwig

This comment has been minimized.

Show comment
Hide comment
@s-ludwig

s-ludwig May 20, 2014

Member

BTW, I didn't find any GDC packages in the d-apt repository.

Member

s-ludwig commented May 20, 2014

BTW, I didn't find any GDC packages in the d-apt repository.

@s-ludwig

This comment has been minimized.

Show comment
Hide comment
@s-ludwig

s-ludwig May 20, 2014

Member

I've tested now with the one from the Ubuntu repository (14.04, 4.8 based, 2.064 front end) and import vibe.core.stream; compiles fine.

Member

s-ludwig commented May 20, 2014

I've tested now with the one from the Ubuntu repository (14.04, 4.8 based, 2.064 front end) and import vibe.core.stream; compiles fine.

@s-ludwig s-ludwig closed this May 20, 2014

@s-ludwig s-ludwig reopened this May 20, 2014

@s-ludwig s-ludwig closed this in cc3ba00 May 20, 2014

s-ludwig added a commit that referenced this issue May 20, 2014

Fix the fix for the for #647... Fixes #670.
No idea why compilation didn't fail for me locally.

s-ludwig added a commit that referenced this issue May 20, 2014

Fix the fix for the fix for #647... Fixes #670.
No idea why compilation didn't fail for me locally.
@s-ludwig

This comment has been minimized.

Show comment
Hide comment
@s-ludwig

s-ludwig May 20, 2014

Member

Not my day it seems...

Member

s-ludwig commented May 20, 2014

Not my day it seems...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment