From 54d1a244ff0f25a6e68d9a774c4a70ca3ddfa225 Mon Sep 17 00:00:00 2001 From: jim wang <122244446+jimwang118@users.noreply.github.com> Date: Tue, 30 Apr 2024 18:31:53 +0000 Subject: [PATCH] [bond] Fixed compilation error under Windows when msvc version is greater than or equal to 1915 (#38471) `D:\b\bond\src\10.0.0-efd5420c47.clean\cpp\inc\bond\core\detail\sdl.h(29): error C4996: 'stdext::checked_array_iterator<_Ptr>': warning STL4043: stdext::checked_array_iterator, stdext::unchecked_array_iterator, and related factory functions are non-Standard extensions and will be removed in the future. std::span (since C++20) and gsl::span can be used instead. You can define _SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING or _SILENCE_ALL_MS_EXT_DEPRECATION_WARNINGS to suppress this warning.` The above problem occurred when I was testing an internal version of msvc, and then I consulted Stephan T. Lavavej. He proposed a repair plan and submitted PR [1205](https://github.com/microsoft/bond/pull/1205) upstream. I used stephan's repair plan to fix this problem in vcpkg. - [X] Changes comply with the [maintainer guide](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md). - [ ] ~~SHA512s are updated for each updated download.~~ - [ ] ~~The "supports" clause reflects platforms that may be fixed by this new version.~~ - [ ] ~~Any fixed [CI baseline](https://github.com/microsoft/vcpkg/blob/master/scripts/ci.baseline.txt) entries are removed from that file.~~ - [ ] ~~Any patches that are no longer applied are deleted from the port's directory.~~ - [X] The version database is fixed by rerunning `./vcpkg x-add-version --all` and committing the result. - [X] Only one version is added to each modified port's versions file. Compile test pass with following triplets: ``` x64-windows ``` --- ports/bond/fix-msc-ver.patch | 13 +++++++++++++ ports/bond/portfile.cmake | 1 + ports/bond/vcpkg.json | 2 +- versions/b-/bond.json | 5 +++++ versions/baseline.json | 2 +- 5 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 ports/bond/fix-msc-ver.patch diff --git a/ports/bond/fix-msc-ver.patch b/ports/bond/fix-msc-ver.patch new file mode 100644 index 0000000000..dedaca158a --- /dev/null +++ b/ports/bond/fix-msc-ver.patch @@ -0,0 +1,13 @@ +diff --git a/cpp/inc/bond/core/detail/sdl.h b/cpp/inc/bond/core/detail/sdl.h +index 2a515f8..a38e6ff 100644 +--- a/cpp/inc/bond/core/detail/sdl.h ++++ b/cpp/inc/bond/core/detail/sdl.h +@@ -24,7 +24,7 @@ + namespace bond { namespace detail + { + +-#ifdef _MSC_VER ++#if defined(_MSC_VER) && _MSC_VER < 1915 + + template inline + stdext::checked_array_iterator make_checked_array_iterator( diff --git a/ports/bond/portfile.cmake b/ports/bond/portfile.cmake index cadcb3e037..f90e4eb90e 100644 --- a/ports/bond/portfile.cmake +++ b/ports/bond/portfile.cmake @@ -9,6 +9,7 @@ vcpkg_from_github( PATCHES fix-install-path.patch skip-grpc-compilation.patch + fix-msc-ver.patch ) if (VCPKG_TARGET_IS_WINDOWS) diff --git a/ports/bond/vcpkg.json b/ports/bond/vcpkg.json index 93b2647d2a..2f501cc6b2 100644 --- a/ports/bond/vcpkg.json +++ b/ports/bond/vcpkg.json @@ -1,7 +1,7 @@ { "name": "bond", "version": "10.0.0", - "port-version": 2, + "port-version": 3, "description": "Bond is a cross-platform framework for working with schematized data. It supports cross-language de/serialization and powerful generic mechanisms for efficiently manipulating data. Bond is broadly used at Microsoft in high scale services.", "homepage": "https://github.com/Microsoft/bond", "dependencies": [ diff --git a/versions/b-/bond.json b/versions/b-/bond.json index 40c2215664..c89a9d828a 100644 --- a/versions/b-/bond.json +++ b/versions/b-/bond.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "529159c6aff85949b583f7f2a577f7a1447ed38c", + "version": "10.0.0", + "port-version": 3 + }, { "git-tree": "800bba87d345e620b88cd1b31b34fb76ac80aee6", "version": "10.0.0", diff --git a/versions/baseline.json b/versions/baseline.json index 5d95c7876b..2d1c8807e7 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -702,7 +702,7 @@ }, "bond": { "baseline": "10.0.0", - "port-version": 2 + "port-version": 3 }, "boolinq": { "baseline": "3.0.4",