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

new_git_repository fails if repo already contains a BUILD directory entry #2226

Closed
gjasny opened this issue Dec 11, 2016 · 6 comments
Closed
Assignees
Labels
P2 We'll consider working on this in future. (Assignee optional)

Comments

@gjasny
Copy link
Contributor

gjasny commented Dec 11, 2016

Hello,

While running the fetch common in a checkout of bazel-boost I get the same error as described here: new_git_repository. This is because my macOS home directory is case-insensitive by default and the modular boost repos all contain a build directory in their root. Therefore placing a BUILD symlink in the repository root fails.

How could I work-around that problem? Imagine a 3rd party repository contains a broken or unsuitable BUILD file that needs to be replaced.

Thanks,
Gregor

@abergmeier-dsfishlabs
Copy link
Contributor

We have the same problem and mostly only purge the build directory before. IMO best option would be to have a way to disable usage of BUILD and enforce BUILD.bazel only.

@katre
Copy link
Member

katre commented Dec 12, 2016

@gjasny Can you please comment back with a clearer way to reproduce the issue, possibly via a repository I can clone and try to build? It'll really simplify figuring out what the issue is and how to address it.

Thanks!

@katre katre added category: extensibility > external repositories P2 We'll consider working on this in future. (Assignee optional) labels Dec 12, 2016
@gjasny
Copy link
Contributor Author

gjasny commented Dec 12, 2016

Use macOS and make sure the current file system is not case-insensitive:

$ diskutil info $(df $PWD | tail -n1 | cut -f1 -d' ') |grep Journaled
   File System Personality:  Journaled HFS+
   Name (User Visible):      Mac OS Extended (Journaled)

Use bazel 0.4.2

$ bazel version
Build label: 0.4.2-homebrew
Build target: bazel-out/local-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Thu Dec 8 03:17:26 2016 (1481167046)
Build timestamp: 1481167046
Build timestamp as int: 1481167046

Clone bazel-boost

git clone https://github.com/bowlofstew/bazel-boost.git && cd bazel-boost

Fetch modular boost

$ bazel fetch @com_github_boost_program_options//...:all
ERROR: Error creating symbolic link from /private/var/tmp/_bazel_gjasny/7922797243248e6f5ce6f6b07e28bff9/external/com_github_boost_program_options/BUILD to /Users/gjasny/tmp/bazel-boost/third_party/boost.BUILD: /private/var/tmp/_bazel_gjasny/7922797243248e6f5ce6f6b07e28bff9/external/com_github_boost_program_options/BUILD (Directory not empty).

If you look into .../external/com_github_boost_program_optionsyou see the presence of a build directory:

$ ls -l /private/var/tmp/_bazel_gjasny/7922797243248e6f5ce6f6b07e28bff9/external/com_github_boost_program_options
total 16
-rw-r--r--   1 gjasny  wheel  135 Dec 12 17:03 WORKSPACE
drwxr-xr-x   3 gjasny  wheel  102 Dec 12 17:03 build
drwxr-xr-x  24 gjasny  wheel  816 Dec 12 17:03 doc
drwxr-xr-x  13 gjasny  wheel  442 Dec 12 17:03 example
drwxr-xr-x   3 gjasny  wheel  102 Dec 12 17:03 include
-rw-r--r--   1 gjasny  wheel  539 Dec 12 17:03 index.html
drwxr-xr-x   3 gjasny  wheel  102 Dec 12 17:03 meta
drwxr-xr-x  13 gjasny  wheel  442 Dec 12 17:03 src
drwxr-xr-x  23 gjasny  wheel  782 Dec 12 17:03 test

Hope that help and thanks for looking into it!

-Gregor

@katre
Copy link
Member

katre commented Dec 12, 2016

Awesome, thanks, I'll look into it.

@katre katre self-assigned this Dec 12, 2016
@katre
Copy link
Member

katre commented Dec 13, 2016

Sent https://bazel-review.googlesource.com/7850 to address this.

bazel-io pushed a commit that referenced this issue Dec 16, 2016
…linked/new build file, which has less changes of causing conflicts. Fixes #2226."

This reverts commit 2f31d60.
Re-open #2226.

--
Change-Id: I7f223df4bb239daf8c306955e92f817310e6cd4f
Reviewed-on: https://cr.bazel.build/7950
PiperOrigin-RevId: 142257579
MOS_MIGRATED_REVID=142257579
@katre katre reopened this Dec 16, 2016
@katre
Copy link
Member

katre commented Dec 16, 2016

Re-opening until I can fix rules_go, release that, update rules_webtesting and buildifier, and then re-submit this.

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)
Projects
None yet
Development

No branches or pull requests

3 participants