From ac632af043f57841c19d511e195e91b556144a60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Sun, 18 Mar 2018 11:45:52 +0100 Subject: [PATCH 1/8] Test on DMD 2.079.0 and LDC 1.8.0. Excluding the intermediate versions to avoid unnecessary CI job bloat. --- .travis.yml | 4 +++- appveyor.yml | 18 +++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index bffeccc01f..404e43ec13 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,12 +19,14 @@ d: # this way the overall test time gets cut down (GDC/LDC are a lot # slower tham DMD, so they should be started early), while still # catching most DMD version related build failures early - - dmd-2.075.0 + - dmd-2.079.0 - dmd-2.068.2 + - ldc-1.8.0 - ldc-1.3.0 - ldc-1.2.0 - ldc-1.1.1 - ldc-1.0.0 + - dmd-2.075.0 - dmd-2.074.1 - dmd-2.073.2 - dmd-2.072.2 diff --git a/appveyor.yml b/appveyor.yml index 57f9d31646..ccb8d9f81d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,25 +2,29 @@ platform: x64 environment: matrix: - DC: dmd - DVersion: 2.076.0 + DVersion: 2.079.0 arch: x64 config: win32 - DC: dmd - DVersion: 2.076.0 + DVersion: 2.079.0 arch: x86 config: win32 - DC: dmd - DVersion: 2.076.0 + DVersion: 2.079.0 arch: x86_mscoff config: win32 - DC: dmd - DVersion: 2.076.0 + DVersion: 2.079.0 arch: x86 config: libevent - DC: dmd - DVersion: 2.076.0 + DVersion: 2.079.0 arch: x86 config: libasync + - DC: dmd + DVersion: 2.079.0 + arch: x86_mscoff + config: win32 - DC: dmd DVersion: 2.076.0 arch: x86_mscoff @@ -49,6 +53,10 @@ environment: DVersion: 2.070.0 arch: x64 config: win32 + - DC: ldc + DVersion: 1.8.0 + arch: x64 + config: win32 - DC: ldc DVersion: 1.3.0 arch: x64 From 53b74a2db11b892e569c9f8763557794526c6947 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Mon, 19 Mar 2018 10:38:29 +0100 Subject: [PATCH 2/8] Fix SO_REUSEPORT redefinition. --- source/vibe/core/drivers/utils.d | 1 + 1 file changed, 1 insertion(+) diff --git a/source/vibe/core/drivers/utils.d b/source/vibe/core/drivers/utils.d index fd1258bcf8..21c096d302 100644 --- a/source/vibe/core/drivers/utils.d +++ b/source/vibe/core/drivers/utils.d @@ -49,6 +49,7 @@ version (Windows) { } else alias SystemSocketException = ErrnoException; version (linux) { + import core.sys.posix.sys.socket; static if (!is(typeof(SO_REUSEPORT))) { enum { SO_REUSEPORT = 15 } } From 1ae1dabf578efaa4c6dd1b75f3e122b13f0eae44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Mon, 19 Mar 2018 11:39:11 +0100 Subject: [PATCH 3/8] Reduce buffer size to avoid OOM errors on Win32. --- tests/vibe.core.net.1726/source/app.d | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/vibe.core.net.1726/source/app.d b/tests/vibe.core.net.1726/source/app.d index f664abc8b3..843c0bf8fb 100644 --- a/tests/vibe.core.net.1726/source/app.d +++ b/tests/vibe.core.net.1726/source/app.d @@ -6,7 +6,7 @@ import vibe.core.log; shared static this() { bool done = false; - auto buf = new ubyte[512*1024*1024]; + auto buf = new ubyte[256*1024*1024]; listenTCP(11375,(conn) { bool read_ex = false; @@ -37,7 +37,7 @@ shared static this() assert(read_ex, "No read exception thrown"); assert(write_ex, "No write exception thrown"); exitEventLoop(); - }); + }, "127.0.0.1"); runTask({ try { From 254a2c9225c1c7cdda5dcbef222fb4b8b6d56bdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Sun, 18 Mar 2018 11:24:49 +0100 Subject: [PATCH 4/8] Fix serialization test for the latest DMD versions. --- source/vibe/data/serialization.d | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/source/vibe/data/serialization.d b/source/vibe/data/serialization.d index f6b9e9b732..e8d80b8c2b 100644 --- a/source/vibe/data/serialization.d +++ b/source/vibe/data/serialization.d @@ -523,7 +523,7 @@ private template deserializeValueImpl(Serializer, alias Policy) { return cast(T) deserializeValue!(Unqual!T, ATTRIBUTES)(ser); } - T deserializeValue(T, ATTRIBUTES...)(ref Serializer ser) if(isMutable!T) + T deserializeValue(T, ATTRIBUTES...)(ref Serializer ser) if(isMutable!T) { import std.typecons : BitFlags, Nullable; @@ -1285,7 +1285,8 @@ unittest { // basic serialization behavior test(12.0f, "V(f)(12)"); assert(serialize!TestSerializer(null) == "null"); test(["hello", "world"], "A(AAya)[2][AE(Aya,0)(V(Aya)(hello))AE(Aya,0)AE(Aya,1)(V(Aya)(world))AE(Aya,1)]A(AAya)"); - test(["hello": "world"], "D(HAyaAya){DE(Aya,hello)(V(Aya)(world))DE(Aya,hello)}D(HAyaAya)"); + string mangleOfAA = (string[string]).mangleof; + test(["hello": "world"], "D(" ~ mangleOfAA ~ "){DE(Aya,hello)(V(Aya)(world))DE(Aya,hello)}D(" ~ mangleOfAA ~ ")"); test(cast(int*)null, "null"); int i = 42; test(&i, "V(i)(42)"); @@ -1438,14 +1439,14 @@ unittest // Make sure serializing through properties still works unittest // Immutable data deserialization { import vibe.data.json; - + static struct S { int a; } static class C { immutable(S)[] arr; } - + auto c = new C; c.arr ~= S(10); auto d = c.serializeToJson().deserializeJson!(immutable C); @@ -1559,7 +1560,7 @@ unittest { auto ser_red = "V(Aya)(red)"; assert(serializeWithPolicy!(TestSerializer, P)(E.RED) == ser_red, serializeWithPolicy!(TestSerializer, P)(E.RED)); assert(deserializeWithPolicy!(TestSerializer, P, E)(ser_red) == E.RED); - + import vibe.data.json : Json, JsonSerializer; assert(serializeWithPolicy!(JsonSerializer, P)(E.RED) == Json("red")); } From 9cce01faa162488c5a67ef5583f865b73814a507 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Mon, 19 Mar 2018 13:44:48 +0100 Subject: [PATCH 5/8] Skip failing IPv6 test on Travis. --- travis-ci.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/travis-ci.sh b/travis-ci.sh index 1c0a59931d..717c054225 100755 --- a/travis-ci.sh +++ b/travis-ci.sh @@ -29,8 +29,12 @@ if [ ${BUILD_EXAMPLE=1} -eq 1 ]; then fi if [ ${RUN_TEST=1} -eq 1 ]; then for ex in `\ls -1 tests/`; do - echo "[INFO] Running test $ex" - (cd tests/$ex && dub --compiler=$DC && dub clean) + if [ $ex == "vibe.http.server.1388" ]; then + echo "[WARNING] Skipping test $ex due to TravisCI incompatibility". + else + echo "[INFO] Running test $ex" + (cd tests/$ex && dub --compiler=$DC && dub clean) + fi done fi From 0e4639bdf3b57b62603ac33b9cabfd51706ce2be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Mon, 19 Mar 2018 14:33:39 +0100 Subject: [PATCH 6/8] Avoid IPv6 only listen addresses in tests to fix Travis-CI build. --- tests/vibe.http.server.1721/source/app.d | 4 ++-- tests/vibe.http.server.host-header/source/app.d | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/vibe.http.server.1721/source/app.d b/tests/vibe.http.server.1721/source/app.d index 1d6f9b91ae..829979028f 100644 --- a/tests/vibe.http.server.1721/source/app.d +++ b/tests/vibe.http.server.1721/source/app.d @@ -11,7 +11,7 @@ shared static this() { auto s1 = new HTTPServerSettings; s1.options &= ~HTTPServerOption.errorStackTraces; - s1.bindAddresses = ["::1"]; + s1.bindAddresses = ["127.0.0.1"]; s1.port = 11721; listenHTTP(s1, &handler); @@ -19,7 +19,7 @@ shared static this() scope (exit) exitEventLoop(); try { - auto conn = connectTCP("::1", 11721); + auto conn = connectTCP("127.0.0.1", 11721); conn.write("GET / HTTP/1.0\r\n\r\n"); string res = cast(string)conn.readLine(); assert(res == "HTTP/1.0 200 OK", res); diff --git a/tests/vibe.http.server.host-header/source/app.d b/tests/vibe.http.server.host-header/source/app.d index 6e7868dbc8..94a3f7f272 100644 --- a/tests/vibe.http.server.host-header/source/app.d +++ b/tests/vibe.http.server.host-header/source/app.d @@ -10,15 +10,15 @@ shared static this() { auto s1 = new HTTPServerSettings; s1.options &= ~HTTPServerOption.errorStackTraces; - s1.bindAddresses = ["::1"]; + s1.bindAddresses = ["127.0.0.1"]; s1.port = 11388; listenHTTP(s1, &handler); runTask({ scope (failure) assert(false); - auto conn = connectTCP("::1", 11388); - conn.write("GET / HTTP/1.1\r\nHost: [::1]\r\n\r\n"); + auto conn = connectTCP("127.0.0.1", 11388); + conn.write("GET / HTTP/1.1\r\nHost: 127.0.0.1\r\n\r\n"); string res = cast(string)conn.readLine(); assert(res == "HTTP/1.1 200 OK", res); while (conn.readLine().length > 0) {} @@ -36,7 +36,7 @@ shared static this() assert(!conn.connected && conn.empty); logInfo("1.1 without Host header OK."); - conn = connectTCP("::1", 11388); + conn = connectTCP("127.0.0.1", 11388); conn.write("GET / HTTP/1.0\r\n\r\n"); res = cast(string)conn.readLine(); assert(res == "HTTP/1.0 200 OK", res); From 21304933b6682745c1165df33c860411e6065bc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Mon, 19 Mar 2018 18:27:57 +0100 Subject: [PATCH 7/8] Ignore DUB related failures. --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 404e43ec13..72cb4e784f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -48,6 +48,8 @@ matrix: env: VIBED_DRIVER=libasync BUILD_EXAMPLE=0 RUN_TEST=0 allow_failures: - d: dmd-beta + - d: dmd-2.072.2 # incompatible dub version + - d: ldc-1.1.1 # buggy dub version - d: ldc-1.3.0 env: VIBED_DRIVER=libasync BUILD_EXAMPLE=0 RUN_TEST=0 - d: dmd-2.068.2 From b594d17dd4a6af95bc5d5cd0ff9a1fefbd4b0935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Wed, 21 Mar 2018 19:53:42 +0100 Subject: [PATCH 8/8] Fix download of LDC >= 1.7.0 --- appveyor.yml | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index ccb8d9f81d..ddbd163c1a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -108,15 +108,22 @@ install: } $env:toolchain = "msvc"; $version = $env:DVersion; - Invoke-WebRequest "https://github.com/ldc-developers/ldc/releases/download/v$($version)/ldc2-$($version)-win64-msvc.zip" -OutFile "c:\ldc.zip"; - echo "finished."; - pushd c:\\; - 7z x ldc.zip > $null; - popd; + if($version -eq "1.3.0" -Or $version -eq "1.4.0" -Or $version -eq "1.5.0" -Or $version -eq "1.6.0") { + Invoke-WebRequest "https://github.com/ldc-developers/ldc/releases/download/v$($version)/ldc2-$($version)-win64-msvc.zip" -OutFile "c:\ldc.zip"; + echo "finished."; + pushd c:\\; + 7z x ldc.zip > $null; + popd; + } else { + Invoke-WebRequest "https://github.com/ldc-developers/ldc/releases/download/v$($version)/ldc2-$($version)-windows-$($env:arch).7z" -OutFile "c:\ldc.7z"; + pushd c:\\; + 7z x ldc.7z > $null; + popd; + } } } - ps: SetUpDCompiler - - powershell -Command Invoke-WebRequest https://code.dlang.org/files/dub-1.2.1-windows-x86.zip -OutFile dub.zip + - powershell -Command [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Invoke-WebRequest "https://github.com/dlang/dub/releases/download/v1.7.2/dub-1.7.2-windows-x86.zip" -OutFile dub.zip - 7z x dub.zip -odub > nul - set PATH=%CD%\%binpath%;%CD%\dub;%PATH% - dub --version @@ -139,7 +146,11 @@ before_build: } elseif($env:DC -eq "ldc"){ $version = $env:DVersion; - $env:PATH += ";C:\ldc2-$($version)-win64-msvc\bin"; + if($version -eq "1.3.0" -Or $version -eq "1.4.0" -Or $version -eq "1.5.0" -Or $version -eq "1.6.0") { + $env:PATH += ";C:\ldc2-$($version)-win64-msvc\bin"; + } else { + $env:PATH += ";C:\ldc2-$($version)-windows-$($env:arch)\bin"; + } $env:DC = "ldc2"; } - ps: $env:compilersetup = "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall";