You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Can git.bzl support checking out repo to another sub directory #25453
P2We'll consider working on this in future. (Assignee optional)help wantedSomeone outside the Bazel team could own thisteam-ExternalDepsExternal dependency handling, remote repositiories, WORKSPACE file.type: feature request
local xtd = import "github.com/jsonnet-libs/xtd/main.libsonnet"
So when we fetch it to prepare the build, ideally it should be checked out to github.com/jsonnet-libs/xtd instead xtd directory. So adding an option to support that would be nice.
Currently, I work around this by introducing a patch command like this:
patch_cmds = [
# Move the source code location with github.com/jsonnet-libs/xtd directory
# So imports with such a prefix would work.
"mkdir -p github.com/jsonnet-libs/xtd",
"cp *.libsonnet github.com/jsonnet-libs/xtd",
],
It works but looks tedious.
Which category does this issue belong to?
No response
What underlying problem are you trying to solve with this feature?
No response
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 ?
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
P2We'll consider working on this in future. (Assignee optional)help wantedSomeone outside the Bazel team could own thisteam-ExternalDepsExternal dependency handling, remote repositiories, WORKSPACE file.type: feature request
Activity
meteorcloudy commentedon Mar 11, 2025
I could imagine we add an
add_prefixattribute togit_repository(maybe also http_archive) to create the directory.meteorcloudy commentedon Mar 11, 2025
We actually already have it for
http_archive:bazel/tools/build_defs/repo/http.bzl
Line 277 in 2dbda27
willstranton commentedon May 2, 2026
See the implementation of this in #29453
Add `add_prefix` attribute to `git_repository` (bazelbuild#29453)