Git hash stamping for an external repository #4464
Labels
P3
We're not considering working on this, but happy to review a PR. (No assignee)
stale
Issues or PRs that are stale (no activity for 30 days)
team-ExternalDeps
External dependency handling, remote repositiories, WORKSPACE file.
type: feature request
Description of the problem / feature request:
I need to get the git hash from a git_repository define in a WORKSPACE. Using a workspace_status_command option as described in #216 does not work, since the top level workspace ends up providing the git hash, not the external repository.
Feature requests: what underlying problem are you trying to solve with this feature?
I need to incorporate the git hash in the build because it is used as a cache validation key. It must be a github git hash because we need to be inter-operable with caches produced on other machines. The project's normal cmake build system has no problem handling this.
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Write a genrule that consumes bazel-out/volatile-status.txt in Workspace A, import Workspace A in Workspace B using git_repository, run
bazel build --workspace_status_command=
with the example workspace status command (https://github.com/bazelbuild/bazel/blob/master/tools/buildstamp/get_workspace_status). The genrule will see the git hash of Workspace B, not Workspace A, even of the genrule is in Workspace A.What operating system are you running Bazel on?
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux rodete
Release: rodete
Codename: rodete
What's the output of
bazel info release
?release 0.9.0
Have you found anything relevant by searching the web?
Mostly what is in #216, which works OK for a single workspace but not at all when using external workspaces.
The text was updated successfully, but these errors were encountered: