bazelbuild / bazelbuild/bazel

Allow git_repository rules to check out repositories with relative directories

Open
#25,747 2 comments 0 reactions 0 assignees View on GitHub
P4 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:

Note: This is an issue created to accompany an upcoming PR.

git_repository's implementation is such that repositories are fetched by creating a new repository in a working directory, adding the value of the remote kwarg as a git remote and fetching that remote.

This works well for repositories which are git/http/ssh urls, and absolute local paths.

However, using a relative directory (including ., the current directory) is precluded by the change directory step in the repository implementation.

### Which category does this issue belong to?

External Dependency

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

An interesting category of tests is cross-release compatibility, ensuring that code in version n produces outputs that can be stably supported by code in version n+1.

Where bazel and git are used together, allowing remote="." branch="X" would allow tests to depend on a different version of the same code and ensure compatibility between them

### 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 HEAD` ?

```text

```

### 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 by reading the git_repository implementation and how it handles the remote and branch kwargs, focusing on the change-directory step described in the issue. Verify the behavior with a relative remote such as "."; done means a relative repository directory can be checked out while existing URL and absolute-path behavior remains supported.

Written by the indexing model from the issue text.

Assessment

Tech stack
git
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.