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

When a giant project already has a folder called external in the root folder #185

Open
YongZhao12 opened this issue Apr 20, 2024 · 1 comment

Comments

@YongZhao12
Copy link

The external folder already contains some git repos.

I followed the README.md, and I am not sure whether I did everything correctly. I used WORKSPACE, so I adapted accordingly in First step. From what I understand, in Second Step, I just run my bazel build command to build my target. My build succeeded, but I found no compile_commands.json is generated.

So I tried to run path 1 of the four common paths to see what happens. I got an error complaining external folder is not a link.

In this case, do I have a path forward except changing the folder name?

I tried changing the folder name, and it turned out that I came to other tricky bugs, which doesn't seem to be promising.

I also tried to comment out _ensure_external_workspaces_link_exists() in main() of refresh.template.py, then I got a error like the below

in _get_bazel_version
bazel_version_process = subprocess.run(
^^^^^^^^^^^^^^^
File "internal/python3.11/subprocess.py", line 571, in run
subprocess.CalledProcessError: Command '['bazel', 'version']' returned non-zero exit status 1.

However "bazel version" succeeds when I run it separately.

Thank you for any input.

@cpsauer
Copy link
Contributor

cpsauer commented Apr 24, 2024

Hi Yong Zhao! Thanks for giving the tool a whirl--sorry this one doesn't work out of the box.

Unfortunately, bazel has some hardcoded edges cases around having an external subfolder, since that's where it stashes external dependencies when it's compiling. It's likely to cause you all kinds pain if you're try to build code from inside of there... We also have to match their folder structure--hence creating the external symlink.

Lots more details in #30 (comment) if you want them, but I think the best move (both for this tool and for bazel in general) is going to end up being renaming that folder and avoiding all the subtle collisions :/

Sorry to not have something better for you. Wishing you happy coding!
Chris

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants