bazelbuild / bazelbuild/bazel

Support repository_ctx.patch(patch_directory) arg

Open
#19,772 0 comments 0 reactions 0 assignees View on GitHub
help wanted P3 team-ExternalDeps type: feature request
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

### Description of the feature request:

I would like to specify the working directory for the `repository_ctx.patch` so that it is different than the repository root.

Aspect's `bazel-lib` has a similar function: https://github.com/aspect-build/bazel-lib/blob/8b06f31c46bea4e416bd199f67da68f8494a2ebd/docs/repo_utils.md?plain=1#L33

### Which category does this issue belong to?

Core

### What underlying problem are you trying to solve with this feature?

Having patching restricted to a subset of the repository tree.

### Which operating system are you running Bazel on?

_No response_

### What is the output of `bazel info release`?

_No response_

### If `bazel info release` returns `development version` or `(@non-git)`, tell us how you built Bazel.

_No response_

### What's the output of `git remote get-url origin; git rev-parse master; git rev-parse HEAD` ?

_No response_

### Have you found anything relevant by searching the web?

_No response_

### Any other information, logs, or outputs that you want to share?

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the repository_ctx.patch API and compare its current behavior with the linked Aspect bazel-lib repository utility documentation. Determine where patching is implemented and how a patch_directory argument should constrain the operation; done means patches can target a repository subtree instead of only the repository root.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.