RejectedSoftware Forums

Sign up

Weird compiler error

import vibe.http.client;
shared static this() {
	HTTPClient http = connectHTTP("", 8080);
	http.request((scope HTTPClientRequest req) {
	}, (scope HTTPClientResponse res) {
	});
}

When I compile the code above with dub --build=release, using DMD 2.0.67, the compiler error below will happen. This does not happen when I compile a debug build. I extracted the regex code from vibe.d and put it into a simpler .d, and it works fine.

Has anyone seen this before, and perhaps knows of a workaround?

Also, CowArray? :D

D:\Stuff\dmd2\windows\bin....\src\phobos\std\uni.d(3141): Error: integral constant must be scalar type, not void
D:\Stuff\dmd2\windows\bin....\src\phobos\std\uni.d(3165): Error: this.data is not yet implemented at compile time
D:\Stuff\dmd2\windows\bin....\src\phobos\std\uni.d(2074): called from here: (Intervals!(CowArray!(GcPolicy)) slInter3055 = Intervals(0u, 0u, CowArray(null));
,
slInter3055).this((CowArray!(GcPolicy) copytmp3056 = ref CowArray!(GcPolicy) this = copytmp3056 = this.data;
, !(ref CowArray!(GcPolicy) this = this;
, this.data.length == 0u) && (ref CowArray!(GcPolicy) this = this;
, (uint cnt = (ref CowArray!(GcPolicy) this = this;
, this.data[dollar - 1u]) + 1u;
) , this.data[
dollar - 1u] = cnt);
, copytmp3056))
D:\Stuff\dmd2\windows\bin\..\..\src\phobos\std\uni.d(1974): called from here: set.byInterval()
D:\Stuff\dmd2\windows\bin\..\..\src\phobos\std\uni.d(5909): called from here: (InversionList!(GcPolicy)
slInver4170 = InversionList(CowArray(null));
, slInver4170).this(asSet(cast(const(ubyte)[])tab()[cast(uint)idx].compressed))
D:\Stuff\dmd2\windows\bin\..\..\src\phobos\std\uni.d(5909): called from here: dest.opAssign((InversionList!(GcPolicy)
slInver4170 = InversionList(CowArray(null));
, slInver4170).this(asSet(cast(const(ubyte)[])tab()[cast(uint)idx].compressed)))
D:\Stuff\dmd2\windows\bin\..\..\src\phobos\std\uni.d(6008): called from here: loadUnicodeSet(name, target)
D:\Stuff\dmd2\windows\bin\..\..\src\phobos\std\uni.d(6222): called from here: loadProperty(name, set)
D:\Stuff\dmd2\windows\bin\..\..\src\phobos\std\uni.d(6115): called from here: loadAny("White_Space")
D:\Stuff\dmd2\windows\bin\..\..\src\phobos\std\regex\internal\parser.d(1320): called from here: opDispatch()
D:\Stuff\dmd2\windows\bin\..\..\src\phobos\std\regex\internal\parser.d(1320): called from here: this.charsetToIr(opDispatch())
D:\Stuff\dmd2\windows\bin\..\..\src\phobos\std\regex\internal\parser.d(770): called from here: this.parseEscape()
D:\Stuff\dmd2\windows\bin\..\..\src\phobos\std\regex\internal\parser.d(595): called from here: this.parseAtom()
D:\Stuff\dmd2\windows\bin\..\..\src\phobos\std\regex\internal\parser.d(322): called from here: this.parseRegex()
D:\Stuff\dmd2\windows\bin\..\..\src\phobos\std\regex\package.d(324): called from here: parser.this(pattern, flags)
D:\Stuff\dmd2\windows\bin\..\..\src\phobos\std\regex\package.d(316): called from here: regexImpl(pattern, flags)
C:\Users\Marcio\AppData\Roaming\dub\packages\vibe-d-0.7.23\source\vibe\http\client.d(470): called from here: regex("^\\s*((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[
0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))\\s*$", "")
D:\Stuff\dmd2\windows\bin\..\..\src\phobos\std\uni.d(3141): Error: integral constant must be scalar type, not void
D:\Stuff\dmd2\windows\bin\..\..\src\phobos\std\uni.d(3165): Error: this.data is not yet implemented at compile time
D:\Stuff\dmd2\windows\bin\..\..\src\phobos\std\uni.d(2074): called from here: (Intervals!(CowArray!(GcPolicy))
slInter3055 = Intervals(0u, 0u, CowArray(null));
, slInter3055).this((CowArray!(GcPolicy) copytmp3056 = ref CowArray!(GcPolicy) this = copytmp3056 = this.data;
, !(ref CowArray!(GcPolicy) this = this;
, this.data.length == 0u) && (ref CowArray!(GcPolicy) this = this;
, (uint cnt = (ref CowArray!(GcPolicy) this = this;
, this.data[
dollar - 1u]) + 1u;
) , this.data[dollar - 1u] = cnt);
,
copytmp3056))
D:\Stuff\dmd2\windows\bin....\src\phobos\std\uni.d(1974): called from here: set.byInterval()
D:\Stuff\dmd2\windows\bin....\src\phobos\std\uni.d(5909): called from here: (InversionList!(GcPolicy) slInver4170 = InversionList(CowArray(null));
,
slInver4170).this(asSet(cast(const(ubyte)[])tab()[cast(uint)idx].compressed))
D:\Stuff\dmd2\windows\bin....\src\phobos\std\uni.d(5909): called from here: dest.opAssign((InversionList!(GcPolicy) slInver4170 = InversionList(CowArray(null));
,
slInver4170).this(asSet(cast(const(ubyte)[])tab()[cast(uint)idx].compressed)))
D:\Stuff\dmd2\windows\bin....\src\phobos\std\uni.d(6008): called from here: loadUnicodeSet(name, target)
D:\Stuff\dmd2\windows\bin....\src\phobos\std\uni.d(6222): called from here: loadProperty(name, set)
D:\Stuff\dmd2\windows\bin....\src\phobos\std\uni.d(6115): called from here: loadAny("White_Space")
D:\Stuff\dmd2\windows\bin....\src\phobos\std\regex\internal\parser.d(1320): called from here: opDispatch()
D:\Stuff\dmd2\windows\bin....\src\phobos\std\regex\internal\parser.d(1320): called from here: this.charsetToIr(opDispatch())
D:\Stuff\dmd2\windows\bin....\src\phobos\std\regex\internal\parser.d(770): called from here: this.parseEscape()
D:\Stuff\dmd2\windows\bin....\src\phobos\std\regex\internal\parser.d(595): called from here: this.parseAtom()
D:\Stuff\dmd2\windows\bin....\src\phobos\std\regex\internal\parser.d(322): called from here: this.parseRegex()
D:\Stuff\dmd2\windows\bin....\src\phobos\std\regex\package.d(324): called from here: parser.this(pattern, flags)
D:\Stuff\dmd2\windows\bin....\src\phobos\std\regex\package.d(316): called from here: regexImpl(pattern, flags)
C:\Users\Marcio\AppData\Roaming\dub\packages\vibe-d-0.7.23\source\vibe\http\client.d(471): called from here: regex("^\\s((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}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ler error

try

dub run -b release --combined

On Wed, 22 Apr 2015 18:48:17 GMT, Márcio Martins wrote:

When I compile the code above with dub --build=release, using DMD 2.0.67, the compiler error below will happen. This does not happen when I compile a debug build. I extracted the regex code from vibe.d and put it into a simpler .d, and it works fine.

Has anyone seen this before, and perhaps knows of a workaround?

Re: Weird compiler error

Seems to be a DMD 2.067.0 regression (still doesn't work in 2.067.1, but
works for 2.066.1). Unfortunately it's always a but nasty to reduce such
cross-library regressions... you'd have to copy the relevant code form
phobos into a separate DUB package and change the code in
vibe.http.client to use that version. Then "dub dustmite" should do
the trick.

I don't have time to look into this now, but in general I'd eventually
like to replace that regex code by something more concise anyway (also
to get compile times down). That IPv6 regex is really ridiculously large.

Re: Weird compiler error

On Mon, 27 Apr 2015 10:37:40 +0200, Sönke Ludwig wrote:

Seems to be a DMD 2.067.0 regression (still doesn't work in 2.067.1, but
works for 2.066.1). Unfortunately it's always a but nasty to reduce such
cross-library regressions... you'd have to copy the relevant code form
phobos into a separate DUB package and change the code in
vibe.http.client to use that version. Then "dub dustmite" should do
the trick.

I don't have time to look into this now, but in general I'd eventually
like to replace that regex code by something more concise anyway (also
to get compile times down). That IPv6 regex is really ridiculously large.

I tried the --combined approach and it works fine, though it hogs all my VM's memory, and seems to take a lot longer to compiler - I guess it's due to higher load on the swap file!

Sönke, I think that is a good idea. I currently refrain from using too much CTFE magic, as our project grows, compile times are becoming more and more noticeable.

Thanks guys!