Skip to content

[vtk] Avoid stdext::checked_array_iterator.#51794

Closed
Oleg2 wants to merge 1 commit into
microsoft:masterfrom
Oleg2:vtk-stdext-checked-array-iterator
Closed

[vtk] Avoid stdext::checked_array_iterator.#51794
Oleg2 wants to merge 1 commit into
microsoft:masterfrom
Oleg2:vtk-stdext-checked-array-iterator

Conversation

@Oleg2

@Oleg2 Oleg2 commented May 15, 2026

Copy link
Copy Markdown

Fixes #51766.

What this fixes

VTK's bundled (pre-7.0) copy of fmtlib at ThirdParty/diy2/vtkdiy2/include/vtkdiy2/fmt/format.h references stdext::checked_array_iterator under #ifdef _SECURE_SCL. This extension has been removed from the MSVC standard library in MSVC 14.51 (VS 2026 Preview), so the build fails with:

error C2653: 'stdext': is not a class or namespace name
error C2061: syntax error: identifier 'checked_array_iterator'

(full failure log in #51766)

Resolution

Drop the _SECURE_SCL branch and keep only the raw-pointer fallback. The patched make_checked / checked_ptr aliases become unconditional pass-throughs. This is the same approach already accepted in vcpkg for the same removal across five other ports:

PR Port
#51750 cpprestsdk
#51774 breakpad
#51749 duckdb
#51753 ampl-mp
#51785 luminoengine

Files

  • ports/vtk/diy2-fmt-remove-stdext-checked-array-iterator.patch — the source patch
  • ports/vtk/portfile.cmake — register the patch
  • ports/vtk/vcpkg.json — port-version 15 → 16
  • versions/v-/vtk.json, versions/baseline.json — version DB bump (via vcpkg x-add-version vtk)

Local verification

Built vtk[core]:x64-windows against this overlay port using MSVC 14.51.36231 (VS 2026 Preview, generator Visual Studio 18 2026). The failing vtkDIYDataExchanger.cxx translation unit now compiles cleanly.

Manifest

  • Changes comply with the maintainer guide.
  • SHA512s are updated for each updated download. (no source changes)
  • The "supports" clause reflects platforms that may be built. (unchanged)
  • Any fixed CI baseline entries are removed from that file. (none applicable)
  • Any patches that are no longer applied are deleted from the port's directory. (none)
  • The version database is fixed by rerunning ./vcpkg x-add-version --all and committing the result.
  • Only one version is added to each modified port's versions file.

@Oleg2

Oleg2 commented May 15, 2026

Copy link
Copy Markdown
Author

Withdrawing — switching to a local-only patch in my private vcpkg checkout. The patch (ports/vtk/diy2-fmt-remove-stdext-checked-array-iterator.patch) and its construction notes remain available in the commit if anyone wants to revive it as their own PR.

@Oleg2 Oleg2 closed this May 15, 2026
@BillyONeal

Copy link
Copy Markdown
Member

Is there something wrong with it? (Why withdraw it? Would rather give you credit for the fix if it actually fixes)

To be clear I have not reviewed, I just saw linked to my other PR

@drescherjm

Copy link
Copy Markdown

This patch seems to have worked for me in my local port. Although I am on an older version of the vtk port than the current.

vtk[cgns,core,libharu,libtheora,netcdf,proj,seacas,sql]:x64-windows@9.3.0-pv5.12.1#15 package ABI: accdcd3c7beea8fc4108a4ccd3eb68d053af928ae7a0258325e5aede226ddc79 Building vtk[cgns,core,libharu,libtheora,netcdf,proj,seacas,sql]:x64-windows@9.3.0-pv5.12.1#15... X:\vcpkgbased\DICOMUtilities\vcpkg/ports\vtk: info: installing overlay port from here -- Using cached Kitware-VTK-09a76bc55b37caad94d0d8ebe865caaed1b438af.tar.gz -- Extracting source X:/vcpkgbased/vcpkg/downloads/Kitware-VTK-09a76bc55b37caad94d0d8ebe865caaed1b438af.tar.gz -- Applying patch ffmpeg.diff -- Applying patch ffmpeg-8.diff -- Applying patch FindLZMA.patch -- Applying patch FindLZ4.patch -- Applying patch libproj.patch -- Applying patch mysql.diff -- Applying patch pegtl.patch -- Applying patch pythonwrapper.patch -- Applying patch NoUndefDebug.patch -- Applying patch fix-using-hdf5.patch -- Applying patch FindExpat.patch -- Applying patch cgns.patch -- Applying patch vtkm.patch -- Applying patch afxdll.patch -- Applying patch vtkioss.patch -- Applying patch jsoncpp.patch -- Applying patch iotr.patch -- Applying patch fast-float.patch -- Applying patch fix-exprtk.patch -- Applying patch devendor_exodusII.patch -- Applying patch remove-prefix-changes.patch -- Applying patch hdf5helper.patch -- Applying patch opencascade-7.8.0.patch -- Applying patch no-libharu-for-ioexport.patch -- Applying patch no-libproj-for-netcdf.patch -- Applying patch octree.patch -- Applying patch fix-tbbsmptool.patch -- Applying patch backport-bda8324.diff -- Applying patch use-compile-tools.diff -- Applying patch zspace.diff -- Applying patch mpi-language.diff -- Applying patch fix-eigen3.patch -- Applying patch diy2-fmt-remove-stdext-checked-array-iterator.patch -- Using source at X:/vcpkgbased/vcpkg/buildtrees/vtk/src/aed1b438af-00b856e7db.clean

-- Configuring x64-windows
-- Building x64-windows-dbg
-- Building x64-windows-rel
-- Installing: X:/vcpkgbased/vcpkg/packages/vtk_x64-windows/tools/vtk/vtkProbeOpenGLVersion-9.3.exe
-- Installing: X:/vcpkgbased/vcpkg/packages/vtk_x64-windows/tools/vtk/vtkTestOpenGLVersion-9.3.exe
-- Performing post-build validation

@drescherjm

Copy link
Copy Markdown

Oops, sorry for the noise. I didn't realize a different version of this patch was merged and was actually in the current port.

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.

[VTK] build failure

3 participants