Skip to content

Error on single_version_override patch with wrong patch_strip#28566

Open
fmeum wants to merge 3 commits intobazelbuild:masterfrom
fmeum:28560-better-patch-error
Open

Error on single_version_override patch with wrong patch_strip#28566
fmeum wants to merge 3 commits intobazelbuild:masterfrom
fmeum:28560-better-patch-error

Conversation

@fmeum
Copy link
Collaborator

@fmeum fmeum commented Feb 6, 2026

Since diffs that don't apply to the MODULE.bazel file are silently skipped (see c413192), this is needed to make users aware that their patch doesn't actually apply to the file.

Fixes #28560

@github-actions github-actions bot added team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. awaiting-review PR is awaiting review from an assigned reviewer labels Feb 6, 2026
Copy link

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

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 introduces a helpful error message when a patch for a single_version_override is used with patch_strip = 0 but the patch file contains a/ and b/ prefixes typical of a git diff. This prevents silent failures where the patch is not applied. The change includes a new check in PatchUtil.java and a corresponding test case. My review suggests an improvement to the new error message to report a more accurate line number, making it more useful for debugging.

fmeum and others added 2 commits February 6, 2026 23:12
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@fmeum
Copy link
Collaborator Author

fmeum commented Feb 6, 2026

@bazel-io fork 9.1.0

@fmeum
Copy link
Collaborator Author

fmeum commented Feb 6, 2026

@bazel-io fork 9.0.1

@fmeum
Copy link
Collaborator Author

fmeum commented Feb 6, 2026

@bazel-io fork 8.6.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-review PR is awaiting review from an assigned reviewer team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Patching MODULE.bazel has no effect on module extension evaluation

1 participant