Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vtk] Reduce dependencies by adding new features #39511

Merged
merged 10 commits into from
Jul 18, 2024

Conversation

bansan85
Copy link
Contributor

@bansan85 bansan85 commented Jun 25, 2024

Fixes #39491.

  • Changes comply with the maintainer guide.
  • SHA512s are updated for each updated download.
  • The "supports" clause reflects platforms that may be fixed by this new version.
  • Any fixed CI baseline entries are removed from that file.
  • Any patches that are no longer applied are deleted from the port's directory.
  • 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.

The CI check all dependencies at once. I want to reduce dependencies of vtk. I will check that the following package can be installed one by one on my computer for triplet x64-windows, x64-windows-static-md, x64-linux, x64-linux-dynamic:

  • itk[core,vtk] : x64-linux, x64-linux-dynamic
  • opencascade[core,vtk] : x64-linux
  • opencv[core,vtk] : x64-linux
  • opencv3[core,vtk] : x64-linux
  • opencv4[core,vtk] : x64-linux
  • paraview[core,vtkm] : x64-linux
  • pcl[core,vtk] : x64-linux
  • rtabmap[core,gui] : x64-linux
  • vtk-dicom[core] : x64-linux

The previous tick must be checked before leaving Draft.

@bansan85
Copy link
Contributor Author

Maybe I was a bit optimist but I think I will be able to remove some dependencies that have a very long compilation time.

@jimwang118 jimwang118 added the category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist label Jun 26, 2024
@bansan85 bansan85 force-pushed the vtk-lightweight branch 4 times, most recently from 7603805 to 431722f Compare July 2, 2024 09:46
@bansan85
Copy link
Contributor Author

bansan85 commented Jul 2, 2024

itk doesn't build. Update to itk 5.4.0 because build failure is fixed on newer version (InsightSoftwareConsortium/ITK@9a719a0)

Fix #34663

@bansan85
Copy link
Contributor Author

bansan85 commented Jul 2, 2024

Can't test on x64-linux-dynamic, minc doesn't build.

Comment on lines 1 to 6
{
"name": "itk",
"version-string": "5.3rc02",
"port-version": 1,
"version": "5.4.0",
"description": "Insight Segmentation and Registration Toolkit (ITK) is used for image processing and analysis.",
"homepage": "https://github.com/InsightSoftwareConsortium/ITK",
"license": "Apache-2.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be a different PR

Copy link
Contributor Author

@bansan85 bansan85 Jul 8, 2024

Choose a reason for hiding this comment

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

I moved it to #39757

@bansan85
Copy link
Contributor Author

bansan85 commented Jul 8, 2024

It takes really long time to build for x64-linux. It "should" be fine for Windows.

This PR tries to reduce some dependencies. The biggest problem is that "default-features" is not transitive. So I needed to add the root vcpkg.json:

    {
      "name": "cgns",
      "default-features": false
    },
    {
      "name": "freetype",
      "default-features": false
    },
    {
      "name": "hdf5",
      "default-features": false
    },
    {
      "name": "libxml2",
      "default-features": false
    },
    {
      "name": "netcdf-c",
      "default-features": false
    },
    {
      "name": "seacas",
      "default-features": false
    },
    {
      "name": "tiff",
      "default-features": false
    },
    {
      "name": "vtk",
      "default-features": false,
      "features": [
        "qt",
        "opengl"
      ]
    }

qtbase should not default-features.

@bansan85 bansan85 marked this pull request as ready for review July 8, 2024 09:21
@bansan85 bansan85 force-pushed the vtk-lightweight branch 3 times, most recently from be5cb41 to 35e2119 Compare July 9, 2024 09:24
@bansan85
Copy link
Contributor Author

This PR is ready to merge. I don't see how I can lighten it port.

@jimwang118 jimwang118 added the info:reviewed Pull Request changes follow basic guidelines label Jul 11, 2024
@JavierMatosD
Copy link
Contributor

@bansan85, I need a bit more context on what the issue is exactly. Your title claims to be reducing dependencies to improve the build time, but I don't look like the changes reduce the number of dependencies. Can you give a little more context on what you are intending to do? Or perhaps, I am overlooking something?

@JavierMatosD JavierMatosD marked this pull request as draft July 11, 2024 16:06
@dg0yt
Copy link
Contributor

dg0yt commented Jul 11, 2024

IIUC it enables a better effect of top-level "default-features": false.

@bansan85
Copy link
Contributor Author

@JavierMatosD

At first, I wanted to be able to make (almost) all dependencies optional. Unfortunately, it looks that it's not that easy and I don't master the compile build system of VTK.

At the end, I was able to remove only a few package.

If I install vtk[qt], it doesn't require anymore freeglut, jasper, libwebp, qtimageformats, qttools.

If I install vtk[qt] and if I force

dependencies in vcpkg.json
    {
      "name": "qtbase",
      "default-features": false,
      "features": [
        "harfbuzz"
      ]
    },
    {
      "name": "cgns",
      "default-features": false
    },
    {
      "name": "freetype",
      "default-features": false
    },
    {
      "name": "hdf5",
      "default-features": false
    },
    {
      "name": "libxml2",
      "default-features": false
    },
    {
      "name": "netcdf-c",
      "default-features": false
    },
    {
      "name": "seacas",
      "default-features": false
    },
    {
      "name": "tiff",
      "default-features": false
    },
    {
      "name": "vtk",
      "default-features": false,
      "features": [
        "qt",
        "opengl"
      ]
    }

it doesn't require anymore brotli, bzip2, freeglut, jasper, libiconv, libwebp, matio, qtimageformats, qttools.

Note : if I remove harfbuzz in qtbase, widgets are broken (i.e. missing arrows symbol in QSpinBox).

It's not as much as expected but it's a little better.

@dg0yt Yes. I also encounter the same problem when I force the version of package with overrides. vcpkg ignores it if it's not in the main vcpkg.json.

@JavierMatosD JavierMatosD marked this pull request as ready for review July 15, 2024 20:08
Comment on lines 40 to 42
"default-features": [
"matio"
],
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this should be a default feature. The point of default features is that a user who is transitively using this dependency would consider it "broken" if it did not have this behavior enabled. e.g. a generic file compression library not supporting .zip files.

Copy link
Contributor

Choose a reason for hiding this comment

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

Additionally, vcpkg install vtk[all] should still work.

Copy link
Contributor

Choose a reason for hiding this comment

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

Additionally, vcpkg install vtk[all] should still work.

is broken since forever due to missing dependencies (#29260). Mainly needs a decision on tool ports.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@JavierMatosD I disabled Matio

At first, I enabled it by default to keep compatibility. But I don't think this feature is used by lots of people.

Copy link
Contributor

Choose a reason for hiding this comment

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

is broken since forever due to missing dependencies (#29260). Mainly needs a decision on tool ports.

@Neumann-A, thanks for the context!

@bansan85, that sounds reasonable to me. Please mark "ready for review" when you are ready for me to take a look at this again.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@JavierMatosD I was waiting that CI finished. I can't read log in progress and I forgot that x64_osx sometimes hangs.

@JavierMatosD JavierMatosD marked this pull request as draft July 15, 2024 20:38
bansan85 added 4 commits July 16, 2024 09:39
But need qtbase[sql-sqlite]
See ThirdParty\freetype\vtkfreetype\include\freetype\config\ftoption.h
See ThirdParty\libxml2\vtk.module
@bansan85 bansan85 marked this pull request as ready for review July 16, 2024 13:46
@JavierMatosD JavierMatosD merged commit d8e76e3 into microsoft:master Jul 18, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist info:reviewed Pull Request changes follow basic guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[vtk] Reduce dependencies by adding new features
5 participants