hedronvision / bazel-compile-commands-extractor

Goal: Enable awesome tooling for Bazel users of the C language family.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Would be nice to be able te prefix the symlink created for external paths (`/external`)

chandlerc opened this issue · comments

Currently the tool generates an /external symlink. It'd be nice to be able to customize the name, and for example by default prefix it with bazel- similar to other bazel-* symlinks.

Hey Chandler! Thanks for giving the tool a go--and for writing in.

Somewhat common request, but much harder to do than you might think, unfortunately. The external symlink's name is matching the one in Bazel's internal compilation environment (along with bazel-out, but they don't have a prefix for external). So changing the symlink name would require significant additional complexity in this tool, manually patching all possible flag variants for all toolchains (rather than (mostly) exporting the flags from Bazel as they actually are). Doable, probably, but I think not worth it. Could ask bazel if they'd change it? Willing also to take a PR, but it's gonna be tricky to get all the cases. (See past efforts.)

Saw your backlinked PR, btw. Definitely don't check in //external; the format varies on Windows. No need to add it or compile_commands.json to .gitignore if you don't want to; we automatically add to the hidden gitignore in .git/info/exclude. See _ensure_gitignore_entries_exist if you're curious.

Go Carbon! Happy coding :)
Chris

I see, I didn't realize you were leveraging this to avoid editing the flags, but that makes sense. I guess leaving it as-is for now works.