Skip to content

flowey: add --custom-protoc to build-igvm CLI#2620

Merged
justus-camp-microsoft merged 1 commit intomicrosoft:mainfrom
justus-camp-microsoft:local_protoc
Jan 8, 2026
Merged

flowey: add --custom-protoc to build-igvm CLI#2620
justus-camp-microsoft merged 1 commit intomicrosoft:mainfrom
justus-camp-microsoft:local_protoc

Conversation

@justus-camp-microsoft
Copy link
Copy Markdown
Contributor

@justus-camp-microsoft justus-camp-microsoft commented Jan 7, 2026

Similar to #2388, adds the ability to override the protoc path with a local path. This should work independently of the other arguments but also with them. Tested all combinations of arguments specified and all work as expected.

This is another step towards reproducible builds where we're adding the capability to use "local" versions of everything that will eventually be supplied by nix.

Copilot AI review requested due to automatic review settings January 7, 2026 22:44
@justus-camp-microsoft justus-camp-microsoft requested review from a team as code owners January 7, 2026 22:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 adds the --custom-protoc CLI argument to the build-igvm pipeline, allowing users to override the protoc path with a local path. This mirrors the existing --custom-openvmm-deps functionality added in #2388. The PR refactors download_protoc to resolve_protoc to support both downloading and using local paths.

Key changes:

  • Renamed download_protoc module to resolve_protoc to better reflect its dual capability
  • Added new Request::LocalPath variant to support custom protoc paths
  • Updated cfg_versions to accept LocalOpenvmmDeps and LocalProtoc requests independently
  • Added is_executable() helper method to check file executability

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated no comments.

Show a summary per file
File Description
flowey/flowey_lib_common/src/resolve_protoc.rs Refactored from download_protoc to support both downloading and local paths; added validation logic
flowey/flowey_lib_hvlite/src/_jobs/cfg_versions.rs Updated to support independent local overrides for openvmm_deps and protoc
flowey/flowey_hvlite/src/pipelines/build_igvm.rs Added --custom-protoc CLI argument that works with --use-local-deps
flowey/flowey/src/lib.rs Added is_executable() helper to check file permissions on Unix systems
flowey/flowey_lib_common/src/lib.rs Updated module export from download_protoc to resolve_protoc
flowey/flowey_lib_hvlite/src/init_openvmm_magicpath_protoc.rs Updated import to use resolve_protoc
flowey/flowey_lib_hvlite/src/_jobs/cfg_common.rs Updated import to use resolve_protoc
flowey/flowey_hvlite/src/pipelines/*.rs Updated all pipelines to use Request::Init instead of Request::Download
.github/workflows/*.yaml Auto-generated workflow files updated with module rename
ci-flowey/*.yaml Auto-generated pipeline files updated with module rename
Comments suppressed due to low confidence (3)

flowey/flowey_lib_common/src/resolve_protoc.rs:113

  • The comment states "If a local path is specified, assume protoc is already executable." However, due to the bug in resolve_protoc_from_dir where make_executable() is always called on line 38, this assumption is violated. When make_executable is false, the function will still attempt to make the file executable if it's already executable. This comment needs to be updated after fixing the bug in resolve_protoc_from_dir.
    flowey/flowey_lib_common/src/resolve_protoc.rs:38
  • The logic in this function has a flaw: when make_executable is false and the file is not executable, it bails with an error. However, on line 38, make_executable() is called unconditionally regardless of the make_executable parameter value. This means:
  1. If make_executable is false and the file is not executable, it will bail on line 32 before reaching line 38
  2. If make_executable is false and the file is executable, it will still try to make it executable on line 38 (unnecessary but harmless)
  3. The make_executable parameter essentially becomes meaningless since line 38 always tries to make it executable when it can be reached

The logic should be: only call make_executable() on line 38 if the make_executable parameter is true. The current implementation makes the make_executable parameter misleading.
flowey/flowey_lib_common/src/resolve_protoc.rs:57

  • The documentation comment says "Use a locally downloaded protoc" but the parameter name is LocalPath and it's used for custom/local paths that users specify, not necessarily "downloaded" copies. The comment should say "Use a local protoc from the specified path" or "Use a custom protoc path" to be more accurate.

chris-oo
chris-oo previously approved these changes Jan 8, 2026
Comment thread flowey/flowey/src/lib.rs
@justus-camp-microsoft justus-camp-microsoft enabled auto-merge (squash) January 8, 2026 19:46
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 8, 2026

@justus-camp-microsoft justus-camp-microsoft merged commit 99fb146 into microsoft:main Jan 8, 2026
80 of 82 checks passed
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.

3 participants