{"id":20776,"date":"2018-06-04T11:40:12","date_gmt":"2018-06-04T18:40:12","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/vcblog\/?p=19485"},"modified":"2019-04-18T09:31:03","modified_gmt":"2019-04-18T09:31:03","slug":"use-boost-hana-via-vcpkg-with-the-latest-msvc-compiler","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/use-boost-hana-via-vcpkg-with-the-latest-msvc-compiler\/","title":{"rendered":"Use Boost.Hana via vcpkg with the latest MSVC compiler"},"content":{"rendered":"<p><b><span>Overview<\/span><\/b><b><span style=\"margin: 0px;color: #2e75b5;font-family: 'Calibri,Times New Roman',serif;font-size: 14pt\"><\/span><\/b><\/p>\n<p><span style=\"color: #000000\"><span style=\"font-family: Calibri\">As we continue to work towards improving the conformance of the MSVC compiler for the C++ community<span>, we would like to enable more C++ libraries, <\/span>and today we are bringing Boost.Hana to Visual C++.<\/span><span style=\"margin: 0px;font-family: 'Calibri,Times New Roman',serif\"><span>\u00a0 <\/span><\/span><span><span style=\"font-family: Calibri\">Building<\/span><\/span><span style=\"margin: 0px;font-family: 'Calibri,Times New Roman',serif\"> <\/span><span><span style=\"font-family: Calibri\">on our recent C++ conformance progress<\/span><\/span><span style=\"margin: 0px;font-family: 'Calibri,Times New Roman',serif\">, <\/span><span><span style=\"font-family: Calibri\">customers can now use Boost.Hana with the VS2017 15.7 update<\/span><\/span><span style=\"margin: 0px;font-family: 'Calibri,Times New Roman',serif\"> <\/span><\/span><span style=\"font-family: Calibri\"><span style=\"color: #000000\">after we&#8217;ve applied some source workarounds in the <\/span><a href=\"https:\/\/github.com\/Microsoft\/vcpkg\">vcpkg<\/a><\/span><span style=\"color: #000000\"><span style=\"font-family: Calibri\"> version<span>. We want to thank the author of Boost.Hana<\/span><\/span><span style=\"margin: 0px;font-family: 'Calibri,Times New Roman',serif\">, <\/span><span><span style=\"font-family: Calibri\">Louis Dionne<\/span><\/span><span style=\"margin: 0px;font-family: 'Calibri,Times New Roman',serif\">,<\/span><span><span style=\"font-family: Calibri\"> for working with us on this effort and for extending his support.<\/span><\/span><\/span><span><\/span><\/p>\n<p><b><span>How do I get it?<\/span><\/b><b><span style=\"margin: 0px;color: #2e75b5;font-family: 'Calibri,Times New Roman',serif;font-size: 14pt\"><\/span><\/b><\/p>\n<ul>\n<li><span style=\"color: #000000\"><span><span style=\"font-family: Calibri\">Go to the <a href=\"https:\/\/github.com\/Microsoft\/vcpkg\">vcpkg repo on GitHub<\/a> and follow the instructions in the README.md<\/span><\/span><\/span><\/li>\n<li><span style=\"color: #000000\"><span><span style=\"font-family: Calibri\">We created a new fork of Boost.Hana and redirected vcpkg to that <\/span><\/span><\/span><a href=\"https:\/\/github.com\/xiangfan-ms\/hana\"><span>fork<\/span><\/a><span><\/span><\/li>\n<li><span style=\"color: #000000\"><span><span style=\"font-family: Calibri\">After you&#8217;ve built vcpkg, then run this command to install Boost.Hana:<\/span><\/span><\/span>\n<ul>\n<li><b><i><span><span style=\"color: #000000;font-family: Calibri\">vcpkg.exe install boost-hana<\/span><\/span><\/i><\/b><\/li>\n<li><span><span style=\"color: #000000;font-family: Calibri\">You will see this disclaimer during the installation of Boost on Windows:<span style=\"color: #001000;font-family: Georgia,'Times New Roman','Bitstream Charter',Times,serif\"> <\/span><\/span><\/span><i><span><span style=\"color: #000000;font-family: Calibri\">&#8220;The current MSVC releases can&#8217;t compile boost hana yet. <\/span><\/span><\/i><span><\/span><i><span><span style=\"color: #000000;font-family: Calibri\">Use a fork from boost 1.67 which has source workarounds instead.&#8221;<\/span><\/span><\/i><span><\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><b><span>Background<\/span><\/b><b><span style=\"margin: 0px;color: #2e75b5;font-family: 'Calibri,Times New Roman',serif;font-size: 14pt\"><\/span><\/b><\/p>\n<p><span style=\"font-family: Calibri\"><span><span style=\"color: #000000\">You may have seen our\u00a0<\/span><\/span><a href=\"https:\/\/blogs.msdn.microsoft.com\/vcblog\/2018\/05\/07\/announcing-msvc-conforms-to-the-c-standard\/\">VCBlog post about C++ conformance completion<\/a><span style=\"color: #000000\"><span> for our compiler with the recent VS2017 update. A<\/span>s of early June 2018, MSVC cannot build the master branch of Boost.Hana due to several blocking bugs<span>. We started working on that two years ago and have since fixed around 40 compiler bugs exposed by the library. We hit some blocking issues in constexpr, so the effort was halted for a while until we made sufficient progress recently in C++14 and C++17 constexpr conformance with the VS2017 15.7 release<\/span><\/span><\/span><span style=\"margin: 0px;font-family: 'Calibri,Times New Roman',serif\"><span style=\"color: #000000\">.<\/span><\/span><\/p>\n<p><span style=\"color: #000000\"><span style=\"font-family: Calibri\"><span>We have revisited the status recently and most of the blocking constexpr issues are fixed in the VS2017 15.7 update. <\/span>There are still outstanding issues in multiple feature areas within the compiler that prevent us from building Boost.Hana<\/span><span style=\"margin: 0px;font-family: 'Calibri,Times New Roman',serif\">.<\/span><\/span><\/p>\n<p><span style=\"color: #000000\"><span style=\"font-family: Calibri\">While work remains to be done in the compiler, because of the heavy demand for this library from our customers, we have made <span>source workarounds in Boost.Hana for the remaining compiler bugs. This was needed so we can have complete test coverage of all the known issues. We are now building it in our daily testing repertoire to maintain regression-free compiler development while we progress toward achieving one-to-one parity with the<\/span><\/span><span style=\"margin: 0px;font-family: 'Calibri,Times New Roman',serif\"><span>\u00a0<\/span><\/span><span><span style=\"font-family: Calibri\">public library sources.<\/span><\/span><span style=\"margin: 0px;font-family: 'Calibri,Times New Roman',serif\"> <\/span><\/span><\/p>\n<p><span style=\"font-family: Calibri\"><span style=\"color: #000000\">After discussing this issue with Louis, we&#8217;ve jointly agreed to provide a version of Boost.Hana in <\/span><a href=\"https:\/\/github.com\/Microsoft\/vcpkg\"><span>vcpkg<\/span><\/a><\/span><span style=\"color: #000000\"><span style=\"margin: 0px;font-family: 'Calibri,Times New Roman',serif\"> <\/span><span style=\"font-family: Calibri\">to promote <span>usage of the library among more C++ users from the Visual C++ community. <\/span>This includes the patches we previously identified, and<span> as we fix the remaining bugs, we\u2019ll gradually update the version of Boost.Hana in vcpkg, <\/span>ultimately removing it and replacing it with master as the bugs are fixed<span>. We think we\u2019re close enough with our efforts that we can conduct this progress publicly in vcpkg without hindering new users who take a dependency on the library. <\/span><\/span><\/span><\/p>\n<p><span><span style=\"color: #000000;font-family: Calibri\">\u00a0<\/span><\/span><span style=\"font-family: Calibri\"><span><span style=\"color: #000000\">Again, a huge THANKS to Louis for being willing to take <\/span><\/span><a href=\"https:\/\/github.com\/boostorg\/hana\/issues\"><span>bug reports on Hana<\/span><\/a><span><span style=\"color: #000000\"> and quickly resolving them, which greatly sped up our progress.<\/span><\/span><\/span><span><\/span><span style=\"margin: 0px;font-family: 'Calibri,Times New Roman',serif\"><span style=\"color: #000000\">\u00a0<\/span><\/span><\/p>\n<p><b><span>Source workarounds in place<\/span><\/b><b><span style=\"margin: 0px;color: #2e75b5;font-family: 'Calibri,Times New Roman',serif;font-size: 14pt\"><\/span><\/b><\/p>\n<ul>\n<li><span style=\"color: #000000\"><span><span style=\"font-family: Calibri\">MSVC-specific source workarounds appear in 70 places<\/span><\/span><span style=\"margin: 0px;font-family: 'Calibri,Times New Roman',serif\">: <\/span><span><span style=\"font-family: Calibri\">27 in the library itself, 20 in the tests, and<\/span><\/span><span style=\"margin: 0px;font-family: 'Calibri,Times New Roman',serif\"> <\/span><span><span style=\"font-family: Calibri\">23 in the examples.<\/span><\/span><\/span><\/li>\n<li><span style=\"color: #000000\"><span><span style=\"font-family: Calibri\">These<\/span><\/span><span style=\"margin: 0px;font-family: 'Calibri,Times New Roman',serif\"> <\/span><span><span style=\"font-family: Calibri\">are all under unique macro definitions that are prefixed with &#8220;<i>BOOST_HANA_WORKAROUND_MSVC_<\/i>&#8221; and postfixed with a specific bug ID number from our internal database for each issue. <a href=\"https:\/\/github.com\/xiangfan-ms\/hana\/blob\/master\/include\/boost\/hana\/config.hpp\">Full details<\/a> for more information.<\/span><\/span><\/span><\/li>\n<li><span style=\"color: #000000\"><span style=\"color: #000000\"><span><span style=\"font-family: Calibri\">Here are some examples<\/span><\/span><span style=\"margin: 0px;font-family: 'Calibri,Times New Roman',serif\">:<\/span><\/span><\/span><span style=\"margin: 0px;font-family: 'Calibri,Times New Roman',serif\"><span style=\"color: #000000\"><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/Hana-source-changes.png\"><img decoding=\"async\" width=\"635\" height=\"334\" class=\"alignnone wp-image-19505\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/Hana-source-changes.png\" \/><\/a><\/span><\/span><\/li>\n<\/ul>\n<p><b><span>Compiler bugs<\/span><\/b><b><span style=\"margin: 0px;color: #2e75b5;font-family: 'Calibri,Times New Roman',serif;font-size: 14pt\"><\/span><\/b><\/p>\n<ul>\n<li><span style=\"color: #000000\"><span><span style=\"font-family: Calibri\">There are 25 active bugs with the VS2017 15.7 update.<\/span><\/span><\/span><\/li>\n<li><span style=\"color: #000000\"><span><span style=\"font-family: Calibri\">We plan to fix them all by<\/span><\/span><span style=\"margin: 0px;font-family: 'Calibri,Times New Roman',serif\"> <\/span><span><span style=\"font-family: Calibri\">the VS2017 15.9 update.\n<a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/Hana-bugs.png\"><img decoding=\"async\" width=\"617\" height=\"410\" class=\"alignnone wp-image-19495\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/Hana-bugs.png\" \/><\/a><\/span><\/span><\/span><\/li>\n<\/ul>\n<p><b>W<\/b><b>hat&#8217;s next\u2026<\/b><\/p>\n<ul>\n<li><b><span style=\"margin: 0px;color: #1e4e79;font-family: 'Calibri,Times New Roman',serif;font-size: 16pt\"><\/span><\/b><span style=\"color: #000000\"><span><span style=\"font-family: Calibri\"><b><\/b>Throughout the remaining updates of Visual Studio 2017, we will exhaust the remaining MSVC bugs that block upstream versions of the Boost.Hana library. As we fix bugs, we will gradually update the corresponding source workarounds<\/span><\/span><span style=\"margin: 0px;font-family: 'Calibri,Times New Roman',serif\">.<\/span><\/span><\/li>\n<li><span style=\"color: #000000\"><span style=\"font-family: Calibri\">We will continue to provide status updates on our progress<span>.<\/span><\/span><\/span><\/li>\n<li><span style=\"color: #000000\"><span><span style=\"font-family: Calibri\">We will ensure that users who take a dependency on this library in vcpkg will not be affected by our work.<\/span><\/span><\/span><\/li>\n<li><span style=\"color: #000000\"><span><span style=\"font-family: Calibri\">What about Range-v3?<\/span><\/span><\/span>\n<ul>\n<li><span style=\"margin: 0px;font-family: Calibri\">Similarly, we are tracking all Range-v3 blocking bugs in the compiler and have plans to fix them in the remaining Visual Studio 2017 updates.<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul type=\"disc\">\n<li style=\"list-style-type: none\"><\/li>\n<\/ul>\n<p>Thank you,<\/p>\n<p>Xiang Fan, Ulzii Luvsanbat<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Overview As we continue to work towards improving the conformance of the MSVC compiler for the C++ community, we would like to enable more C++ libraries, and today we are bringing Boost.Hana to Visual C++.\u00a0 Building on our recent C++ conformance progress, customers can now use Boost.Hana with the VS2017 15.7 update after we&#8217;ve applied [&hellip;]<\/p>\n","protected":false},"author":1062,"featured_media":35994,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[270,272],"tags":[8,140,65,151,36],"class_list":["post-20776","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-announcement","category-vcpkg","tag-announcement","tag-c","tag-compiler","tag-iso-c","tag-vc"],"acf":[],"blog_post_summary":"<p>Overview As we continue to work towards improving the conformance of the MSVC compiler for the C++ community, we would like to enable more C++ libraries, and today we are bringing Boost.Hana to Visual C++.\u00a0 Building on our recent C++ conformance progress, customers can now use Boost.Hana with the VS2017 15.7 update after we&#8217;ve applied [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/20776","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/users\/1062"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/comments?post=20776"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/20776\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media\/35994"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media?parent=20776"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=20776"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=20776"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}