You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ne...@apache.org on 2017/05/10 04:22:45 UTC
[1/5] mesos git commit: Fixed `Version::validateIdentifier()` for
Unicode edge case.
Repository: mesos
Updated Branches:
refs/heads/1.2.x b498bfb94 -> 69fae40ac
Fixed `Version::validateIdentifier()` for Unicode edge case.
The test case `u8"1.0.0-b\u00e9ta"` in `VersionTest.ParseInvalid` caused
an abort in `isctype.cpp` with VS 2017. Changing the `char` to an
`unsigned char` prevents this.
Review: https://reviews.apache.org/r/59110/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/33c72bb4
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/33c72bb4
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/33c72bb4
Branch: refs/heads/1.2.x
Commit: 33c72bb45e8825d60556783a5da8972775673a96
Parents: b498bfb
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Tue May 9 14:06:01 2017 -0700
Committer: Neil Conway <ne...@gmail.com>
Committed: Tue May 9 21:12:13 2017 -0700
----------------------------------------------------------------------
3rdparty/stout/include/stout/version.hpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/33c72bb4/3rdparty/stout/include/stout/version.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/include/stout/version.hpp b/3rdparty/stout/include/stout/version.hpp
index 9120e42..4be7222 100644
--- a/3rdparty/stout/include/stout/version.hpp
+++ b/3rdparty/stout/include/stout/version.hpp
@@ -299,7 +299,7 @@ private:
return Error("Empty identifier");
}
- auto alphaNumericOrHyphen = [](char c) -> bool {
+ auto alphaNumericOrHyphen = [](unsigned char c) -> bool {
return std::isalnum(c) || c == '-';
};
[3/5] mesos git commit: Cleaned up comments in stout's Version.
Posted by ne...@apache.org.
Cleaned up comments in stout's Version.
Review: https://reviews.apache.org/r/59122
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/04485c38
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/04485c38
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/04485c38
Branch: refs/heads/1.2.x
Commit: 04485c38b212f8079bb8526e88824d04284b4c1b
Parents: aa711e6
Author: Neil Conway <ne...@gmail.com>
Authored: Tue May 9 17:52:20 2017 -0700
Committer: Neil Conway <ne...@gmail.com>
Committed: Tue May 9 21:12:33 2017 -0700
----------------------------------------------------------------------
3rdparty/stout/include/stout/version.hpp | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/04485c38/3rdparty/stout/include/stout/version.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/include/stout/version.hpp b/3rdparty/stout/include/stout/version.hpp
index bff6e4c..b396cad 100644
--- a/3rdparty/stout/include/stout/version.hpp
+++ b/3rdparty/stout/include/stout/version.hpp
@@ -38,11 +38,6 @@
//
// TODO(neilc): Consider providing a "strict" variant that does not
// allow these extensions.
-//
-// Ideally, the version components would be called simply "major",
-// "minor", and "patch". However, GNU libstdc++ already defines these
-// as macros for compatibility reasons (man 3 makedev for more
-// information) implicitly included in every compilation.
struct Version
{
// Expect the string in the following format:
@@ -55,6 +50,11 @@ struct Version
// consist of one or more dot-separated identifiers. An identifier
// is a non-empty string containing ASCII alphanumeric characters or
// hyphens.
+ //
+ // Ideally, the version components would be called simply "major",
+ // "minor", and "patch". However, GNU libstdc++ already defines
+ // these as macros for compatibility reasons (man 3 makedev for more
+ // information) implicitly included in every compilation.
static Try<Version> parse(const std::string& input)
{
// The input string consists of the numeric components, optionally
[2/5] mesos git commit: Allowed leading zeros in input to stout's
Version parser.
Posted by ne...@apache.org.
Allowed leading zeros in input to stout's Version parser.
The original behavior was to allow leading zeros. When Version was
enhanced with more complete support for SemVer [1], it was also changed
to reject leading zeros in numeric components (version numbers and
prerelease identifiers). Although this change was consistent with the
SemVer spec (which mandates that such version strings "MUST" be
considered invalid), it breaks compatibility with the versions used by
some common software packages (e.g., Docker).
This commit reverts the change in behavior, so that leading zeros are
once again allowed. In the future, we might consider adding a "strict"
mode to the Version parser, and/or supporting an "options" scheme that
would allow the user to customize the version parser's behavior.
[1] 287556284d76e03c11cff3fc076224fe966096e0
Review: https://reviews.apache.org/r/59105/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/aa711e6d
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/aa711e6d
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/aa711e6d
Branch: refs/heads/1.2.x
Commit: aa711e6d417359ce25b54c921c65a66fb3c6590a
Parents: 33c72bb
Author: Neil Conway <ne...@gmail.com>
Authored: Tue May 9 17:50:11 2017 -0700
Committer: Neil Conway <ne...@gmail.com>
Committed: Tue May 9 21:12:25 2017 -0700
----------------------------------------------------------------------
3rdparty/stout/include/stout/version.hpp | 63 ++++++++-------------------
3rdparty/stout/tests/version_tests.cpp | 14 +++---
2 files changed, 26 insertions(+), 51 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/aa711e6d/3rdparty/stout/include/stout/version.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/include/stout/version.hpp b/3rdparty/stout/include/stout/version.hpp
index 4be7222..bff6e4c 100644
--- a/3rdparty/stout/include/stout/version.hpp
+++ b/3rdparty/stout/include/stout/version.hpp
@@ -30,7 +30,14 @@
// This class provides convenience routines for working with version
// numbers. We support the SemVer 2.0.0 (http://semver.org) format,
-// with minor extensions.
+// with two differences:
+//
+// (1) Numeric components with leading zeros are allowed.
+//
+// (2) Missing version components are allowed and treated as zero.
+//
+// TODO(neilc): Consider providing a "strict" variant that does not
+// allow these extensions.
//
// Ideally, the version components would be called simply "major",
// "minor", and "patch". However, GNU libstdc++ already defines these
@@ -42,11 +49,6 @@ struct Version
// <major>[.<minor>[.<patch>]][-prerelease][+build]
//
// Missing `minor` or `patch` components are treated as zero.
- // Allowing some version numbers to be omitted is an extension to
- // SemVer, albeit one that several other SemVer libraries implement.
- //
- // TODO(neilc): Consider providing a "strict" variant that does not
- // allow version numbers to be omitted.
//
// `prerelease` is a prerelease label (e.g., "beta", "rc.1");
// `build` is a build metadata label. Both `prerelease` and `build`
@@ -69,9 +71,7 @@ struct Version
if (buildParts.size() == 2) {
const std::string& buildString = buildParts.back();
- // NOTE: Build metadata identifiers can contain leading zeros
- // (unlike numeric prerelease identifiers; see below).
- Try<std::vector<std::string>> parsed = parseLabel(buildString, false);
+ Try<std::vector<std::string>> parsed = parseLabel(buildString);
if (parsed.isError()) {
return Error("Invalid build label: " + parsed.error());
}
@@ -92,8 +92,7 @@ struct Version
if (prereleaseParts.size() == 2) {
const std::string& prereleaseString = prereleaseParts.back();
- // Prerelease identifiers cannot contain leading zeros.
- Try<std::vector<std::string>> parsed = parseLabel(prereleaseString, true);
+ Try<std::vector<std::string>> parsed = parseLabel(prereleaseString);
if (parsed.isError()) {
return Error("Invalid prerelease label: " + parsed.error());
}
@@ -121,11 +120,6 @@ struct Version
": " + result.error());
}
- if (hasLeadingZero(numericComponents[i])) {
- return Error("Invalid version component '" + numericComponents[i] + "'"
- ": cannot contain leading zero");
- }
-
versionNumbers[i] = result.get();
}
@@ -153,11 +147,11 @@ struct Version
// valid prerelease and build identifiers.
foreach (const std::string& identifier, prerelease) {
- CHECK_NONE(validateIdentifier(identifier, true));
+ CHECK_NONE(validateIdentifier(identifier));
}
foreach (const std::string& identifier, build) {
- CHECK_NONE(validateIdentifier(identifier, false));
+ CHECK_NONE(validateIdentifier(identifier));
}
}
@@ -290,10 +284,9 @@ struct Version
private:
// Check that a string contains a valid identifier. An identifier is
// a non-empty string; each character must be an ASCII alphanumeric
- // or hyphen.
- static Option<Error> validateIdentifier(
- const std::string& identifier,
- bool rejectLeadingZero)
+ // or hyphen. We allow leading zeros in numeric identifiers, which
+ // inconsistent with the SemVer spec.
+ static Option<Error> validateIdentifier(const std::string& identifier)
{
if (identifier.empty()) {
return Error("Empty identifier");
@@ -311,23 +304,13 @@ private:
"'" + stringify(*firstInvalid) + "'");
}
- // If requested, disallow identifiers that contain a leading
- // zero. Note that this only applies to numeric identifiers, and
- // that zero-valued identifiers are allowed.
- if (rejectLeadingZero && hasLeadingZero(identifier)) {
- return Error("Identifier contains leading zero");
- }
-
return None();
}
// Parse a string containing a series of dot-separated identifiers
// into a vector of strings; each element of the vector contains a
- // single identifier. If `rejectLeadingZeros` is true, we reject any
- // numeric identifier in the label that contains a leading zero.
- static Try<std::vector<std::string>> parseLabel(
- const std::string& label,
- bool rejectLeadingZeros)
+ // single identifier.
+ static Try<std::vector<std::string>> parseLabel(const std::string& label)
{
if (label.empty()) {
return Error("Empty label");
@@ -336,7 +319,7 @@ private:
std::vector<std::string> identifiers = strings::split(label, ".");
foreach (const std::string& identifier, identifiers) {
- Option<Error> error = validateIdentifier(identifier, rejectLeadingZeros);
+ Option<Error> error = validateIdentifier(identifier);
if (error.isSome()) {
return error.get();
}
@@ -345,16 +328,6 @@ private:
return identifiers;
}
- // Checks whether the input string is numeric and contains a leading
- // zero. Note that "0" by itself is not considered a "leading zero".
- static bool hasLeadingZero(const std::string& identifier) {
- Try<uint32_t> numericIdentifier = parseNumericIdentifier(identifier);
-
- return numericIdentifier.isSome() &&
- numericIdentifier.get() != 0 &&
- strings::startsWith(identifier, '0');
- }
-
// Try to parse the given string as a numeric identifier. According
// to the SemVer spec, identifiers that begin with hyphens are
// considered non-numeric.
http://git-wip-us.apache.org/repos/asf/mesos/blob/aa711e6d/3rdparty/stout/tests/version_tests.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/tests/version_tests.cpp b/3rdparty/stout/tests/version_tests.cpp
index bce185e..a532d0c 100644
--- a/3rdparty/stout/tests/version_tests.cpp
+++ b/3rdparty/stout/tests/version_tests.cpp
@@ -124,7 +124,13 @@ TEST(VersionTest, ParseValid)
{"1-2-3.4+5.6-7",
{Version(1, 0, 0, {"2-3", "4"}, {"5", "6-7"}), "1.0.0-2-3.4+5.6-7"}},
{"1-2.-3+4.-5",
- {Version(1, 0, 0, {"2", "-3"}, {"4", "-5"}), "1.0.0-2.-3+4.-5"}}
+ {Version(1, 0, 0, {"2", "-3"}, {"4", "-5"}), "1.0.0-2.-3+4.-5"}},
+ // Allow leading zeros: in violation of the SemVer spec, but we
+ // tolerate it for compatibility with common practice (e.g., Docker).
+ {"01.2.3", {Version(1, 2, 3), "1.2.3"}},
+ {"1.02.3", {Version(1, 2, 3), "1.2.3"}},
+ {"1.2.03", {Version(1, 2, 3), "1.2.3"}},
+ {"1.2.3-alpha.001", {Version(1, 2, 3, {"alpha", "001"}), "1.2.3-alpha.001"}}
};
foreachpair (const string& input, const ExpectedValue& expected, testCases) {
@@ -152,11 +158,8 @@ TEST(VersionTest, ParseInvalid)
".1.2",
"0.1.-2",
"0.-1.2",
- "0.1.2.3",
+ "1.2.3.4",
"-1.1.2",
- "01.2.3",
- "1.02.3",
- "1.2.03",
"1.1.2-",
"1.1.2+",
"1.1.2-+",
@@ -169,7 +172,6 @@ TEST(VersionTest, ParseInvalid)
"1.1.2+.foo",
"1.1.2-al^pha",
"1.1.2+exp;",
- "1.1.2-alpha.001",
"-foo",
"+foo",
u8"1.0.0-b\u00e9ta"
[5/5] mesos git commit: Sorted 1.2.1 CHANGELOG entries.
Posted by ne...@apache.org.
Sorted 1.2.1 CHANGELOG entries.
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/69fae40a
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/69fae40a
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/69fae40a
Branch: refs/heads/1.2.x
Commit: 69fae40ac9a4fdee9b942424fc2ddd10a050a638
Parents: 9c99c31
Author: Neil Conway <ne...@gmail.com>
Authored: Tue May 9 21:22:16 2017 -0700
Committer: Neil Conway <ne...@gmail.com>
Committed: Tue May 9 21:22:16 2017 -0700
----------------------------------------------------------------------
CHANGELOG | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/69fae40a/CHANGELOG
----------------------------------------------------------------------
diff --git a/CHANGELOG b/CHANGELOG
index 7ba85cf..818bc0f 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -18,10 +18,10 @@ All Issues:
* [MESOS-7264] - Possibly duplicate environment variables should not leak values to the sandbox.
* [MESOS-7265] - Containerizer startup may cause sensitive data to leak into sandbox logs.
* [MESOS-7272] - Unified containerizer does not support docker registry version < 2.3.
+ * [MESOS-7346] - Agent crashes if the task name is too long.
+ * [MESOS-7350] - Failed to pull image from Nexus Registry due to signature missing.
* [MESOS-7366] - Agent sandbox gc could accidentally delete the entire persistent volume content.
* [MESOS-7383] - Docker executor logs possibly sensitive parameters.
- * [MESOS-7350] - Failed to pull image from Nexus Registry due to signature missing.
- * [MESOS-7346] - Agent crashes if the task name is too long.
* [MESOS-7389] - Mesos 1.2.0 crashes with pre-1.0 Mesos agents.
* [MESOS-7400] - The mesos crashes due to an incorrect invariant check in the decoder.
* [MESOS-7427] - Registry puller cannot fetch manifests from Amazon ECR: 405 Unsupported.
[4/5] mesos git commit: Added MESOS-7464,
MESOS-7484 to 1.2.1 CHANGELOG.
Posted by ne...@apache.org.
Added MESOS-7464, MESOS-7484 to 1.2.1 CHANGELOG.
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/9c99c312
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/9c99c312
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/9c99c312
Branch: refs/heads/1.2.x
Commit: 9c99c3128b6acbdc347c579eaa887b26403ab985
Parents: 04485c3
Author: Neil Conway <ne...@gmail.com>
Authored: Tue May 9 21:20:50 2017 -0700
Committer: Neil Conway <ne...@gmail.com>
Committed: Tue May 9 21:20:50 2017 -0700
----------------------------------------------------------------------
CHANGELOG | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/9c99c312/CHANGELOG
----------------------------------------------------------------------
diff --git a/CHANGELOG b/CHANGELOG
index 4217a3e..7ba85cf 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -27,8 +27,10 @@ All Issues:
* [MESOS-7427] - Registry puller cannot fetch manifests from Amazon ECR: 405 Unsupported.
* [MESOS-7429] - Allow isolators to inject task-specific environment variables.
* [MESOS-7453] - glyphicons-halflings-regular.woff2 is missing in WebUI.
+ * [MESOS-7464] - Recent Docker versions cannot be parsed by stout.
* [MESOS-7471] - Provisioner recover should not always assume 'rootfses' dir exists.
* [MESOS-7478] - Pre-1.2.x master does not work with 1.2.x agent.
+ * [MESOS-7484] - VersionTest.ParseInvalid aborts on Windows.
Release Notes - Mesos - Version 1.2.0