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

Extremely long build time for grpc and its protobuf dependency #43603

Open
frederick-brier opened this issue Feb 3, 2025 · 3 comments
Open
Assignees
Labels
category:question This issue is a question

Comments

@frederick-brier
Copy link

Describe the bug
Our build process uses vcpkg to build many of our dependencies including gRPC and via its dependencies, protobuf. It is sometimes taking hours to build. The bug is not so much a failure as builds that were taking 15-20 minutes are taking 2-4 hours and downloading 35GB as part of the process.

Environment

  • OS: Windows 11 and the GitHub windows-latest runner
  • Compiler: Microsoft 2022 Enterprise

To Reproduce
Steps to reproduce the behavior:

  1. The vcpkg.json file contains
    {
    "name": "grpc",
    "platform": "(windows & x64 & static )"
    },
    {
    "name": "grpc",
    "platform": "(windows & arm64 & static )"
    }
  2. Run the cmake build with vcpkg configured in the recommended way.

Expected behavior
The grpc and protobuf ports should build in a few minutes as do all the other ports being used.

Failure logs

  • There are not failures. But 35GB is being downloaded in the process of building grpc.

Additional context
The protobuf repository is made up of branches such as 1.68.x with tags such as 1.68.2. The problem may be that the entire repository with the whole history is being checked out in order to select the latest stable version (which we are not specifying), which is currently 1.68.2. It appears that 35GB is being downloaded when building grpc. Obviously a shallow copy of just the desired tag such as 1.68.2 would dramatically speed the build process.

@magnesj
Copy link

magnesj commented Feb 3, 2025

Related to #43454

@Osyotr
Copy link
Contributor

Osyotr commented Feb 3, 2025

Not really. IIRC building grpc is slow because of pkg-config post-build check.

@Cheney-W Cheney-W self-assigned this Feb 5, 2025
@Cheney-W Cheney-W added the category:question This issue is a question label Feb 5, 2025
@nickelpro
Copy link
Contributor

nickelpro commented Feb 6, 2025

This isn't the post-validation check, which only takes a couple of minutes.

@magnesj is correct this has something to do with how vcpkg is building gRPC. The "naive" build of:

cmake -G "Visual Studio 17 2022" -B build
cmake --build build --config Release

Produces much smaller binaries in much less time than vcpkg does, even with set(VCPKG_BUILD_TYPE release) in the triplet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:question This issue is a question
Projects
None yet
Development

No branches or pull requests

5 participants