[ 
https://issues.apache.org/jira/browse/THRIFT-4478?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16505620#comment-16505620
 ] 

ASF GitHub Bot commented on THRIFT-4478:
----------------------------------------

jeking3 closed pull request #1559: THRIFT-4478 Thrift will not build with dlang 
2.078 or later
URL: https://github.com/apache/thrift/pull/1559
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/LANGUAGES.md b/LANGUAGES.md
index 779d9b6bbd..ef3bee299f 100644
--- a/LANGUAGES.md
+++ b/LANGUAGES.md
@@ -101,7 +101,7 @@ The Language/Library Levels indicate the minimum and 
maximum versions that are u
 <td align=left><a href="lib/d/README.md">Dlang</a></td>
 <!-- Since -----------------><td>0.9.0</td>
 <!-- Build Systems ---------><td><img src="doc/images/cgrn.png" 
alt="Yes"/></td><td><img src="doc/images/cred.png" alt=""/></td>
-<!-- Language Levels -------><td>2.073.2</td><td>2.077.1</td>
+<!-- Language Levels -------><td>2.073.2</td><td>2.080.0</td>
 <!-- Low-Level Transports --><td><img src="doc/images/cred.png" 
alt=""/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img 
src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cgrn.png" 
alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img 
src="doc/images/cgrn.png" alt="Yes"/></td>
 <!-- Transport Wrappers ----><td><img src="doc/images/cgrn.png" 
alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img 
src="doc/images/cgrn.png" alt="Yes"/></td>
 <!-- Protocols -------------><td><img src="doc/images/cgrn.png" 
alt="Yes"/></td><td><img src="doc/images/cgrn.png" alt="Yes"/></td><td><img 
src="doc/images/cgrn.png" alt="Yes"/></td><td><img src="doc/images/cred.png" 
alt=""/></td>
diff --git a/build/docker/README.md b/build/docker/README.md
index cae4577b93..324921ead7 100644
--- a/build/docker/README.md
+++ b/build/docker/README.md
@@ -143,7 +143,7 @@ Last updated: October 1, 2017
 | c_glib    | 2.48.2        | 2.54.0        |       |
 | cl (sbcl) |               | 1.4.5         |       |
 | cocoa     |               |               | Not in CI |
-| d         | 2.073.2       | 2.077.1       |       |
+| d         | 2.073.2       | 2.080.0       |       |
 | dart      | 1.22.1        | 1.24.3        |       |
 | delphi    |               |               | Not in CI |
 | dotnet    | 2.1.4         | 2.1.4         | v2.1.4 SDK uses v2.0.5 Runtime |
diff --git a/build/docker/ubuntu-artful/Dockerfile 
b/build/docker/ubuntu-artful/Dockerfile
index d712becaa5..153ce61e0c 100644
--- a/build/docker/ubuntu-artful/Dockerfile
+++ b/build/docker/ubuntu-artful/Dockerfile
@@ -18,8 +18,8 @@
 # - dart: does not come with Ubuntu
 # - dotnet: does not come with Ubuntu
 # - haxe: version 3.4.2 that comes with Ubuntu cores in our CI build
-# - go: xenial comes with 1.8, we want the latest (supported)
-# - nodejs: want v8, Ubuntu comes with v6
+# - go: artful comes with 1.9, we want the latest (supported)
+# - nodejs: want v8, artful comes with v6
 #
 
 FROM buildpack-deps:artful-scm
@@ -103,8 +103,8 @@ RUN \
     sbcl --version && \
     rm -rf sbcl*
 
-ENV D_VERSION     2.077.1
-ENV DMD_DEB       dmd_2.077.1-0_amd64.deb
+ENV D_VERSION     2.080.0
+ENV DMD_DEB       dmd_2.080.0-0_amd64.deb
 RUN \
 `# D dependencies` \
     wget -q http://downloads.dlang.org/releases/2.x/${D_VERSION}/${DMD_DEB} && 
\
diff --git a/lib/d/src/thrift/async/socket.d b/lib/d/src/thrift/async/socket.d
index 6de13d9167..a08f51db08 100644
--- a/lib/d/src/thrift/async/socket.d
+++ b/lib/d/src/thrift/async/socket.d
@@ -18,6 +18,7 @@
  */
 module thrift.async.socket;
 
+import core.stdc.errno: ECONNRESET;
 import core.thread : Fiber;
 import core.time : dur, Duration;
 import std.array : empty;
diff --git a/lib/d/src/thrift/server/transport/base.d 
b/lib/d/src/thrift/server/transport/base.d
index da165d3d32..704e16d21e 100644
--- a/lib/d/src/thrift/server/transport/base.d
+++ b/lib/d/src/thrift/server/transport/base.d
@@ -95,16 +95,7 @@ class TServerTransportException : TException {
 
   ///
   this(Type type, string file = __FILE__, size_t line = __LINE__, Throwable 
next = null) {
-    string msg = "TTransportException: ";
-    switch (type) {
-      case Type.UNKNOWN: msg ~= "Unknown server transport exception"; break;
-      case Type.NOT_LISTENING: msg ~= "Server transport not listening"; break;
-      case Type.ALREADY_LISTENING: msg ~= "Server transport already 
listening"; break;
-      case Type.RESOURCE_FAILED: msg ~= "An underlying resource failed"; break;
-      default: msg ~= "(Invalid exception type)"; break;
-    }
-
-    this(msg, type, file, line, next);
+    this(errorMsg(type), type, file, line, next);
   }
 
   ///
@@ -129,5 +120,18 @@ class TServerTransportException : TException {
 
 protected:
   Type type_;
+
+private:
+  string errorMsg(Type type) {
+    string msg = "TTransportException: ";
+    switch (type) {
+      case Type.UNKNOWN: msg ~= "Unknown server transport exception"; break;
+      case Type.NOT_LISTENING: msg ~= "Server transport not listening"; break;
+      case Type.ALREADY_LISTENING: msg ~= "Server transport already 
listening"; break;
+      case Type.RESOURCE_FAILED: msg ~= "An underlying resource failed"; break;
+      default: msg ~= "(Invalid exception type)"; break;
+    }
+    return msg;
+  }
 }
 
diff --git a/lib/d/src/thrift/transport/file.d 
b/lib/d/src/thrift/transport/file.d
index aac728938f..fe88e73066 100644
--- a/lib/d/src/thrift/transport/file.d
+++ b/lib/d/src/thrift/transport/file.d
@@ -37,7 +37,8 @@ import std.array : empty;
 import std.algorithm : min, max;
 import std.concurrency;
 import std.conv : to;
-import std.datetime : AutoStart, dur, Duration, StopWatch;
+import std.datetime : dur, Duration;
+import std.datetime.stopwatch : AutoStart, StopWatch;
 import std.exception;
 import std.stdio : File;
 import thrift.base;
@@ -1076,15 +1077,15 @@ unittest {
 
       // If any attempt takes more than 500ms, treat that as a fatal failure to
       // avoid looping over a potentially very slow operation.
-      enforce(sw.peek().msecs < 1500,
-        text("close() took ", sw.peek().msecs, "ms."));
+      enforce(sw.peek().total!"msecs" < 1500,
+        text("close() took ", sw.peek().total!"msecs", "ms."));
 
       // Normally, it takes less than 5ms on my dev box.
       // However, if the box is heavily loaded, some of the test runs can take
       // longer. Additionally, on a Windows Server 2008 instance running in
       // a VirtualBox VM, it has been observed that about a quarter of the runs
       // takes (217 ± 1) ms, for reasons not yet known.
-      if (sw.peek().msecs > 50) {
+      if (sw.peek().total!"msecs" > 50) {
         ++numOver;
       }
 
diff --git a/lib/d/src/thrift/transport/socket.d 
b/lib/d/src/thrift/transport/socket.d
index 228abf004b..fcb38da36d 100644
--- a/lib/d/src/thrift/transport/socket.d
+++ b/lib/d/src/thrift/transport/socket.d
@@ -18,6 +18,7 @@
  */
 module thrift.transport.socket;
 
+import core.stdc.errno: ECONNRESET;
 import core.thread : Thread;
 import core.time : dur, Duration;
 import std.array : empty;
@@ -256,7 +257,7 @@ class TSocket : TSocketBase {
         new TCompoundOperationException(
           text(
             "All addresses tried failed (",
-            joiner(map!q{text(a._0, `: "`, a._1.msg, `"`)}(zip(addrs, 
errors)), ", "),
+            joiner(map!q{text(a[0], `: "`, a[1].msg, `"`)}(zip(addrs, 
errors)), ", "),
             ")."
           ),
           errors
diff --git a/lib/d/test/client_pool_test.d b/lib/d/test/client_pool_test.d
index 85bcb291d2..52207d9c7c 100644
--- a/lib/d/test/client_pool_test.d
+++ b/lib/d/test/client_pool_test.d
@@ -409,8 +409,8 @@ void asyncAggregatorTest(const(ushort)[] ports, 
ExTestHandler[] handlers) {
     )();
     Thread.sleep(dur!"msecs"(20));
     auto resultTuple = partialResult.finishGet();
-    enforce(resultTuple._0 == ports[0 .. 2]);
-    enforce(equal(map!"a.port"(cast(TestServiceException[])resultTuple._1),
+    enforce(resultTuple[0] == ports[0 .. 2]);
+    enforce(equal(map!"a.port"(cast(TestServiceException[])resultTuple[1]),
       ports[3 .. $ - 1]));
   }
 }
diff --git a/lib/d/test/serialization_benchmark.d 
b/lib/d/test/serialization_benchmark.d
index 35515c82a5..40d0480942 100644
--- a/lib/d/test/serialization_benchmark.d
+++ b/lib/d/test/serialization_benchmark.d
@@ -13,7 +13,7 @@
  */
 module serialization_benchmark;
 
-import std.datetime : AutoStart, StopWatch;
+import std.datetime.stopwatch : AutoStart, StopWatch;
 import std.math : PI;
 import std.stdio;
 import thrift.protocol.binary;
@@ -46,7 +46,7 @@ void main() {
     }
     sw.stop();
 
-    auto msecs = sw.peek().msecs;
+    auto msecs = sw.peek().total!"msecs";
     writefln("Write: %s ms (%s kHz)", msecs, ITERATIONS / msecs);
   }
 
@@ -64,7 +64,7 @@ void main() {
     }
     sw.stop();
 
-    auto msecs = sw.peek().msecs;
+    auto msecs = sw.peek().total!"msecs";
     writefln(" Read: %s ms (%s kHz)", msecs, ITERATIONS / msecs);
   }
 }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Thrift will not build with dlang 2.078 or later
> -----------------------------------------------
>
>                 Key: THRIFT-4478
>                 URL: https://issues.apache.org/jira/browse/THRIFT-4478
>             Project: Thrift
>          Issue Type: Bug
>          Components: D - Library
>    Affects Versions: 0.11.0
>            Reporter: James E. King III
>            Assignee: Aki Sukegawa
>            Priority: Critical
>             Fix For: 0.12.0
>
>
> I tried to move the ubuntu-artful dlang version up from 2.076.0 to 2.078.1 
> and the build failed here:
> {noformat}
> dmd -L-fuse-ld=gold -L-levent ../libthriftd-event.a -L-fuse-ld=gold -L-lssl 
> -L-lcrypto ../libthriftd-ssl.a -w -wi -O -release -inline 
> -I../../../lib/d/src -Igen-d ../../../lib/d/libthriftd.a 
> -ofserialization_benchmark serialization_benchmark.d 
> gen-d/DebugProtoTest_types.d
> thrift_test_client.d(128): Deprecation: struct 
> std.datetime.StopWatch is deprecated - Use std.datetime.stopwatch.StopWatch.
> thrift_test_client.d(128): Deprecation: struct 
> std.datetime.StopWatch is deprecated - Use std.datetime.stopwatch.StopWatch.
> serialization_benchmark.d(16): Deprecation: alias 
> std.datetime.AutoStart is deprecated - Use std.datetime.stopwatch.AutoStart.
> serialization_benchmark.d(16): Deprecation: alias 
> std.datetime.AutoStart is deprecated - Use std.datetime.stopwatch.AutoStart.
> serialization_benchmark.d(16): Deprecation: struct 
> std.datetime.StopWatch is deprecated - Use std.datetime.stopwatch.StopWatch.
> serialization_benchmark.d(16): Deprecation: struct 
> std.datetime.StopWatch is deprecated - Use std.datetime.stopwatch.StopWatch.
> thrift_test_client.d(338): Deprecation: struct 
> std.datetime.StopWatch is deprecated - Use std.datetime.stopwatch.StopWatch.
> thrift_test_client.d(338): Deprecation: alias 
> std.datetime.AutoStart is deprecated - Use std.datetime.stopwatch.AutoStart.
> thrift_test_client.d(338): Deprecation: struct 
> std.datetime.StopWatch is deprecated - Use std.datetime.stopwatch.StopWatch.
> serialization_benchmark.d(42): Deprecation: struct 
> std.datetime.StopWatch is deprecated - Use std.datetime.stopwatch.StopWatch.
> serialization_benchmark.d(60): Deprecation: struct 
> std.datetime.StopWatch is deprecated - Use std.datetime.stopwatch.StopWatch.
> /usr/include/dmd/druntime/import/object.d(3461): Error: no 
> property 'tupleof' for type 
> 'const(HashSet!(string[immutable(Insanity)][])[int][immutable(HashSet!int)])'
> /usr/include/dmd/druntime/import/object.d(3461): Error: no 
> property 'tupleof' for type 
> 'const(HashSet!(string[immutable(Insanity)][])[int][immutable(HashSet!int)])'
> ../../../lib/d/src/thrift/codegen/base.d(466): Error: template 
> instance 
> object.__equals!(const(HashSet!(string[immutable(Insanity)][])[int][immutable(HashSet!int)]),
>  const(HashSet!(string[immutable(Insanity)][])[int][immutable(HashSet!int)])) 
> error instantiating
> /usr/include/dmd/druntime/import/object.d(3461): Error: no 
> property 'tupleof' for type 'const(HashSet!string[int])'
> /usr/include/dmd/druntime/import/object.d(3461): Error: no 
> property 'tupleof' for type 'const(HashSet!string[int])'
> ../../../lib/d/src/thrift/codegen/base.d(466): Error: template 
> instance object.__equals!(const(HashSet!string[int]), 
> const(HashSet!string[int])) error instantiating
> Makefile:803: recipe for target 'thrift_test_client' failed
> make[5]: *** [thrift_test_client] Error 1
> make[5]: *** Waiting for unfinished jobs....
> /usr/include/dmd/druntime/import/object.d(3461): Error: no 
> property 'tupleof' for type 
> 'const(HashSet!(string[immutable(Insanity)][])[int][immutable(HashSet!int)])'
> /usr/include/dmd/druntime/import/object.d(3461): Error: no 
> property 'tupleof' for type 
> 'const(HashSet!(string[immutable(Insanity)][])[int][immutable(HashSet!int)])'
> ../../../lib/d/src/thrift/codegen/base.d(466): Error: template 
> instance 
> object.__equals!(const(HashSet!(string[immutable(Insanity)][])[int][immutable(HashSet!int)]),
>  const(HashSet!(string[immutable(Insanity)][])[int][immutable(HashSet!int)])) 
> error instantiating
> /usr/include/dmd/druntime/import/object.d(3461): Error: no 
> property 'tupleof' for type 'const(HashSet!string[int])'
> /usr/include/dmd/druntime/import/object.d(3461): Error: no 
> property 'tupleof' for type 'const(HashSet!string[int])'
> ../../../lib/d/src/thrift/codegen/base.d(466): Error: template 
> instance object.__equals!(const(HashSet!string[int]), 
> const(HashSet!string[int])) error instantiating
> Makefile:806: recipe for target 'thrift_test_server' failed
> make[5]: *** [thrift_test_server] Error 1
> make[5]: Leaving directory '/thrift/src/lib/d/test'
> {noformat}
> When I backed it down to 2.077.1, things worked again.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to