From 1f62b32641045fe377ee80ff1854a785344687d2 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 22 Mar 2018 10:01:12 -0700 Subject: [PATCH] [vcpkg] Sort abi tags to ensure stability --- toolsrc/include/vcpkg/build.h | 5 +++++ toolsrc/src/vcpkg/build.cpp | 2 ++ 2 files changed, 7 insertions(+) diff --git a/toolsrc/include/vcpkg/build.h b/toolsrc/include/vcpkg/build.h index 8c4d7b5751..1c22d39d81 100644 --- a/toolsrc/include/vcpkg/build.h +++ b/toolsrc/include/vcpkg/build.h @@ -209,6 +209,11 @@ namespace vcpkg::Build { std::string key; std::string value; + + bool operator<(const AbiEntry& other) const + { + return key < other.key || (key == other.key && value < other.value); + } }; struct AbiTagAndFile diff --git a/toolsrc/src/vcpkg/build.cpp b/toolsrc/src/vcpkg/build.cpp index ebded27365..953e77460f 100644 --- a/toolsrc/src/vcpkg/build.cpp +++ b/toolsrc/src/vcpkg/build.cpp @@ -449,6 +449,8 @@ namespace vcpkg::Build if (config.build_package_options.use_head_version == UseHeadVersion::YES) abi_tag_entries.emplace_back(AbiEntry{"head", ""}); + Util::sort(abi_tag_entries); + std::string full_abi_info = Strings::join("", abi_tag_entries, [](const AbiEntry& p) { return p.key + " " + p.value + "\n"; });