aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-01-17 22:35:08 +0800
committerGitHub <noreply@github.com>2017-01-17 22:35:08 +0800
commit4f4963131bd969fa063a3aad980139dad2034087 (patch)
tree6eec3d6869ded827ab280e1fd6c15cda10ba9a4d
parented12b977615822f1fd6c7674b1b90efc9c6479d3 (diff)
parent467559917008525d6b606de264e4a86a1c5e0620 (diff)
downloaddexon-solidity-4f4963131bd969fa063a3aad980139dad2034087.tar
dexon-solidity-4f4963131bd969fa063a3aad980139dad2034087.tar.gz
dexon-solidity-4f4963131bd969fa063a3aad980139dad2034087.tar.bz2
dexon-solidity-4f4963131bd969fa063a3aad980139dad2034087.tar.lz
dexon-solidity-4f4963131bd969fa063a3aad980139dad2034087.tar.xz
dexon-solidity-4f4963131bd969fa063a3aad980139dad2034087.tar.zst
dexon-solidity-4f4963131bd969fa063a3aad980139dad2034087.zip
Merge pull request #1573 from ethereum/metadata-version
Store strict version number in metadata (exclude the platform)
-rw-r--r--Changelog.md1
-rw-r--r--cmake/scripts/buildinfo.cmake2
-rw-r--r--cmake/templates/BuildInfo.h.in2
-rw-r--r--libsolidity/interface/CompilerStack.cpp2
-rw-r--r--libsolidity/interface/Version.cpp4
-rw-r--r--libsolidity/interface/Version.h1
6 files changed, 11 insertions, 1 deletions
diff --git a/Changelog.md b/Changelog.md
index 1a80bac0..a4063640 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -2,6 +2,7 @@
Features:
* AST: Use deterministic node identifiers.
+ * Metadata: Do not include platform in the version number.
### 0.4.8 (2017-01-13)
diff --git a/cmake/scripts/buildinfo.cmake b/cmake/scripts/buildinfo.cmake
index 8e1615f6..efbfb8fb 100644
--- a/cmake/scripts/buildinfo.cmake
+++ b/cmake/scripts/buildinfo.cmake
@@ -60,6 +60,8 @@ if (SOL_COMMIT_HASH AND SOL_LOCAL_CHANGES)
set(SOL_COMMIT_HASH "${SOL_COMMIT_HASH}.mod")
endif()
+set(SOL_VERSION_COMMIT "commit.${SOL_COMMIT_HASH}")
+set(SOl_VERSION_PLATFORM ETH_BUILD_PLATFORM)
set(SOL_VERSION_BUILDINFO "commit.${SOL_COMMIT_HASH}.${ETH_BUILD_PLATFORM}")
set(TMPFILE "${ETH_DST_DIR}/BuildInfo.h.tmp")
diff --git a/cmake/templates/BuildInfo.h.in b/cmake/templates/BuildInfo.h.in
index 6c16e4ac..4b35df98 100644
--- a/cmake/templates/BuildInfo.h.in
+++ b/cmake/templates/BuildInfo.h.in
@@ -8,3 +8,5 @@
#define ETH_BUILD_PLATFORM "@ETH_BUILD_PLATFORM@"
#define SOL_VERSION_PRERELEASE "@SOL_VERSION_PRERELEASE@"
#define SOL_VERSION_BUILDINFO "@SOL_VERSION_BUILDINFO@"
+#define SOL_VERSION_COMMIT "@SOL_VERSION_COMMIT@"
+#define SOL_VERSION_PLATFORM "@SOL_VERSION_PLATFORM@"
diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp
index a31df584..08b21715 100644
--- a/libsolidity/interface/CompilerStack.cpp
+++ b/libsolidity/interface/CompilerStack.cpp
@@ -695,7 +695,7 @@ string CompilerStack::createOnChainMetadata(Contract const& _contract) const
Json::Value meta;
meta["version"] = 1;
meta["language"] = "Solidity";
- meta["compiler"]["version"] = VersionString;
+ meta["compiler"]["version"] = VersionStringStrict;
meta["sources"] = Json::objectValue;
for (auto const& s: m_sources)
diff --git a/libsolidity/interface/Version.cpp b/libsolidity/interface/Version.cpp
index ff66f039..0d23f9c3 100644
--- a/libsolidity/interface/Version.cpp
+++ b/libsolidity/interface/Version.cpp
@@ -38,6 +38,10 @@ string const dev::solidity::VersionString =
(string(SOL_VERSION_PRERELEASE).empty() ? "" : "-" + string(SOL_VERSION_PRERELEASE)) +
(string(SOL_VERSION_BUILDINFO).empty() ? "" : "+" + string(SOL_VERSION_BUILDINFO));
+string const dev::solidity::VersionStringStrict =
+ string(dev::solidity::VersionNumber) +
+ (string(SOL_VERSION_PRERELEASE).empty() ? "" : "-" + string(SOL_VERSION_PRERELEASE)) +
+ (string(SOL_VERSION_COMMIT).empty() ? "" : "+" + string(SOL_VERSION_COMMIT));
bytes dev::solidity::binaryVersion()
{
diff --git a/libsolidity/interface/Version.h b/libsolidity/interface/Version.h
index 5b07b3f4..24c3555d 100644
--- a/libsolidity/interface/Version.h
+++ b/libsolidity/interface/Version.h
@@ -32,6 +32,7 @@ namespace solidity
extern char const* VersionNumber;
extern std::string const VersionString;
+extern std::string const VersionStringStrict;
/// @returns a binary form of the version string, where A.B.C-HASH is encoded such that
/// the first byte is zero, the following three bytes encode A B and C (interpreted as decimals)