Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetching repositories twice does not work #330

Closed
lberki opened this issue Jul 27, 2015 · 6 comments
Closed

Fetching repositories twice does not work #330

lberki opened this issue Jul 27, 2015 · 6 comments
Labels
P2 We'll consider working on this in future. (Assignee optional) type: bug

Comments

@lberki
Copy link
Contributor

lberki commented Jul 27, 2015

./compile.sh
cat > base_workspace/WORKSPACE <<EOF
git_repository(
    name = "protobuf",
    remote = "https://github.com/google/protobuf",
    commit = "HEAD"
)
EOF
cd base_workspace
../output/bazel --batch build @protobuf//:protoc
../output/bazel --batch build @protobuf//:protoc

The second execution results in an ugly exception:

java.lang.RuntimeException: Unrecoverable error while evaluating node 'GIT_CLONE:https://github.com/google/protobuf -> /usr/local/google/home/lberki/.cache/bazel/_bazel_lberki/b054b3aab4025af98dc2601e4ff14214/external/protobuf (HEAD) submodules: false' (requested by nodes 'GIT_REPOSITORY:@protobuf')
    at com.google.devtools.build.skyframe.ParallelEvaluator$Evaluate.run(ParallelEvaluator.java:745)
    at com.google.devtools.build.lib.concurrent.AbstractQueueVisitor$1.run(AbstractQueueVisitor.java:346)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.eclipse.jgit.api.errors.JGitInternalException: Destination path "protobuf" already exists and is not an empty directory
    at org.eclipse.jgit.api.CloneCommand.init(CloneCommand.java:152)
    at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:132)
    at com.google.devtools.build.lib.bazel.repository.GitCloneFunction.compute(GitCloneFunction.java:68)
    at com.google.devtools.build.skyframe.ParallelEvaluator$Evaluate.run(ParallelEvaluator.java:709)
    ... 4 more
@damienmg damienmg added type: bug P2 We'll consider working on this in future. (Assignee optional) labels Jul 27, 2015
@damienmg damienmg assigned davidzchen and unassigned kchodorow Jul 27, 2015
@damienmg
Copy link
Contributor

It seems to be a git_repository specific bug. (JGit exception)

@haxorz
Copy link
Contributor

haxorz commented Jul 27, 2015

we could hack around the existing file issue but, ideally, shouldn't all this external git repo stuff not happen at all in skyframe-land on the second, incremental build? why are the SkyFunction being re-executed?

@kchodorow
Copy link
Contributor

Due to #251.

@haxorz
Copy link
Contributor

haxorz commented Jul 27, 2015

oh, sorry, i missed the usage of "--batch". disregard my comment.

@hanwen
Copy link
Contributor

hanwen commented Oct 13, 2015

I now get:

$ bazel --batch build @protobuf//:protocERROR: Error sending results to http://localhost:8082: Connection to http://localhost:8082 refused.
ERROR: no such package '@protobuf//': Invalid branch, tag, or commit: Ref HEAD can not be resolved.
INFO: Elapsed time: 35.683s

given that we ask for sha256 for files, we should probably ask for git sha1 for the commit.

kchodorow added a commit that referenced this issue Dec 11, 2015
Fixes #650, #551, and the stack trace parts of #625 and #330.

--
MOS_MIGRATED_REVID=109925156
@kchodorow
Copy link
Contributor

HEAD is still not a recognized reference, which I think this is WAI (as generally we're not supporting "latest" as an option in WS files). commit = "<sha1>" does work and all of the other bugs mentioned in this issue have been fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 We'll consider working on this in future. (Assignee optional) type: bug
Projects
None yet
Development

No branches or pull requests

6 participants