You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by jo...@apache.org on 2017/02/17 01:50:53 UTC

[1/7] mesos git commit: Stout: Explicitly marked protobuf file as using v2 syntax.

Repository: mesos
Updated Branches:
  refs/heads/master 83c564cda -> 85d9d4ef2


Stout: Explicitly marked protobuf file as using v2 syntax.

`protoc` will complain about `.proto` files that do not explicitly
specify the version of PB syntax they're using. On Windows, this
registers as a build warning.

To ameliorate this, we explicitly specify the syntax in all `.proto`
files.

NOTE: The generated protobuf does not need to be updated because
this commit does not change the content of the protobuf.  This
change only explicitly marks the syntax of the file.

Review: https://reviews.apache.org/r/56594/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/7bfba7d8
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/7bfba7d8
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/7bfba7d8

Branch: refs/heads/master
Commit: 7bfba7d8c835694c4f74b65e5693ed050c65db20
Parents: e81612d
Author: Anthony Sottile <as...@yelp.com>
Authored: Thu Feb 16 15:02:42 2017 -0800
Committer: Joseph Wu <jo...@apache.org>
Committed: Thu Feb 16 17:50:09 2017 -0800

----------------------------------------------------------------------
 3rdparty/stout/tests/protobuf_tests.proto | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/7bfba7d8/3rdparty/stout/tests/protobuf_tests.proto
----------------------------------------------------------------------
diff --git a/3rdparty/stout/tests/protobuf_tests.proto b/3rdparty/stout/tests/protobuf_tests.proto
index 229ac25..d16726a 100644
--- a/3rdparty/stout/tests/protobuf_tests.proto
+++ b/3rdparty/stout/tests/protobuf_tests.proto
@@ -10,6 +10,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License
 
+syntax = "proto2";
+
 package tests;
 
 // NOTE: The generated headers for this file have been included


[6/7] mesos git commit: Explicitly marked protobuf files as using v2 syntax.

Posted by jo...@apache.org.
Explicitly marked protobuf files as using v2 syntax.

`protoc` will complain about `.proto` files that do not explicitly
specify the version of PB syntax they're using. On Windows, this
registers as a build warning.

To ameliorate this, we explicitly specify the syntax in all `.proto`
files.

Review: https://reviews.apache.org/r/56593/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/b7e00bd7
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/b7e00bd7
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/b7e00bd7

Branch: refs/heads/master
Commit: b7e00bd778ab5426c285e4aa1decf0ee7ed68c0b
Parents: 7bfba7d
Author: Anthony Sottile <as...@yelp.com>
Authored: Thu Feb 16 15:26:36 2017 -0800
Committer: Joseph Wu <jo...@apache.org>
Committed: Thu Feb 16 17:50:10 2017 -0800

----------------------------------------------------------------------
 include/mesos/agent/agent.proto                                   | 2 ++
 include/mesos/allocator/allocator.proto                           | 2 ++
 include/mesos/appc/spec.proto                                     | 2 ++
 include/mesos/authentication/authentication.proto                 | 2 ++
 include/mesos/authorizer/acls.proto                               | 2 ++
 include/mesos/authorizer/authorizer.proto                         | 2 ++
 include/mesos/docker/spec.proto                                   | 2 ++
 include/mesos/docker/v1.proto                                     | 2 ++
 include/mesos/docker/v2.proto                                     | 2 ++
 include/mesos/executor/executor.proto                             | 2 ++
 include/mesos/fetcher/fetcher.proto                               | 2 ++
 include/mesos/maintenance/maintenance.proto                       | 2 ++
 include/mesos/master/master.proto                                 | 2 ++
 include/mesos/mesos.proto                                         | 2 ++
 include/mesos/module/hook.proto                                   | 2 ++
 include/mesos/module/module.proto                                 | 2 ++
 include/mesos/oci/spec.proto                                      | 2 ++
 include/mesos/quota/quota.proto                                   | 2 ++
 include/mesos/scheduler/scheduler.proto                           | 2 ++
 include/mesos/slave/containerizer.proto                           | 2 ++
 include/mesos/slave/oversubscription.proto                        | 2 ++
 include/mesos/state/state.proto                                   | 2 ++
 include/mesos/uri/uri.proto                                       | 2 ++
 include/mesos/v1/agent/agent.proto                                | 2 ++
 include/mesos/v1/allocator/allocator.proto                        | 2 ++
 include/mesos/v1/executor/executor.proto                          | 2 ++
 include/mesos/v1/maintenance/maintenance.proto                    | 2 ++
 include/mesos/v1/master/master.proto                              | 2 ++
 include/mesos/v1/mesos.proto                                      | 2 ++
 include/mesos/v1/quota/quota.proto                                | 2 ++
 include/mesos/v1/scheduler/scheduler.proto                        | 2 ++
 src/master/registry.proto                                         | 2 ++
 src/messages/flags.proto                                          | 2 ++
 src/messages/log.proto                                            | 2 ++
 src/messages/messages.proto                                       | 2 ++
 src/messages/state.proto                                          | 2 ++
 src/slave/containerizer/mesos/isolators/docker/volume/state.proto | 2 ++
 src/slave/containerizer/mesos/isolators/network/cni/spec.proto    | 2 ++
 src/slave/containerizer/mesos/provisioner/docker/message.proto    | 2 ++
 39 files changed, 78 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/b7e00bd7/include/mesos/agent/agent.proto
----------------------------------------------------------------------
diff --git a/include/mesos/agent/agent.proto b/include/mesos/agent/agent.proto
index 775c14b..61c3e8c 100644
--- a/include/mesos/agent/agent.proto
+++ b/include/mesos/agent/agent.proto
@@ -14,6 +14,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+syntax = "proto2";
+
 import "mesos/mesos.proto";
 
 package mesos.agent;

http://git-wip-us.apache.org/repos/asf/mesos/blob/b7e00bd7/include/mesos/allocator/allocator.proto
----------------------------------------------------------------------
diff --git a/include/mesos/allocator/allocator.proto b/include/mesos/allocator/allocator.proto
index 9fc8bac..c27780e 100644
--- a/include/mesos/allocator/allocator.proto
+++ b/include/mesos/allocator/allocator.proto
@@ -14,6 +14,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+syntax = "proto2";
+
 import "mesos/mesos.proto";
 
 package mesos.allocator;

http://git-wip-us.apache.org/repos/asf/mesos/blob/b7e00bd7/include/mesos/appc/spec.proto
----------------------------------------------------------------------
diff --git a/include/mesos/appc/spec.proto b/include/mesos/appc/spec.proto
index 2dbb350..7be2a6f 100644
--- a/include/mesos/appc/spec.proto
+++ b/include/mesos/appc/spec.proto
@@ -14,6 +14,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+syntax = "proto2";
+
 package appc.spec;
 
 /**

http://git-wip-us.apache.org/repos/asf/mesos/blob/b7e00bd7/include/mesos/authentication/authentication.proto
----------------------------------------------------------------------
diff --git a/include/mesos/authentication/authentication.proto b/include/mesos/authentication/authentication.proto
index a24d535..3869d6b 100644
--- a/include/mesos/authentication/authentication.proto
+++ b/include/mesos/authentication/authentication.proto
@@ -14,6 +14,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+syntax = "proto2";
+
 package mesos.internal;
 
 option java_package = "org.apache.mesos";

http://git-wip-us.apache.org/repos/asf/mesos/blob/b7e00bd7/include/mesos/authorizer/acls.proto
----------------------------------------------------------------------
diff --git a/include/mesos/authorizer/acls.proto b/include/mesos/authorizer/acls.proto
index fd25e54..8389917 100644
--- a/include/mesos/authorizer/acls.proto
+++ b/include/mesos/authorizer/acls.proto
@@ -16,6 +16,8 @@
 
 // TODO(arojas): Consider removing this file from the public interface.
 
+syntax = "proto2";
+
 package mesos;
 
 option java_package = "org.apache.mesos";

http://git-wip-us.apache.org/repos/asf/mesos/blob/b7e00bd7/include/mesos/authorizer/authorizer.proto
----------------------------------------------------------------------
diff --git a/include/mesos/authorizer/authorizer.proto b/include/mesos/authorizer/authorizer.proto
index 8b860a3..9cc75b0 100644
--- a/include/mesos/authorizer/authorizer.proto
+++ b/include/mesos/authorizer/authorizer.proto
@@ -14,6 +14,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+syntax = "proto2";
+
 import "mesos/mesos.proto";
 import "mesos/quota/quota.proto";
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/b7e00bd7/include/mesos/docker/spec.proto
----------------------------------------------------------------------
diff --git a/include/mesos/docker/spec.proto b/include/mesos/docker/spec.proto
index 734395c..bc6f763 100644
--- a/include/mesos/docker/spec.proto
+++ b/include/mesos/docker/spec.proto
@@ -14,6 +14,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+syntax = "proto2";
+
 package docker.spec;
 
 /**

http://git-wip-us.apache.org/repos/asf/mesos/blob/b7e00bd7/include/mesos/docker/v1.proto
----------------------------------------------------------------------
diff --git a/include/mesos/docker/v1.proto b/include/mesos/docker/v1.proto
index 209fb4a..3386754 100644
--- a/include/mesos/docker/v1.proto
+++ b/include/mesos/docker/v1.proto
@@ -14,6 +14,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+syntax = "proto2";
+
 package docker.spec.v1;
 
 /**

http://git-wip-us.apache.org/repos/asf/mesos/blob/b7e00bd7/include/mesos/docker/v2.proto
----------------------------------------------------------------------
diff --git a/include/mesos/docker/v2.proto b/include/mesos/docker/v2.proto
index 9b5bfb5..31f5fc8 100644
--- a/include/mesos/docker/v2.proto
+++ b/include/mesos/docker/v2.proto
@@ -14,6 +14,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+syntax = "proto2";
+
 package docker.spec.v2;
 
 import "mesos/docker/v1.proto";

http://git-wip-us.apache.org/repos/asf/mesos/blob/b7e00bd7/include/mesos/executor/executor.proto
----------------------------------------------------------------------
diff --git a/include/mesos/executor/executor.proto b/include/mesos/executor/executor.proto
index e746608..d24f32b 100644
--- a/include/mesos/executor/executor.proto
+++ b/include/mesos/executor/executor.proto
@@ -14,6 +14,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+syntax = "proto2";
+
 import "mesos/mesos.proto";
 
 package mesos.executor;

http://git-wip-us.apache.org/repos/asf/mesos/blob/b7e00bd7/include/mesos/fetcher/fetcher.proto
----------------------------------------------------------------------
diff --git a/include/mesos/fetcher/fetcher.proto b/include/mesos/fetcher/fetcher.proto
index 7f204e1..6a5d807 100644
--- a/include/mesos/fetcher/fetcher.proto
+++ b/include/mesos/fetcher/fetcher.proto
@@ -14,6 +14,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+syntax = "proto2";
+
 import "mesos/mesos.proto";
 
 package mesos.fetcher;

http://git-wip-us.apache.org/repos/asf/mesos/blob/b7e00bd7/include/mesos/maintenance/maintenance.proto
----------------------------------------------------------------------
diff --git a/include/mesos/maintenance/maintenance.proto b/include/mesos/maintenance/maintenance.proto
index 4afae5c..c4f268b 100644
--- a/include/mesos/maintenance/maintenance.proto
+++ b/include/mesos/maintenance/maintenance.proto
@@ -14,6 +14,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+syntax = "proto2";
+
 import "mesos/mesos.proto";
 import "mesos/allocator/allocator.proto";
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/b7e00bd7/include/mesos/master/master.proto
----------------------------------------------------------------------
diff --git a/include/mesos/master/master.proto b/include/mesos/master/master.proto
index 472348b..0d8d589 100644
--- a/include/mesos/master/master.proto
+++ b/include/mesos/master/master.proto
@@ -14,6 +14,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+syntax = "proto2";
+
 import "mesos/mesos.proto";
 
 import "mesos/maintenance/maintenance.proto";

http://git-wip-us.apache.org/repos/asf/mesos/blob/b7e00bd7/include/mesos/mesos.proto
----------------------------------------------------------------------
diff --git a/include/mesos/mesos.proto b/include/mesos/mesos.proto
index 34a288b..b3c022f 100644
--- a/include/mesos/mesos.proto
+++ b/include/mesos/mesos.proto
@@ -14,6 +14,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+syntax = "proto2";
+
 package mesos;
 
 option java_package = "org.apache.mesos";

http://git-wip-us.apache.org/repos/asf/mesos/blob/b7e00bd7/include/mesos/module/hook.proto
----------------------------------------------------------------------
diff --git a/include/mesos/module/hook.proto b/include/mesos/module/hook.proto
index f7b91f8..0339ac6 100644
--- a/include/mesos/module/hook.proto
+++ b/include/mesos/module/hook.proto
@@ -14,6 +14,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+syntax = "proto2";
+
 import "mesos/mesos.proto";
 
 package mesos;

http://git-wip-us.apache.org/repos/asf/mesos/blob/b7e00bd7/include/mesos/module/module.proto
----------------------------------------------------------------------
diff --git a/include/mesos/module/module.proto b/include/mesos/module/module.proto
index 1c6c4b0..440c140 100644
--- a/include/mesos/module/module.proto
+++ b/include/mesos/module/module.proto
@@ -14,6 +14,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+syntax = "proto2";
+
 import "mesos/mesos.proto";
 
 package mesos;

http://git-wip-us.apache.org/repos/asf/mesos/blob/b7e00bd7/include/mesos/oci/spec.proto
----------------------------------------------------------------------
diff --git a/include/mesos/oci/spec.proto b/include/mesos/oci/spec.proto
index f3083dd..97f3cf3 100644
--- a/include/mesos/oci/spec.proto
+++ b/include/mesos/oci/spec.proto
@@ -14,6 +14,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+syntax = "proto2";
+
 package oci.spec.image.v1;
 
 /**

http://git-wip-us.apache.org/repos/asf/mesos/blob/b7e00bd7/include/mesos/quota/quota.proto
----------------------------------------------------------------------
diff --git a/include/mesos/quota/quota.proto b/include/mesos/quota/quota.proto
index 78e12d5..f2ed6f5 100644
--- a/include/mesos/quota/quota.proto
+++ b/include/mesos/quota/quota.proto
@@ -14,6 +14,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+syntax = "proto2";
+
 import "mesos/mesos.proto";
 
 package mesos.quota;

http://git-wip-us.apache.org/repos/asf/mesos/blob/b7e00bd7/include/mesos/scheduler/scheduler.proto
----------------------------------------------------------------------
diff --git a/include/mesos/scheduler/scheduler.proto b/include/mesos/scheduler/scheduler.proto
index da2c67a..d04924a 100644
--- a/include/mesos/scheduler/scheduler.proto
+++ b/include/mesos/scheduler/scheduler.proto
@@ -14,6 +14,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+syntax = "proto2";
+
 import "mesos/mesos.proto";
 
 package mesos.scheduler;

http://git-wip-us.apache.org/repos/asf/mesos/blob/b7e00bd7/include/mesos/slave/containerizer.proto
----------------------------------------------------------------------
diff --git a/include/mesos/slave/containerizer.proto b/include/mesos/slave/containerizer.proto
index c70d437..76fde8a 100644
--- a/include/mesos/slave/containerizer.proto
+++ b/include/mesos/slave/containerizer.proto
@@ -14,6 +14,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+syntax = "proto2";
+
 package mesos.slave;
 
 import "mesos/mesos.proto";

http://git-wip-us.apache.org/repos/asf/mesos/blob/b7e00bd7/include/mesos/slave/oversubscription.proto
----------------------------------------------------------------------
diff --git a/include/mesos/slave/oversubscription.proto b/include/mesos/slave/oversubscription.proto
index e734608..5d1b070 100644
--- a/include/mesos/slave/oversubscription.proto
+++ b/include/mesos/slave/oversubscription.proto
@@ -14,6 +14,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+syntax = "proto2";
+
 import "mesos/mesos.proto";
 
 package mesos.slave;

http://git-wip-us.apache.org/repos/asf/mesos/blob/b7e00bd7/include/mesos/state/state.proto
----------------------------------------------------------------------
diff --git a/include/mesos/state/state.proto b/include/mesos/state/state.proto
index 7a7d68e..c6fba02 100644
--- a/include/mesos/state/state.proto
+++ b/include/mesos/state/state.proto
@@ -14,6 +14,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+syntax = "proto2";
+
 package mesos.internal.state;
 
 // Describes a state entry, a versioned (via a UUID) key/value pair.

http://git-wip-us.apache.org/repos/asf/mesos/blob/b7e00bd7/include/mesos/uri/uri.proto
----------------------------------------------------------------------
diff --git a/include/mesos/uri/uri.proto b/include/mesos/uri/uri.proto
index 55023b6..46eade4 100644
--- a/include/mesos/uri/uri.proto
+++ b/include/mesos/uri/uri.proto
@@ -14,6 +14,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+syntax = "proto2";
+
 package mesos;
 
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/b7e00bd7/include/mesos/v1/agent/agent.proto
----------------------------------------------------------------------
diff --git a/include/mesos/v1/agent/agent.proto b/include/mesos/v1/agent/agent.proto
index a98acb7..9b82cc1 100644
--- a/include/mesos/v1/agent/agent.proto
+++ b/include/mesos/v1/agent/agent.proto
@@ -14,6 +14,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+syntax = "proto2";
+
 import "mesos/v1/mesos.proto";
 
 package mesos.v1.agent;

http://git-wip-us.apache.org/repos/asf/mesos/blob/b7e00bd7/include/mesos/v1/allocator/allocator.proto
----------------------------------------------------------------------
diff --git a/include/mesos/v1/allocator/allocator.proto b/include/mesos/v1/allocator/allocator.proto
index 093f18f..0958bb7 100644
--- a/include/mesos/v1/allocator/allocator.proto
+++ b/include/mesos/v1/allocator/allocator.proto
@@ -14,6 +14,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+syntax = "proto2";
+
 import "mesos/v1/mesos.proto";
 
 package mesos.v1.allocator;

http://git-wip-us.apache.org/repos/asf/mesos/blob/b7e00bd7/include/mesos/v1/executor/executor.proto
----------------------------------------------------------------------
diff --git a/include/mesos/v1/executor/executor.proto b/include/mesos/v1/executor/executor.proto
index 754e62a..b2ef325 100644
--- a/include/mesos/v1/executor/executor.proto
+++ b/include/mesos/v1/executor/executor.proto
@@ -14,6 +14,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+syntax = "proto2";
+
 import "mesos/v1/mesos.proto";
 
 package mesos.v1.executor;

http://git-wip-us.apache.org/repos/asf/mesos/blob/b7e00bd7/include/mesos/v1/maintenance/maintenance.proto
----------------------------------------------------------------------
diff --git a/include/mesos/v1/maintenance/maintenance.proto b/include/mesos/v1/maintenance/maintenance.proto
index 27f7c2b..9ae8715 100644
--- a/include/mesos/v1/maintenance/maintenance.proto
+++ b/include/mesos/v1/maintenance/maintenance.proto
@@ -14,6 +14,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+syntax = "proto2";
+
 import "mesos/v1/mesos.proto";
 
 import "mesos/v1/allocator/allocator.proto";

http://git-wip-us.apache.org/repos/asf/mesos/blob/b7e00bd7/include/mesos/v1/master/master.proto
----------------------------------------------------------------------
diff --git a/include/mesos/v1/master/master.proto b/include/mesos/v1/master/master.proto
index 9d2f38e..da6f110 100644
--- a/include/mesos/v1/master/master.proto
+++ b/include/mesos/v1/master/master.proto
@@ -14,6 +14,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+syntax = "proto2";
+
 import "mesos/v1/mesos.proto";
 
 import "mesos/v1/maintenance/maintenance.proto";

http://git-wip-us.apache.org/repos/asf/mesos/blob/b7e00bd7/include/mesos/v1/mesos.proto
----------------------------------------------------------------------
diff --git a/include/mesos/v1/mesos.proto b/include/mesos/v1/mesos.proto
index 6638111..1019902 100644
--- a/include/mesos/v1/mesos.proto
+++ b/include/mesos/v1/mesos.proto
@@ -14,6 +14,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+syntax = "proto2";
+
 package mesos.v1;
 
 option java_package = "org.apache.mesos.v1";

http://git-wip-us.apache.org/repos/asf/mesos/blob/b7e00bd7/include/mesos/v1/quota/quota.proto
----------------------------------------------------------------------
diff --git a/include/mesos/v1/quota/quota.proto b/include/mesos/v1/quota/quota.proto
index 424e6b4..5dd772f 100644
--- a/include/mesos/v1/quota/quota.proto
+++ b/include/mesos/v1/quota/quota.proto
@@ -14,6 +14,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+syntax = "proto2";
+
 import "mesos/v1/mesos.proto";
 
 package mesos.v1.quota;

http://git-wip-us.apache.org/repos/asf/mesos/blob/b7e00bd7/include/mesos/v1/scheduler/scheduler.proto
----------------------------------------------------------------------
diff --git a/include/mesos/v1/scheduler/scheduler.proto b/include/mesos/v1/scheduler/scheduler.proto
index 65ccfa7..6e8246d 100644
--- a/include/mesos/v1/scheduler/scheduler.proto
+++ b/include/mesos/v1/scheduler/scheduler.proto
@@ -14,6 +14,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+syntax = "proto2";
+
 import "mesos/v1/mesos.proto";
 
 package mesos.v1.scheduler;

http://git-wip-us.apache.org/repos/asf/mesos/blob/b7e00bd7/src/master/registry.proto
----------------------------------------------------------------------
diff --git a/src/master/registry.proto b/src/master/registry.proto
index eab9821..362a9fa 100644
--- a/src/master/registry.proto
+++ b/src/master/registry.proto
@@ -14,6 +14,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+syntax = "proto2";
+
 import "mesos/mesos.proto";
 import "mesos/maintenance/maintenance.proto";
 import "mesos/quota/quota.proto";

http://git-wip-us.apache.org/repos/asf/mesos/blob/b7e00bd7/src/messages/flags.proto
----------------------------------------------------------------------
diff --git a/src/messages/flags.proto b/src/messages/flags.proto
index 08406b6..e87075f 100644
--- a/src/messages/flags.proto
+++ b/src/messages/flags.proto
@@ -14,6 +14,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+syntax = "proto2";
+
 package mesos.internal;
 
 // Initializes firewall rules to allow access control of the

http://git-wip-us.apache.org/repos/asf/mesos/blob/b7e00bd7/src/messages/log.proto
----------------------------------------------------------------------
diff --git a/src/messages/log.proto b/src/messages/log.proto
index 12c2d83..ca740bd 100644
--- a/src/messages/log.proto
+++ b/src/messages/log.proto
@@ -14,6 +14,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+syntax = "proto2";
+
 package mesos.internal.log;
 
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/b7e00bd7/src/messages/messages.proto
----------------------------------------------------------------------
diff --git a/src/messages/messages.proto b/src/messages/messages.proto
index 258ceeb..2da89a8 100644
--- a/src/messages/messages.proto
+++ b/src/messages/messages.proto
@@ -14,6 +14,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+syntax = "proto2";
+
 import "mesos/mesos.proto";
 
 package mesos.internal;

http://git-wip-us.apache.org/repos/asf/mesos/blob/b7e00bd7/src/messages/state.proto
----------------------------------------------------------------------
diff --git a/src/messages/state.proto b/src/messages/state.proto
index 857a888..e2606e4 100644
--- a/src/messages/state.proto
+++ b/src/messages/state.proto
@@ -14,6 +14,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+syntax = "proto2";
+
 import "mesos/state/state.proto";
 
 package mesos.internal.state;

http://git-wip-us.apache.org/repos/asf/mesos/blob/b7e00bd7/src/slave/containerizer/mesos/isolators/docker/volume/state.proto
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolators/docker/volume/state.proto b/src/slave/containerizer/mesos/isolators/docker/volume/state.proto
index 4c5b03c..9117357 100644
--- a/src/slave/containerizer/mesos/isolators/docker/volume/state.proto
+++ b/src/slave/containerizer/mesos/isolators/docker/volume/state.proto
@@ -14,6 +14,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+syntax = "proto2";
+
 package mesos.internal.slave;
 
 message DockerVolume {

http://git-wip-us.apache.org/repos/asf/mesos/blob/b7e00bd7/src/slave/containerizer/mesos/isolators/network/cni/spec.proto
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolators/network/cni/spec.proto b/src/slave/containerizer/mesos/isolators/network/cni/spec.proto
index 4b38500..2e5c3e8 100644
--- a/src/slave/containerizer/mesos/isolators/network/cni/spec.proto
+++ b/src/slave/containerizer/mesos/isolators/network/cni/spec.proto
@@ -14,6 +14,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+syntax = "proto2";
+
 package mesos.internal.slave.cni.spec;
 
 message Route {

http://git-wip-us.apache.org/repos/asf/mesos/blob/b7e00bd7/src/slave/containerizer/mesos/provisioner/docker/message.proto
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/provisioner/docker/message.proto b/src/slave/containerizer/mesos/provisioner/docker/message.proto
index c93c7a9..a55ac90 100644
--- a/src/slave/containerizer/mesos/provisioner/docker/message.proto
+++ b/src/slave/containerizer/mesos/provisioner/docker/message.proto
@@ -14,6 +14,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+syntax = "proto2";
+
 import "mesos/docker/spec.proto";
 
 package mesos.internal.slave.docker;


[4/7] mesos git commit: Libprocess: Dealt with some MSVC compiler warnings.

Posted by jo...@apache.org.
Libprocess: Dealt with some MSVC compiler warnings.

This commit explicitly qualifies some implicit number casting.

The only additional CHECK added by this commit is in the `FileEncoder`,
which casts an unsigned size (size_t) to a signed value (off_t).
All usages of `FileEncoder` are expected to retrieve the size value
from the `off_t st_size` field of `struct stat`.  This means that
it is a programmer error to construct `FileEncoder` with a size
greater than the numeric maximum of `off_t`.

Review: https://reviews.apache.org/r/56592/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/e81612de
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/e81612de
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/e81612de

Branch: refs/heads/master
Commit: e81612deb99ab01f65519ec95c3141f945c1b129
Parents: a9a1721
Author: Alex Clemmer <cl...@gmail.com>
Authored: Thu Feb 16 14:22:45 2017 -0800
Committer: Joseph Wu <jo...@apache.org>
Committed: Thu Feb 16 17:50:09 2017 -0800

----------------------------------------------------------------------
 3rdparty/libprocess/include/process/metrics/counter.hpp |  4 ++--
 3rdparty/libprocess/include/process/network.hpp         |  6 ++++--
 3rdparty/libprocess/src/encoder.hpp                     | 12 ++++++++++--
 3 files changed, 16 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/e81612de/3rdparty/libprocess/include/process/metrics/counter.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/metrics/counter.hpp b/3rdparty/libprocess/include/process/metrics/counter.hpp
index a13cc7e..15aeeb5 100644
--- a/3rdparty/libprocess/include/process/metrics/counter.hpp
+++ b/3rdparty/libprocess/include/process/metrics/counter.hpp
@@ -33,7 +33,7 @@ public:
     : Metric(name, window),
       data(new Data())
   {
-    push(data->value.load());
+    push(static_cast<double>(data->value.load()));
   }
 
   virtual ~Counter() {}
@@ -64,7 +64,7 @@ public:
   Counter& operator+=(int64_t v)
   {
     int64_t prev = data->value.fetch_add(v);
-    push(prev + v);
+    push(static_cast<double>(prev + v));
     return *this;
   }
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/e81612de/3rdparty/libprocess/include/process/network.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/network.hpp b/3rdparty/libprocess/include/process/network.hpp
index 0590e7a..8f48a4a 100644
--- a/3rdparty/libprocess/include/process/network.hpp
+++ b/3rdparty/libprocess/include/process/network.hpp
@@ -47,7 +47,8 @@ inline Try<Nothing> bind(int_fd s, const Address& address)
 {
   sockaddr_storage storage = address;
 
-  if (net::bind(s, (sockaddr*) &storage, address.size()) < 0) {
+  const socklen_t address_size = static_cast<socklen_t>(address.size());
+  if (net::bind(s, (sockaddr*) &storage, address_size) < 0) {
     return ErrnoError("Failed to bind on " + stringify(address));
   }
 
@@ -60,7 +61,8 @@ inline Try<Nothing, SocketError> connect(int_fd s, const Address& address)
 {
   sockaddr_storage storage = address;
 
-  if (net::connect(s, (sockaddr*) &storage, address.size()) < 0) {
+  const socklen_t address_size = static_cast<socklen_t>(address.size());
+  if (net::connect(s, (sockaddr*) &storage, address_size) < 0) {
     return SocketError("Failed to connect to " + stringify(address));
   }
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/e81612de/3rdparty/libprocess/src/encoder.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/encoder.hpp b/3rdparty/libprocess/src/encoder.hpp
index b019bf9..57800b4 100644
--- a/3rdparty/libprocess/src/encoder.hpp
+++ b/3rdparty/libprocess/src/encoder.hpp
@@ -16,6 +16,7 @@
 #include <stdint.h>
 #include <time.h>
 
+#include <limits>
 #include <map>
 #include <sstream>
 
@@ -244,7 +245,14 @@ class FileEncoder : public Encoder
 {
 public:
   FileEncoder(int_fd _fd, size_t _size)
-    : fd(_fd), size(_size), index(0) {}
+    : fd(_fd), size(static_cast<off_t>(_size)), index(0)
+  {
+    // NOTE: For files, we expect the size to be derived from `stat`-ing
+    // the file.  The `struct stat` returns the size in `off_t` form,
+    // meaning that it is a programmer error to construct the `FileEncoder`
+    // with a size greater the max value of `off_t`.
+    CHECK_LE(_size, std::numeric_limits<off_t>::max());
+  }
 
   virtual ~FileEncoder()
   {
@@ -268,7 +276,7 @@ public:
   virtual void backup(size_t length)
   {
     if (index >= static_cast<off_t>(length)) {
-      index -= length;
+      index -= static_cast<off_t>(length);
     }
   }
 


[7/7] mesos git commit: Windows: Changed ZK patch to fix macro redefinition warnings.

Posted by jo...@apache.org.
Windows: Changed ZK patch to fix macro redefinition warnings.

Currently, compiling against ZK on Windows will cause many macro
redefinition errors. This occurs because ZK has a `winstdint.h` file,
which contains definitions for macros that historically have not existed
in the MSVC toolchain.

However, since MSVC 1900, many of these now exist. Here, we introduce a
patch file that will condition out these definitions for versions 1900
and later.

Additionally, the previous patch file was not fully correct, resulting
in the patch being "fuzzed" when it was applied. This patch generates
the correct output, allowing the patches to apply cleanly.

Review: https://reviews.apache.org/r/56652/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/85d9d4ef
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/85d9d4ef
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/85d9d4ef

Branch: refs/heads/master
Commit: 85d9d4ef259e795a438eae12bd740063809e8bfc
Parents: b7e00bd
Author: Alex Clemmer <cl...@gmail.com>
Authored: Thu Feb 16 16:10:45 2017 -0800
Committer: Joseph Wu <jo...@apache.org>
Committed: Thu Feb 16 17:50:10 2017 -0800

----------------------------------------------------------------------
 3rdparty/zookeeper-06d3f3f.patch | 274 +++++++++++++++++-----------------
 1 file changed, 141 insertions(+), 133 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/85d9d4ef/3rdparty/zookeeper-06d3f3f.patch
----------------------------------------------------------------------
diff --git a/3rdparty/zookeeper-06d3f3f.patch b/3rdparty/zookeeper-06d3f3f.patch
index be2ceaf..7f66875 100644
--- a/3rdparty/zookeeper-06d3f3f.patch
+++ b/3rdparty/zookeeper-06d3f3f.patch
@@ -1,5 +1,145 @@
+diff --git a/src/c/include/winconfig.h b/src/c/include/winconfig.h
+index ccc3c189..a4b3287a 100644
+--- a/src/c/include/winconfig.h
++++ b/src/c/include/winconfig.h
+@@ -1,3 +1,5 @@
++#pragma once
++
+ /* Define to 1 if you have the <arpa/inet.h> header file. */
+ #undef HAVE_ARPA_INET_H
+
+@@ -152,13 +154,6 @@
+ #define __attribute__(x)
+ #define __func__ __FUNCTION__
+
+-#ifndef _WIN32_WINNT_NT4
+-#define _WIN32_WINNT_NT4 0x0400
+-#endif
+-
+-#define NTDDI_VERSION _WIN32_WINNT_NT4
+-#define _WIN32_WINNT _WIN32_WINNT_NT4
+-
+ #define _CRT_SECURE_NO_WARNINGS
+ #define WIN32_LEAN_AND_MEAN
+ #include <Windows.h>
+@@ -171,12 +166,17 @@
+ #undef max
+
+ #include <errno.h>
++#include <stdlib.h>
+
+ #define strtok_r strtok_s
+ #define localtime_r(a,b) localtime_s(b,a)
+ #define get_errno() errno=GetLastError()
+-#define random rand
++
++inline int __cdecl random() { return rand(); }
++
++#if ((defined(_MSC_VER) && _MSC_VER < 1900) || !defined(_MSC_VER))
+ #define snprintf _snprintf
++#endif
+
+ #define ACL ZKACL  // Conflict with windows API
+
+@@ -192,5 +192,5 @@
+ #define EINPROGRESS WSAEINPROGRESS
+ #endif
+
+-typedef int pid_t;
++typedef DWORD pid_t;
+ #endif
+diff --git a/src/c/include/winstdint.h b/src/c/include/winstdint.h
+index d02608a5..196ecc5d 100644
+--- a/src/c/include/winstdint.h
++++ b/src/c/include/winstdint.h
+@@ -41,6 +41,7 @@
+ #endif
+
+ #include <limits.h>
++#include <stdint.h>
+
+ // For Visual Studio 6 in C++ mode and for many Visual Studio versions when
+ // compiling for ARM we should wrap <wchar.h> include with 'extern "C++" {}'
+@@ -100,16 +101,6 @@ typedef uint16_t  uint_least16_t;
+ typedef uint32_t  uint_least32_t;
+ typedef uint64_t  uint_least64_t;
+
+-// 7.18.1.3 Fastest minimum-width integer types
+-typedef int8_t    int_fast8_t;
+-typedef int16_t   int_fast16_t;
+-typedef int32_t   int_fast32_t;
+-typedef int64_t   int_fast64_t;
+-typedef uint8_t   uint_fast8_t;
+-typedef uint16_t  uint_fast16_t;
+-typedef uint32_t  uint_fast32_t;
+-typedef uint64_t  uint_fast64_t;
+-
+ // 7.18.1.4 Integer types capable of holding object pointers
+ #ifdef _WIN64 // [
+    typedef signed __int64    intptr_t;
+@@ -126,7 +117,7 @@ typedef uint64_t  uintmax_t;
+
+ // 7.18.2 Limits of specified-width integer types
+
+-#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [   See footnote 220 at page 257 and footnote 221 at page 259
++#if (_MSC_VER < 1900) && (!defined(__cplusplus) || defined(__STDC_LIMIT_MACROS)) // [   See footnote 220 at page 257 and footnote 221 at page 259
+
+ // 7.18.2.1 Limits of exact-width integer types
+ #define INT8_MIN     ((int8_t)_I8_MIN)
+@@ -223,7 +214,7 @@ typedef uint64_t  uintmax_t;
+
+ // 7.18.4 Limits of other integer types
+
+-#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [   See footnote 224 at page 260
++#if (_MSC_VER < 1900) && (!defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS)) // [   See footnote 224 at page 260
+
+ // 7.18.4.1 Macros for minimum-width integer constants
+
+diff --git a/src/c/zookeeper-vs2015.sln b/src/c/zookeeper-vs2015.sln
+new file mode 100644
+index 00000000..44d738f8
+--- /dev/null
++++ b/src/c/zookeeper-vs2015.sln
+@@ -0,0 +1,37 @@
++Microsoft Visual Studio Solution File, Format Version 12.00
++# Visual Studio 14
++VisualStudioVersion = 14.0.23107.0
++MinimumVisualStudioVersion = 10.0.40219.1
++Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zookeeper", "zookeeper.vcxproj", "{5754FB2B-5EA5-4988-851D-908CA533A626}"
++EndProject
++Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cli", "cli.vcxproj", "{F267C55D-E02C-4BAF-A246-0AA58E8FE4A6}"
++EndProject
++Global
++	GlobalSection(SolutionConfigurationPlatforms) = preSolution
++		Debug|Win32 = Debug|Win32
++		Debug|x64 = Debug|x64
++		Release|Win32 = Release|Win32
++		Release|x64 = Release|x64
++	EndGlobalSection
++	GlobalSection(ProjectConfigurationPlatforms) = postSolution
++		{5754FB2B-5EA5-4988-851D-908CA533A626}.Debug|Win32.ActiveCfg = Debug|Win32
++		{5754FB2B-5EA5-4988-851D-908CA533A626}.Debug|Win32.Build.0 = Debug|Win32
++		{5754FB2B-5EA5-4988-851D-908CA533A626}.Debug|x64.ActiveCfg = Debug|x64
++		{5754FB2B-5EA5-4988-851D-908CA533A626}.Debug|x64.Build.0 = Debug|x64
++		{5754FB2B-5EA5-4988-851D-908CA533A626}.Release|Win32.ActiveCfg = Release|Win32
++		{5754FB2B-5EA5-4988-851D-908CA533A626}.Release|Win32.Build.0 = Release|Win32
++		{5754FB2B-5EA5-4988-851D-908CA533A626}.Release|x64.ActiveCfg = Release|x64
++		{5754FB2B-5EA5-4988-851D-908CA533A626}.Release|x64.Build.0 = Release|x64
++		{F267C55D-E02C-4BAF-A246-0AA58E8FE4A6}.Debug|Win32.ActiveCfg = Debug|Win32
++		{F267C55D-E02C-4BAF-A246-0AA58E8FE4A6}.Debug|Win32.Build.0 = Debug|Win32
++		{F267C55D-E02C-4BAF-A246-0AA58E8FE4A6}.Debug|x64.ActiveCfg = Debug|x64
++		{F267C55D-E02C-4BAF-A246-0AA58E8FE4A6}.Debug|x64.Build.0 = Debug|x64
++		{F267C55D-E02C-4BAF-A246-0AA58E8FE4A6}.Release|Win32.ActiveCfg = Release|Win32
++		{F267C55D-E02C-4BAF-A246-0AA58E8FE4A6}.Release|Win32.Build.0 = Release|Win32
++		{F267C55D-E02C-4BAF-A246-0AA58E8FE4A6}.Release|x64.ActiveCfg = Release|x64
++		{F267C55D-E02C-4BAF-A246-0AA58E8FE4A6}.Release|x64.Build.0 = Release|x64
++	EndGlobalSection
++	GlobalSection(SolutionProperties) = preSolution
++		HideSolutionNode = FALSE
++	EndGlobalSection
++EndGlobal
 diff --git a/src/c/zookeeper.vcxproj b/src/c/zookeeper.vcxproj
-index be4ad9a..59f9172 100644
+index be4ad9ab..5e75f779 100644
 --- a/src/c/zookeeper.vcxproj
 +++ b/src/c/zookeeper.vcxproj
 @@ -1,5 +1,5 @@
@@ -74,135 +214,3 @@ index be4ad9a..59f9172 100644
        <PrecompiledHeader />
        <WarningLevel>Level3</WarningLevel>
        <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-@@ -144,7 +145,7 @@
-     <ClCompile>
-       <AdditionalIncludeDirectories>./include;./generated;./hashtable;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-       <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;ZOOKEEPER_EXPORTS;DLL_EXPORT;THREADED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
--      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
-       <PrecompiledHeader>
-       </PrecompiledHeader>
-       <WarningLevel>Level3</WarningLevel>
-diff --git a/src/c/zookeeper-vs2015.sln b/src/c/zookeeper-vs2015.sln
-new file mode 100644
-index 0000000..44d738f
---- /dev/null
-+++ b/src/c/zookeeper-vs2015.sln
-@@ -0,0 +1,37 @@
-+Microsoft Visual Studio Solution File, Format Version 12.00
-+# Visual Studio 14
-+VisualStudioVersion = 14.0.23107.0
-+MinimumVisualStudioVersion = 10.0.40219.1
-+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zookeeper", "zookeeper.vcxproj", "{5754FB2B-5EA5-4988-851D-908CA533A626}"
-+EndProject
-+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cli", "cli.vcxproj", "{F267C55D-E02C-4BAF-A246-0AA58E8FE4A6}"
-+EndProject
-+Global
-+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-+		Debug|Win32 = Debug|Win32
-+		Debug|x64 = Debug|x64
-+		Release|Win32 = Release|Win32
-+		Release|x64 = Release|x64
-+	EndGlobalSection
-+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-+		{5754FB2B-5EA5-4988-851D-908CA533A626}.Debug|Win32.ActiveCfg = Debug|Win32
-+		{5754FB2B-5EA5-4988-851D-908CA533A626}.Debug|Win32.Build.0 = Debug|Win32
-+		{5754FB2B-5EA5-4988-851D-908CA533A626}.Debug|x64.ActiveCfg = Debug|x64
-+		{5754FB2B-5EA5-4988-851D-908CA533A626}.Debug|x64.Build.0 = Debug|x64
-+		{5754FB2B-5EA5-4988-851D-908CA533A626}.Release|Win32.ActiveCfg = Release|Win32
-+		{5754FB2B-5EA5-4988-851D-908CA533A626}.Release|Win32.Build.0 = Release|Win32
-+		{5754FB2B-5EA5-4988-851D-908CA533A626}.Release|x64.ActiveCfg = Release|x64
-+		{5754FB2B-5EA5-4988-851D-908CA533A626}.Release|x64.Build.0 = Release|x64
-+		{F267C55D-E02C-4BAF-A246-0AA58E8FE4A6}.Debug|Win32.ActiveCfg = Debug|Win32
-+		{F267C55D-E02C-4BAF-A246-0AA58E8FE4A6}.Debug|Win32.Build.0 = Debug|Win32
-+		{F267C55D-E02C-4BAF-A246-0AA58E8FE4A6}.Debug|x64.ActiveCfg = Debug|x64
-+		{F267C55D-E02C-4BAF-A246-0AA58E8FE4A6}.Debug|x64.Build.0 = Debug|x64
-+		{F267C55D-E02C-4BAF-A246-0AA58E8FE4A6}.Release|Win32.ActiveCfg = Release|Win32
-+		{F267C55D-E02C-4BAF-A246-0AA58E8FE4A6}.Release|Win32.Build.0 = Release|Win32
-+		{F267C55D-E02C-4BAF-A246-0AA58E8FE4A6}.Release|x64.ActiveCfg = Release|x64
-+		{F267C55D-E02C-4BAF-A246-0AA58E8FE4A6}.Release|x64.Build.0 = Release|x64
-+	EndGlobalSection
-+	GlobalSection(SolutionProperties) = preSolution
-+		HideSolutionNode = FALSE
-+	EndGlobalSection
-+EndGlobal
-diff --git a/src/c/include/winconfig.h b/src/c/include/winconfig.h
-old mode 100644
-new mode 100755
-index ccc3c18..b1f4bfe
---- a/src/c/include/winconfig.h
-+++ b/src/c/include/winconfig.h
-@@ -1,3 +1,5 @@
-+#pragma once
-+
- /* Define to 1 if you have the <arpa/inet.h> header file. */
- #undef HAVE_ARPA_INET_H
-
-@@ -156,9 +158,2 @@ Allow APIs defined post NT4 to be used in files using the header
-
--#ifndef _WIN32_WINNT_NT4
--#define _WIN32_WINNT_NT4 0x0400
--#endif
--
--#define NTDDI_VERSION _WIN32_WINNT_NT4
--#define _WIN32_WINNT _WIN32_WINNT_NT4
--
-#define _CRT_SECURE_NO_WARNINGS
-
-@@ -171,12 +164,17 @@
- #undef max
-
- #include <errno.h>
-+#include <stdlib.h>
-
- #define strtok_r strtok_s
- #define localtime_r(a,b) localtime_s(b,a)
- #define get_errno() errno=GetLastError()
--#define random rand
-+
-+inline int __cdecl random() { return rand(); }
-+
-+#if ((defined(_MSC_VER) && _MSC_VER < 1900) || !defined(_MSC_VER))
- #define snprintf _snprintf
-+#endif
-
- #define ACL ZKACL  // Conflict with windows API
-
-@@ -192,5 +199,5 @@
- #define EINPROGRESS WSAEINPROGRESS
- #endif
-
--typedef int pid_t;
-+typedef DWORD pid_t;
- #endif
-diff --git a/src/c/include/winstdint.h b/src/c/include/winstdint.h
-old mode 100755
-new mode 100644
-index d02608a..be60a65
---- a/src/c/include/winstdint.h
-+++ b/src/c/include/winstdint.h
-@@ -41,6 +41,7 @@
- #endif
-
- #include <limits.h>
-+#include <stdint.h>
-
- // For Visual Studio 6 in C++ mode and for many Visual Studio versions when
- // compiling for ARM we should wrap <wchar.h> include with 'extern "C++" {}'
-@@ -100,16 +101,6 @@ typedef uint16_t  uint_least16_t;
- typedef uint32_t  uint_least32_t;
- typedef uint64_t  uint_least64_t;
-
--// 7.18.1.3 Fastest minimum-width integer types
--typedef int8_t    int_fast8_t;
--typedef int16_t   int_fast16_t;
--typedef int32_t   int_fast32_t;
--typedef int64_t   int_fast64_t;
--typedef uint8_t   uint_fast8_t;
--typedef uint16_t  uint_fast16_t;
--typedef uint32_t  uint_fast32_t;
--typedef uint64_t  uint_fast64_t;
--
- // 7.18.1.4 Integer types capable of holding object pointers
- #ifdef _WIN64 // [
-    typedef signed __int64    intptr_t;


[5/7] mesos git commit: Windows: Handle environment variable inheritance uniformly in Mesos.

Posted by jo...@apache.org.
Windows: Handle environment variable inheritance uniformly in Mesos.

This review is a planned regression on MESOS-6816. In other parts of the
codebase, we copy all environment variables from the system before
launching a process, overwriting user specified environment variables.

This is not correct behavior, but a half-measure that is necessary,
because Windows does not inherit environment variables by default. In
this commit, we make this behavior uniform across all places where we
are creating a process, because it is better for behavior to be
consistent before we get around to fixing it. We do have concrete plans
to come back and resolve this issue (and allow users to specify certain
environment variables).

Review: https://reviews.apache.org/r/56702/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/a9a17212
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/a9a17212
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/a9a17212

Branch: refs/heads/master
Commit: a9a17212d26601b8805a7bfec3ab2acbdf714792
Parents: e4d8573
Author: Daniel Pravat <dp...@outlook.com>
Authored: Wed Feb 15 18:00:11 2017 -0800
Committer: Joseph Wu <jo...@apache.org>
Committed: Thu Feb 16 17:50:09 2017 -0800

----------------------------------------------------------------------
 src/slave/containerizer/docker.cpp       | 13 +++++++++++++
 src/slave/containerizer/mesos/launch.cpp | 15 +++++++++++++++
 2 files changed, 28 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/a9a17212/src/slave/containerizer/docker.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/docker.cpp b/src/slave/containerizer/docker.cpp
index 1791108..406e560 100644
--- a/src/slave/containerizer/docker.cpp
+++ b/src/slave/containerizer/docker.cpp
@@ -1405,6 +1405,19 @@ Future<pid_t> DockerContainerizerProcess::launchExecutorProcess(
     environment["PATH"] = os::host_default_path();
   }
 
+#ifdef __WINDOWS__
+  // TODO(dpravat): (MESOS-6816) We should allow system environment variables to
+  // be overwritten if they are specified by the framework.  This might cause
+  // applications to not work, but upon overriding system defaults, it becomes
+  // the overidder's problem.
+  Option<std::map<string, string>> systemEnvironment =
+    process::internal::getSystemEnvironment();
+  foreachpair(const string& key, const string& value,
+    systemEnvironment.get()) {
+    environment[key] = value;
+  }
+#endif // __WINDOWS__
+
   vector<string> argv;
   argv.push_back(MESOS_DOCKER_EXECUTOR);
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/a9a17212/src/slave/containerizer/mesos/launch.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/launch.cpp b/src/slave/containerizer/mesos/launch.cpp
index 4dd81b4..8658525 100644
--- a/src/slave/containerizer/mesos/launch.cpp
+++ b/src/slave/containerizer/mesos/launch.cpp
@@ -25,6 +25,8 @@
 #include <set>
 #include <string>
 
+#include <process/subprocess.hpp>
+
 #include <stout/foreach.hpp>
 #include <stout/os.hpp>
 #include <stout/protobuf.hpp>
@@ -671,6 +673,19 @@ int MesosContainerizerLaunch::execute()
       environment["PATH"] = os::host_default_path();
     }
 
+#ifdef __WINDOWS__
+    // TODO(dpravat): (MESOS-6816) We should allow system environment variables
+    // to be overwritten if they are specified by the framework.  This might
+    // cause applications to not work, but upon overriding system defaults, it
+    // becomes the overidder's problem.
+    Option<std::map<string, string>> systemEnvironment =
+      process::internal::getSystemEnvironment();
+    foreachpair (
+        const string& key, const string& value, systemEnvironment.get()) {
+      environment[key] = value;
+    }
+#endif // __WINDOWS__
+
     envp = os::raw::Envp(environment);
   }
 


[2/7] mesos git commit: Stout: Dealt with some MSVC compiler warnings.

Posted by jo...@apache.org.
Stout: Dealt with some MSVC compiler warnings.

The warnings dealt with in this commit are implicit type conversions,
mostly to/from integers.

Two notable tweaks are:
  * `struct timeval` construction in `stout/duration.hpp` no longer
    performs an `int64_t -> double -> long` chain of casts.
  * Protobuf (de)serialization will now CHECK if the input string
    can be safely casted to a signed integer.

Review: https://reviews.apache.org/r/56591


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/e4d8573d
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/e4d8573d
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/e4d8573d

Branch: refs/heads/master
Commit: e4d8573dcb37a069b81bade8940cdb8c9e950ecf
Parents: 7a6b7c6
Author: Daniel Pravat <dp...@outlook.com>
Authored: Wed Feb 15 16:30:42 2017 -0800
Committer: Joseph Wu <jo...@apache.org>
Committed: Thu Feb 16 17:50:09 2017 -0800

----------------------------------------------------------------------
 3rdparty/stout/include/stout/abort.hpp          | 16 ++++++++++++++--
 3rdparty/stout/include/stout/duration.hpp       |  7 +++++--
 3rdparty/stout/include/stout/gzip.hpp           |  4 ++--
 3rdparty/stout/include/stout/os/windows/dup.hpp |  6 ++++++
 3rdparty/stout/include/stout/os/windows/fd.hpp  | 20 ++++++++++++++++++++
 3rdparty/stout/include/stout/protobuf.hpp       | 18 ++++++++++++++++--
 3rdparty/stout/include/stout/windows/os.hpp     | 12 ++++++++++++
 7 files changed, 75 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/e4d8573d/3rdparty/stout/include/stout/abort.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/include/stout/abort.hpp b/3rdparty/stout/include/stout/abort.hpp
index b7dba03..d3291dc 100644
--- a/3rdparty/stout/include/stout/abort.hpp
+++ b/3rdparty/stout/include/stout/abort.hpp
@@ -42,15 +42,27 @@
 
 inline NORETURN void _Abort(const char* prefix, const char* message)
 {
+  // NOTE: On Windows, `_write` takes an `unsigned int`, not `size_t`. We
+  // preform an explicit type conversion here to silence the warning. `strlen`
+  // always returns a positive result, which means it is safe to cast it to an
+  // unsigned value.
+#ifndef __WINDOWS__
+  const size_t prefix_len = strlen(prefix);
+  const size_t message_len = strlen(message);
+#else
+  const unsigned int prefix_len = static_cast<unsigned int>(strlen(prefix));
+  const unsigned int message_len = static_cast<unsigned int>(strlen(message));
+#endif // !__WINDOWS__
+
   // Write the failure message in an async-signal safe manner,
   // assuming strlen is async-signal safe or optimized out.
   // In fact, it is highly unlikely that strlen would be
   // implemented in an unsafe manner:
   // http://austingroupbugs.net/view.php?id=692
-  while (::write(STDERR_FILENO, prefix, strlen(prefix)) == -1 &&
+  while (::write(STDERR_FILENO, prefix, prefix_len) == -1 &&
          errno == EINTR);
   while (message != nullptr &&
-         ::write(STDERR_FILENO, message, strlen(message)) == -1 &&
+         ::write(STDERR_FILENO, message, message_len) == -1 &&
          errno == EINTR);
 
   // NOTE: Since `1` can be interpreted as either an `unsigned int` or a

http://git-wip-us.apache.org/repos/asf/mesos/blob/e4d8573d/3rdparty/stout/include/stout/duration.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/include/stout/duration.hpp b/3rdparty/stout/include/stout/duration.hpp
index 0a30a09..165dd15 100644
--- a/3rdparty/stout/include/stout/duration.hpp
+++ b/3rdparty/stout/include/stout/duration.hpp
@@ -96,8 +96,11 @@ public:
   struct timeval timeval() const
   {
     struct timeval t;
-    t.tv_sec = secs();
-    t.tv_usec = us() - (t.tv_sec * MILLISECONDS);
+
+    // Explicitly compute `tv_sec` and `tv_usec` instead of using `us` and
+    // `secs` to avoid converting `int64_t` -> `double` -> `long`.
+    t.tv_sec = ns() / SECONDS;
+    t.tv_usec = (ns() / MICROSECONDS) - (t.tv_sec * SECONDS / MICROSECONDS);
     return t;
   }
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/e4d8573d/3rdparty/stout/include/stout/gzip.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/include/stout/gzip.hpp b/3rdparty/stout/include/stout/gzip.hpp
index 7040a32..1dcad5d 100644
--- a/3rdparty/stout/include/stout/gzip.hpp
+++ b/3rdparty/stout/include/stout/gzip.hpp
@@ -123,7 +123,7 @@ public:
   {
     stream.next_in =
       const_cast<Bytef*>(reinterpret_cast<const Bytef*>(compressed.data()));
-    stream.avail_in = compressed.length();
+    stream.avail_in = static_cast<uInt>(compressed.length());
 
     // Build up the decompressed result.
     Bytef buffer[GZIP_BUFFER_SIZE];
@@ -189,7 +189,7 @@ inline Try<std::string> compress(
   z_stream_s stream;
   stream.next_in =
     const_cast<Bytef*>(reinterpret_cast<const Bytef*>(decompressed.data()));
-  stream.avail_in = decompressed.length();
+  stream.avail_in = static_cast<uInt>(decompressed.length());
   stream.zalloc = Z_NULL;
   stream.zfree = Z_NULL;
   stream.opaque = Z_NULL;

http://git-wip-us.apache.org/repos/asf/mesos/blob/e4d8573d/3rdparty/stout/include/stout/os/windows/dup.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/include/stout/os/windows/dup.hpp b/3rdparty/stout/include/stout/os/windows/dup.hpp
index 1fc4d55..1c9dda0 100644
--- a/3rdparty/stout/include/stout/os/windows/dup.hpp
+++ b/3rdparty/stout/include/stout/os/windows/dup.hpp
@@ -36,11 +36,17 @@ inline Try<WindowsFD> dup(const WindowsFD& fd)
       return result;
     }
     case WindowsFD::FD_SOCKET: {
+#pragma warning(push)
+#pragma warning(disable : 4996)
+      // Disable compiler warning asking us to use the Unicode version of
+      // `WSASocket` and `WSADuplicateSocket`, because Mesos currently does not
+      // support Unicode. See MESOS-6817.
       WSAPROTOCOL_INFO protInfo;
       if (::WSADuplicateSocket(fd, GetCurrentProcessId(), &protInfo) !=
           INVALID_SOCKET) {
         return WSASocket(0, 0, 0, &protInfo, 0, 0);
       };
+#pragma warning(pop)
       return SocketError();
     }
   }

http://git-wip-us.apache.org/repos/asf/mesos/blob/e4d8573d/3rdparty/stout/include/stout/os/windows/fd.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/include/stout/os/windows/fd.hpp b/3rdparty/stout/include/stout/os/windows/fd.hpp
index fddaaa5..ae2db27 100644
--- a/3rdparty/stout/include/stout/os/windows/fd.hpp
+++ b/3rdparty/stout/include/stout/os/windows/fd.hpp
@@ -185,8 +185,13 @@ inline bool operator<(const WindowsFD& left, const WindowsFD& right)
           if (left.crt() < 0) {
             return true;
           }
+#pragma warning(push)
+#pragma warning(disable : 4312)
+          // Disable `int`-to-`HANDLE` compiler warning. This is safe to do,
+          // see comment above.
           return reinterpret_cast<HANDLE>(left.crt()) <
                  static_cast<HANDLE>(right);
+#pragma warning(pop)
         }
         case WindowsFD::FD_SOCKET: {
           if (static_cast<SOCKET>(right) == INVALID_SOCKET) {
@@ -208,8 +213,13 @@ inline bool operator<(const WindowsFD& left, const WindowsFD& right)
           if (right.crt() < 0) {
             return false;
           }
+#pragma warning(push)
+#pragma warning(disable : 4312)
+          // Disable `int`-to-`HANDLE` compiler warning. This is safe to do,
+          // see comment above.
           return static_cast<HANDLE>(left) <
                  reinterpret_cast<HANDLE>(right.crt());
+#pragma warning(pop)
         }
         case WindowsFD::FD_HANDLE: {
           return static_cast<HANDLE>(left) < static_cast<HANDLE>(right);
@@ -334,8 +344,13 @@ inline bool operator==(const WindowsFD& left, const WindowsFD& right)
           if (left.crt() < 0) {
             return false;
           }
+#pragma warning(push)
+#pragma warning(disable : 4312)
+          // Disable `int`-to-`HANDLE` compiler warning. This is safe to do,
+          // see comment above.
           return reinterpret_cast<HANDLE>(left.crt()) ==
                  static_cast<HANDLE>(right);
+#pragma warning(pop)
         }
         case WindowsFD::FD_SOCKET: {
           if (static_cast<SOCKET>(right) == INVALID_SOCKET) {
@@ -357,8 +372,13 @@ inline bool operator==(const WindowsFD& left, const WindowsFD& right)
           if (right.crt() < 0) {
             return false;
           }
+#pragma warning(push)
+#pragma warning(disable : 4312)
+          // Disable `int`-to-`HANDLE` compiler warning. This is safe to do,
+          // see comment above.
           return static_cast<HANDLE>(left) ==
                  reinterpret_cast<HANDLE>(right.crt());
+#pragma warning(pop)
         }
         case WindowsFD::FD_HANDLE: {
           return static_cast<HANDLE>(left) == static_cast<HANDLE>(right);

http://git-wip-us.apache.org/repos/asf/mesos/blob/e4d8573d/3rdparty/stout/include/stout/protobuf.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/include/stout/protobuf.hpp b/3rdparty/stout/include/stout/protobuf.hpp
index c0f03bc..34290c7 100644
--- a/3rdparty/stout/include/stout/protobuf.hpp
+++ b/3rdparty/stout/include/stout/protobuf.hpp
@@ -175,7 +175,14 @@ Try<T> deserialize(const std::string& value)
   T t;
   (void) static_cast<google::protobuf::Message*>(&t);
 
-  google::protobuf::io::ArrayInputStream stream(value.data(), value.size());
+  // Verify that the size of `value` fits into `ArrayInputStream`'s
+  // constructor. The maximum size of a proto2 message is 64 MB, so it is
+  // unlikely that we will hit this limit, but since an arbitrary string can be
+  // passed in, we include this check to be safe.
+  CHECK_LE(value.size(), std::numeric_limits<int>::max());
+  google::protobuf::io::ArrayInputStream stream(
+      value.data(),
+      static_cast<int>(value.size()));
   if (!t.ParseFromZeroCopyStream(&stream)) {
     return Error("Failed to deserialize " + t.GetDescriptor()->full_name());
   }
@@ -274,8 +281,15 @@ struct Read
     // must outlive the creation of ArrayInputStream.
     const std::string& data = result.get();
 
+    // Verify that the size of `data` fits into `ArrayInputStream`'s
+    // constructor. The maximum size of a proto2 message is 64 MB, so it is
+    // unlikely that we will hit this limit, but since an arbitrary string can
+    // be passed in, we include this check to be safe.
+    CHECK_LE(data.size(), std::numeric_limits<int>::max());
     T message;
-    google::protobuf::io::ArrayInputStream stream(data.data(), data.size());
+    google::protobuf::io::ArrayInputStream stream(
+        data.data(),
+        static_cast<int>(data.size()));
 
     if (!message.ParseFromZeroCopyStream(&stream)) {
       if (undoFailed) {

http://git-wip-us.apache.org/repos/asf/mesos/blob/e4d8573d/3rdparty/stout/include/stout/windows/os.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/include/stout/windows/os.hpp b/3rdparty/stout/include/stout/windows/os.hpp
index b5172fc..0bedb2d 100644
--- a/3rdparty/stout/include/stout/windows/os.hpp
+++ b/3rdparty/stout/include/stout/windows/os.hpp
@@ -51,10 +51,16 @@ inline Try<OSVERSIONINFOEX> os_version()
 {
   OSVERSIONINFOEX os_version;
   os_version.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
+#pragma warning(push)
+#pragma warning(disable : 4996)
+  // Disable compiler warning asking us to use the Unicode version of
+  // `GetVersionEx`, because Mesos currently does not support Unicode. See
+  // MESOS-6817.
   if (!::GetVersionEx(reinterpret_cast<LPOSVERSIONINFO>(&os_version))) {
     return WindowsError(
         "os::internal::os_version: Call to `GetVersionEx` failed");
   }
+#pragma warning(pop)
 
   return os_version;
 }
@@ -459,9 +465,15 @@ inline Try<Version> release()
 {
   OSVERSIONINFOEX os_version;
   os_version.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
+#pragma warning(push)
+#pragma warning(disable : 4996)
+  // Disable compiler warning asking us to use the Unicode version of
+  // `GetVersionEx`, because Mesos currently does not support Unicode. See
+  // MESOS-6817.
   if (!::GetVersionEx(reinterpret_cast<LPOSVERSIONINFO>(&os_version))) {
     return WindowsError("os::release: Call to `GetVersionEx` failed");
   }
+#pragma warning(pop)
 
   return Version(os_version.dwMajorVersion, os_version.dwMinorVersion, 0);
 }


[3/7] mesos git commit: Added Windows support for Docker executor.

Posted by jo...@apache.org.
Added Windows support for Docker executor.

This commit will introduce the changes to the Mesos Docker interfaces
required to use the Docker executor to run Windows Containers in the
Mesos agent. In particular, since Windows Containers use named pipes to
connect do the Docker host, rather than a socket, we introduce the
plumbing to default to a named pipe connection when invoking the
`docker` command.

This work constitutes the beginning of the end of the work that will
eventually result in Mesos support of Windows Containers.

This review is partially based on r/52364, which was the work of Daniel
Pravat.

Review: https://reviews.apache.org/r/56505/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/7a6b7c69
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/7a6b7c69
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/7a6b7c69

Branch: refs/heads/master
Commit: 7a6b7c69560178a22be7a6f0990b27556fca2c59
Parents: 83c564c
Author: Daniel Pravat <dp...@outlook.com>
Authored: Wed Feb 15 16:21:39 2017 -0800
Committer: Joseph Wu <jo...@apache.org>
Committed: Thu Feb 16 17:50:09 2017 -0800

----------------------------------------------------------------------
 src/docker/docker.cpp              |  9 +++++++++
 src/docker/docker.hpp              | 13 ++++++++++++-
 src/docker/executor.hpp            |  6 ++++--
 src/slave/constants.hpp            |  8 ++++++++
 src/slave/containerizer/docker.cpp |  3 ++-
 src/slave/flags.cpp                | 10 ++++++----
 src/tests/flags.hpp                | 16 +++++++++++-----
 7 files changed, 52 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/7a6b7c69/src/docker/docker.cpp
----------------------------------------------------------------------
diff --git a/src/docker/docker.cpp b/src/docker/docker.cpp
index 68042fd..9a454ec 100755
--- a/src/docker/docker.cpp
+++ b/src/docker/docker.cpp
@@ -104,9 +104,18 @@ Try<Owned<Docker>> Docker::create(
     bool validate,
     const Option<JSON::Object>& config)
 {
+#ifndef __WINDOWS__
+  // TODO(hausdorff): Currently, `path::absolute` does not handle all the edge
+  // cases of Windows. Revisit this when MESOS-3442 is resolved.
+  //
+  // NOTE: When we do come back and fix this bug, it is also worth noting that
+  // on Windows an empty value of `socket` is frequently used to connect to the
+  // Docker host (i.e., the user wants to connect 'npipes://', with an empty
+  // socket path). A full solution should accommodate this.
   if (!path::absolute(socket)) {
     return Error("Invalid Docker socket path: " + socket);
   }
+#endif // __WINDOWS__
 
   Owned<Docker> docker(new Docker(path, socket, config));
   if (!validate) {

http://git-wip-us.apache.org/repos/asf/mesos/blob/7a6b7c69/src/docker/docker.hpp
----------------------------------------------------------------------
diff --git a/src/docker/docker.hpp b/src/docker/docker.hpp
index 9093371..314fcb4 100644
--- a/src/docker/docker.hpp
+++ b/src/docker/docker.hpp
@@ -38,6 +38,17 @@
 #include "mesos/resources.hpp"
 
 
+// OS-specific default prefix to be used for the DOCKER_HOST environment
+// variable. Note that on Linux, the default prefix is the only prefix
+// available; only Windows supports multiple prefixes.
+// TODO(hausdorff): Add support for the Windows `tcp://` prefix as well.
+#ifdef __WINDOWS__
+constexpr char DEFAULT_DOCKER_HOST_PREFIX[] = "npipe://";
+#else
+constexpr char DEFAULT_DOCKER_HOST_PREFIX[] = "unix://";
+#endif // __WINDOWS__
+
+
 // Abstraction for working with Docker (modeled on CLI).
 //
 // TODO(benh): Make futures returned by functions be discardable.
@@ -212,7 +223,7 @@ protected:
          const std::string& _socket,
          const Option<JSON::Object>& _config)
        : path(_path),
-         socket("unix://" + _socket),
+         socket(DEFAULT_DOCKER_HOST_PREFIX + _socket),
          config(_config) {}
 
 private:

http://git-wip-us.apache.org/repos/asf/mesos/blob/7a6b7c69/src/docker/executor.hpp
----------------------------------------------------------------------
diff --git a/src/docker/executor.hpp b/src/docker/executor.hpp
index 8385631..d424977 100644
--- a/src/docker/executor.hpp
+++ b/src/docker/executor.hpp
@@ -45,8 +45,10 @@ struct Flags : public virtual mesos::internal::logging::Flags
 
     add(&Flags::docker_socket,
         "docker_socket",
-        "The UNIX socket path to be used by docker CLI for accessing docker\n"
-        "daemon.");
+        "Resource used by the agent and the executor to provice CLI access\n"
+        "to the Docker daemon. On Unix, this is typically a path to a\n"
+        "socket, such as '/var/run/docker.sock'. On Windows this must be a\n"
+        "named pipe, such as '//./pipe/docker_engine'.");
 
     add(&Flags::sandbox_directory,
         "sandbox_directory",

http://git-wip-us.apache.org/repos/asf/mesos/blob/7a6b7c69/src/slave/constants.hpp
----------------------------------------------------------------------
diff --git a/src/slave/constants.hpp b/src/slave/constants.hpp
index 1159ac3..725689a 100644
--- a/src/slave/constants.hpp
+++ b/src/slave/constants.hpp
@@ -98,6 +98,14 @@ constexpr Bytes DEFAULT_EXECUTOR_MEM = Megabytes(32);
 constexpr uint16_t DEFAULT_EPHEMERAL_PORTS_PER_CONTAINER = 1024;
 #endif
 
+// Default UNIX socket (Linux) or Named Pipe (Windows) resource that provides
+// CLI access to the Docker daemon.
+#ifdef __WINDOWS__
+constexpr char DEFAULT_DOCKER_HOST_RESOURCE[] = "//./pipe/docker_engine";
+#else
+constexpr char DEFAULT_DOCKER_HOST_RESOURCE[] = "/var/run/docker.sock";
+#endif // __WINDOWS__
+
 // Default duration that docker containers will be removed after exit.
 constexpr Duration DOCKER_REMOVE_DELAY = Hours(6);
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/7a6b7c69/src/slave/containerizer/docker.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/docker.cpp b/src/slave/containerizer/docker.cpp
index 886528f..1791108 100644
--- a/src/slave/containerizer/docker.cpp
+++ b/src/slave/containerizer/docker.cpp
@@ -37,6 +37,7 @@
 #include <stout/hashset.hpp>
 #include <stout/jsonify.hpp>
 #include <stout/os.hpp>
+#include <stout/path.hpp>
 #include <stout/uuid.hpp>
 
 #include <stout/os/killtree.hpp>
@@ -91,7 +92,7 @@ const string DOCKER_NAME_SEPERATOR = ".";
 
 
 // Declared in header, see explanation there.
-const string DOCKER_SYMLINK_DIRECTORY = "docker/links";
+const string DOCKER_SYMLINK_DIRECTORY = path::join("docker", "links");
 
 
 #ifdef __WINDOWS__

http://git-wip-us.apache.org/repos/asf/mesos/blob/7a6b7c69/src/slave/flags.cpp
----------------------------------------------------------------------
diff --git a/src/slave/flags.cpp b/src/slave/flags.cpp
index 71935de..8de2643 100644
--- a/src/slave/flags.cpp
+++ b/src/slave/flags.cpp
@@ -632,10 +632,12 @@ mesos::internal::slave::Flags::Flags()
 
   add(&Flags::docker_socket,
       "docker_socket",
-      "The UNIX socket path to be mounted into the docker executor container\n"
-      "to provide docker CLI access to the docker daemon. This must be the\n"
-      "path used by the agent's docker image.\n",
-      "/var/run/docker.sock");
+      "Resource used by the agent and the executor to provice CLI access\n"
+      "to the Docker daemon. On Unix, this is typically a path to a\n"
+      "socket, such as '/var/run/docker.sock'. On Windows this must be a\n"
+      "named pipe, such as '//./pipe/docker_engine'. NOTE: This must be\n"
+      "the path used by the Docker image used to run the agent.\n",
+      DEFAULT_DOCKER_HOST_RESOURCE);
 
   add(&Flags::docker_config,
       "docker_config",

http://git-wip-us.apache.org/repos/asf/mesos/blob/7a6b7c69/src/tests/flags.hpp
----------------------------------------------------------------------
diff --git a/src/tests/flags.hpp b/src/tests/flags.hpp
index cab2416..9bfe7be 100644
--- a/src/tests/flags.hpp
+++ b/src/tests/flags.hpp
@@ -26,10 +26,15 @@
 #include <stout/os.hpp>
 
 #include "common/parse.hpp"
+
 #include "logging/logging.hpp"
+
 #include "master/constants.hpp"
+
 #include "messages/messages.hpp"
 
+#include "slave/constants.hpp"
+
 namespace mesos {
 namespace internal {
 namespace tests {
@@ -77,11 +82,12 @@ public:
 
     add(&Flags::docker_socket,
         "docker_socket",
-        "The UNIX socket path to be mounted into the\n"
-        "docker executor container to provide docker\n"
-        "CLI access to the docker daemon. This must be the\n"
-        "path used by the agent's docker image.\n",
-        "/var/run/docker.sock");
+        "Resource used by the agent and the executor to provice CLI access\n"
+        "to the Docker daemon. On Unix, this is typically a path to a\n"
+        "socket, such as '/var/run/docker.sock'. On Windows this must be a\n"
+        "named pipe, such as '//./pipe/docker_engine'. NOTE: This must be\n"
+        "the path used by the Docker image used to run the agent.\n",
+        slave::DEFAULT_DOCKER_HOST_RESOURCE);
 
     // This help message for --modules flag is the same for
     // {master,slave,sched,tests}/flags.[ch]pp and should always be kept in