Skip to content

[vtk] Avoid removed stdext.#51869

Merged
vicroms merged 1 commit into
microsoft:masterfrom
BillyONeal:vtk-msvc-1951
May 20, 2026
Merged

[vtk] Avoid removed stdext.#51869
vicroms merged 1 commit into
microsoft:masterfrom
BillyONeal:vtk-msvc-1951

Conversation

@BillyONeal
Copy link
Copy Markdown
Member

Alternative to #51794

Regenerated all patches and reverted those where only the "index" part changed.

Removed blank newline delete from NoUndefDebug.patch.

Alternative to microsoft#51794

Regenerated all patches and reverted those where only the "index" part changed.

Removed blank newline delete from NoUndefDebug.patch.
Comment thread ports/vtk/afxdll.patch
set(vtk_mfc_static 0)
else ()
set(vtk_mfc_static 1)
diff --git a/GUISupport/MFC/CMakeLists.txt b/GUISupport/MFC/CMakeLists.txt
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main change is that this file was incorrectly CRLF.

Comment thread ports/vtk/cgns.patch
-
-find_library(CGNS_LIBRARY
- NAMES
@@ -16,7 +16,7 @@ mark_as_advanced(CGNS_INCLUDE_DIR)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When someone minted this patch they changed all the line endings in the file so the patch duplicated the whole file. I copied the "new" over the old with correct line endings and regenerated the patch.

Comment thread ports/vtk/iotr.patch
index 38765256..c0d9c3d6 100644
--- a/IO/IOSS/vtkIOSSUtilities.cxx
+++ b/IO/IOSS/vtkIOSSUtilities.cxx
@@ -32,6 +32,7 @@
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line number is different than the old one which is why I kept this but I wish it did not reorder the hunks :/

Comment thread ports/vtk/jsoncpp.patch
- VERSION 0.7.0
TARGETS JsonCpp::JsonCpp
STANDARD_INCLUDE_DIRS)
diff --git a/ThirdParty/jsoncpp/CMakeLists.txt b/ThirdParty/jsoncpp/CMakeLists.txt
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another broken CRLF patch being fixed to be LF

Comment thread ports/vtk/vtkm.patch
CLASSES ${classes})
vtk_module_link(VTK::AcceleratorsVTKmFilters
PRIVATE
- vtkm_worklet
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea why before this was doing a patch on a patch inside the same patch, but the regeneration process merged this hunk into the one above

@BillyONeal BillyONeal requested a review from Copilot May 19, 2026 22:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates the vtk vcpkg port to avoid reliance on stdext (removed in newer MSVC toolsets) and refreshes the port’s patch set accordingly.

Changes:

  • Bump vtk port-version to 16 and update baseline/versions entries.
  • Add a new patch to gate stdext::checked_array_iterator usage for older MSVC.
  • Regenerate/refresh multiple VTK patches (VTKm, PEGTL, IOSS/IOtr, etc.) to match updated upstream file contexts and dependency target expectations.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
versions/v-/vtk.json Adds a new version entry for the port-version bump.
versions/baseline.json Updates vtk baseline port-version to 16.
ports/vtk/vcpkg.json Bumps vtk port-version to 16.
ports/vtk/portfile.cmake Applies the new avoid-stdext patch during source acquisition.
ports/vtk/avoid-stdext.diff New patch to avoid stdext usage on newer MSVC.
ports/vtk/pegtl.patch Updates PEGTL integration (Find module + API adjustments).
ports/vtk/afxdll.patch Changes MFC runtime decision to use vcpkg CRT linkage.
ports/vtk/vtkm.patch Switches VTKm integration towards config-package + target usage.
ports/vtk/vtkioss.patch Adds missing include and links additional IOSS target.
ports/vtk/pythonwrapper.patch Adds interface include dirs to Python wrapper generation args.
ports/vtk/iotr.patch Ensures Iotr_Factory.h is included where needed.
ports/vtk/cgns.patch Extends CGNS library name search and adds HDF5 linkage.
ports/vtk/jsoncpp.patch Removes an external version pin from JsonCpp third-party declaration.
ports/vtk/libproj.patch Refreshes libproj patch offsets/contexts.
ports/vtk/opencascade-7.8.0.patch Refreshes patch offsets/contexts.
ports/vtk/NoUndefDebug.patch Adjusts patch context and removes a stray blank-line deletion.
ports/vtk/FindExpat.patch Refreshes the patch offset/context for FindEXPAT changes.
Comments suppressed due to low confidence (3)

ports/vtk/pegtl.patch:1

  • find_package(PEGTL CONFIG REQUIRED) will hard-fail when a config package is not available, making the else() fallback code path unreachable. To preserve the intended fallback behavior, use a non-REQUIRED (and typically QUIET) config lookup first, then fall back to the find_path/FindPackageHandleStandardArgs logic, and only error out if neither approach succeeds.
diff --git a/CMake/FindPEGTL.cmake b/CMake/FindPEGTL.cmake

ports/vtk/afxdll.patch:1

  • This condition will evaluate true whenever CMAKE_MSVC_RUNTIME_LIBRARY is unset, which can incorrectly force vtk_mfc_static to 0 even when VCPKG_CRT_LINKAGE is static. In vcpkg toolchain scenarios where CMAKE_MSVC_RUNTIME_LIBRARY is often not explicitly set, this risks selecting the wrong MFC mode; prefer basing the decision primarily on VCPKG_CRT_LINKAGE (or ensure CMAKE_MSVC_RUNTIME_LIBRARY is reliably set before this check).
diff --git a/GUISupport/MFC/CMakeLists.txt b/GUISupport/MFC/CMakeLists.txt

ports/vtk/cgns.patch:1

  • This makes HDF5 a hard requirement whenever CGNS is found, which can break configurations where CGNS is built without HDF5. Additionally, the code only links when HDF5::HDF5 exists, but many setups provide different imported target names (or only variables) via FindHDF5/HDF5 config, so the dependency may not be wired even after a successful find. Consider using a non-REQUIRED HDF5 lookup here and linking via whichever imported targets are actually provided (falling back to HDF5_LIBRARIES/include vars when no imported targets exist).
diff --git a/CMake/FindCGNS.cmake b/CMake/FindCGNS.cmake

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ports/vtk/avoid-stdext.diff
@vicroms vicroms merged commit 72d876b into microsoft:master May 20, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants