Skip to content

fix: remove Vcpkg dependency from ProtoCompile - #1728

Closed
dudantas wants to merge 1 commit into
mainfrom
dudantas/fix-solution-buiild
Closed

fix: remove Vcpkg dependency from ProtoCompile#1728
dudantas wants to merge 1 commit into
mainfrom
dudantas/fix-solution-buiild

Conversation

@dudantas

@dudantas dudantas commented May 27, 2026

Copy link
Copy Markdown
Member

Drop the DependsOnTargets="VcpkgInstallManifestDependencies" attribute from the ProtoCompile target in vc18/otclient.vcxproj. This allows the ProtoCompile step to run without forcing the vcpkg install manifest target to execute, avoiding build ordering issues when vcpkg integration is not required or present.

Summary by CodeRabbit

  • Chores
    • Updated build configuration to streamline the proto compilation process.

Review Change Stack

Drop the DependsOnTargets="VcpkgInstallManifestDependencies" attribute from the ProtoCompile target in vc18/otclient.vcxproj. This allows the ProtoCompile step to run without forcing the vcpkg install manifest target to execute, avoiding build ordering issues when vcpkg integration is not required or present.
Copilot AI review requested due to automatic review settings May 27, 2026 13:35
@coderabbitai

coderabbitai Bot commented May 27, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8f431108-312e-4583-a0b1-2e0725b8b47b

📥 Commits

Reviewing files that changed from the base of the PR and between e111717 and b97f1e0.

📒 Files selected for processing (1)
  • vc18/otclient.vcxproj

📝 Walkthrough

Walkthrough

This PR removes an explicit dependency declaration from the MSBuild ProtoCompile target in the Visual Studio 2018 project file. The target now relies on its BeforeTargets="PrepareForBuild" timing and RunProtoCompile condition without a hard dependency on VcpkgInstallManifestDependencies.

Changes

Proto Build Configuration

Layer / File(s) Summary
ProtoCompile target dependency update
vc18/otclient.vcxproj
The ProtoCompile target removes its explicit DependsOnTargets="VcpkgInstallManifestDependencies" attribute while retaining the BeforeTargets="PrepareForBuild" and RunProtoCompile condition controls.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • opentibiabr/otclient#1627: Both PRs modify protobuf compilation wiring in the same Visual Studio file (vc18/otclient.vcxproj), specifically the ProtoCompile target's conditional execution/dependency behavior.

Suggested reviewers

  • libergod
  • majestyotbr

Poem

🐰 A tiny hop, one line refined,
Dependencies left behind,
Build targets now more free,
Simpler wiring, clean and spry!
Proto compiles still on time! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: remove Vcpkg dependency from ProtoCompile' directly and clearly summarizes the main change: removing a Vcpkg dependency from the ProtoCompile MSBuild target.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dudantas/fix-solution-buiild

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request modifies the MSBuild project file vc18/otclient.vcxproj to remove the DependsOnTargets="VcpkgInstallManifestDependencies" attribute from the ProtoCompile target. The reviewer noted that removing this dependency entirely can cause build failures in environments using vcpkg, as the protobuf compiler (protoc.exe) might not yet be restored when the target executes. A conditional dependency approach was suggested to support both vcpkg and non-vcpkg environments safely.

Comment thread vc18/otclient.vcxproj
<ProtoFiles Include="$(ProtoPath)\*.proto" />
</ItemGroup>
<Target Name="ProtoCompile" BeforeTargets="PrepareForBuild" DependsOnTargets="VcpkgInstallManifestDependencies" Condition="'$(RunProtoCompile)'=='true'">
<Target Name="ProtoCompile" BeforeTargets="PrepareForBuild" Condition="'$(RunProtoCompile)'=='true'">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

Removing DependsOnTargets="VcpkgInstallManifestDependencies" entirely can cause build failures when vcpkg is used and RunProtoCompile is true. Since ProtoCompile runs BeforeTargets="PrepareForBuild", it may execute before vcpkg has restored the dependencies, meaning protoc.exe will not yet exist in the vcpkg_installed directory.

To safely support environments both with and without vcpkg integration, we can conditionally define the dependency using an MSBuild property that checks if the vcpkg targets file exists.

  <PropertyGroup>
    <ProtoCompileDependsOn Condition="Exists('$(VcpkgRoot)\\scripts\\buildsystems\\msbuild\\vcpkg.targets')">VcpkgInstallManifestDependencies</ProtoCompileDependsOn>
  </PropertyGroup>
  <Target Name="ProtoCompile" BeforeTargets="PrepareForBuild" DependsOnTargets="$(ProtoCompileDependsOn)" Condition="'$(RunProtoCompile)'=='true'">

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Visual Studio project’s protobuf generation step to no longer force execution of vcpkg’s manifest install target before running protoc, aiming to avoid build ordering issues when vcpkg MSBuild integration isn’t available.

Changes:

  • Removes DependsOnTargets="VcpkgInstallManifestDependencies" from the ProtoCompile MSBuild target in vc18/otclient.vcxproj.

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

Comment thread vc18/otclient.vcxproj
Comment on lines +736 to 737
<Target Name="ProtoCompile" BeforeTargets="PrepareForBuild" Condition="'$(RunProtoCompile)'=='true'">
<Exec Command="&quot;$(ProtocPath)&quot; --proto_path=&quot;$(ProtoPath)&quot; --cpp_out=&quot;generated&quot; &quot;%(ProtoFiles.Identity)&quot;" />
@dudantas dudantas closed this Jun 5, 2026
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.

2 participants