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

bazel fetch fails on pulling git repo #625

Closed
endobson opened this issue Nov 19, 2015 · 3 comments
Closed

bazel fetch fails on pulling git repo #625

endobson opened this issue Nov 19, 2015 · 3 comments
Labels
P2 We'll consider working on this in future. (Assignee optional) type: bug

Comments

@endobson
Copy link
Contributor

Important section of workspace

git_repository(
  name = "trunk",
  remote = "https://github.com/mzhaom/trunk.git",
  commit = "a4daafd562215a9e088cfc8997970d1182523ff9",
)

Error message.

endobson@yggdrasil () ~/proj/racket/racket-grpc % bazel fetch @trunk//:all                                                                                                                                                            (37)
.........
[4 / 4] Cloning https://github.com/mzhaom/trunk.git: Updating references (0 / 2)
java.lang.RuntimeException: Unrecoverable error while evaluating node 'GIT_CLONE:https://github.com/mzhaom/trunk.git -> /private/var/tmp/_bazel_endobson/c44540f7eaf5aad49840e43c8c60c881/external/trunk (a4daafd562215a9e088cfc8997970d1182523ff9) submodules: false' (requested by nodes 'GIT_REPOSITORY:@trunk')
        at com.google.devtools.build.skyframe.ParallelEvaluator$Evaluate.run(ParallelEvaluator.java:976)
        at com.google.devtools.build.lib.concurrent.AbstractQueueVisitor$2.run(AbstractQueueVisitor.java:495)
        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: Creating directories for /private/var/tmp/_bazel_endobson/c44540f7eaf5aad49840e43c8c60c881/external/trunk/third_party/libunwind/build/k8/include failed
        at org.eclipse.jgit.api.CheckoutCommand.call(CheckoutCommand.java:320)
        at com.google.devtools.build.lib.bazel.repository.GitCloneFunction.compute(GitCloneFunction.java:131)
        at com.google.devtools.build.skyframe.ParallelEvaluator$Evaluate.run(ParallelEvaluator.java:940)
        ... 4 more
Caused by: java.io.IOException: Creating directories for /private/var/tmp/_bazel_endobson/c44540f7eaf5aad49840e43c8c60c881/external/trunk/third_party/libunwind/build/k8/include failed
        at org.eclipse.jgit.util.FileUtils.mkdirs(FileUtils.java:316)
        at org.eclipse.jgit.dircache.DirCacheCheckout.checkoutEntry(DirCacheCheckout.java:1149)
        at org.eclipse.jgit.dircache.DirCacheCheckout.doCheckout(DirCacheCheckout.java:450)
        at org.eclipse.jgit.dircache.DirCacheCheckout.checkout(DirCacheCheckout.java:396)
        at org.eclipse.jgit.api.CheckoutCommand.call(CheckoutCommand.java:263)
        ... 6 more
endobson@yggdrasil () ~/proj/racket/racket-grpc % bazel version                                                                                                                                                                        (0)
.........
Build label: head (@3d84695)
Build target: bazel-out/local_darwin-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel-main_deploy.jar
Build time: Wed Nov 18 09:53:41 2015 (1447840421)
Build timestamp: 1447840421
Build timestamp as int: 1447840421
@endobson
Copy link
Contributor Author

I think this is because the git repo has a directory with a "BUILD" file and a subdirectory "build" which doesn't work on case insensitive file systems like mine. I'm not really sure what bazel can do in this case, but possibly something better than crashing and burning.

@damienmg
Copy link
Contributor

Yes this is a known issue. We should detect when build is directory and do not try to parse + use the extension proposed to resolve #552

@damienmg damienmg added type: bug P2 We'll consider working on this in future. (Assignee optional) labels Nov 19, 2015
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

On the plus side, it doesn't fail as hideously anymore:

ERROR: no such package '@trunk//': Creating directories for /private/var/tmp/_bazel_kchodorow/16a1114002542b106523c47d490a1041/external/trunk/third_party/libunwind/build/k8/include failed.

On the downside, it's still not a great error message and this is from the guts of jgit (which just calls java.io.File.mkdir, which doesn't expose why a mkdir failed). I don't think there's anything more we can really do here.

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

3 participants