Repository navigation
fix: build with MSVC 14.42 (VS 2022 17.12) - #986
rohanjain101 wants to merge 2 commits into
Conversation
The README lists MSVC 2022+ as supported, but the sources do not compile
with MSVC 14.42. Newer MSVC versions are unaffected. This change makes no
functional change:
- ParallelCollect used a lambda in its requires-clause and lambdas expanded
over a parameter pack, which 14.42 rejects (C3546/C2326/C3520). Replace
them with a class-template trait and helper function templates.
- ManifestGroup used a conditional operator over two move-only
Result<ManifestEntryStreamPtr> prvalues, which 14.42 tries to copy (C2280).
Select the stream with if/else in a small helper instead.
- Replace the C++23 0UZ literal, which 14.42 does not support (C3688), with
size_t{0}.
- Add the empty parameter list to a lambda with a trailing return type in
cache_test.cc. Omitting it is C++23 syntax (P1102) that 14.42 rejects.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Currently our ci is running on Windows 2025 image which uses MSVC 17.14.37710.0: https://github.com/actions/runner-images/blob/main/images/windows/Windows2025-Readme.md#visual-studio-enterprise-2022. I'm just afraid that it will break in the future. Is it possible to let vcpkg use a higher version? |
|
lgtm |
@wgtmac unfortunately not since vcpkg provides source distributions and has no control over what versions users compile with. I created this PR since the docs listed 17.12 as supported, but if this would cause maintenance problems, I'm happy to abandon in which case maybe the docs should be updated as requiring atleast 17.14. |
+1 for updating the doc for minimum MSVC version. @rohanjain101 do you mind to create a PR for that? |
I've done that in #1061 |
What
Make the sources compile with MSVC 14.42 (VS 2022 17.12). The README lists MSVC 2022+ as supported, but the
current sources fail to build with 14.42. Newer MSVC versions are unaffected. There is no functional change.
ParallelCollect(util/executor_util_internal.h) used a lambda in its requires-clause and lambdas expanded overa parameter pack. 14.42 rejects both (C3546/C2326/C3520). They are replaced with a class-template trait and helper
function templates.
manifest_group.ccused a conditional operator over two move-onlyResult<ManifestEntryStreamPtr>prvalues.14.42 tries to copy them (C2280). The stream is now selected with if/else in a small helper.
snapshot_update.ccandmerging_snapshot_update_test.ccused the C++230UZliteral, which 14.42 does notsupport (C3688). It is replaced with
size_t{0}.cache_test.ccused a lambda with a trailing return type and no parameter list ([&] -> Status). This is C++23syntax (P1102) that 14.42 rejects. The empty parameter list is added.
Why
vcpkg carries these changes as a downstream patch for 0.4.0 (microsoft/vcpkg#54315). Upstreaming them lets that
patch be dropped after the next release.
Testing
util_test(ParallelCollect/executor and cache tests),scan_test,manifest_testandtable_update_test.iceberg_static,iceberg_data_staticand every changed source file, including thechanged tests, now compile.