-
Notifications
You must be signed in to change notification settings - Fork 65
Copilot Build Instructions #1211
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
Merged
mikeprosserni
merged 2 commits into
main
from
users/mprosser/copilot-build-instructions
Oct 28, 2025
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| # Copilot Instructions for grpc-device Repository | ||
|
|
||
| ## Building the Project | ||
|
|
||
| This repository requires specific environment setup before building. **Always** follow these guidelines when running build commands. | ||
|
|
||
| ### Prerequisites | ||
|
|
||
| 1. **Visual Studio Build Tools**: Ensure Visual Studio Build Tools are installed with C++ development components | ||
| 2. **CMake**: Make sure CMake is available in the system PATH | ||
|
|
||
| ### Critical: Preferred Build Method | ||
|
|
||
| **Always use the copilot-build.ps1 script for all builds (recommended for Copilot):** | ||
|
|
||
| ```powershell | ||
| # Default Debug build | ||
| .\utils\copilot-build.ps1 | ||
|
|
||
| # Release build | ||
| .\utils\copilot-build.ps1 --config Release | ||
|
|
||
| # RelWithDebInfo build | ||
| .\utils\copilot-build.ps1 --config RelWithDebInfo | ||
|
|
||
| # Other cmake arguments | ||
| .\utils\copilot-build.ps1 --target clean --config Debug | ||
| .\utils\copilot-build.ps1 --parallel 4 --config Release | ||
| ``` | ||
|
|
||
| This script automatically handles the Visual Studio environment setup and is much more Copilot-friendly since it avoids complex command chaining that often requires manual approval. | ||
| Any parameters you pass into this script will be passed along into the cmake command. However, you should prefer to do simple full builds instead of targetted builds. Ninja is good | ||
mikeprosserni marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| at doing incremental builds quickly. | ||
|
|
||
| ### Testing | ||
|
|
||
| To run tests after building: | ||
|
|
||
| ```powershell | ||
| # Run unit tests | ||
| .\build\Debug\UnitTestsRunner.exe | ||
|
|
||
| # Run system tests | ||
| .\build\Debug\SystemTestsRunner.exe | ||
| ``` | ||
|
|
||
| Or use the build script to build first, then run tests: | ||
|
|
||
| ```powershell | ||
| .\utils\copilot-build.ps1 --config Debug | ||
| .\build\Debug\UnitTestsRunner.exe | ||
| .\build\Debug\SystemTestsRunner.exe | ||
| ``` | ||
|
|
||
| ### Clean Build | ||
|
|
||
| **WARNING: Never perform a clean build without asking the user first.** Full builds take a very long time and are almost never needed. Most issues can be resolved with a regular incremental build. | ||
|
|
||
| If a clean build is specifically requested: | ||
|
|
||
| ```powershell | ||
| # Using the build script (preferred) | ||
| .\utils\copilot-build.ps1 --target clean --config Debug | ||
|
|
||
| # Or manually | ||
| cmd.exe /c "call `"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat`" && cd /d `"%cd%\build`" && cmake --build . --target clean && cmake --build . --config Debug" | ||
| ``` | ||
|
|
||
| ## Repository Structure Notes | ||
|
|
||
| - Source code is in the `source/` directory | ||
| - Examples are in the `examples/` directory | ||
| - Generated code is in the `generated/` directory | ||
| - Build artifacts go in the `build/` directory | ||
| - The project uses gRPC and Protocol Buffers for communication | ||
|
|
||
| ## Python Components | ||
|
|
||
| This repository also contains Python components. When working with Python: | ||
|
|
||
| 1. Use the virtual environment created by the build system | ||
| 2. Install dependencies from `python_build_requirements.txt` | ||
| 3. Python examples are located in the `examples/` directory | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| #!/usr/bin/env pwsh | ||
| # Build script for grpc-device project | ||
| # This script sets up the Visual Studio environment and builds the project | ||
| # | ||
| # This script is particularly useful for GitHub Copilot since the complex | ||
| # cmd.exe command with vcvars64.bat setup often requires manual approval. | ||
| # Using this script allows for easier auto-approval of build commands. | ||
|
|
||
| param( | ||
| [Parameter(ValueFromRemainingArguments = $true)] | ||
| [string[]]$BuildArgs | ||
| ) | ||
|
|
||
| # Convert BuildArgs array to a single string for passing to cmake | ||
| $cmakeArgs = if ($BuildArgs) { $BuildArgs -join " " } else { "--config Debug" } | ||
|
|
||
| # Run the build command with Visual Studio environment setup | ||
| $command = "call `"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat`" && cd /d `"$PWD\build`" && cmake --build . $cmakeArgs" | ||
|
|
||
| Write-Host "Running build command: cmake --build . $cmakeArgs" | ||
| Write-Host "Setting up Visual Studio environment and building..." | ||
|
|
||
| cmd.exe /c $command |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.