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

ARROW-11340: [C++] Add vcpkg.json manifest to cpp project root #9287

Closed
wants to merge 33 commits into from

Conversation

ianmcook
Copy link
Member

@ianmcook ianmcook commented Jan 22, 2021

@kszucs could you review this please? My main purpose in adding this is to improve the experience for Arrow C++ devs using Windows, but I noticed it also relates to your TODO in #9096. vcpkg does not have any requirements.txt-style package enumeration mechanism, but it supports this JSON manifest as a mechanism of defining dependencies.

In the vcpkg install command, you can specify the path to the directory containing this manifest file with --x-manifest-root which later will change to --manifest-root. See details at https://vcpkg.readthedocs.io/en/stable/specifications/manifests/.

There are some differences between the packages listed in this manifest versus the packages you listed in the vcpkg install commands in #9096

  • This installs gtest and benchmark
  • This installs boost instead of separate boost-filesystem, boost-regex, etc.
  • This does not explicitly include the core feature of aws-sdk-cpp because explicitly including it causes an error, and it gets installed anyway

@ianmcook ianmcook changed the title Add vcpkg.json manifest ARROW-11340: [C++] Add vcpkg.json manifest to cpp project root Jan 22, 2021
@github-actions
Copy link

Thanks for opening a pull request!

Could you open an issue for this pull request on JIRA?
https://issues.apache.org/jira/browse/ARROW

Then could you also rename pull request title in the following format?

ARROW-${JIRA_ID}: [${COMPONENT}] ${SUMMARY}

See also:

@github-actions
Copy link

@kszucs
Copy link
Member

kszucs commented Jan 22, 2021

Thanks Ian for working on this!

I have a couple of questions:

  • could we define multiple manifest files for different use cases (e.g. for building wheels or having a minimal build)?
  • how can one utilize this manifest file (I assume we need to document this in the developer guide)?
  • why do we need to add a version string to the manifest (if it is mandatory than we need to update the version bumping scripts used during the release procedure)?

Could you setup a github actions build to test it?

@ianmcook
Copy link
Member Author

Replies inline

Thanks Ian for working on this!

I have a couple of questions:

  • could we define multiple manifest files for different use cases (e.g. for building wheels or having a minimal build)?

Yes, definitely. Or would it be better to use this one as the master copy and apply patches to it to create the copies for other use cases?

For safety, we should never name the copies vcpkg.json because Visual Studio automatically detects manifests with that file name.

  • how can one utilize this manifest file (I assume we need to document this in the developer guide)?

I'm working on that in ARROW-11336

  • why do we need to add a version string to the manifest (if it is mandatory than we need to update the version bumping scripts used during the release procedure)?

It's mandatory. (The vcpkg docs say so and I confirmed by testing.)

Could you setup a github actions build to test it?

Sure, I'll work on that

@ianmcook
Copy link
Member Author

ianmcook commented Jan 22, 2021

FYI, the version of vcpkg that is currently preinstalled on the Github Actions Windows images is 2020.11.12 (as noted here). This version has a bug that causes the installation of aws-cpp-sdk to fail. (See details at awslabs/aws-c-common#734 and microsoft/vcpkg#14716.) When running vcpkg in Github Actions on Windows, remove the preinstalled vcpkg and install the newest version from source.

@ianmcook ianmcook changed the title ARROW-11340: [C++] Add vcpkg.json manifest to cpp project root ARROW-11340: [C++] Add vcpkg.json manifest to cpp project root [WIP] Jan 25, 2021
@ianmcook
Copy link
Member Author

@github-actions crossbow submit test-build-vcpkg-win

@github-actions
Copy link

Revision: af7b3cf

Submitted crossbow builds: ursacomputing/crossbow @ actions-47

Task Status
test-build-vcpkg-win Github Actions

@ianmcook
Copy link
Member Author

@github-actions crossbow submit test-build-vcpkg-win

@github-actions
Copy link

Revision: 1ddb30d

Submitted crossbow builds: ursacomputing/crossbow @ actions-48

Task Status
test-build-vcpkg-win Github Actions

@ianmcook
Copy link
Member Author

@github-actions crossbow submit test-build-vcpkg-win

@github-actions
Copy link

Revision: 94f35d7

Submitted crossbow builds: ursacomputing/crossbow @ actions-49

Task Status
test-build-vcpkg-win Github Actions

@ianmcook ianmcook changed the title ARROW-11340: [C++] Add vcpkg.json manifest to cpp project root [WIP] ARROW-11340: [C++] Add vcpkg.json manifest to cpp project root Jan 26, 2021
@ianmcook
Copy link
Member Author

ianmcook commented Jan 26, 2021

@kszucs I added a Crossbow test. It runs a GHA job on a Windows instance. The job installs the current version of vcpkg, installs all the dependencies listed in vcpkg.json, runs CMake with many Arrow features enabled, and builds Arrow. I added this task to the test group. It takes about 2 hours to run.

@pitrou pitrou requested a review from kou January 27, 2021 17:48
@ianmcook
Copy link
Member Author

@github-actions crossbow submit test-build-vcpkg-win

@github-actions
Copy link

Revision: 5408df1

Submitted crossbow builds: ursacomputing/crossbow @ actions-51

Task Status
test-build-vcpkg-win Github Actions

@ianmcook
Copy link
Member Author

@github-actions crossbow submit test-build-vcpkg-win

@github-actions
Copy link

Revision: 7703a38

Submitted crossbow builds: ursacomputing/crossbow @ actions-53

Task Status
test-build-vcpkg-win Github Actions

Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

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

+1

We can merge this with some minor improvements and green CI result.

@ianmcook
Copy link
Member Author

@github-actions crossbow submit test-build-vcpkg-win

@github-actions
Copy link

Revision: a1950d6

Submitted crossbow builds: ursacomputing/crossbow @ actions-99

Task Status
test-build-vcpkg-win Github Actions

@ianmcook
Copy link
Member Author

@github-actions crossbow submit wheel-manylinux2010-cp36m wheel-windows-cp36m

@github-actions
Copy link

Revision: a1950d6

Submitted crossbow builds: ursacomputing/crossbow @ actions-100

Task Status
wheel-manylinux2010-cp36m Github Actions
wheel-windows-cp36m Github Actions

@ianmcook
Copy link
Member Author

@kszucs My latest commits in this PR fix the unintended side effects that were occurring because of the addition of the manifest file cpp/vcpkg.json:

  • The Python wheel builds (which use vcpkg to install dependencies but are not supposed to use the manifest) were failing, because the existence of the manifest was causing the Visual Studio CMake toolchain to behave in some unexpected ways. I have set several variables and options that resolve this.
  • When a developer opened the cpp directory in the Visual Studio 2019 IDE, it would automatically recognize the manifest and initiate a vcpkg install regardless of whether the developer intended to use vcpkg to install dependencies. I added a CMakeSettings.json file to disable this behavior.

The wheel-manylinux2010-cp36m and wheel-windows-cp36m Crossbow builds are now passing

The test-build-vcpkg-win failure is for the same reasons as noted above in #9287 (comment) and should not block this from being merged.

Copy link
Member

@kszucs kszucs left a comment

Choose a reason for hiding this comment

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

LGTM, thanks Ian!

@kszucs kszucs closed this in ad4504e Feb 17, 2021
GeorgeAp pushed a commit to sirensolutions/arrow that referenced this pull request Jun 7, 2021
@kszucs could you review this please? My main purpose in adding this is to improve the experience for Arrow C++ devs using Windows, but I noticed it also relates to your [TODO in apache#9096](https://github.com/apache/arrow/pull/9096/files#diff-990134cce6657dbbcf95457cf1a56810a7efa1f6cd58ecc27557c7d6ff45b533R67-R68). vcpkg does not have any `requirements.txt`-style package enumeration mechanism, but it supports this JSON manifest as a mechanism of defining dependencies.

In the `vcpkg install` command, you can specify the path to the directory containing this manifest file with `--x-manifest-root` which later will change to `--manifest-root`. See details at https://vcpkg.readthedocs.io/en/stable/specifications/manifests/.

There are some differences between the packages listed in this manifest versus the packages you listed in the `vcpkg install` commands in apache#9096
- This installs `gtest` and `benchmark`
- This installs `boost` instead of separate `boost-filesystem`, `boost-regex`, etc.
- This does not explicitly include the `core` feature of `aws-sdk-cpp` because explicitly including it causes an error, and it gets installed anyway

Closes apache#9287 from ianmcook/ARROW-11340

Lead-authored-by: Ian Cook <ianmcook@gmail.com>
Co-authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Krisztián Szűcs <szucs.krisztian@gmail.com>
michalursa pushed a commit to michalursa/arrow that referenced this pull request Jun 13, 2021
@kszucs could you review this please? My main purpose in adding this is to improve the experience for Arrow C++ devs using Windows, but I noticed it also relates to your [TODO in apache#9096](https://github.com/apache/arrow/pull/9096/files#diff-990134cce6657dbbcf95457cf1a56810a7efa1f6cd58ecc27557c7d6ff45b533R67-R68). vcpkg does not have any `requirements.txt`-style package enumeration mechanism, but it supports this JSON manifest as a mechanism of defining dependencies.

In the `vcpkg install` command, you can specify the path to the directory containing this manifest file with `--x-manifest-root` which later will change to `--manifest-root`. See details at https://vcpkg.readthedocs.io/en/stable/specifications/manifests/.

There are some differences between the packages listed in this manifest versus the packages you listed in the `vcpkg install` commands in apache#9096
- This installs `gtest` and `benchmark`
- This installs `boost` instead of separate `boost-filesystem`, `boost-regex`, etc.
- This does not explicitly include the `core` feature of `aws-sdk-cpp` because explicitly including it causes an error, and it gets installed anyway

Closes apache#9287 from ianmcook/ARROW-11340

Lead-authored-by: Ian Cook <ianmcook@gmail.com>
Co-authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Krisztián Szűcs <szucs.krisztian@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants