mesos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From josep...@apache.org
Subject [1/6] mesos git commit: Windows: Removed deprecated flag parsing behavior.
Date Mon, 15 May 2017 17:33:39 GMT
Repository: mesos
Updated Branches:
  refs/heads/master 8ca6e6f04 -> 4e0a30f66


Windows: Removed deprecated flag parsing behavior.

On Posix, you can load a file into a flag by specifying prefixing
the flag value with a forward slash.  This behavior has been
deprecated since 0.22.

Therefore, on Windows, we choose to omit the deprecated code
instead of porting it.

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


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

Branch: refs/heads/master
Commit: 877f24bbeb06f8ce25b7e2e7279e542f492fdb76
Parents: 7b74227
Author: Jeff Coffler <jeff@taltos.com>
Authored: Mon May 8 18:21:43 2017 -0700
Committer: Joseph Wu <josephwu@apache.org>
Committed: Mon May 15 09:44:07 2017 -0700

----------------------------------------------------------------------
 3rdparty/stout/include/stout/flags/parse.hpp | 8 ++++++++
 3rdparty/stout/tests/flags_tests.cpp         | 8 +++++---
 2 files changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/877f24bb/3rdparty/stout/include/stout/flags/parse.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/include/stout/flags/parse.hpp b/3rdparty/stout/include/stout/flags/parse.hpp
index 65edd86..3448c57 100644
--- a/3rdparty/stout/include/stout/flags/parse.hpp
+++ b/3rdparty/stout/include/stout/flags/parse.hpp
@@ -87,12 +87,15 @@ inline Try<net::IP> parse(const std::string& value)
 template <>
 inline Try<JSON::Object> parse(const std::string& value)
 {
+#ifndef __WINDOWS__
   // A value that already starts with 'file://' will properly be
   // loaded from the file and put into 'value' but if it starts with
   // '/' we need to explicitly handle it for backwards compatibility
   // reasons (because we used to handle it before we introduced the
   // 'fetch' mechanism for flags that first fetches the data from URIs
   // such as 'file://').
+  //
+  // NOTE: Because this code is deprecated, it is not supported on Windows.
   if (strings::startsWith(value, "/")) {
     LOG(WARNING) << "Specifying an absolute filename to read a command line "
                     "option out of without using 'file:// is deprecated and "
@@ -106,6 +109,7 @@ inline Try<JSON::Object> parse(const std::string& value)
     }
     return JSON::parse<JSON::Object>(read.get());
   }
+#endif // __WINDOWS__
   return JSON::parse<JSON::Object>(value);
 }
 
@@ -113,12 +117,15 @@ inline Try<JSON::Object> parse(const std::string& value)
 template <>
 inline Try<JSON::Array> parse(const std::string& value)
 {
+#ifndef __WINDOWS__
   // A value that already starts with 'file://' will properly be
   // loaded from the file and put into 'value' but if it starts with
   // '/' we need to explicitly handle it for backwards compatibility
   // reasons (because we used to handle it before we introduced the
   // 'fetch' mechanism for flags that first fetches the data from URIs
   // such as 'file://').
+  //
+  // NOTE: Because this code is deprecated, it is not supported on Windows.
   if (strings::startsWith(value, "/")) {
     LOG(WARNING) << "Specifying an absolute filename to read a command line "
                     "option out of without using 'file:// is deprecated and "
@@ -132,6 +139,7 @@ inline Try<JSON::Array> parse(const std::string& value)
     }
     return JSON::parse<JSON::Array>(read.get());
   }
+#endif // __WINDOWS__
   return JSON::parse<JSON::Array>(value);
 }
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/877f24bb/3rdparty/stout/tests/flags_tests.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/tests/flags_tests.cpp b/3rdparty/stout/tests/flags_tests.cpp
index e2681f8..d78ab55 100644
--- a/3rdparty/stout/tests/flags_tests.cpp
+++ b/3rdparty/stout/tests/flags_tests.cpp
@@ -978,9 +978,10 @@ TEST(FlagsTest, JSON)
 class FlagsFileTest : public TemporaryDirectoryTest {};
 
 
-// TODO(hausdorff): Enable this test on Windows. Currently `flags::parse`
-// assumes filesystems are rooted at '/'. See MESOS-5937.
-TEST_F_TEMP_DISABLED_ON_WINDOWS(FlagsFileTest, JSONFile)
+#ifndef __WINDOWS__
+// This tests deprecated code that pre-dates Windows support for Mesos.
+// Hence, we should not build or enable this test on Windows.
+TEST_F(FlagsFileTest, JSONFile)
 {
   class TestFlags : public virtual FlagsBase
   {
@@ -1015,6 +1016,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(FlagsFileTest, JSONFile)
 
   ASSERT_SOME_EQ(object, flags.json);
 }
+#endif // __WINDOWS__
 
 
 TEST_F(FlagsFileTest, FilePrefix)


Mime
View raw message