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 2016/07/18 20:45:52 UTC

[1/3] mesos git commit: Updated Windows build instructions.

Repository: mesos
Updated Branches:
  refs/heads/master fd89c0754 -> bd2310b56


Updated Windows build instructions.

Adds notes about the type of Visual Studio installation expected (C++),
the git checkout configuration, and the build path on Windows.

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


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

Branch: refs/heads/master
Commit: bd2310b5624bcb2062bf2d7031ca4a426416743e
Parents: 2d08b8c
Author: Joseph Wu <jo...@mesosphere.io>
Authored: Mon Jul 18 13:25:21 2016 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Mon Jul 18 13:44:35 2016 -0700

----------------------------------------------------------------------
 docs/getting-started.md | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/bd2310b5/docs/getting-started.md
----------------------------------------------------------------------
diff --git a/docs/getting-started.md b/docs/getting-started.md
index 104816e..ebe5270 100644
--- a/docs/getting-started.md
+++ b/docs/getting-started.md
@@ -172,10 +172,15 @@ Following are the instructions for stock CentOS 7.1. If you are using a differen
 Following are the instructions for stock Windows 10 and Windows Server 2012 or newer.
 
 1. Install the latest version of [Visual Studio Community 2015](https://www.visualstudio.com/post-download-vs?sku=community).
+   Make sure to select the Common Tools for Visual C++ and the Windows 10 SDK.
    Start Visual Studio Community to complete the setup and configuration.
 2. Install [CMake 3.5.2 or later](https://cmake.org/files/v3.5/cmake-3.5.2-win32-x86.msi).
    Do not run CMake before finishing the Visual Studio Community setup.
 3. Install [Gnu Patch 2.5.9-7 or later](http://downloads.sourceforge.net/project/gnuwin32/patch/2.5.9-7/patch-2.5.9-7-setup.exe).
+4. If building from git, make sure you have Windows-style line endings.
+   i.e. `git config core.autocrlf true`.
+5. Make sure there are no spaces in your build directory.
+   For example, `C:/Program Files (x86)/mesos` is an invalid build directory.
 
 ## Building Mesos (Posix)
 
@@ -223,13 +228,13 @@ In order to speed up the build and reduce verbosity of the logs, you can append
     # NOTE: `PreferredToolArchitecture` can be set system-wide via Control Panel.
     $ msbuild Mesos.sln /p:PreferredToolArchitecture=x64
 
-    # mesos-agent.exe can be found in the <repository>\build\src\Debug folder.
-    $ cd src\Debug
+    # mesos-agent.exe can be found in the <repository>\build\src folder.
+    $ cd src
 
     # The Windows agent exposes new isolators that must be used as with
     # the `--isolation` flag. To get started point the agent to a working
     # master, using eiher an IP address or zookeeper information.
-    $ mesos-agent.exe --master=<master> --work_dir=<work folder> --isolation=windows/cpu,filesystem/windows --launcher_dir=<repository>\build\src\Debug
+    $ mesos-agent.exe --master=<master> --work_dir=<work folder> --isolation=windows/cpu,filesystem/windows --launcher_dir=<repository>\build\src
 
 ## Examples
 


[3/3] mesos git commit: Synced up common/values.cpp and v1/values.cpp.

Posted by jo...@apache.org.
Synced up common/values.cpp and v1/values.cpp.

Includes two patches made on common/values.cpp:

1) https://reviews.apache.org/r/45813/
   Removed capture by reference.
2) https://reviews.apache.org/r/48593/
   Refactor Value::Ranges subtraction.

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


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

Branch: refs/heads/master
Commit: 2608199df6d939a9848a777f022d1aa9e50c5286
Parents: fd89c07
Author: Guangya Liu <gy...@gmail.com>
Authored: Mon Jul 18 13:13:42 2016 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Mon Jul 18 13:44:35 2016 -0700

----------------------------------------------------------------------
 src/v1/values.cpp | 73 +++++++++++++++++++++-----------------------------
 1 file changed, 31 insertions(+), 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/2608199d/src/v1/values.cpp
----------------------------------------------------------------------
diff --git a/src/v1/values.cpp b/src/v1/values.cpp
index 3e0f739..ff1926f 100644
--- a/src/v1/values.cpp
+++ b/src/v1/values.cpp
@@ -33,6 +33,7 @@
 
 #include <stout/error.hpp>
 #include <stout/foreach.hpp>
+#include <stout/interval.hpp>
 #include <stout/strings.hpp>
 
 using std::max;
@@ -267,46 +268,32 @@ void coalesce(Value::Ranges* result, const Value::Range& addedRange)
 }
 
 
-// Removes a range from already coalesced ranges.
-// The algorithms constructs a new vector of ranges which is then
-// coalesced into a Value::Ranges instance.
-static void remove(Value::Ranges* _ranges, const Value::Range& removal)
+// Convert Ranges value to IntervalSet value.
+IntervalSet<uint64_t> rangesToIntervalSet(const Value::Ranges& ranges)
 {
-  vector<internal::Range> ranges;
-  ranges.reserve(_ranges->range_size());
+  IntervalSet<uint64_t> set;
 
-  foreach (const Value::Range& range, _ranges->range()) {
-    // Skip if the entire range is subsumed by `removal`.
-    if (range.begin() >= removal.begin() && range.end() <= removal.end()) {
-      continue;
-    }
+  foreach (const Value::Range& range, ranges.range()) {
+    set += (Bound<uint64_t>::closed(range.begin()),
+            Bound<uint64_t>::closed(range.end()));
+  }
 
-    // Divide if the range subsumes the `removal`.
-    if (range.begin() < removal.begin() && range.end() > removal.end()) {
-      // Front.
-      ranges.emplace_back(internal::Range{range.begin(), removal.begin() - 1});
-      // Back.
-      ranges.emplace_back(internal::Range{removal.end() + 1, range.end()});
-    }
+  return set;
+}
 
-    // Fully Emplace if the range doesn't intersect.
-    if (range.end() < removal.begin() || range.begin() > removal.end()) {
-      ranges.emplace_back(internal::Range{range.begin(), range.end()});
-    } else {
-      // Trim if the range does intersect.
-      if (range.end() > removal.end()) {
-        // Trim front.
-        ranges.emplace_back(internal::Range{removal.end() + 1, range.end()});
-      } else {
-        // Trim back.
-        CHECK(range.begin() < removal.begin());
-        ranges.emplace_back(
-            internal::Range{range.begin(), removal.begin() - 1});
-      }
-    }
+
+// Convert IntervalSet value to Ranges value.
+Value::Ranges intervalSetToRanges(const IntervalSet<uint64_t>& set)
+{
+  Value::Ranges ranges;
+
+  foreach (const Interval<uint64_t>& interval, set) {
+    Value::Range* range = ranges.add_range();
+    range->set_begin(interval.lower());
+    range->set_end(interval.upper() - 1);
   }
 
-  internal::coalesce(_ranges, std::move(ranges));
+  return ranges;
 }
 
 
@@ -406,13 +393,15 @@ Value::Ranges& operator+=(Value::Ranges& left, const Value::Ranges& right)
 }
 
 
-Value::Ranges& operator-=(Value::Ranges& left, const Value::Ranges& right)
+Value::Ranges& operator-=(Value::Ranges& _left, const Value::Ranges& _right)
 {
-  coalesce(&left);
-  for (int i = 0; i < right.range_size(); ++i) {
-    remove(&left, right.range(i));
-  }
-  return left;
+  IntervalSet<uint64_t> left, right;
+
+  left = rangesToIntervalSet(_left);
+  right = rangesToIntervalSet(_right);
+  _left = intervalSetToRanges(left - right);
+
+  return _left;
 }
 
 
@@ -610,7 +599,7 @@ Try<Value> parse(const string& text)
     // This is a Value::Ranges.
     value.set_type(Value::RANGES);
     Value::Ranges* ranges = value.mutable_ranges();
-    const vector<string>& tokens = strings::tokenize(temp, "[]-,\n");
+    const vector<string> tokens = strings::tokenize(temp, "[]-,\n");
     if (tokens.size() % 2 != 0) {
       return Error("Expecting one or more \"ranges\"");
     } else {
@@ -637,7 +626,7 @@ Try<Value> parse(const string& text)
       // This is a set.
       value.set_type(Value::SET);
       Value::Set* set = value.mutable_set();
-      const vector<string>& tokens = strings::tokenize(temp, "{},\n");
+      const vector<string> tokens = strings::tokenize(temp, "{},\n");
       for (size_t i = 0; i < tokens.size(); i++) {
         set->add_item(tokens[i]);
       }


[2/3] mesos git commit: Fixed CMake build on CentOS.

Posted by jo...@apache.org.
Fixed CMake build on CentOS.


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

Branch: refs/heads/master
Commit: 2d08b8c654e9c7e94a5f74f7f0c5da80ee99a2f0
Parents: 2608199
Author: Joseph Wu <jo...@apache.org>
Authored: Mon Jul 18 12:09:41 2016 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Mon Jul 18 13:44:35 2016 -0700

----------------------------------------------------------------------
 3rdparty/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/2d08b8c6/3rdparty/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt
index a651eed..770a382 100755
--- a/3rdparty/CMakeLists.txt
+++ b/3rdparty/CMakeLists.txt
@@ -134,7 +134,7 @@ endif (NOT WIN32)
 set(LIBEVENT_CMAKE_ARGS
   ${LIBEVENT_CMAKE_ARGS}
   -LH
-  -DCMAKE_C_FLAGS="-fPIC"
+  -DCMAKE_C_FLAGS=-fPIC
   -DEVENT__HAVE_SYS_STAT_H=1
   -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
   )